• Breaking News

    Saturday, July 14, 2018

    Does it matter what size file extensions I use for file formats I create? Ask Programming

    Does it matter what size file extensions I use for file formats I create? Ask Programming


    Does it matter what size file extensions I use for file formats I create?

    Posted: 14 Jul 2018 05:47 PM PDT

    Hello everyone,

    I am not a programmer but I am working on a large music generation program. I have now created two file formats (one for tunings and one for scales) that my software uses. Each one has a 3-letter file extension. Turns out they are both already being used by other programs for essentially the same musical purpose so I need to change them.

    So I thought about just adding a letter representing my program or otherwise just going with the long names (six and five letters respectively). I know way back in the day 3 letter names were all Windows could handle but do I need to reasonably worry about this anymore for any modern platform? Are there any good rules of thumb for this? Guidelines?

    Right now it's just Linux, Windows and MacOS but eventually mobile platforms as well.

    Thanks.

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

    What's the coolest project you've created due to your programming skills?

    Posted: 14 Jul 2018 09:34 PM PDT

    i have no imagination

    Posted: 14 Jul 2018 06:07 PM PDT

    I can never think of what to code and when I do it's too complex. I have knowledge in Python, Java and C++ yet any projects except web scrapers, translators, and websites. I'm getting tired of websites since I like software more.

    I'm currently learning c++ to learn low-level stuff and yet cant think of what to code. I thought of writing an aimbot but Idk where to begin learning, I thought of learning to code a packet sniffer but idk where to begin,

    Does anyone have any tips or suggestions.

    submitted by /u/RAW-IWNL-
    [link] [comments]

    Adapt 1 vs 1 Tic Tac Toe code to 1 vs CPU.

    Posted: 14 Jul 2018 02:10 PM PDT

    Hi, i have the following code of a tic tac toe game, and need to adapt it to make it possible to also be playable as human vs cpu, the option for either one of those is made in a menu on a separate class. I also need it to reset when there's a draw.

    Thanks,

    The code is the following:

    import java.util.Scanner; public class Game { private Scanner scan; private boolean Turn; private char[][] board; private String 1; private String 2; public static void main(String[] args) { Game game = new Game(); game.play(); } public void play(){ while(true){ displayBoard(); if(getMove()){ displayBoard(); if(Turn) System.out.println(" ヽ༼ຈل͜ຈ༽ノ " + 1); else System.out.println(" ヽ༼ຈل͜ຈ༽ノ " + 2); }else if(boardFull()){ displayBoard(); System.out.println(" "); System.out.println("draw"); Game game = new Game(); }else { Turn = !Turn; } } } public Game() { board = new char[3][3]; for(int r = 0; r < 3; r++) { for(int c = 0; c < 3; c++) board[r][c] = ' '; } Turn = true; scan = new Scanner(System.in); } private void displayRow(int row) { System.out.println(" " + board[row][0] + " | " + board[row][1] + " | " + board[row][2]); } private void displayBoard() { displayRow(2); System.out.println("------------"); displayRow(1); System.out.println("------------"); displayRow(0); if(Turn == true) { System.out.println(" "); System.out.println("1"); }else{ System.out.println(" "); System.out.println("2"); } } private boolean getMove(){ boolean invalid = true; int row = 0, col = 0; while(invalid) { System.out.println(""); row = scan.nextInt(); col = scan.nextInt(); if(row >= 0 && row <= 2 && col >= 0 && col <= 2) { if(board[row][col] != ' ') System.out.println("Error"); else invalid = false; } else System.out.println("Error"); } if(Turn) board[row][col] = 'X'; else board[row][col] = 'O'; return winner(row,col); } private boolean winner(int lR, int lC) { boolean winner = false; char symbol = board[lR][lC]; int check = 0; for(int c = 0; c < 3; c++) { if(board[lR][c] == symbol) check++; } if(check == 3) winner = true; check = 0; for(int r = 0; r < 3; r++) { if(board[r][lC] == symbol) check++; } if(check == 3) winner = true; check = 0; for(int i = 0; i < 3; i++) { if(board[i][i] == symbol) check++; } if(check == 3) winner = true; check = 0; for(int i = 0; i < 3; i++) { if(board[i][2-i] == symbol) check++; } if(check == 3) winner = true; return winner; } private boolean boardFull() { int spaces = 0; for(int r = 0; r < 3; r++) { for(int c = 0; c < 3; c++) { if(board[r][c] == 'X' || board[r][c] == 'O') spaces++; } } return spaces == 9; } } 
    submitted by /u/DiligentCode
    [link] [comments]

    Having issues with going back to original state of my site

    Posted: 14 Jul 2018 05:43 PM PDT

    On the site im working on I want users to be scroll and click on icons to "open" them up.For example if a user clicks the about us icon it would have a paragraph of info in which they can scroll up and down the text along with a back button. the back button would take the user back to the icon where they can scroll once more to pick another icon. Though since i replaced the icon divs with a paragraph div (when you click the about icon) hence when i go back i have to create a new instance of the middle div where the icons are. They show up though i cant scroll through them.

    https://stackoverflow.com/questions/51335968/back-button-will-not-reinstate-previous-page

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

    C# DataGridView repainting woes

    Posted: 14 Jul 2018 04:18 PM PDT

    Good evening ladies and gentlemen,

    Today, I come pleading for resolution to a problem that has plagued me for weeks now. Using Visual Studio, I've setup a form with two DataGridViews. Those two DGVs are sourced to two seperate DataTables. Those DataTables, are fed live, rapid, high-volume data from an asynchronous websocket feed. (is async implied since it's a websocket feed?) To be more specific, I am using the Coinbase Pro/GDAX API, and am currently working with Level 2 updates.

    The issue I'm having is that once I have received some new data, I then update rows and cell data in the DataTables, accept changes, but the DGV has no change. If I click a cell in the DGV, it will usually then update the cell data to reflect the correct data. If I minimize then restore the form, both DGVs are painted correctly, but only for that instance. Once there is new data received from the websocket feed, the existing table is now obsolete.

    I thought I stumbled across a miracle line of code, dataGridView.Invalidate(), but even that seems to produce the same issue I had when I tried to Update() the DGVs every time the Level 2 event was fired.

    I can't seem to catch a break with this thing, and have googled an unenumerable amount of keywords, phrases, and even spells. The damn thing just won't do the thing! The GIF is to show what happens when using Invalidate() every time a Level 2 update is received, and a similiar, if not identical, thing happens with Update().

    https://imgur.com/a/EjveKHf

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

    Accessing website elements without api

    Posted: 14 Jul 2018 07:51 AM PDT

    I'm not sure if this is the best place for this question (if not, please direct me where) but I have been really wanting to play around with Soundcloud's API, or rather just use certain Soundcloud features, but their API hasn't been available for some time now.

    Is there any way I could work with features on their site (users, songs, likes, follows, etc.) without having an API key? Maybe not do anything like create a playlist under a user (a la Hearddit) but perhaps just get follower counts or song plays, etc.

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

    Is there any convention to initialize js variables that will receive html object?

    Posted: 14 Jul 2018 02:50 AM PDT

    For objects: var myObject = {};

    For strings: var myString = "";

    For number: var myNumber = 0;

    For html object: var myHtmlElement = ??? (this will store some document.querySelector("myElement"))

    submitted by /u/Don-g9
    [link] [comments]

    How can I see the POST data that is actually being submitted between RN and Laravel? csrf token problem

    Posted: 14 Jul 2018 04:22 AM PDT

    I have a React native front end, laravel back end.

    The web laravel MCV is working with csrf. My front end react native javascript is the issue.

    My post data is being submitted and accepted in RN JS, but the moment I re-add the security to require csrf tokens, my front end fails to submit the data.

    I have a header include a meta tag for csrf that should be attaching to every page and post request.

    Here is how it looks when I view source on web:

    <meta name="csrf-token" content="TLhZiwCb6wLNUVN9j6uF7vbjJXoYylvcLrcmwT6">

    I am blind to what is being submitted and looking for a way to debug this.

    I'm trying to test this:

    export const CREATE_CLIENT = 'CREATE_CLIENT';
    export function create_client() {
    return (dispatch) => {
    setTimeout(() => {
    var makeClient = axios.post('http://24.192.53.114/txns/mobile', {
    'X-CSRF-TOKEN': axios.defaults.xsrfHeaderName,

    'nickname': 'MandyPandy',
    'myspy_to_send': '.014211111',

    })
    // before it was .then((response) => { return response.json()})
    .then((response) => { return response})
    .then((respJson) => {
    dispatch({type: CREATE_CLIENT, payload:respJson});
    console.log("ACTION resolved, CREATE CLIENT---------------------");
    console.log("responseClinet:"+respJson);
    })
    .catch((error) => {
    console.error("You have an error"+error);
    });
    },
    50);
    };
    }

    Also.... Is it bad to post my IP/working practice website?

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

    Email crawler/scraper

    Posted: 14 Jul 2018 01:29 AM PDT

    Hi, I'm trying to build a program in either Python or Java (but feel free to suggest a better language).

    It's purpose would be to scrape my email inbox to look for emails that conform to a specific type of email (promotions, receipts...) so that it can organise and store them for easy access in a separate application.

    Is there a good way to go about this? I saw a little bit that suggested I use APIs in both Java and Gmail. I'm not too sure how to proceed and any help would be useful.

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

    Help creating a personal webpage for me and my girlfriend

    Posted: 13 Jul 2018 11:53 PM PDT

    I am trying to make a little site for my girlfriend as a gift, and I'm planning for it to be just for the two of us to ever access. All I really want is for her to be able to send little notifications to me (either directly to me through some sort of notification thing or just where I also have to visit the site) and for us to be able to play some little games (like simple card games and stuff) in a correspondence style.

     

    My current plan is to host the site on just a raspberry pi I have lying around and to just bookmark the IP address on both of our computers so as to avoid having to buy a domain name.

     

    I'm familiar with writing simple client-side js, html and css, and I am capable of writing the game logic in js or a handful of other programming languages, but I have no idea how to handle any part of the server side of things or how to get the things communicating. I've tried looking through tutorials for things like the MEAN stack and other frameworks like that, but I never can figure out what I actually need for such a simple use case.

     

    Ultimately I would really appreciate advice or help finding resources to help answer any of the following questions

    • What is the bare minimum server-side setup I'd need to handle this simple just sending the page to each of us and keeping track of the simple game data?
    • Are there any problems (Security risks, ISP problems etc.) with hosting a little server on a raspberry pi at my home and with not using an actual domain name?
    • If I wanted to have a way for the site to differentiate us and show us different stuff (like hands of cards or other messages) would a login system be best for that, or are there other simpler ways?
    • Is any of what I've been proposing just so outrageously stupid that I should reconsider large parts of the project?

    Thanks so much for the help.

    submitted by /u/45534d
    [link] [comments]

    trying to find a programmer to work with

    Posted: 14 Jul 2018 12:49 AM PDT

    Hey reddit! Just as the title says, I'm trying to find a programmer to work with, and I'm unsure where to go!

    I don't have many funds (at all) so I figure it could be a skill trade (i do art yay) or I hate to say free, but, well free, depending on how complicated it would to be. Anyhow, where would you guys send me to ask around for help? and am i terrible person for not offering cash money?(so sorry again)

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

    No comments:

    Post a Comment