• Breaking News

    Sunday, March 1, 2020

    If I'm new to .NET programming, should I just start learning .NET Core or I need to start with .NET Framework? Ask Programming

    If I'm new to .NET programming, should I just start learning .NET Core or I need to start with .NET Framework? Ask Programming


    If I'm new to .NET programming, should I just start learning .NET Core or I need to start with .NET Framework?

    Posted: 01 Mar 2020 04:10 PM PST

    What's a Good Series I Can Watch Each Day to Gradually Expand My Programming Knowledge?

    Posted: 01 Mar 2020 08:06 PM PST

    Everyday when I take my lunch break, I usually watch various youtube series.

    I've found that I can learn a ton of stuff over the course of a few weeks/months doing this.

    So far I've done stuff like: spanish tutorials, history/nature documentaries, car repairs

    And I completely understand the best way to improve my code is through actual practice, but watching these videos is purely complementary to what I'm already doing.

    If anyone has any channels or series to recommend, it's much appreciated!

    Currently I'm looking into The Coding Train channel. Seems like that guy's a pretty experienced teacher.

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

    Having Python script run without having to install packages

    Posted: 01 Mar 2020 07:48 AM PST

    I have an assignment where I must submit a Python program that my professor will then run on his computer. It is a web crawler that outputs data to a CSV. It requires a few packages such as Requests. Is there a way that I can submit a working assignment that does not require the professor to install the packages in order for the program to run? I have just started looking at Docker and think it could be a solution. I would be very grateful if anyone could point me in the right direction.

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

    How many hours of the 8 work hours per day do you spend programming or productively at the office, please explain?

    Posted: 01 Mar 2020 10:48 AM PST

    What idiosyncrasies do you have that keep you productive, creative, or help you problem solve while you’re programming?

    Posted: 01 Mar 2020 08:38 PM PST

    How to distribute rectangles with minimum overlap

    Posted: 01 Mar 2020 01:56 PM PST

    Basically I need to distribute various rectangles in a bigger rectangle randomly. So:

    1. While there is enough space, rectangles don't overlap or overlap just a bit.
    2. When there is not enough space rectangles overlap but still trying to overlap as little as possible (so they all stack in one place).

    I don't need classical ideal top-left to bottom-right packing. The point is that I need random spread.

    At first I tried to brute-force it by randomly selecting position for a rectangle and then comparing collision with all rectangles that were already placed. Not ideal, obviously.

    Then I tried to assign "points" to the space and place rectangles near these points. The closer rectangle was to a point the more "pressure" it applied to it. And that pressure stacked for each rectangle that was placed. Algorithm tried to place rectangles near points with minimal pressure. Unfortunately this resulted in rectangles stacking near top-left and bottom-right corners.

    Picture to try to make things easier to understand: https://i.ibb.co/0j6VQr0/lets-try-pictures.png

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

    Help needed with C++ string program!

    Posted: 01 Mar 2020 03:53 PM PST

    I've been working on this code for several days now, and after reading the book and writing the code, I really thought I understood how to do this, but I'm getting build errors but I'm unsure where I'm going wrong!

    The intent of the program it to make specified changes to two strings and send one into a function as shown below. Here is the code:

    #include <iostream> #include <string> #include <cctype> using namespace std; void displayInfo(string sent); int main() { string sentence("This is a 101 SAMPLE to demonstrate string processing"); displayInfo(sentence); string sentenceTwo(sentence); cout << "Sentence 2: " << sentenceTwo << endl; sentence.erase((sentence.length() - 10), 10); cout << "Sentence 1 is now: " << sentence << endl; sentenceTwo.swap(sentence); cout << "Sentence 1: " << sentence << endl; cout << "Sentence 2: " << sentenceTwo << endl; string sentence(sentenceTwo, 4, 6); cout << "Sentence 1: " << sentence << endl; } //************************************************************************************************************* void displayInfo(string sent) { int length = sent.length(); cout << "Information of Sentence 1:" << endl; cout << "Length: " << length << endl; cout << "Character at position 14: " << sent.at(14) << endl; cout << "Last character of Sentence: " << sent.back() << endl; cout << "The first 's' is at position: " << sent.find('s', 0) << endl; cout << "The second 's' is at position: " << sent.find('s', (sent.find('s', 0)) + 1) << endl; int numLetters = 0; for (int i = 0; i < length; ++i) { if (isalpha(sent[i])) { numLetters++; } } cout << "The number of letters is: " << numLetters << endl; int numDigits = 0; for (int j = 0; j < length; ++j) { if (isdigit(sent[j])) { numDigits++; } } cout << "The number of digits is: " << numDigits << endl; int numLower = 0; for (int k = 0; k < length; ++k) { if (islower(sent[k])) { numLower++; } } cout << "The number of lower case letters is: " << numLower << endl; int numUpper = 0; for (int l = 0; l < length; ++l) { if (isupper(sent[l])) { numUpper++; } } cout << "The number of upper case letters is: " << numUpper << endl; } 

    The build errors I'm having trouble solving are:

    1. In main, with the line of code shown below I am getting the error for redefinition/re initialization. So when I try to fix this by removing 'string' from the line of code, the red error line appears under 'sentence' that "call of an object of a class type without appropriate operator() or conversion functions to pointer-to-function type". How would I settle this?
    2. The line of code shown below is giving me the error for "see declaration of sentence" which I am assuming may have something to do with the last issue I brought up?? Otherwise I have no idea...
    3. The line of code is saying using "<<" is illegal for the class? I just flat out don't understand that one.

    1. string sentence(sentenceTwo, 4, 6); 2. string sentence("This is a 101 SAMPLE to demonstrate string processing"); 3. cout << "Sentence 1: " << sentence << endl; 
    submitted by /u/aarose10
    [link] [comments]

    Where does this code differ with the other?

    Posted: 01 Mar 2020 06:08 PM PST

    Hi, I'm not sure if this is really the type of question for here but I've been stuck on this personal project of mine for months now and it's getting really frustrating. I'm trying to build a simple LUKS (the linux encrypted drives management program) dictionary attack program in C, which needs to reimplement the LUKS specification in order to attempt to decrypt keys stored on a drive, which as it turns out is quite complex. It contains what's called an 'anti-forensics splitter' which splits key data across large amounts of data as to prevent one faulty sector remapping on a drive from leaving an entire key available to forensics of a captured drive as the user wouldn't be able to properly delete it.

    I believe that everything in my code works besides my implementation of the reverse of this process to retrieve the key, ie the anti-forensics merger. The whole thing is about 50 lines of C, and I've tried to cross reference each line with the implementation found in the cryptsetup program, but I can't for the life of me find where either our of code deviates in semantics or logic. If anyone would be willing to look through this and maybe find something I've missed, I'd really greatly appreciate it. Thanks.

    My code: https://gist.github.com/muke101/8edd1b67b789e2e7649b3221c25301bb

    Cryptsetup's code: https://gitlab.com/cryptsetup/cryptsetup/blob/master/lib/luks1/af.c

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

    How to bubble sort through an array of class objects

    Posted: 01 Mar 2020 05:39 PM PST

    I actually understand the bubble sort algorithm. The problem I am having is trying to sort through a number of 'grades' in an array of class objects and then printing them out. I have been trying to get this function to print out the student names and grades but am just confusing myself at this point. Here is my code (full program at the bottom):

    function bubbleSort(stu){ //loop length const loop = stu.length; //loop for loop length for (let i = 0; i < loop; i++){ for (let j = 0; j < loop; j++){ //loop to cycle through array items if (stu[j] > stu[j+1]) { //Compare adjacent items eg. 12 and 54 let temp = stu[j]; //Temp takes 54 stu[j] = stu[j+1]; //arr[j+1] now takes 54 and arr[j] takes 23 stu[j+1] = temp; } } document.writeln(stu + "<br>"); } return stu; } 

    Things I have tried include:

    - adding .grade after if (stu[j] > stu[j+1]); like so if (stu[j].grade > stu[j+1].grade)

    -I have also done this throughout this function to no avail all I usually get is the output from my other functions, and where the bubbleSort function is supposed to print I get a bunch of [object Object] outputs.

    What exactly am I doing wrong here?

    Full program:

    class Student { //Initialize an object constructor(name, grade){ this.name = name; this.grade = grade; } //Declare a method showAlltheGrades(){ document.writeln("Name: " + this.name + " | " + "Grade: " + this.grade + "<br>"); }//End method }//End class //Bubblesort function function bubbleSort(stu){ //loop length const loop = stu.length; //loop for loop length for (let i = 0; i < loop; i++){ for (let j = 0; j < loop; j++){ //loop to cycle through array items if (stu[j] > stu[j+1]) { //Compare adjacent items eg. 12 and 54 let temp = stu[j]; //Temp takes 54 stu[j] = stu[j+1]; //arr[j+1] now takes 54 and arr[j] takes 23 stu[j+1] = temp; } } document.writeln(stu + "<br>"); } return stu; } //function to get student info function getStudentInfo(arr) { while (true) { let name = prompt("Enter student name: "); if (name == "???") { break; } let grade = parseInt(prompt("Enter student grade: ")); arr.push(new Student(name, grade)); //creates new object in a class } } function maxGrade(arr){ let max = arr[0].grade; let tmp; for(let i = 0; i < arr.length; i++){ tmp = arr[i].grade; if (tmp > max){ //Compares grades against eachother (Which is why we used .grade) max = tmp; } } document.writeln("The highest grade is: " + max + "<br>"); } //Students array that holds name and grade let students = []; getStudentInfo(students); //calls studentInfo function //Show all students names and grades for (let i = 0; i < students.length; i++){ students[i].showAlltheGrades(); //Calls method } maxGrade(students); //calls maxGrade function bubbleSort(students); //calls bubblesort function 
    submitted by /u/OneLargeToe
    [link] [comments]

    JavaFX Discord Server

    Posted: 01 Mar 2020 01:07 PM PST

    I made a JavaFX Discord Server for people who like to talk about JavaFX stuff, or need help with certain projects, I really like to work with java, especially with people who are working with JavaFX (:

    Here is the discord link: https://discord.gg/yZ3Y3Fd or https://discord.gg/AzFaNU

    Every Monday, there will be an event (:

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

    In the HTTP protocol is there a standard way to call multiple URLs at the same server each with a different content bytes?

    Posted: 01 Mar 2020 08:59 AM PST

    For example simultaneously do:

    GET /abc/xyz.html

    GET /pics/picA.jpg

    POST /pics/picB.jpg ...certain bytes...

    POST /pics/picC.jpg ...certain other bytes...

    This would be a useful optimization to avoid multiple calls at the network level, such as if you want to do 300 small things at once that would be wasteful. Theres a similar protocol in some databases to do multiple queries in a single network call.

    I could of course write a specific server code to do this, but it would be more useful if it already existed in some form in existing websites.

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

    COM and C#

    Posted: 01 Mar 2020 11:52 AM PST

    I am working on a python library and I need to use a lot of interop to write it because of what it does. A lot of the interop stuff I'm reading on the C#/C++ side talks about COM and to me COM just sounds like voodoo sorcery. Is there a tutorial/video course/book that makes COM easy to understand?

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

    Assembly Compiler

    Posted: 01 Mar 2020 09:22 AM PST

    Which editor/compiler can you use to write in Assembly Language? Also, where can you learn the language online?

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

    Do not understand this incomparable types error in Java

    Posted: 01 Mar 2020 02:41 PM PST

    I am currently writing code that is supposed to ask for input from the keyboard and return an output that says whether or not the user typed something that is a valid Java identifier. This is what I have:

    import java.util.Scanner;

    public class JavaIdentifier

    {

    public static void main (String [] args)

    {

    String input ;

    System.out.println("Enter the input: ");

    Scanner scanner = new Scanner(System.in);

    input = scanner.nextLine () ;

    System.out.println("The input is " + input ) ;

    char firstChar = input.charAt (0) ;

    if (firstChar == "A" || "B" || "C" || "D" || "E" || "F" || "G "|| "H" || "I" ||

    "J" || "K "|| "L "|| "M "|| "N" || "O" || "P" || "Q" || "R" || "S" || "T" || "U"

    || "V" || "W" || "X" || "Y" || "Z" || "a" || "b" || "c" || "e" || "f" || "g"

    || "h" || "i" || "j" || "k" || "l" || "m" || "n" || "o" || "p" || "q" || "r"

    || "s" || "t" || "u" || "v" || "w" || "x" || "y" || "z" || "$" || "_" )

    {

    System.out.println ("This is a valid identifier" ) ;

    }

    else

    {

    System.out.println ("This is not a valid java identifier. Change the first character to make it one" ) ;

    }

    }

    }

    On the if statement, I am getting two error message saying: "incomparable types: char and java.lang.string" and "bad operand types for binary operator '||'. I tried changing the string to a char, I've tried changing firstChar to string, but none of those worked.

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

    In a world without performance concerns, would parallelism, asynchrony and concurrency be useless?

    Posted: 01 Mar 2020 08:39 AM PST

    Does anyone know of an English dictionary with snappy definitions in a convenient format?

    Posted: 01 Mar 2020 01:07 PM PST

    I have looked online for English dictionaries. A lot of them seem to be formatted for human consumption and there are subtle formatting differences depending on whether words can be multiple parts of speech, have multiple meanings, multiple pronunciations, or relate closely to other words.

    I need a dictionary as follows: " 'Word', 'snappy definition' /n 'Word', 'snappy definition' /n, ..."

    I have also found dictionaries that just list the words without meanings. I already have that so that is no use to me at this stage either.

    Context:

    Some (non-programmer) work colleagues have been doing evening 'quizzes' to keep motivated when we need to work late nights. A theme has developed:

    A word meaning 'To make a crossing', add an A, 'modified'. Answer: abridged.

    'A class of drug', add an A, 'a celestial body' Answer: asteroid.

    I want to extract all possible such questions from a dictionary.

    So far I have a list of English words, where prepending an 'a' gives another English word.

    Now I just need snappy definitions for all of these words.

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

    What is the most efficient way to return k largest or smallest elements from 2 sorted list?

    Posted: 01 Mar 2020 01:03 PM PST

    Programmers and hollywood

    Posted: 01 Mar 2020 06:00 PM PST

    Is any one else tired of Hollywood fetishising programmers? I think we get a pretty bad rep, it's not that cool to be looked at like some autistic creep, which is of course what every developer is portrayed as. Kind of reminds me how Disney used to portray black people. Honestly the genius bullshit makes me want to go press a button in a factory.

    submitted by /u/Fuck-reddit444
    [link] [comments]

    New coding help website feedback

    Posted: 01 Mar 2020 11:42 AM PST

    Hello r/AskProgramming! I'm posting here about a website I'm starting.

    It's called TalentDex, and we aim to help people l learn coding more effectively and save people time through the online coaching we offer on our platform. Customers on our site are able to ask questions and get mentored through whatever language they are learning, and the coaches in turn are paid to do it.

    I'm posting here to see if anyone would be interested in this kind of service. Would any of you purchase lessons or q/a time on the site? What kinds of features would you guys want to see?

    I appreciate any feedback or questions you might have. Please feel free to DM me or leave any ideas in the comments.

    Thank you!

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

    What's better?

    Posted: 01 Mar 2020 01:11 AM PST

    let everyTwoHours = setTimeout(() => (), 1000 * 60 * 60 * 2);

    Or

    let 2hrs = 1000 * 60 * 60 * 2); let second = 0; let everyTwoHours = setTimeout(() => ({ if (interval++ === 2hrs) { } }), 1000);

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

    Job "rejection" hypothetical question..

    Posted: 01 Mar 2020 07:08 AM PST

    My wife and I were talking this morning about a recent interview experience that I had and she told me the way that I was thinking about the situation was dumb. So I thought I'd pose the question if anyone else would thing about it the same way.

    I've been going through a fairly long and rigorous interview process with a big tech firm. And I had my final on-site with them not too long ago.

    A quick aside: I'm a fairly senior developer at this point that's been exposed to many different things, expert systems, pseudo-realtime systems, data engineering, distributed systems and I've spent my recent 2-3 years as an IC (I've wanted to change after being in the same industry for a while). I've been in management for a while but still actively coding. In some respects, you can say that I'm in the middle of a career mid-life crisis mixed in with a bit of imposter syndrome. I tried getting into Google a few years ago but I was dumb again and didn't really prep (although I didn't do terribly and they have reached out to me again since).

    Either way, I wasn't quite sure what I wanted to do until a recent job posting. The position is pretty much ideal for me. I went on-site and I thought it went very well. And maybe this is a dumb attitude but I also didn't want to come in on a recommendation. While I was there I did reach out to that person and was going to ask for a referral post the process. But I wasn't able to reach them in time.

    The company response took longer than they said but ultimately I was told that they had picked another candidate but said "it was a difficult decision." And oddly enough, my reference finally got back to me after the rejection and was very complimentary and would have spoken with the team.

    So my question is:

    Would you feel better in this case getting outright rejected or in this situation where a slight bit of luck could have changed your circumstances?

    I'm not sure what to think anymore but at first I was in "the one that got away" camp was worse. I'm curious about how others feel about their job search situations.

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

    What do you wish you could make more time for?

    Posted: 01 Mar 2020 01:46 AM PST

    As a programmer, what do you wish to make more time for in your life?

    submitted by /u/Rawad_Al-Kattan
    [link] [comments]

    Need suggestions, tips, resources.

    Posted: 01 Mar 2020 01:33 AM PST

    Okay, so I'm currently pursuing a 6 months internship on VLSI systems design as a pre-final year student of B.Tech in Electronics and Communication Engineering. I'm planning on making full use of this semester and got up with an idea which would help me learn as well as get my profile on the web.

    So my idea is making a portfolio website, but along with the usual navigation of the webpage, my website would also have a chatbot which would answer questions about myself and maybe display nice memes too.

    But I'm really getting started with web development and machine learning. I would appreciate any suggestions for frameworks/libraries I should use, resources for learning and referring to while developing and any other tips that might help me.

    I hope I'd be able to complete this project in time with my on-going internship.

    TLDR: - I'm planning to make a website with an integrated chatbot. I would appreciate any suggestions for frameworks/libraries I should use, resources for learning and referring to while developing and any other tips that might help me.

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

    No comments:

    Post a Comment