• Breaking News

    Thursday, June 6, 2019

    Is your software engineer job easier or harder than what you expected? Ask Programming

    Is your software engineer job easier or harder than what you expected? Ask Programming


    Is your software engineer job easier or harder than what you expected?

    Posted: 06 Jun 2019 07:45 PM PDT

    How do computers spend their time?

    Posted: 06 Jun 2019 07:20 AM PDT

    Knuth wrote "Computer manufacturers of the 1960's estimated that more than 25 percent of the running time of their computers was spent on sorting, when all their customers were taken into account. In fact, there were many installations in which the task of sorting was responsible for more than half of the computing time."

    What do computers nowadays spend their time doing? in relation to algorithms you might study. As in 3-sat solvers are really good now. And work on them is important. But I doubt the total time spent solving 3-sat is a big % of all computation. Game rendering by GPUs would seem to be a big chunk of all computations.

    Does anyone know what computers spend their time doing?

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

    audio not working in pygame

    Posted: 06 Jun 2019 09:27 PM PDT

    I was hoping somebody could help me figure this out since I got kinda confused with the google results I was given lol. I'm trying to load an mp3 file for background music on a pygame project I'm working on. I'm using pygame 2.7.10 on VS code and I'm on a mac (macOS high sierra 10.13.1). I keep getting this error:

    pygame.error: Failed to start CoreAudio: AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)

    Anyone have any solutions?

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

    Who do you put on Tech Debt tickets usually “high skill set” or “beginner” Developers?

    Posted: 06 Jun 2019 05:12 PM PDT

    Im a full stack JavaScript senior software developer at a pretty large retail company on the FE team.

    I'm just rolling off two team I was supporting at the same time (one project and one product team, work is done, they are not filling these with anyone after)

    I was the sole FE engineer on both teams.

    I was told today in an effort to get ready for peak we are making a foundational BE shift and all teams need resources for this shift. I would be the sole engineer to represent FE.

    I'll be supporting all FEs to help with there tech debt in the down time.

    I don't know how interpret this. One hand I view this as a positive as they said this has the highest priority for all of digital and I'll be working with all of our orgs global/domain architects

    On the other hand what that really means from a FE side is this is really just reporting when other break stuff when switch BE resources and just fixing other teams bugs in the down time.

    How would you interpret this?

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

    Looking to hire a freelance coder for an app. Any tips or red flags I should look for when choosing?

    Posted: 06 Jun 2019 06:11 PM PDT

    Title.

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

    How to implement multi-factor authentication?

    Posted: 06 Jun 2019 05:35 PM PDT

    I need to add MFA to our application. But I'm not really sure where to begin. Also based on my searches, there's not very many resources on this.

    Do you have any resources in implementing MFA?

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

    Application&reason in programming language

    Posted: 06 Jun 2019 04:45 PM PDT

    What is the application/use in every or upcoming programming language? (For example html: website designer, c++ for making games, etc) And why programming language are variety not just one for making simple to programming software/hardware?

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

    Senior Devs, Hiring Managers, Team leads, etc. if you were starting a five week internship on Monday, with the possibility of being converted to a Jr. Dev upon completion, what would you do to give yourself the best shot at success?

    Posted: 06 Jun 2019 10:35 AM PDT

    This is the situation I am in. On Monday I'll begin a five week internship. I want to do anything and everything in my power to ensure I am offered an entry level developer job at the end of the five weeks.

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

    When did you realize that you are ready to work?

    Posted: 06 Jun 2019 11:56 AM PDT

    At what point did you realize that you can try to fulfill orders or go to work in the office without fear of letting the customer down?

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

    Help with nested loops in Apple’s Playground

    Posted: 06 Jun 2019 03:06 PM PDT

    https://imgur.com/gallery/1wMJMtC

    I don't understand why this just stops working

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

    Problem with Othello Alpha-Beta Pruning (likely passing wrong board) (Java)

    Posted: 06 Jun 2019 02:15 PM PDT

    Title says most of it. In case you ask why I'm not using a reverse move method, that's a lot harder to implement in Othello. Instead, I use a stack of boards which basically act as "reverse move" by popping out the one on top. Here is the code for my minimax (yeah I know the bestmove may be messed up)

    Variable boards is a global Stack of Piece[][] arrays. Before the declaration, I clear it out and add the current board.

    private double minimax(Piece[][] board, int depth, double alpha, double beta, boolean player) {

     if(depth == 0 || gameOver()) { Piece\[\]\[\] tempBoard = new Piece\[8\]\[8\]; copyGrid(board, tempBoard); boards.push(tempBoard); boards.pop(); return evaluator(tempBoard, player); } else if(possibleMove(player) == false) { return minimax(board, depth - 1, alpha, beta, !player); } else if(player == false) { virtualBlackMove = false; bestScore = -1E100; double maxEval = -1E100; int moves = possibleMoves(false, board); int\[\]\[\] map = new int\[moves\]\[2\]; mapMoves(false, board, map); for(int i = 0; i < moves; i++) { Piece p = new Piece(false); printGrid(boards.peek()); Piece\[\]\[\] tempBoard = new Piece\[8\]\[8\]; copyGrid(boards.peek(), tempBoard); System.out.println(virtualBlackMove + " " + possibleMoves(virtualBlackMove, boards.peek())); virtualPlace(p, map\[i\]\[0\], map\[i\]\[1\], tempBoard); boards.push(tempBoard); double eval = minimax(boards.peek(), depth - 1, alpha, beta, true); maxEval = Math.max(maxEval, eval); alpha = Math.max(alpha, eval); boards.pop(); if(beta < alpha) 

    break;

     if(eval > bestScore) { 

    bestScore = eval;

    bestRow = map[i][0];

    bestCol = map[i][1];

    System.out.println("new best move");

     } } return maxEval; } else { virtualBlackMove = true; double bestScore = 1E100; double minEval = 1E100; int moves = possibleMoves(true, board); int\[\]\[\] map = new int\[moves\]\[2\]; mapMoves(true, board, map); for(int i = 0; i < moves; i++) { Piece\[\]\[\] tempBoard = new Piece\[8\]\[8\]; printGrid(boards.peek()); copyGrid(boards.peek(), tempBoard); System.out.println(virtualBlackMove); Piece p = new Piece(virtualBlackMove); virtualPlace(p, map\[i\]\[0\], map\[i\]\[1\], tempBoard); boards.push(tempBoard); double eval = minimax(boards.peek(), depth - 1, alpha, beta, false); System.out.print(eval + " "); minEval = Math.min(minEval, eval); beta = Math.min(beta, eval); System.out.println(depth + " " + virtualBlackMove); boards.pop(); if(beta < alpha) 

    break;

     } return minEval; } 

    }

    Thanks so much in advance

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

    How to enforce stack allocation of string with macro?

    Posted: 06 Jun 2019 01:33 PM PDT

    Basically what i want to accomplish is a preprocessor trick to allocate a string on the stack using array initializers like:

    char foo[] = {'f', 'o', 'o', 0}; 

    While the above works, i't like to have a nicer syntax to declare a string explicitly on the stack.

    I tried using the stringizing preprocessor operator, which works, but only if the string is less than 14 characters for some reason...

    #define STACKSTRING(s) {#s[0], #s[1], #s[2], #s[3], #s[4], #s[5], #s[6], #s[7], \ #s[8], #s[9], #s[10], #s[11], #s[12], #s[13], #s[14], #s[15],\ #s[16], #s[17], #s[18], #s[19], #s[20], #s[21], #s[22], #s[23], \ #s[24], #s[25], #s[26], #s[27], #s[28], #s[29], #s[30], #s[31]} char foo[] = STACKSTRING("foofoofoofoofo"); 

    Any longer that 14, and it will end up in .rdata...

    I'm using MSVC 15.

    Would it be possible to do with some c++ template magics?

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

    C# interfaces and generics cast problem

    Posted: 06 Jun 2019 01:28 PM PDT

    Hi, I have following problem.

    I have:

    abstract class Operation{} class OperationB: OperationA class OperationC: OperationA 

    Some interface for processing instances of those classses as follows:

    interface IHandler<in T> where T: A { void Calculate(T operation) {} } 

    Then i want to have some classes for calculating those operations as follows:

    class OperationBHandler: IHandler<OperationB> { void Calculate(OperationB operation) {} } 

    Everything alright, now I want to have some service which will take collection of those operations, take handler and calculate this operation. First thing i wanna do is to register those handlers in dictionary so this service looks kinda like this:

    class Service { Dictionary<Type, IHandler<OperationA> dict = new ... Service() { dict.Add(typeof(OperationB), Activator.CreateInstance<OperationBHandler>() as IHandler<OperationA>) } } 

    Now when i take operation and want to retreive handler from dictionary

    dict[operation.GetType()] 

    I get null, I guess its becouse i cannot cast Activator.CreateInstance<OperationBHandler>() to IHandler<OperationA>.

    I tried some different approaches but every each of them gave me complilation errors and i guess im missing something?

    Can someone point me direction? Thanks in advance.

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

    When reading a technical textbook, what are some guidelines to know what I can skim?

    Posted: 06 Jun 2019 01:13 PM PDT

    When dealing with technical textbooks like Minix 3 or many of the O'Reilly books on system development (as that is my interest), I often find myself stuck on trying to understand code sections. Trying to understand someone else's code is really tricky for me and I often ask myself "what is the author doing here and why is the author doing it?" What are some tell-tale signs of "I don't need to worry about not understanding this section of the source code"?

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

    Freelancing as a software engineer

    Posted: 06 Jun 2019 09:16 AM PDT

    I am a CS student who is trying to get a head start in the industry, but considering I have no degrees or experience, it's been a bit tough to even gain attention from recruiters. I figured freelancing may be a good place to start. I dont know much about freelancing in the context of software design. Would anyone be so kind as to share their experience and maybe some advice. Thank you!

    -A broke and lost college student

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

    Copying multiple files inside a Google Cloud bucket to different directories based on file name

    Posted: 06 Jun 2019 12:17 PM PDT

    Suppose I have multiple files in different sub-directories with names like 20060630 AD8,11 +1015.WAV and 20050508_Natoa_Enc1_AD5AK_1.WAV. Now I know that all these files will have a substring like AD (in the first file) and AD , AK (in the second). There are total 16 of these classes (AD, AK, AN etc) that I've made as empty folders in the top level directory.

    I want to copy all these files according to the substrings matched into their respective directory. Now using gsutil, the commands may come like:

    gsutil cp gs://bucket/Field/2005/20060630 AD8,11 +1015.WAV gs://bucket/AD/20060630 AD8,11 +1015.WAV 

    How can this approach work for automating the task for thousands of files in the same bucket?

    Is it safe to assume an approach like:

    if 'AD' in filename: gsutil cp gs://bucket/<filename> gs://bucket/AD/<filename> elif 'AK' in filename: gsutil cp gs://bucket/<filename> gs://bucket/AK/<filename> 
    submitted by /u/ZER_0_NE
    [link] [comments]

    JS/HTML Stopwatch Help

    Posted: 06 Jun 2019 11:28 AM PDT

    2 questions:

    Question 1 is that the stopwatch starts as soon as the page is loaded. How can I make it wait until the user presses the start button?

    Question 2 is how can I make the web page redirect to somewhere else after 15 minutes?

    HTML:

    <h2><time>00:00</time></h2> <button id="start">Start</button> <button id="stop">Stop</button> <button id="clear">Reset</button>

    JS:

    var h1 = document.getElementsByTagName('h2')[0], start = document.getElementById('start'), stop = document.getElementById('stop'), clear = document.getElementById('clear'), seconds = 0, minutes = 0, t;

    function add() { seconds++; if (seconds >= 60) { seconds = 0; minutes++; }

    h1.textContent = (minutes ? (minutes > 9 ? minutes : "0" + minutes) : "00") + ":" + (seconds > 9 ? seconds : "0" + seconds); timer(); 

    } function timer() { t = setTimeout(add, 1000); } timer();

    /* Start button */ start.onclick = timer;

    /* Stop button */ stop.onclick = function() { clearTimeout(t); }

    /* Clear button */ clear.onclick = function() { h1.textContent = "00:00"; seconds = 0; minutes = 0; }

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

    Pose Estimation Raspberry Pi

    Posted: 06 Jun 2019 03:50 AM PDT

    Hey everyone,

    I want to do a pose estimation program that can work on a Pi so that i can make games out of it.

    I need help i dont know where to start and how to do it.

    Thank you

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

    Which language should I use for a 2D 1v1 fight game?

    Posted: 06 Jun 2019 08:59 AM PDT

    I'm pretty new to programming but now with the beginning of the summer vacation, I had a nice idea for a game. I learned PASCAL and Visual Basic 6.0 at school and wanted to take a step forward. I was thinking about programming a Brawhalla-like Smash-like game and I was thinking about uploading it to Steam. I would want to play against friends, not against BOTs. I do realise these type of projects take a long time, but this is something I enjoy doing, so I don't mind. What language should I learn for this, and where should I learn it? Is there anything I should know before I get into this adventure? Any kind of help is highly appreciated

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

    How to declare a vector of data

    Posted: 06 Jun 2019 08:47 AM PDT

    I'm doing an Assembly program in ArmV8 that uses multiple constants (in floating point) that are therefore multiplied by the a certain value (also in floating point). For that, I want to develop a loop that just went trought a vector that contained the constants, incrementing the address each time to access the next constant, multiply it and so on, instead of repeating the same operation again and again. Although, I'm not sure how to declare this vector directly in the Assembly program.

    In ArmV7 I did something like this to achieve that purpose:

    Aux DCD 0x7F800000, 0x007FFFFF, 0x7FFFFFFF 

    But this only works for words in ArmV7 and I was working with doubles in ArmV8.

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

    Issue with sorting algorithm

    Posted: 06 Jun 2019 08:38 AM PDT

    I have been trying to implement a sorting algorithm but it doesn't work

    i am a beginner so please go easy

    code and output below

    #include<stdio.h>

    void SwapData(int* lData, int* rData);

    void SortData(int data[],int sizeofData);

    void PrintData(int data[],int sizeofData);

    void SwapData(int* lData, int* rData)

    {

    int temp = *lData;

    *lData = *rData;

    *rData = temp;

    }

    void PrintData(int data[],int sizeofData)

    {

    printf("The Array is\n");

    for(int i = 0; i < sizeofData; i++)

    {

    printf("%d ",data[i]);

    }

    }

    void SortData(int data[],int sizeofData)

    {

    for (int i = 0; i<sizeofData-1;i++)

    {

    int min_idx = i;

    for (int j = i+1;j<sizeofData;j++)

    {

    if(data[j] < data[min_idx])

    {

    SwapData(&data[j],&data[min_idx]);

    min_idx=j;

    }

    }

    }

    }

    int main( void )

    {

    int testData[] = {3,1,2,38,19,69,10,420,1,6,12};

    int sizeofData = (int)(sizeof(testData)/sizeof(testData[0]));

    SortData(testData,sizeofData);

    PrintData(testData,sizeofData);

    return 0;

    }

    output:1 1 2 19 3 6 10 12 38 69 420

    thanks for your help

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

    Is my understanding of what Django is accurate?

    Posted: 06 Jun 2019 05:40 AM PDT

    Previously, I have written webpages using html and javascript, and I have written offline programs in python. For my current project, also a website, I have some prewritten python code to use. My understanding is that if I use Django, I can build a website exclusively (or primarily) using just python. Is this all accurate?

    My real question that I'm using this information to figure out: I need to build a website that uses some python programs on an AWS instance with apache installed. Would it be better to use html and javascript, or to use Django with python?

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

    Tips to improve online coding attempt and correctness ratio!

    Posted: 06 Jun 2019 05:10 AM PDT

    I recently started online coding for practice purpose. I am doing coding from last two years created some projects but not online coding. I spend 2-3 hours daily and solve just 2-3 problem. How can I improve my efficiency?

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

    No comments:

    Post a Comment