• Breaking News

    Monday, August 12, 2019

    How different is your work setup vs your home setup for programming? Ask Programming

    How different is your work setup vs your home setup for programming? Ask Programming


    How different is your work setup vs your home setup for programming?

    Posted: 12 Aug 2019 03:54 PM PDT

    I do web dev on OSX with a stock apple 104 key chiclet-style keyboard at work, but at home I run Debian/GNOME with an 87 key mechanical, with ctrl and caps swapped. I use Emacs in both cases, using left and right hand modifiers equally.

    I'm finding that the muscle memory I build for 8 hours a day at work really makes working on side projects at home unpleasant due to typos and reaching for the wrong modifier.

    I'm wondering if anyone out there feels equally productive on multiple interfaces, or if I should give up and try to standardize my setup between work and home.

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

    JAVA - How to read approved option from JFileChooser and then append it to a file?

    Posted: 12 Aug 2019 10:04 PM PDT

    EDIT: Added the whole code instead of just the AddListener class.

    I'm trying to append the path selected from the JFileChooser to a file, but if I do it more than once, it just overwrites the previous selection. So say I select "path1" select ok, then I select "path2" select ok, then I check the file and it only has path2. I don't know why it's getting overridden, any help would be much appreciated.

    Here's my code (and I know it's terribly written, I'm pretty noob still):

     import javax.swing.*; import javax.swing.border.Border; import javax.swing.filechooser.FileNameExtensionFilter; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.ArrayList; public class Main { private static JTextArea text; private static JPanel panel; private static ArrayList<String> gameList = new ArrayList(); private static File savePath = new File("PATH"); public static void main(String[] args) { Main gameChooser = new Main(); gameChooser.go(); } public void go() { JFrame frame = new JFrame(); panel = new JPanel(); text = new JTextArea(50, 50); JButton addButton = new JButton("Add game"); addButton.addActionListener(new AddListener()); JButton startButton = new JButton("Start game"); panel.add(text); if (savePath != null) { readGames(); for (int i = 0; i < gameList.size(); i++) { text.append(gameList.get(i) + "\n"); } } frame.getContentPane().add(BorderLayout.CENTER, panel); frame.getContentPane().add(BorderLayout.NORTH, addButton); frame.getContentPane().add(BorderLayout.SOUTH, startButton); frame.setSize(777, 777); frame.setVisible(true); } public class AddListener implements ActionListener { public void actionPerformed(ActionEvent add) { JFileChooser chooser = new JFileChooser("PATH"); int returnVal = chooser.showOpenDialog(panel); if (returnVal == JFileChooser.APPROVE_OPTION) { try { FileWriter fw = new FileWriter(savePath); BufferedWriter bw = new BufferedWriter(fw); String gamePath = chooser.getSelectedFile().getAbsolutePath(); bw.append(gamePath); bw.close(); text.append(gamePath + "\n"); } catch (IOException ex) { } } } } public class StartListener implements ActionListener { public void actionPerformed(ActionEvent start) { try { int rand = (int) (Math.random() * gameList.size()); String gameString = gameList.get(rand); File game = new File(gameString); Desktop desktop = Desktop.getDesktop(); desktop.open(game); } catch (IOException ex) { ex.printStackTrace(); } } } public void readGames() { try { FileReader fr = new FileReader(savePath); BufferedReader br = new BufferedReader(fr); String temp = ""; while ((temp = br.readLine()) != null) { gameList.add(temp); } } catch (IOException e) { } } } 
    submitted by /u/dnlaua
    [link] [comments]

    I'm starting a MASc in computational engineering. I'll be running simulations with many different versions of code and variables. What's the best way to manage this?

    Posted: 12 Aug 2019 08:45 AM PDT

    For example, I might run a set of simulations where everything is the same except one or two parameters. For now, I've been sorting results into descriptive folders, but I know this approach will be extremely troublesome when I have hundreds of different results. What's the best way for me to organize things? Should I look into SQL?

    Thanks!

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

    My brother's cell phone has a resolution of 1440x3040 so even in portrait view, it loads the CSS media query for desktops. Can you stop this from happening?

    Posted: 12 Aug 2019 09:17 PM PDT

    I set breakpoints based on how my design looks, starting with mobile view then widening out. I also took into account common screen resolutions based off this site: https://gs.statcounter.com/screen-resolution-stats

    Here are some examples of the screen resolutions I'm talking about: http://socialcompare.com/en/comparison/samsung-galaxy-s-product-line

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

    Trying to find a simple algorithm for rewriting into a run-length-encoded binary sequence

    Posted: 12 Aug 2019 03:31 PM PDT

    Suppose I have a sequence of black and white pixels, encoded as block-lengths. For example:

    3,5,1,2

    encodes the following:

    BBB WWWWW B WW

    Now suppose I want to change the pixels at positions 4 to 7 to Black:

    BBB W BBBBB WW

    The new encoded sequence is 3,1,5,2.

    If instead I had changed positions 3 to 7 to black:

    BBBBBBBBB WW

    the new encoded sequence would be 9,2.

    What I'm trying to find is if there is a simple algorithm for taking one encoded sequence, specifying a block of pixels to change to either black or white, and to then output the new encoded sequence.

    Naively, one could decompress the sequence to a string of black and white pixels, make the change, and recompress it, but that's what I'm trying to avoid.

    I've figured that I can work out where the new block lies, which blocks it overlaps, and various ways for dealing with all combinations, but it feels like there should be a simpler way.

    Does anyone have any ideas? Or any proper names for some of the concepts I'm talking about that would help me to search for more info?

    Notes: the first number always represents a black block, so it may be 0. The uncompressed sequence always has the same total length. I'm writing in C++ but I'm just trying to find a simple generic algorithm at the moment.

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

    Using Send API to send customized messages to FB messenger via Amazon Web Services

    Posted: 12 Aug 2019 02:15 PM PDT

    I currently have a chatbot set up using Amazon Lex that answers questions and interacts properly with my facebook business page. However, I am trying to introduce a new subscription messaging feature (just got approved by Facebook) that will send customized messages to different users based on different metrics (e.g. frequency of message, contents of message, etc.)

    How do I go about setting this up? so that I can send all types of messages (e.g. subscription message, broadcast message etc.) in addition to the pre-set messages that the chatbot can send. I currently have all of the business logic for my facebook business app on AWS (lambda functions, storage, etc.)

    I am not a developer, but I have been able to teach myself the basics so far.

    My best guess is to use AWS's API gateway service. I need directions on the best way to set these up considering all of the current infrastructures I have set up. Any guidance will be much appreciated

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

    How should I start with MVVM + Retrofit?

    Posted: 12 Aug 2019 01:21 PM PDT

    Hi, I've got a little problem with MVVM. I'd wanted to create my own project, using Retrofit, instead of Room, but I'm totally don't know how It should look like. I'm already familiar with Retrofit, but I don't have any idea, how to use it with MVVM, can I have any advice?

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

    What programming languages would you recommend to someone wanting to work in this field?

    Posted: 12 Aug 2019 05:01 PM PDT

    I've been interested for long in working in the field of software programming, I've learned a few languages and enjoyed very much doing so, but what are languages I should learn if I want a great future in this job?

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

    How to tell how popular a given NumPy function is

    Posted: 12 Aug 2019 04:19 PM PDT

    Basically like stars on GitHub.

    Is there a way? This is one of the ways in which I judge whether to use a function or not (or which function to use), because I'll almost always pick the more popular ones. They tend to have the most staying power.

    Is there a way to do this?

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

    C# array struct

    Posted: 12 Aug 2019 01:22 PM PDT

    Is it possible to create a custom type Cell that acts like an array of integers (i.e. supports indexing, but has a fixed size) but also like a struct? If so, what would be the best way to go about doing that?

    Cell a = ... Cell b = a; b[0] += 1; 

    I'd like that last line to modify b but not a. Would be nice for it to implement IEnumerable<int> too, but that's not essential.

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

    Suggestions for GUI practice for hobby project

    Posted: 12 Aug 2019 01:08 PM PDT

    I know it sounds suspicious, but this is not homework. I finished an interdisciplinary arts degree and a computer science degree and we had exactly one class where we worked with GUIs, and that was Java class/OOP, and even then it was like create_rect(1,5); type stuff. As you can tell, I feel like school was a waste of time where I didn't really learn anything, but whatever.

    That said, I want to work my way up to making a very simple connect 4 game where I can click on a column and then have the coin fall in. At the moment I have a (I believe) fully functioning connect 4 game for two people where you can set it between 7 to 98 columns. I will eventually make it to where you can have like 5 players.

    Once I am happy with my clickable connect 4, I'm going to make an item based checkers/chess game where you can shoot pieces or make them invulnerable to being captured, maybe add teleportation and cloning or create shields.

    But anyway, here's my code at the moment to show that I put in effort and am not trying to get someone to code my project. I test my code like every other line with stuff like "printf "testing C. You should see this.\n") to make sure my program correctly progresses, so ignore the weird commented prints.

    include <stdio.h>

    include <stdlib.h>

    //can change rows between 4 and infinity probably

    define ROWS 6

    define COLUMNS 7

    define WINLENGTH 4

    define CLEARSCREEN system("cls")

    void createBoard(int board[ROWS][COLUMNS]); void showBoard(int board[ROWS][COLUMNS]); void dropPiece(int board[ROWS][COLUMNS], int player, int lastMove); int checkVictory(int board[ROWS][COLUMNS], int* lastMove);

    int main(int argc, char *argv[]) { int board[ROWS][COLUMNS]; int lastMove[2]; int player=1; int turnsElapsed = 0; createBoard(board); //initialize an empty 6x7 board

    while (1) { CLEARSCREEN; if (turnsElapsed == ROWS * COLUMNS) { CLEARSCREEN; printf("GAME OVER.\n"); showBoard(board); return 0; } showBoard(board); printf("It is PLAYER %d's turn. ",player); if (player == 1) { printf(" (0)\n"); } else if (player == 2) { printf(" [X]\n"); } dropPiece(board, &player, lastMove); turnsElapsed++; printf("Turn #%d\n", turnsElapsed); showBoard(board); if (checkVictory(board,lastMove) == 0) { CLEARSCREEN; showBoard(board); printf("You win. GTFO.\n"); return 0; } } 

    }

    void createBoard(int board[ROWS][COLUMNS]) { int c,r;

     for (r=0; r<ROWS; r++) { for (c=0; c<COLUMNS; c++) { board[r][c] = 999; //printf(" (%d %d) ",r,c); } } 

    }

    void showBoard(int board[ROWS][COLUMNS]) { int r,c,i; i = 0;

     for (r=0; r<ROWS; r++) { i++; for (c=0; c<COLUMNS; c++) { if (board[r][c] == 999) printf(" + "); else if (board[r][c] == 1) printf("(O)"); else if (board[r][c] == 2) printf("[X]"); //printf("(%d %d) ",r,c); } printf("\n"); } printf("\n"); int columnLabel=0; for (columnLabel=0; columnLabel<COLUMNS; columnLabel++) { printf(" %d ",columnLabel); } printf("\n"); 

    }

    void dropPiece(int board[ROWS][COLUMNS],int* player, int* lastMove) { int attempt; while (1) { printf("Which column do you wish to drop a piece into?\n"); scanf("%d",&attempt);

     if (attempt <0 || attempt >= COLUMNS) { printf("Pick a number between 0 and %d. Try again.\n",COLUMNS); printf("Your attempt is >%d<\n",attempt); continue; } else if (board[0][attempt] != 999) { printf("Column is full. Try again.\n"); } else { int i = ROWS-1; while (board[i][attempt]!=999) { i--; } //printf("Open space at %d\n",i); if (*player == 1) board[i][attempt]=1; else if (*player == 2) board [i][attempt]=2; lastMove[0]=i; lastMove[1]=attempt; break; } } //playerLoop will be worked on here if (*player == 1) *player = 2; else *player = 1; 

    }

    int checkVictory(int board[ROWS][COLUMNS], int* lastMove) {

    int r = lastMove[0]; int c = lastMove[1]; int rReset = r; int cReset = c; int growth = 1; int leftFlag = 0; //you can't go left, it's been tested int rightFlag = 0; //you can't go right; it's been tested int downFlag = 0; int upRightFlag = 0; int upLeftFlag =0; int downLeftFlag = 0; int downRightFlag = 0; //int loopsProcessed =0; while (1) { //printf("LoopsProcessed %d\n", ++loopsProcessed); if (growth == WINLENGTH) { //printf("You win based on root win check\n"); showBoard(board); return 0; } //HORIZONTAL WINCHECK //rightCheck if ( c+1 <= COLUMNS && board[r][c] == board[r][c+1] && rightFlag==0 ) { growth++; //printf("growing due to going right. Size: %d\n",growth); c++; continue; } //rightCheckingEnd if ( ( (c+1 == COLUMNS) && (rightFlag==0))|| (board[r][c] != board[r][c+1] && rightFlag == 0)) { //printf("Rightflag set\n"); rightFlag=1; c = cReset; continue; } //leftCheck if ( (c-1>=0 && leftFlag==0) && (board[r][c] == board[r][c-1] && leftFlag == 0)) { growth++; //printf("Growing due to going left. Size: %d.\n", growth); c--; continue; } //leftCheckingEnd if ( ( c-1<0 && leftFlag ==0) || (leftFlag==0 && board[r][c] != board[r][c-1])) { //printf("Left flag set, resetting.\n"); leftFlag=1; c = cReset; if (growth == WINLENGTH) { //printf("you win with left test\n"); return 0; } growth = 1; } //VERTICAL //downCheck if ((r+1 < ROWS) && board[r][c] == board[r+1][c] && downFlag==0 ) { growth++; //printf("growing due to going south. Size: %d \n",growth); r++; continue; } //downCheckingEnd if ( ( (r+1 >= ROWS) || (board[r][c] != board[r+1][c])) && downFlag == 0) { //printf("Downflag set. Resetting.\n"); downFlag=1; r = rReset; growth = 1; continue; } //DIAGONALS //upRightCheck if ((r-1 >= 0 && c+1 < COLUMNS) && (upRightFlag == 0) && (board[r][c] == board[r-1][c+1] ) ) { growth++; //printf("Growing upright. Growth is: %d\n",growth); r--; c++; continue; } //upRightCheckingEnd if ( (r-1 < 0 || c+1 == COLUMNS || board[r][c] != board[r-1][c+1] ) && upRightFlag == 0) { //printf("Setting uprightflag.\n"); upRightFlag = 1; r = rReset; c = cReset; continue; } //downLeftCheck if ( ( r+1 < ROWS && c-1>=0 && downLeftFlag == 0) && ( board[r][c] == board[r+1][c-1]) && downLeftFlag == 0) { growth++; //printf("Growing downleft. Growth size is: %d\n",growth); r++; c--; continue; } //downLeftCheckingEnd if ( (r+1 >= ROWS || c-1 < 0 || board[r][c] != board[r+1][c-1] ) && downLeftFlag == 0) { //printf("Setting downleftflag.\n"); downLeftFlag = 1; r = rReset; c = cReset; if (growth==WINLENGTH) { //printf("win due to down left.\n"); return 0; } growth = 1; continue; } //upLeftCheck if ((r-1 >= 0 && c-1 >= 0) && (upLeftFlag == 0) && (board[r][c] == board[r-1][c-1] ) ) { growth++; //printf("Growing upLeft. Growth is: %d\n",growth); r--; c--; continue; } //upLeftCheckingEnd if ( (r-1 < 0 || c-1 <0 || board[r][c] != board[r-1][c-1] ) && upLeftFlag == 0) { //printf("Setting upLeftFlag.\n"); upLeftFlag = 1; r = rReset; c = cReset; continue; } //downright if ( ( r+1 < ROWS && c+1<COLUMNS && downRightFlag == 0) && ( board[r][c] == board[r+1][c+1]) && downRightFlag == 0) { growth++; //printf("Growing downright. Growth size is: %d\n",growth); r++; c++; continue; } if ( (r+1 >= ROWS || c+1 >=COLUMNS || board[r][c] != board[r+1][c+1] ) && downRightFlag == 0) { //printf("downRightFlag is %d\n", downRightFlag); //printf("Setting downRightflag.\n"); downRightFlag = 1; r = rReset; c = cReset; if (growth==WINLENGTH) { //printf("win due to down right.\n"); return 0; } growth = 1; continue; } if (leftFlag && rightFlag && downFlag&&upRightFlag&&downLeftFlag&&upLeftFlag&&downRightFlag) { //printf("Didn't win yet, SORRY!.\n"); return 1; } printf("Should never see this!!!!!!!!!!!!!!!!!!!!!! Flags are: left: %d right %d down: %d upRight %d downleft %d upLeft %d downRight %d\n", leftFlag, rightFlag,downFlag, upRightFlag, downLeftFlag, upLeftFlag, downRightFlag); } 

    }

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

    What's the best to automate video view counts from LinkedIn & Twitter to a Google Sheets document?

    Posted: 12 Aug 2019 12:55 PM PDT

    My company is running an internal competition where employees generate video content that is then posted to our LinkedIn and Twitter pages and monitored over 1 week. Whoever has the highest view count at the end of the period wins. I set up a spreadsheet and dashboard in Google Data Studio already that allows me to manually update the counts of each, but I'm looking to automate this process.

    I've looked into some of the API documentation for LinkedIn and Twitter, but it's honestly pretty above my head and I'm not even sure how to go about getting started. I know pretty basic-level Python and bash, but am just looking for the quickest / easiest way possible to do this to lessen my workload. (No tools I've found offer this functionality so far)

    Any help or direction for this would be much appreciated, thanks!

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

    Project with a large spreadsheet - pinpointing rows with the most "important" words rather than frequent

    Posted: 12 Aug 2019 09:03 AM PDT

    Hello! I have been assigned a large project for my team, and I am currently trying to resolve a smoother way to complete my objective. (The example details will be changed due to confidentiality)

    The spreadsheet is on the larger side (~5k rows) with multiple categories. However, I need to find a program/language that will allow me to mark or pinpoint the excel Rows with the most important words on the columns. For example,

    If one of the employee feedback column says "need more consulting training", and as one of other programs contain the keywords "consulting training", then that employee's row will be pinned as "Consulting Program". This applies the same concept with other program names and descriptions as well. I would say this would be a much stronger version of Excel's ctrl + f.

    My team gave me additional time to learn programming and practice them as well, so I am always free to take extra online classes for recommended programs. The file can be worked on the program language as well (Python, R, Etc), but I just would like to know which program is recommended and what the specific function/action is called. Thank you so much, if you guys need more details, please let me know.

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

    What's the best way to generate a schema from a certain set of parameters?

    Posted: 12 Aug 2019 12:03 PM PDT

    I'm trying to generate an array of strings (or any other data structure that might be more useful for my task, but I can't think of anything else) in Python.

    The program I'm working on has several radio buttons. Two examples:

    *) One set of radio buttons is "Blocked" and "Alternating" and results in the output being either blocked or alternated.

    Example:

    Blocked is selected, the output looks like this:

    ['A', 'B', 'C', '1', '2', '3'] 

    Alternated:

    ['A', '1', 'B', '2', 'C', '3'] 

    *) Other set is "single" or "duplicate". Example:

    Single and blocked is selected:

    ['A', 'B', 'C', '1', '2', '3'] 

    Duplicate and alternate is selected:

    ['A', 'A', '1', '1', 'B', 'B', '2', '2', 'C', 'C', '3', '3'] 

    I'm not really after a piece of code, but a general concept of how to create something like this. There's many more settings aside from those I listed, but the general idea is the same: based on the parameters I somehow need to generate an array of varying length with elements of varying order.

    I just need an idea for a concept; it doesn't have to be Python or array - I just can't think of a way to start writing this.

    Thanks in advance!

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

    Programming application to change current image in real time?

    Posted: 12 Aug 2019 10:40 AM PDT

    Let me explain a bit.

    I'm trying to figure out if there is an application or what is the simplest way to do it (within python or java if it can be done) where I can set a solid color (rgb) and with the press of a button i can change it's intensity. so like I press the down key on my keyboard and the intensity of the image lowers. and after which i can press the up key to increase the intensity.

    thing is i don't want it to have like a delay or it stops as soon as i press on it once.

    What is the simplest way for me to do this? I'm trying to build something like this for me to collect data with the images i mess around with.

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

    How to return multiple SQL queries in Java?

    Posted: 12 Aug 2019 06:31 AM PDT

    Hey, I'm trying to extract two SQL queries through Java so that they both would show up on the screen. Is there a return statement that could perform that with this code or do you have any other suggestions on how to do that? https://pastebin.com/Zs7ZgXvx

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

    Personal Project Advice

    Posted: 12 Aug 2019 08:58 AM PDT

    I'm working on my first project in hopes of landing a job but I'm having some trouble getting started.

    In short, the purpose is to be a travel calculator where you enter information in (location, time, date, etc.) And it spits back the best time and way to travel as well as how much it would cost.

    I don't have any idea on how to start and I was wondering if there was a course I could find that would help me start and finish. Any advice or help is appreciated.

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

    What to learn to become a software engineer/developer?

    Posted: 11 Aug 2019 11:18 PM PDT

    Hey guys, I'm studying next year but I'm want to get ahead. What should I learn to help me before course?

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

    Best way to locally store secrets?

    Posted: 12 Aug 2019 07:05 AM PDT

    I am working on a project where we have to store access tokens and passwords to send off to an API. Since we have to send them in plaintext, we can't just hash them and store them that way. That being said, storing them in plaintext is clearly not an option.

    The process I came up with is as follows:

    1. Ask the user for a PIN (can be alphanumeric and as long as they want idc)
    2. Salt and hash the PIN
    3. Generate a random AES key and encrypt the "secret" which is then written to disk
    4. XOR the PIN and the AES key
    5. Write the result to disk

    My line of thinking is that no one can get the AES key back out without knowing the salted hash of the PIN, which would require the knowing of the PIN.

    Is there a better way to do this? And/or a more secure way? Thanks in advance

    Edit: I should mention that the XOR key is longer than a single character, so it is not just a glorified substitution cipher

    Edit2: Some answers to some questions u/moobied had for better visibility: API is third party, and we can either send the user's password to them or an access token. We support both, but no matter what that sensitive information needs to be encrypted. We also do not plan on storing the PIN, nor the salted hash; if the user enters the PIN wrong, we will know when we get a decryption error or a logon error

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

    Editing XML saved as string in table column using SQL

    Posted: 12 Aug 2019 05:51 AM PDT

    The column named "xmlString" contains XML stored as a string. I need to check, for each value of this column, whether or not it contains a certain value for a <tag1> which is wrapped around a bunch of <tag2>. The <tag2>s consist of key-value pairs (basically a dictionary item saved in each one) . I need to add a new <tag2> containing a new key-value pair in a <tag1> with a certain value.

    For example, I have this:

    <tag1 name=\"test_name\"> <tag2 key=\"test_key\" value=\"test_value\" /> </tag1> 

    as a part of my XML, and I want to add a new <tag2> inside a <tag1> which contains --name=\"test_name\"--, or even just "test_name\" if that is possible, the desired outcome would look like this:

    <tag1 name=\"test_name\"> <tag2 key=\"test_key\" value=\"test_value\" /> <tag2 key=\"new_key\" value=\"new_value\" /> </tag1> 

    I need to do this using SQL and basically update every row with the new <tag2> if it contains <tag1 name =\\"test\_name\\">

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

    [Design] About modelling behaviour. More parameters on function, or new function?

    Posted: 12 Aug 2019 05:46 AM PDT

    First, let me set up some context.

    I have a function that simulates a user typing a string, printing each character of the buffer at a fixed delay.

    But now, I want another behaviour. There has to be a random delay if the user wants, so it will now print each character at a random delay between two numbers.

    1. If you add this behaviour to a separate function, it would be almost the same, a copy-paste, except that for now, it takes a tuple (float, float) that specifies the upper bound and lower bound of the random number to be generated.
    2. But if you had this functionality on the same function that takes a fixed delay, you would need to add extra parameters, such as random_delay to be true or false, and then another param to receive the tuple for the boundaries.
    3. You can also make the delay parameter, to take a tuple or float, type check it, and take the path accordingly to the type. The function also has the new parameter random_delay that takes true or false. But this strategy and 2 leads to the question. Doesn't a new behaviour lead inherently to belong to a new function?

    I am a student going through a more analytical approach building stuff and will be great to hear your opinion about it, even for such a simple problem. Would you use option 1, 2 or 3, or even take another approach? Thanks for your insight.

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

    [SERIOUS] How to deal with small windows of downtime while developing/debugging?

    Posted: 12 Aug 2019 02:14 AM PDT

    I code very iteratively, i.e. make a small change, execute code to see if nothing broke, make a small change, etc.

    This means I often have small windows of downtime waiting for my code to finish (usually a minute or two). I find myself often browing reddit while keeping an eye on the execution and return to my work once the execution is done. I feel this method however wreaks havoc on my attention span.

    I would love to spend these small windows on something useful, e.g. learn something new, but I feel these time windows are too small. Moreover, multitasking isn't a thing.

    I have tried meditating in these windows, but I feel there's only so much meditation one can do in a day.

    Does this way of working sound familiar to you? If so, how do you fill these small windows?

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

    Can I add a python decompiler to Visual Studio?

    Posted: 12 Aug 2019 01:25 AM PDT

    I'd like to be able to decompile a pyc file from within VS. Is this possible? I found this decompiler to work best for me. Is there anyway I can add this as a tool so I can right click a pyc file and decompile it like that? I'm new to python and VS. If not, is there another way to decompile using a gui?

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

    No comments:

    Post a Comment