• Breaking News

    Friday, December 25, 2020

    What is the difference between a regular text file and a file with a programming language specfic extension? Ask Programming

    What is the difference between a regular text file and a file with a programming language specfic extension? Ask Programming


    What is the difference between a regular text file and a file with a programming language specfic extension?

    Posted: 25 Dec 2020 07:16 AM PST

    For example, what is the difference between a normal text file and a .py file? Doesn't the compiler/interpreter just look at the file like any text file and the extension doesn't matter? If yes, is the extension just there for the IDE/Editor to recognize it (in order to give you tips and such)?

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

    [JAVA] Need help passing info from class to class.

    Posted: 25 Dec 2020 06:46 PM PST

    So I'm doing spigot plugin development for Minecraft, but this seems like a Java issue, so I wanted to post here.

    Basically, I have 3 classes: Main, EventHandler, DatabaseHandler. My goal is to use the DatabaseHandler in the EventHandler class. Problem is, the constructor for DatabaseHandler requires information that only Main can provide (The database information from the config file that only main can open)

    My solution was to just pass the information though the constructor for EventHandler, and in turn pass it though DatabaseHandler when I create the object. This has lead to errors no matter what I try.

    - Whenever I create the DatabaseHandler object inside the EventHandler's constructor, the methods fail to recognize the object.

    - Whenever I create the DatabaseHandler object outside of the constructor, the arguments to pass along the database information are null, and thus create a MySQL Exception. Which makes sense because I need the constructor to pass along Main's information.

    - If I create the DatabaseHandler object when an event is called, that works, but of course, events can be called thousands of times, so that is extremely bad for optimization in my understanding.

    Anybody know how I am to properly do this? I cannot hard code the database info into DatabaseHandler because it changes. Thanks.

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

    Why isn't Assembly universal, like regular programming languages?

    Posted: 25 Dec 2020 11:44 AM PST

    AFAIK assembly is different for each CPU architecture, but why? Couldn't the assembler just assemble into machine code that the specific CPU understands, like what happens with regular programming languages?

    Thanks

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

    Why doesn't godot need to be installed like other environments?

    Posted: 25 Dec 2020 05:25 PM PST

    This is gonna sound weird but how come that ide/engine doesn't need to be installed, but other ide/engines need to be?

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

    How do you manage a project?

    Posted: 25 Dec 2020 01:19 PM PST

    I'm largely a self-taught programmer, I know how to program, but I don't know how to manage a larger project. I was wondering if there were any recommendations on books or resources to teach you how to manage a larger project more like how you would in an enterprise environment? Is that a documented process? Are there more than one popular way to manage a project like this? Thanks in advance.

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

    How to achieve this HTML layout?

    Posted: 25 Dec 2020 04:59 PM PST

    I'm struggling to figure out how to achieve this layout. I want a layout which takes the full width (which is unknown) of the parent, and within that area to have three columns, the first and last of which should always be equal size, so that the middle column can contain an image which is always centered with respect to the outermost element.

    <--EMPTY--><----------[IMAGE]----------><-CONTENT->

    I thought flex boxes might do it, but the last column always ends up being wider than the first because it has some content.

    I could just use a table with reasonable %ages for the first and last cells, but feels like a cheat to me. Is there a way - without resorting to Javascript - to keep the first first and last columns/cells equal in width, regardless of their contents?

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

    Script to calculate most time-effective route between locations

    Posted: 25 Dec 2020 06:48 AM PST

    TL;DR Need a script that compares driving distances between addresses and sorts them accordingly. What's required?

    Hallo everyone. I work at a small german company that replaces water meters, the ones counting the water people use. So whenever we get hired by a city they send us an Excel file with around 100-1000 addresses where the meter needs to be replaced.

    Now, obviously our guys changing the meters can't be driving around town randomly. This means someone has to assemble sensible routes. It's a simple repeat process: put Street A/Street B into Google Maps, compare driving distance to driving distance Street A/Street C, compare to.... just trying to find the route that wastes the least time driving between locations.

    The problem: this takes way too much time. It eats so much time it hurts. We're a small company so loosing time like that hurts. It's a simple process so I was thinking, maybe I can script this. I absolutely cannot lol.

    So, knowing way less about this than I thought, my question: What might be a way to do this? If I hire someone, what do they need to be capable of?

    thanks for taking the time bros

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

    Help simplify this JS snippet? I feel dumb.. ¯\_(ツ)_/¯

    Posted: 25 Dec 2020 02:35 PM PST

     <script type="text/javascript"> window.onload = function() { setInterval(function () {document.getElementsByClassName("the-next-page")[0].click();}, 12000); setInterval(function () {document.getElementsByClassName("the-next-page")[1].click();}, 12000); setInterval(function () {document.getElementsByClassName("the-next-page")[2].click();}, 12000); setInterval(function () {document.getElementsByClassName("the-next-page")[3].click();}, 12000); setInterval(function () {document.getElementsByClassName("the-next-page")[4].click();}, 12000); } </script> 
    submitted by /u/d223122
    [link] [comments]

    I downloaded instagram data as a json file. Some files are supposed to contain Arabic, but it's not readable.

    Posted: 24 Dec 2020 10:47 PM PST

    Sorry if this is the wrong sub

    I downloaded my Instagram data and wanted to read some of the files there. In some files that contain Arabic, the words are displayed correctly and are readable. However, in all of my messages files, Arabic words are shown in codes that I couldn't figure out how to read, while the messages in English are shown correctly.

    example of a json file that displays Arabic correctly (this json is for Instagram comments) :

    "@username تشكرات ☺️"

    example of a json file that displays Arabic wrong (direct messages json):

    "content": "\u00d9\u0083\u00d9\u0084 \u00d8\u00b9\u00d8\u00a7\u00d9\u0085 \u00d9\u0088\u00d8\u00a3\u00d9\u0086\u00d8\u00aa \u00d8\u00a8\u00d8\u00ae\u00d9\u008a\u00d8\u00b1",

    same json displays English correctly (the coded part is an emoji that doesn't show either):

    "content": "It always has the best views \u00f0\u009f\u0091\u008c"

    Could you please explain the reason of this to me and help me fix it? your help is much appreciated

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

    Self taught programmers where ya at

    Posted: 25 Dec 2020 12:01 PM PST

    I'm seriously considering a career switch and thinking about teaching myself how to program. Started with cs50 and one of their problems (tideman) really made me struggle. My plan is to give myself 1 year to learn as much as I can then apply for jobs. I wanna know how realistic this would be and what others experience have been at self teaching.

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

    How are core libraries for a programming language written?

    Posted: 25 Dec 2020 10:38 AM PST

    For example such libraries which allow I/O, networking, etc. and others which enable other low level functions. Are they written in the language in which the compiler/interpreter is also written in? If yes, how are these libraries written for that language and so forth?

    Thanks

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

    How can I make TTS with my own voice?

    Posted: 25 Dec 2020 10:06 AM PST

    I found some services, but most of them were deprecated. If there's a service, python library or anything similar, I'd be happy to know that.

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

    I would like to learning programming on Python. How do I begin?

    Posted: 24 Dec 2020 11:21 PM PST

    Any suggestions?

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

    No comments:

    Post a Comment