• Breaking News

    Monday, March 18, 2019

    Is there a Program for my Problem??? Ask Programming

    Is there a Program for my Problem??? Ask Programming


    Is there a Program for my Problem???

    Posted: 18 Mar 2019 12:28 PM PDT

    I have a job where I have to log onto the unions website and make myself available to work the next day. My problem is that it opens up at 6 in the morning and its first comes first served. Is there a program that can automate this process? All you have to do is click two buttons.

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

    Can I effectively use git to work on a project from two computers?

    Posted: 18 Mar 2019 07:08 PM PDT

    I'm working on a web project (node, react, express, mongo) and have a mac laptop and windows desktop. I like to use the laptop to develop while out and about, and use the desktop when I'm home.

    I find myself committing and pushing broken code all the time when I want to switch devices. This just feels a bit wrong. I don't like to do it but it's the only efficient way I know to get my code over to the other device.

    I'm using branches when doing this, not committing directly on master, but I still don't love it. I'm not really using git as a collaboration tool, but more as butt storage. Do you have any advice for doing what I want to do better?

    Thanks

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

    3D map Android app using ReactNative beginner help.

    Posted: 18 Mar 2019 03:51 PM PDT

    I have zero programming background and when I presented my idea of a 3D map app of my campus to a random programmer I met, he suggested to "abandon polygon, use React Native".

    I installed React Native, node.js, expo and sublime text editor last night and watched some tutorial and how to use them but I'm still lost as how to proceed?

    What should I do next? Which YouTube tutorial should I look for next?

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

    Copying and pasting from a Word doc, how much shall I pay a developer to automate it?

    Posted: 18 Mar 2019 05:47 PM PDT

    I need to copy and paste segments of Word documents into corresponding sections of an online government registration form.

    The form requires clicking through and typing preset answers in some parts, as well as copying and pasting what clients wrote into the corresponding segments such as name, date of birth, age, nationality etc.

    Posted a project on freelancer, how should I decide which developer to go for? Would an NDA protect the script so its not sold off to a competitor as well?

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

    lua: can't seem to get leafname from a string

    Posted: 18 Mar 2019 09:17 PM PDT

         I am running lua on Linux without any special lua libraries.

         I have a string that consists of a full path, e.g. /etc/cron.weekly/rclone_weekly. I need a function that separates out the leafname i.e., in this case, rclone_weekly. Despite trying out solutions on this StackOverflow page, I can't seem to manage it. A comment on that page says that reading the string backwards - until one hits / presumably - is the most efficient way to do it. Sounds good to me (and I do need the function to be fairly fast) - but how does one do that? (I don't know much about lua, though I do tinker in it.)

    EDIT: I found this function, which splits a string into path, leafname-without-extension, and extension, but I just want the leafname-with-any-extension.

    Further EDIT: and there is this, which does what I want but . . only for Windows-style paths.

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

    Programming rock, paper, scissors in JavaScript help?

    Posted: 18 Mar 2019 12:08 PM PDT

    So my issues is when I type scissors or paper into the userChoice in playGame() I cant lose even when I should. So scissors and paper don't work properly. BUT when I put rock as my userChoice It works properly (as in I win when I should, and I lose when I should). Anyone know whats going on? Thanks

    const getUserChoice = userInput => {

    userInput = userInput.toLowerCase();

    if (userInput === 'rock' || userInput === 'paper' ||

    userInput === 'scissors') {

    return userInput;

    } else {

    return 'Error, Not a choice.';

    }

    };

    const getComputerChoice = () => {

    let randomNumber = Math.floor(Math.random() * 3)

    switch(randomNumber) {

    case 0:

    return 'rock';

    case 1:

    return 'paper' ;

    case 2:

    return 'scissors';

    }

    };

    const determineWinner = (userChoice, computerChoice) => {

    if(userChoice === computerChoice){

    return 'Tie!'};

    if(userChoice === 'rock' && computerChoice === 'paper'){

    //if(computerChoice === 'paper')

    return 'Computer Won!';

    }else{

    return 'You Won!';

    };

    if(userChoice === 'paper' && computerChoice === 'scissors'){

    //if(computerChoice === 'scissors')

    return 'Computer won!';

    }else{

    return 'You Won!';

    };

    if(userChoice === 'scissors' && computerChoice === 'rock'){

    //if(computerChoice === 'rock')

    return 'Computer Won';

    }else{

    return 'You Won!';

    }

    };

    const playGame = () => {

    const userChoice = getUserChoice('rock');

    const computerChoice = getComputerChoice();

    console.log('You threw: ' + userChoice);

    console.log('The computer threw: ' + computerChoice);

    console.log(determineWinner(userChoice, computerChoice));

    };

    playGame()

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

    TIP calc with tip rating(basic java)

    Posted: 18 Mar 2019 08:44 PM PDT

    Hello all, I basically made a tipping system that tells you how good the tip is. My issue is I can't get it to work or it tells me I'm a bad tipper even if the tip is 100$ over 10$

    Here is my code

    import

    javax.swing.JOptionPane;

    public class TipCalc {

    public static void main(String[] args) {

    {

    String input;

    String bill;

    double mealCharge;

    double tipAmount = 0;

    double totalWithTip;

    double idealAmount;

    final double tip = 0.2;

    int tipAmount = 0 ;

    // types of tips and tipping scales % based

    if (tipAmount < 0 || > 40) {

    System.out.print("'Amazing'");

    } else if (tipAmount > 20) {

    System.out.print("'Great tip;");

    } else if (tipAmount > 15) {

    System.out.print("Not bad");

    } else if (tipAmount > 10) {

    System.out.print("Not so great tip;");

    } else {

    System.out.print("Bad tip or terrible service");

    }

    System.out.println("tip = " + tipAmount );

    //input for price as well as amt of tip

    input = JOptionPane.showInputDialog("Enter price of meal : ");

    mealCharge = Double.parseDouble(input);

    input = JOptionPane.showInputDialog("Enter tip amount: ");

    tipAmount = Double.parseDouble(input);

    //calculats ideal tip amt, tip amt and total bill

    totalWithTip = mealCharge + tipAmount;

    idealAmount = mealCharge * tip;

    //display to user meal charge, ideal amount, tip amount, and total bill

    bill = "Your meal charge amount is $" + mealCharge + "." + "\n" +

    "Your tip amount is $" + tipAmount + "." + "\n" +

    "ideal tip amount is $" + idealAmount + "." + "\n" +

    "Total bill amount : $" + totalWithTip + ".";

    JOptionPane.showMessageDialog(null, bill);

    }

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

    Issues with Ruby loop logic

    Posted: 18 Mar 2019 08:04 PM PDT

    I'm new to ruby and programming in general, but I'm trying to make a game where I want to check for potential wins on the board, kind of like bejeweled or connect four, and I can't figure out what is preventing this loop form looking at the whole board. I'm using a 2D array and I know I could look find a simple algorithm, but I want to figure that part out by myself.

    It made sense to me on paper, but it keeps getting stuck. Can someone offer any tips? This is what I have:

    def winner(grid, piece) row = 0 column = 0 winner = false while winner == false && row < 6 if grid[row][column] == piece && grid[row + 1][column + 1] == piece && grid[row + 2][column + 2] == piece && grid[row + 3][column + 3] == piece winner = true #replace Xs, if found, with W. grid[row][column] = "W" grid[row + 1][column + 1] = "W" grid[row + 2][column + 2] = "W" grid[row + 3][column + 3] = "W" grid.each do |row| puts row.join("|") end puts "not stuck here 2" else puts "gets into else" row += 1 winner = false if grid[row][column] == piece && grid[row + 1][column + 1] == piece && grid[row + 2][column + 2] == piece && grid[row + 3][column + 3] == piece winner = true puts "gets past second if" grid[row][column] = "Y" grid[row + 1][column + 1] = "Y" grid[row + 2][column + 2] = "Y" grid[row + 3][column + 3] = "Y" grid.each do |row| puts row.join("|") end else column += 1 end end end return winner end #Xs placed just to test method game_grid = [["_", "_", "_", "_", "_", "_", "_", "_"], ["_", "_", "_", "X", "_", "_", "_", "_"], ["X", "_", "_", "_", "X", "_", "_", "_"], ["_", "X", "_", "_", "_", "X", "_", "_"], ["_", "_", "X", "_", "_", "_", "X", "_"], ["_", "_", "_", "X", "_", "_", "_", "_"], ["_", "_", "_", "_", "X", "_", "_", "_"], ["_", "_", "_", "_", "_", "_", "_", "_"]] nw_se_winner(game_grid, "X") 
    submitted by /u/justfIuff
    [link] [comments]

    Youtube lectures, or tech talks in about 15 min?

    Posted: 18 Mar 2019 03:20 AM PDT

    I have 15 min walk to job so i want to listen to someone. It can be anything, i flared web because it's my main focus but it can be anything. Thanks in advance!

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

    Is there a way to alter Twitter search result url to show more results?

    Posted: 18 Mar 2019 02:24 PM PDT

    I'm trying to get a url for Twitter advanced search that shows more than the default top 30. Ideally I would like to see all the results on one page, without infinite scroll.

    Is there a common, basic way to do this? Also is there a conceptual/high-level concept I can look more into for future reference? (A way to identify these types of urls and how to alter them to show better results)

    Example of a url:

    https://twitter.com/search?l=&q=funny%20near%3A%22Los%20Angeles%22%20within%3A15mi&src=typd&lang=en

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

    Change alpha value of an image

    Posted: 18 Mar 2019 05:12 PM PDT

    I am trying to create a watermark on PDFs, and want to change the alpha value of a specific image (or, even better, any given image) through code. Is there a way that I can do this, similar to the opacity of an image in CSS, but not with CSS?

    Sorry in advance if this is a dumb question because I have very limited knowledge on image representations

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

    Does anyone know of a JS package that can help parse text documents a la Papa Parse but for text documents and not CSVs?

    Posted: 18 Mar 2019 01:25 PM PDT

    All info in title ^. Looking for any tips / suggestions

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

    Are there any ways to add debugging logging without dirtying the functionality it's logging?

    Posted: 18 Mar 2019 01:11 PM PDT

    what is a good source of information on data structures & algorithms, (not about java)

    Posted: 18 Mar 2019 07:59 AM PDT

    I am looking for a good book on this subject, I am mostly interested in python so I would rather it be somewhat agnostic with regards to programming language.

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

    Programming Language with good GUI Frameworks for Windows?

    Posted: 18 Mar 2019 05:31 AM PDT

    Heya.

    I'm currently looking to jump on a second/new programming language after learning a bit of C#, because im not to happy what it happens in terms of GUIs. WPF is okaish, but im not a fan - UWP is UWP and way to restricted - WinForms is just outdated. I've been hearing good things about QT for C++ but havent had a chance to try it yet.

    All in all - What is your favorite Framework for GUIs? (Especially if you want to design "fancy" ones, with animations and so on :) )

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

    I'm SO SLOW! Will I get much faster at programming with practice?

    Posted: 18 Mar 2019 02:37 PM PDT

    I'm a second year applied CS student and I did a programming competition. I just spent like 5 hours trying to solve one of the puzzles from the challenge when the winners completed 3 out of 5 challenges in just 3.5 hours... I feel like I should be better and part of me feels comfortable with code but at the same time I keep missing things and then get taken by suprise by stuff like nullpointers or whatever... I'll write some code thinking "that's it, this should work" and then wind up spending another 3 hours fixing bugs instead.
    Will I get a lot faster with practice? Or do some people just never "get it" despite sinking in a lot of time?

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

    How do I implement a algorithm without tutorials?

    Posted: 18 Mar 2019 01:45 PM PDT

    I'm learning about ray tracing, which is a rendering techinique and I'd like to implement it on C#, but the problem is: I don't know HOW, and I'd like to do it without any tutorials. Any tips?

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

    Making a Plot in R

    Posted: 18 Mar 2019 01:33 PM PDT

    Okay, pardon me as this is my first time ever programming. I don't know proper vernacular yet.

    I have a dataset (for the sake of this, named mydata) that includes hundreds of bird species (column name: AOU), years that data was collected on them (Year), and the number of birds (of that species) counted at a particular stop (StopTotal).

    I want to plot, and get the summary of, the stop totals by year for one particular species (the AOU number would be 60 for this bird species).

    What would I input?

    EDIT: Following u/redCg's directions (not sure if this is structured how they want it to be...)

    structure(list( RouteDataID = c(6234574L, 6234574L, 6234574L, 6234574L, 6234574L, 6234574L), CountryNum = c(840L, 840L, 840L, 840L, 840L, 840L), StateNum = c(36L, 36L, 36L, 36L, 36L, 36L), Route = c(1L, 1L, 1L, 1L, 1L, 1L), RPID = c(101L, 101L, 101L, 101L, 101L, 101L), Year = c(1967L, 1967L, 1967L, 1967L, 1967L, 1967L), AOU = c(2730L, 2890L, 3131L, 3160L, 3250L, 3870L), Count10 = c(0, 9, 0, 8, 0, 0), Count20 = c(0, 6, 0, 8, 0, 3), Count30 = c(1, 4, 2, 9, 0, 0), Count40 = c(1, 8, 0, 4, 0, 2), Count50 = c(0, 4, 0, 4, 4, 3), StopTotal = c(2, 25, 1, 22, 2, 7), SpeciesTotal = c(2, 31, 2, 33, 4, 8)), row.names = c(NA, 6L), class = "data.frame")

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

    Calculating Cache Miss Rate

    Posted: 18 Mar 2019 12:02 PM PDT

    void copy_matrix(int dest[ROWS][COLS], int src[ROWS[COLS]) { int i, j; for(i=0; i<ROWS;i++) { for(j=0; j<COLS;j++) { dest[i][j] = src[i][j]; } } } 

    Could someone please explain how to calculate the miss rates below? Thank you!

    Cache size 64K with block size of 16 bytes

    What is the cache miss rate if * ROWS = 128 and COLS = 128? 100% * ROWS = 128 and COLS = 192 25% * ROWS = 128 and COLS = 256 100%

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

    help with merging two unsorted arrays into one, ascending array.

    Posted: 18 Mar 2019 11:46 AM PDT

    My array1 has different values each iteration. After each iteration, I need to merge these values into mergedArray

    Example:

    First iteration:

    array1 = [5,7,9,10]

    mergedArray = [5,7,9,10]

    Second iteration:

    array1 = [3, 4, 8]

    mergedArray = [ 3, 4, 5, 7, 8, 9 ,10]

    etc...

    I hope someone can help me out. I am really clueless on what to do here.

    Thanks in advance.

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

    Question: Creating a system to scan lists and add them to a single list.

    Posted: 18 Mar 2019 07:06 AM PDT

    Hello r/AskProgramming ,

    i hope I am not completely wrong here to ask this question. If I am, I apologise and would be very happy if you could maybe recommend me a differnt, better fitting subreddit.

    I want to create a system for myself that works this way: I have a qr code or something on a card. That QR Code contains a list of items. And when I scan that qr code, the items on that list will be added to another list. So for example if I have severall cards with different items on them and then scan all of these, I have a list at the end, on which all items from the cards are listed. It would be even more awesome, if it would recognize double items and just add a quantity number (For example 2x Item 4)

    I hope you can understand my explanation, it is a bit wonky.

    Thank you very much!

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

    How to create autocomplete from scratch (Flask Python Jinja2)

    Posted: 18 Mar 2019 10:43 AM PDT

    Hi everyone, I want to have a drop down of autocomplete suggestions in my html <input> tag. Basically, i want to remake this (http://jqueryui.com/autocomplete/#multiple) but using no javascript or <script> tag, and instead using python and jinja.

    Assuming that I already have a function that takes in a string and outputs items in dataset that contains the input:

    • How can I continously run this function on the page?
    • How do I access the current value in <input> tag from jinja?
    • How can I create html elements(the drop down options) inside jinja?

    As you could probably tell by now, this is my first time using flask and jinja, please tolerate me. Thanks in advance!

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

    Method to create buttons out of animated shapes

    Posted: 18 Mar 2019 10:05 AM PDT

    Hello!

    Can anyone tell me the best method to create a nav bar that is shaped like a half of a decagon, cut in slice. When hovering over the slice, it enlarges.

    Very rough sketch attached.

    https://imgur.com/km9rpKv

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

    I'm creating a podcast app and I'm trying to figure out how to test it.

    Posted: 18 Mar 2019 09:24 AM PDT

    How do people test apps with long audios (> 20 min). Is there any way to automate the testing?

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

    Looking for help with app that will fill fields for me on multiple sites

    Posted: 18 Mar 2019 05:22 AM PDT

    Hey,

    So I have a little problem that I'd like to fix using scripts and my first thought was python- but I'm just learning it for the projects I need it for the current situation.

    I'm currently working on translations for website in 12 different languages and the company site forces me to open almost the same page on 12 different tabs and place same values everywhere in the same fields( website key that it uses- ex. app.order.payer_department and translation Payer department in translation) in two fields: "Key" and "Translation" in 12 tabs with link that looks like that: staging.MySite.com/translations/app/en/messages and now the difference between tabs is the ending: EN is replaces with any other language I want to translate to- EN, DE, pl, sk, tr etc.

    And I'm getting on the same page( will provide picture) and click "Add" on top right" then two fields that I fill that I mentioned previously appear with key and translation and I fill those, then click "Create"---- and the same process goes for 11 other tabs.

    Now- I wanted to write a script that will ask for Key that I want to improve and Translation and it will automatically do above steps for me.

    And since I'm new to the language I'd really appreciate some help and general directions that I would have to improve on in order to get it working.

    I'm using pyCharm

    Link to view: https://imgur.com/a/FPL0XyA

    Below you can see added key and all it's translations

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

    No comments:

    Post a Comment