• Breaking News

    Monday, January 20, 2020

    Is it better to learn Objective-C and Android development in Java or go with a cross platform tool like Flutter? Ask Programming

    Is it better to learn Objective-C and Android development in Java or go with a cross platform tool like Flutter? Ask Programming


    Is it better to learn Objective-C and Android development in Java or go with a cross platform tool like Flutter?

    Posted: 20 Jan 2020 06:14 PM PST

    I took C/C++ and Java courses at college and I'm thinking of going into mobile development. Is it better in terms of employability, efficiency etc to learn Objective-C and Java and code an app separately for iphones and android phones or just go with Flutter and it would be the same.

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

    Is it ok to start over 500 lines into a program? Naming conventions and comments?

    Posted: 20 Jan 2020 07:29 AM PST

    I don't like my app.

    Everything works, but it looks like a monster from behind.

    I tried to avoid comments inside the code, and write them in some kind of tutorial/diary for my future-self, which took up 60% of the time. And without comments, I found myself coming to some part of code, thinking "wtf is this shit?". So the problem is twofold I guess. I also read somewhere one of those holier than thou programmer masterrace comments saying: "good code is self- explanatory". So I think I should go this way.

    I plan to make big comments above functions or parts of code, and explain why some fixes were used and needed, and then hiding /collapsing them. That way I won't lose time on writing and constantly updating the parallel diary. But it will also be useful to future me, and the poor sods who make the mistake to read my code on github.

    Also, I am going to make a system for my functions and variables. Maybe you can help me here. My current naming is as follows:

    // global var - no prefix var profiles = {}; // global function - no prefix function loadProfiles(){} //function that is a part of another function for readability function lp_integrityCheck(){} //is used in loadProfiles //local function to inner function (short names) var btn= profiles; //CSS id-s #lp_check_error_message_txt {} //styling for the <p> inside an error message 

    You see the problem. I like to use prefixes because they diminish the already impossible chances to call or owervrite the wrong variable, and you know where the variable belongs, but then again, since most variables are local, who cares what you use. Maybe I should put prefixes on global vars, and then I see no problems. I dunno. CSS names end up super long because I try to be descriptive and write all the parent layers so I know exactly where it is.

    So I thought, maybe there are some superior naming conventions that I should employ, and that would bring me closer to a self-explanatory code.

    Please advise!

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

    Can you fix "fancy" scrolling on certain websites?

    Posted: 20 Jan 2020 03:38 PM PST

    I am not a programmer and know very little about code, but I was wondering, is it possible to "fix" the way a website scrolls?

    I was browsing http://www.lpmusic.com/listen and I just hate the way it moves! Is there anything a front-end user can do to change this? Thanks!

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

    Python on a Chromebook

    Posted: 20 Jan 2020 09:06 PM PST

    I'm just starting out in teaching myself Python. To preface this, I know very little tech/programming-terminology, so I can only try my best to word everything in a way that makes sense to me; sorry in advance.

    I started playing around with Linux/basic Python, but just whatever I'm able to access without switching to "developer mode." I'm hesitant to switch to DM to use the full Python applications, because I have things I need to access through my standard, original google/chrome account and I've read that switching deletes the profile/its contents. So I guess I have a few questions then: - is there a way to properly learn Python and access everything (specifically, I got stuck trying to install Pygames) while not in developer mode? - if there isn't, when I switch back to chrome from Linux in DM, can I use and access my original google account and everything I had linked to it? Email, school stuff, docs? Or will I have to switch entirely from DM to "original"? Is that even a thing? - Because of this situation, would it be easier if I learned a different programming language first? I don't really know where to start, but want to be able to fully follow along to YouTube tutorials etc.

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

    I want to get back into python as a hobby and have a project idea but no idea how to start

    Posted: 20 Jan 2020 08:37 PM PST

    Good day all.

    I used to program as a hobby. It was I enjoyed and I'd like to get back into it. I want to build a program that recognizes shapes in maps. I would like to be able to give my program a picture of a map and have it recognize the country or countries within in. I'm not sure where I would even start or what packages could help with this.

    Any ideas? I googled (which is where I usually start) and surprisingly nothing came up.

    Please let me know if there's a better place to ask this.

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

    What would you rate as a good online / distance learning website or resource, to learn common web languages?

    Posted: 20 Jan 2020 03:27 PM PST

    I have a friend who is looking at "getting into coding". He's a 2nd line IT tech and so has some experience with the basics. I have been a hobby coder for a decade or so, but I work in 2nd line with him. I've written many scripts / automated services for our team over the years - PowerShell, Python, MySql/PHP/Apache, command line batch processes, excel macros etc.

    I've never really been taught how to program officially so I just do it in a slap dash "eh, it works" way - although after 10 years of doing it, I've picked up some skills along the way :-)

    However, I'm in a crappy position to recommend good online learning resources to my friend. He wants to help out with me doing this for the team (as far as the boss is concerned, I'm a magic wizard and am treated with letting me have my own way a lot of the time - it's a good job :D)

    Most of the stuff I do is getting reports done - extracting data from databases, shoving it in excel sheets, then running off charts and whatever - then emailing it out to the middle management in pretty colours. Stats, stats, inventories, address books etc.

    That's what he wants to be helping out with.

    What would be good resources for me to point him toward? He is happy to pay for courses.

    He has asked me if Alison.com is worth it - I honestly don't know.

    Any assistance / advice is appreciated!

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

    Does this just come with time?

    Posted: 20 Jan 2020 05:32 PM PST

    The only formal background I have in programming is a couple of courses on algorithms I took in school, and the focus was more on solving crazy equations with matlab rather than properly learning how code should be structured.

    Anyway, I've been out of school for a bit and know several languages well enough to solve specific problems I might have, which are mostly based on solving equations, analyzing data, or maybe something like writing a batch script. My skills have definitely been improving over time (thanks stackoverflow) but I seem to keep hitting a frustrating bottleneck: when I need to go back and work on code I've already written, and it's sufficiently complex, it usually takes forever to:

    1. Remember and understand exactly how my code worked
    2. Get back into the groove I was in when I originally wrote the code

    It's frustrating that I have no problem getting deeeeep into the zone when starting something from scratch, but when I come back to it (sometimes months) later, it takes what seems like an eternity to figure it out again.

    Does this happen even among experienced/professional developers? If you had this problem, how did you overcome it? Do you just get good enough over time that this goes away?

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

    Was approached by a consultancy firm as a kotlin dev, got sent a java test for codetesting

    Posted: 20 Jan 2020 01:08 PM PST

    Hi, I'll keep this brief.

    I am a junior developer with professional experience mainly with Kotlin, and was sent a java test (timed) for my code test during a hiring process to a firm. Needless to say didn't go stellar, but I re-did the test immediately afterwards in Kotlin and essentially said "I know I flunked the test, but had it been in Kotlin this is what I'd have tried" and sent them a file with 70 lines of code covering what the test asked for in Java.

    So I guess what I am wondering now, is this:

    • Is aiming for a Kotlin position naive (mind you my current position is a kotlin backend position, I am looking for a different company for unrelated reasons)?
    • Should every kotlin developer be equally fluent in Java?

    What took 95% of my time in the test was unfamiliarity with Java, no IDE to help and in general just... The sort of hurdles that aren't present with an IDE and a language of choice.

    Any advice or experience in these situations welcome.

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

    Git Bash - what's the vim :wq equivalent in VSCode?

    Posted: 20 Jan 2020 08:17 AM PST

    Hi

    I installed Git & Git Bash, but I installed VSCode thingy over the default Vim thingy.

    Now, I'm following THIS Traversy Media video on the subject, and he uses the :wq command in Vim to commit the files.

    I'm at the same part, just in VSCode - https://imgur.com/a/ilsuU7T

    So, what's the equivalent to :wq command in VSCode?

    BUT, more importantly - where do I find these "equivalent" commands on my own? I searched google, but had trouble.

    Should I uninstall / reinstall Git and just use the basic Vim instead maybe?

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

    How to run my code continuously?

    Posted: 20 Jan 2020 01:45 PM PST

    Hi there. No so much practical knowledge about programming and python here. I want to use some site api. When running code my code, I must do something like click run to run it. But lets say I want to run code once per second to check continuously something. Something like monitoring for a period of time. How to run my code this way? Should I have my computer open for all this period of time? If yes, how to do it after closing my computer?

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

    Why does Java not supporting operator overloading?

    Posted: 20 Jan 2020 01:24 PM PST

    I'm a Java/Kotlin programmer and I always wondered why is it that there is no operator overloading in those languages, after all it makes the code much more esthetic and easy to read (in my opinion...)

    I looked it up and wasn't satisfied with the answers, the general justification for it is that "Java doesn't need operator overloading". I mean it's true, but what about readability and so called "clean code"?

    I would like to here your thoughts about this subject!

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

    What to wear to an interview at facebook?

    Posted: 20 Jan 2020 06:49 AM PST

    Rocking about 10+ years full stack experience and was told by the recruiter specifically to not show up in a suite or wear a tie. Anyone have advice as to what to wear? Should I just show up like I normally do to interviews in what I wear in my day to day (khakis, tshirt, hoodie, bright green shoes)? Should I wear a polo? Any tips? I did an interview at amazon a few months ago and wore a dress shirt and tie and felt over dressed and don't want to make the same mistake.

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

    Getting an error when trying to pip install a package, any help is much appreciated!

    Posted: 20 Jan 2020 08:25 AM PST

    I'm trying to install the eif package via:

    pip install eif 

    But I'm getting the following error:

    This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

    I'm at a loss for what to do after searching and attempting to fix for a while now so any ideas would be stellar!

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

    What are some interesting ideas in code editing?

    Posted: 20 Jan 2020 06:03 AM PST

    Sublime style multiple cursors, for example, have been quite popular these days. Fuzzy search and fuzzy symbol navigation is interesting as well. What are some useful or interesting and less well-known ideas in Code Editing and other development tooling?

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

    Are methods just syntactic sugar for functions which take in a pointer to a class/struct?

    Posted: 20 Jan 2020 11:46 AM PST

    Are methods (class functions) basically functions with a pointer to the class?

    If we have:

    Entity_doSomething(Entity* self) { self->activated = true; } 

    and

    Entity::doSomething() { this->activated = true; } 

    woudn't both be basically the same thing?

    The class would look like this for this ones.

    class Entity{ bool actived; }; 

    I'm asking because I plan on maybe using both ways of doing it together and I'm curious whether I'm missing something rather obvious how they are totally different. Nothing major, just a personal project, but still.

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

    Chuwi LapBook Pro for light programming on the go?

    Posted: 20 Jan 2020 11:10 AM PST

    So, first off, I dont have a high budget, but I still want to do some light programming on the go, I was searching for a slim laptop and found Chuwi.

    Now,to my question: Is the LapBook good for light programming on the go? Or should I settle for another laptop in that price range?

    This is the laptop.

    Specs: CPU: Intel Gemini-Lake N4100 (which, I think, is a celeron?) GPU: iGPU RAM: 8G ROM: 256GB

    Price: 379€

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

    Is my command-line RPN calculator written well? (Java)

    Posted: 20 Jan 2020 10:53 AM PST

    Over the summer and various breaks in 2019 I have worked on a Java project: to create an RPN calculator similar to that of Unix' dc. I myself began to use it frequently when I have no calculator around, so there's no question about its function from me. However, I am concerned about having properly built the program, with the proper OOP principles and the such. If anyone could give the program a look and tell me what they feel about it, please do!

    https://github.com/ViceroyFaust/JavaRPN

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

    Where to find conventions of my language?

    Posted: 20 Jan 2020 10:02 AM PST

    I'm quite new to programming but every time I'm making something new I can't stop thinking if I'm doing the code readable, if the variables names are good enough and even if the type of naming I'm using is good (I forgot the name of this, but i.e. camelCase). So where can I find these conventions? Just reading others' code or in the documentations?

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

    Web dev

    Posted: 20 Jan 2020 07:41 AM PST

    I am a beginner in web dev, Currently learning HTML5 & CSS. Is it advisable to use IDE like Atom or do I stick to notepad++.

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

    JavaScript, Firefox - DataTransfer, preventDefault, and console.log

    Posted: 20 Jan 2020 03:10 AM PST

    I'm trying to learn how to make drag and drop events work from tutorials and MDN web docs.

    I've got two questions I'm stuck at.

    I'll be going with this page as a reference.

    https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setData

    Executing the example code in its whole seems to work just fine.


    First question:

    First I remove/comment out the drop_handler() function, just keeping dragstart_handler() and dragover_handler(), to analyse what part does what thing in the drag and drop.

    When I refresh the page and start dragging, it still seems to have a drop target. But on drop, it seems to auto-link to an URL "source.com". With some further testing, the address is always the ID of the draggable target, with .com at the end.

    Testing in Edge, no such link has formed, just nothing happens.

    Removing the ev.dataTransfer.setData("text/plain", ev.target.id) line seems to get Firefox to have the same behaviour as Edge has, do nothing on drop.

    Removing the ev.preventDefault() in the dragover_handler() function removes the entire drop zone, and as such does nothing.

    Is this a bug in Firefox or does it work as intended? Can anyone give me information about what's going on here?


    Second question:

    Rather than fully removing ev.preventDefault() in the dragover_handler() function, I tried putting it in console.log() to see what was going on. console.log(ev.preventDefault())

    When I did, undefined returned in the console when I dragged the drag element to the drop element. But when I released by mouse and dropped the target, it still linked to another page. To my reasoning, that shouldn't happen as ev.preventDefault is in a console.log function. It still did though.

    Is this a bug in Firefox or does it work as intended? I'm really confused on this part.


    Again, when having an actual drop function, all functions as intended. This is about the behaviour without that function.

    Thank you for your help.

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

    Help! How do I set an Anaconda Environment back to like 10 minutes ago, I had code that worked that doesn't now after installing 2 modules, which may have altered an existing module!

    Posted: 19 Jan 2020 09:58 PM PST

    If necessary the language was python

    Previous module was tensorflow

    New modules were keras and pytorch

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

    chromatic scale MIDI player

    Posted: 20 Jan 2020 05:36 AM PST

    I am trying to make a midi player who would play a chromatic scale after pressing the key. what's wrong with this code? will there be someone who would explain it to me?

    #include "midi.h"

    #include<iostream>

    #include<stdio.h>

    using namespace std;

    char instrumentChoice;

    int main();

    void chromScale();

    int midiStatus, note, velocity;

    int tempNote;

    int tempVelocity;

    while(true); //creates a loop to play each note

    {

    getMidiMessage(midiStatus, note, velocity, true); //finds note beign played

    if (midiStatus==0x90)

    {

    for (int i = 0; i <= 12; i ++) // creates a for loop to play each note

    {

    sendMidiMessage(0x90, note, velocity); //Plays the note

    delaySeconds(0.2); //Gives a 0.2 second gap inbetween each note on the scale

    sendMidiMessage(0x80, note, velocity);

    note++; //++ to hgo up

    getMidiMessage(midiStatus, tempNote, tempVelocity, false); //Looks For note release

    if(midiStatus == 0x80)

    break; //Stops scale if note is released

    }

    for (int i = 0; i <=12; i++) //creates a for loop to play each note

    {

    sendMidiMessage(0x90, note, velocity);

    delaySeconds(0.2); //Gives a 0.2 second gap inbetween each note on the scale

    sendMidiMessage(0x80, note, velocity);

    note--; //-- to go down the scale again

    getMidiMessage(midiStatus, tempNote, tempVelocity, false); //Looks for note release

    if(midiStatus == 0x80)

    break; //Stops scale if note is released

    }

    }

    }

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

    [JS HTML] How to dynamically show the value of an input element?

    Posted: 20 Jan 2020 05:19 AM PST

    Hello!

    I have the input type file element, and I click on it, and select a file, and then that element has a "value". Now, since in a normal browser this is completely useless, you might be perplexed, but hear me out.

    I can actually see the actual path of the selected file, and it's not "fakepath", and I will use it to retrieve the path.

    BUT, the whole path isn't shown next to the file selector, so I want to show just below that, the actual whole path which is stored in the element.value. It works, I know because I alerted element.value.

    But I am kinda confused, and I don't know how to actually show the value dynamically - so that it changes when the value changes.

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

    How should you store pointers in internal nodes of a b+ tree?

    Posted: 20 Jan 2020 01:14 AM PST

    I'm trying to attempt to implement a b+ tree and it's not clear to me how to store the pointers along with the keys in an internal node. I don't see any good code examples online and although every video I have watched provides a good intuition of how they work, it's not clear how to do it in practice. Every video seems to explain internal nodes as the following:

    [p1, 5, p2, 10, p3, 18, p4]; 

    Should I be literally storing the pointers and keys of an internal node all in one array? Or have two arrays, one for keys and one for pointers?

    I was thinking about taking the approach of storing the pointers in a map related to each key, but then I will have keys with the same child pointers. E.g. 5 will have right child p2 and 10 will have left child p2. So I think have two separate arrays for pointers and keys probably makes most sense.

    const INode = () => { return { keys: [], pointers: {}, length: this.keys.length, insert(key, rChild, lChild) { this.keys.push(key); this.keys.sort(); this.pointers[key] = { rChild, lChild }; } }; }; 
    submitted by /u/1_over_f
    [link] [comments]

    No comments:

    Post a Comment