• Breaking News

    Thursday, March 7, 2019

    How to plan a project? learn programming

    How to plan a project? learn programming


    How to plan a project?

    Posted: 06 Mar 2019 08:41 AM PST

    So the other day i had a program that i wanted to write. Being the noob i am, i started off coding right away and it didn't take long until i realized that i might as well just plan the project on paper before starting to code.

    Getting down to my question: how would you recommend me to plan my project? Plain paper? Is there some good freeware? Any literature that you can recommend? I'd love to hear your suggestions.

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

    I seem to be OK at abstracting programming problems, solving them on a piece of paper, then I get stuck on the coding bits

    Posted: 06 Mar 2019 04:38 AM PST

    Maybe some preface. I'm not a beginner. I've been coding sparsely while studying a slightly related engineering field.

    The coding stuff for school was mostly covering the basics(data structures, loops, OOP) after that just a bunch of highly abstracted languages solving problems using the language's inbuilt functions to do stuff. As soon as there were embedded projects that weren't Arduino I got lost. "How the hell do I get an Arraylist working in pure C", "Wait how do I parse the byte I just received from a UDP stream and convert it into ASCII". I decided to stop being a code monkey and learn things the hard way. Thinking a lot before I write code not just hacking into stuff until it works, optimize the glaring issues and leaving it be. Reading tutorials turned into reading documentation to find out how it works instead of what to write.

    But what I've found is that I'm pretty bad at the coding bit. While I was never the guy to copy paste stuff, I still never felt truly challenged as everything seems to be already solved and easy to find, in SOME language or at least tangentially related enough to change someone elses function so it works with what I want.

    Example. Yesterday I was trying to hack away at a binary representation of a bunch of bits for files then replacing a sub-list with a different array(search and replace algorithm). I got recommended a slice(golang). I ran into problems when the search and replace were different in size and decided to try out a linked list. I drew the linked list onto the paper, annotated the nodes, drew the process of replacing an index with severed ties, where the new linked list points to. Pretty much I had the idea abstracted and in my brain.

    Then I started coding. I kept running into issues. "How the hell do I put this node pointer somewhere so I can retie it to this other node". "Wait why am I looping an extra index". Etc. Basically stupid mistakes mounting and mounting until I lost 4 HOURS trying to implement a simple linkedList replaceSublist.

    What do I do to improve this? Pseudocode until I actually have coded the entire algorithm completely?

    EDIT: So many high effort posts I love you guys <3

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

    Is it necessary to have an IDE?

    Posted: 06 Mar 2019 11:07 PM PST

    I've been using VSCode to code in Python for Flask and I'm pretty comfortable with it, it suits my needs and I'm able to debug just fine with it. But a lot of tutorials I'm seeing use either PyCharm or Visual Studio, and I'm contemplating whether I should move away from VSCode

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

    Is it better to have a userspace mutex or a kernelspace mutex?

    Posted: 06 Mar 2019 11:15 PM PST

    Hello

    Long story short I have a device driver in /dev which contains a buffer of data which is sent. Two different processes need to transmit data using this driver. Is it better to have some sort of mutex mechanism (eg fcntl) in userspace every time one process accesses the driver or is it better to have a mutex inside the driver which protects the buffer?

    I'd be personally keen to say the kernelspace solution is better as this is, in some sense, transparent to the application software.

    Thanks

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

    Web Development in Python with Django. 15 Videos ~ 4hours

    Posted: 06 Mar 2019 08:48 AM PST

    I have a video series on my Youtube channel about Python web development that took me 1 month to record.

    Youtube Playlist - https://www.youtube.com/playlist?list=PLhTjy8cBISEpXc-yjjSW90NgNyPYe7c9_

    Hope you guys will like it :)

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

    How do people use multiple programming languages in the same program/app?

    Posted: 06 Mar 2019 10:43 PM PST

    I always hear of people using multiple languages in the same program? Then I hear them using scripting languages; Can someone on here please in plain english explain to me the difference between what I know as programming languages and scripts, and how on Earth do people use multiple languages together. That just does not make any sense.

    How can someone use Javascript, PHP, and ASP together. Or program a game in C/C++ and use python as scripts? It just doesn't make sense to me, they are different languages for a reason, i assume, so how do they play a role with one another?

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

    Wanting to die everytime I try to code, is this really the right path for me?

    Posted: 06 Mar 2019 06:05 AM PST

    On mobile, sorry for the text block. I'm an absolute beginner using codeacademy to start with python and halfway into learning about class and into() I really can't do this anymore. To start out I am not creative nor perceptive, I like taking the easy way out and I don't enjoy learning how to solve a hard puzzle, which are the traits every programmer should have. On top of this I'm lazy and unmotivated and full of excuses all the time, so my work ethic is next to none. Despite all this I'm learning how to code because it's something that will significantly help me in the future. I'm starting to wonder if I'm just wasting time. The people who can actually graduate are those who enjoy solving problems with the tools they are given or are naturally gifted at coding, or willing to give it their absolute best. I'm a high school freshman and I just cannot fathom how in 4 years, my cute little functions that take average from lists can turn into something that I can enter collage with. I just feel like I'd have to dedicate every hour of my free time to learning how to code and still fall behind those who are just natural born problem solvers and logical thinkers. I'm 100% willing to try, I just don't know if it would be all for nothing since I'd just lag behind everyone who actually likes coding. I don't want any pity or words of encouragement, just want to know is this feeling normal? Do I actually have a chance, or should I give up and pursue something I'm actually good at?

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

    [Homework / Assembly] xmm0 register not being returned / preserved

    Posted: 06 Mar 2019 08:37 PM PST

    Hi r/learnprogramming,

    I posted a few days ago with another question regarding x86 Assembly and mixing it with C and C++.

    Link here: https://www.reddit.com/r/learnprogramming/comments/arzd6u/assembly_summing_up_array_gives_me_wrong_answer/

    I'm now facing the last step in my assignment. I have completed the display.c file, driver.cpp, comute_mean.asm file, and square.cpp file. All is well and working except for one TINY thing.

    When compute_mean returns it's float value in xmm0, it disappears after being called in printf.

    The program properly shows the mean value, but when it's being return to the driver.cpp file, it's zero.

    I've been doing a lot of Google-ing and reading in my textbook about preserving the xmm0 register before and after a printf call but nothing is working.

    I attempted using movaps [rsp], xmm0 to save it and movaps xmm0, [rsp] to restore it with no success.

    To show some code:

     ; calls compute_mean (average of array) ; r13 holds size of array mov rdi, arr mov rsi, r13 call compute_mean ;mean float value is now is xmm0 mov rax, 1 mov rdi, floatformat ; nasm knows that xmm0 is going to be used because rax is 0 call printf 

    However, after this is executed, when ret is called, the driver.cpp file gets zero.

    I've made sure that the C++ function which is calling the Assembly file is in type double that way it can properly receive the returned value.

    All I need to be able to successfully keep xmm0 in it's register and have it return properly.

    I'd appreciate any help at all and even resources to help me as well. Thank you all so much!

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

    Why is Pygame window taking forever to display on my Mac?

    Posted: 06 Mar 2019 08:23 PM PST

    Basically, I am trying to build a game on Python using Pygame. I got the pygame installed and everything. I hit run and the pygame window shows up but when i hover the cursor over it, it shows it loading. What is the problem here?

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

    Confushon galore

    Posted: 06 Mar 2019 04:50 AM PST

    Hello Reddit!

    why is it that when I put in

    System.out.println (100 * 1000 * 10000 * 100000);

    System.out.println (100 * 1000 * 10000 * 100000.0);

    I get

    276447232

    1.0E14

    now I understand 1.0E14 just fine but it's the 276447232 that have me scratching my head. There is no code no nothing else in there to mess it up. If somone could explain I would be very grateful!

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

    Python Tutorial: Fuzzy Name Matching Algorithms

    Posted: 06 Mar 2019 11:59 PM PST

    Best resources to learn web architecture

    Posted: 06 Mar 2019 04:04 PM PST

    Hi all,

    I am a self-taught front end developer that lacks a lot of knowledge when it comes to general web architecture. Things like cookies, protocols, generally how all that stuff works. I know how to make good stuff in react but don't understand the underlying principles that bring it all together (I have found this as a good jumping off point). Are there any suggestions for good books, video courses, blogs, etc on how to get myself up to speed? Thanks!

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

    Is it important at all to blog my programming journey?

    Posted: 06 Mar 2019 11:35 PM PST

    I've seen some posts on Reddit that say "document your journey." However, I don't really see the point. I don't think I have anything of real value to provide right now. Also, it'd take time away from learning and building a portfolio.

    The only thing I could see as useful to others is maybe one blog post on Medium after getting a job detailing what I did.

    What do you think?

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

    Learning programming from scratch

    Posted: 06 Mar 2019 11:25 PM PST

    Hello all

    I wish to learn programming from scratch. Currently I have started java but as a beginner, it's kind of confusion maybe because of the advanced YouTube video I started with.

    If you have any better sources that would aid my learning skills and make me a better programmer in future, kindly share with me

    Thanks all

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

    How to read source code

    Posted: 06 Mar 2019 12:53 PM PST

    So I'm an intermediate programmer at the moment. I'm at the point where I'm looking at the code of some more advanced programs to learn how they work. I was wondering though how to read the source code for OpenCV thats on GitHub.

    For example:

    import cv2

    capture = cv2.VideoCapture(0)

    This is importing the cv2 library and I'm assigning the default camera on my laptop to the 'capture' variable.

    but where in the source code is VideoCapture? Or am I misunderstanding how programming libraries work.

    Is there no actual class or method that contains

    int VideoCapture(int webcam)

    {

    *Code that captures video*;

    return camera;

    }

    Any advise helps, even if its telling me I'm posting in the wrong board

    EDIT: Or should i be reading the documentation at docs.opencv.org instead? This is the first time I've tried to program on my own instead of following tutorials so I'm not sure where to start.

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

    Why does this bash thing behave weirdly as soon as I put in an if statement?

    Posted: 06 Mar 2019 06:48 PM PST

    for filename in dir/*; do echo $filename done 

    This works just fine, prints out the filenames and only the filenames.

    Now I want to look for only the json files in this directory, and print out only the filenames with a .json extension. So I do this:

    for filename in dir/*; do if $filename == *.json; then echo $filename fi echo $filename done 

    It doesn'twork. The script keeps going on and on and seems to be printing out every line of every file in the directory, and it's giving me a line number and a "command not found" message. I don't get it. Why does this not work?

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

    How can Oracle "own" Java?

    Posted: 06 Mar 2019 12:15 PM PST

    My understanding is that languages don't actually exist - that is, languages are really just agreed upon syntax/conventions and then nice people go out and actually code up interpreters/compilers that understand these conventions (exactly) and will produce the correct binaries for it. Essentially, that once a language is out in the open, anyone can learn its syntax and if technically skilled enough implement their own compiler for it. So, how can certain things be closed source (ex. Matlab) or how Oracle owns Java - could they theoretically start charging people to use Java? I know legally this might be possible, but am I right to believe it is technically not possible (given my previous reasoning?). Could someone technically (illegally) create/release a free matlab compiler if they know the specifications well?

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

    Keep getting error: TypeError: Cannot read property 'name' of undefined, how do I get the properties of each record in the database? Using node and mongoose and mongodb.

    Posted: 06 Mar 2019 05:59 PM PST

    What I'm trying to do is loop through the mongodb database by looping through all the objects in the collection. I know I can't loop through an object, but how could I access the properties of each record.

    JS:

    var express = require('express'); var bodyParser = require('body-parser'); var mong = require('mongoose'); var app = express(); app.use(express.static('./')); app.set('view engine', 'ejs'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); var db=mong.connection; var postSchema = new mong.Schema({ name: String, description: String }); var postData = db.collection('Posts').find(); var postDataResults = []; var post = mong.model('Post', postSchema, 'Posts'); app.get('/', function(req,res){ postDataResults=[]; postData.forEach(function(post){ postDataResults.push(post.name, post.description); }, function() { db.close(); res.render('index', {postDataResults: postDataResults}); }) }) app.post('/submit', (req,res)=>{ var newPost = new post({ name: req.body.post, description: req.body.description }); mong.connect('mongodb://localhost/SN', {useNewUrlParser:true}, function(){ post.create(newPost); console.log(newPost); }); res.redirect('/') }); // module.exports = mong.model('Post', postSchema, 'Posts'); app.listen(3000, ()=>{console.log('listening...')}); 

    EJS:

    <html> <body> <form action="/submit" method="POST"> <input type="text" name="post" placeholder="Post name"> <input type="text" name="description" placeholder="Description"> <button>Submit</button> </form> <ul> <li> <% postDataResults.forEach(function(post){ %> <%=post.name+ ' '+post.description %> <% }) %> </li> </ul> </body> </html> 

    Thanks!

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

    Am I getting too hung up on the details?

    Posted: 06 Mar 2019 09:44 PM PST

    Context:

    In the past year I've done some basic programs in C++, but nothing too crazy. Mostly word arrangements and dealing with semi-complex arrays that I can't say I fully understood at the time.

    Now, after bouncing back and forth between languages, I've (hopefully) settled on C#.

    The talk of C++ being a difficult language for a beginner was quite compelling to me, so I really went for it.

    However, I've got the feeling it's not going to be a good fit for what I'm personally interested in.

    To the point:

    I'm currently learning c# and am doing lots of reading on it's concepts and how things work, as well as how it compares to other languages. However, It feels like I'm getting so caught up in the details that I'm spending more time reading than actually programming. Normally I wouldn't have a problem with this, but I can't get rid of the nagging feeling that if I don't apply what I know, then whats the point?

    If there is something I don't understand, I jump into the rabbit hole and go as far down to the fundamentals as possible.

    Then, just when I think I've got a decent enough grasp, I have to go right back to what I just spent a good chunk of time learning about. It's a constant cycle of relearning the same thing to the point I can't move on. It just feels wrong not knowing all the nitty gritty details right then. It's a little sad to think I haven't made it through half of a tutorial because I've spent the majority of the time learning about the differences between a function, method, and procedure. I won't even get into how long it took me to wrap my mind around the C# 'static' modifier, it apparently has members too btw.

    I still don't understand it.

    The last time I actually coded was a few weeks ago when I was learning to make a MAKE file in C++. It was actually pretty cool, too. It demonstrated how things work together in the grand scheme of things. It also filled in my memory about header files and how they worked.

    I don't have someone to mentor me or provide me with a curriculum, so when it comes to self pacing I'm not really sure when or if I should apply the brakes.

    I'm a bit frustrated, so this was perhaps a bit longer than intended.

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

    OCaml - where to start?

    Posted: 06 Mar 2019 05:15 PM PST

    I've spent a lot of time with C-like languages, but OCaml has recently piqued my interest.

    Does anyone know of any good tutorials/books/videos? To be clear, I'm not looking for, "here's how you define a function..." style tutorials. I want to learn how to write idiomatic OCaml, not just Java with OCaml syntax.

    Thanks in advance!

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

    Online websites to learn Computer Statistical Programming through R, etc.?

    Posted: 06 Mar 2019 09:00 PM PST

    Hi all,

    I was just wondering what are some really good websites so I can start learning some data science/statistical applications of computer science or where I could learn some programming languages like R. (I prefer videos but anything works! Beggars can't be choosers.) Thank you all!

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

    How do I make these borders even on my rep.li project?

    Posted: 06 Mar 2019 08:43 PM PST

    https://flexbox-mobile-first-starter-1--hungrygoat.repl.co/

    When I go to fullscreen, the boxes aren't evenly lined up. How do I make them even at 900px?

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

    How do you get a string.charAt(i) in to show up as text and not a number on the canvas?

    Posted: 06 Mar 2019 08:27 PM PST

    final int TEXT_SIZE=30; String quote="Hello World"; int quoteLength=quote.length(); float textDiam=sqrt(2*sq(TEXT_SIZE));//for the spacing between the text float spacing=random(0,TEXT_SIZE); float radius=quote.length()*(textDiam+spacing)/TWO_PI; float angle=random(0,TWO_PI);//starting point void setup(){ size(600,600); } //Write the quote on the canvas letter by letter in a circle void circlePosition(){ float circlePosX=width/2; float circlePosY=height/2; for(int i = 0;i<quote.length();i++){ angle+=(TWO_PI/quoteLength); int text=quote.charAt(i); text(text,circlePosX+radius*cos(angle),circlePosY+radius*sin(angle)); } } void draw(){ circlePosition(); } 

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

    Following Programming News

    Posted: 06 Mar 2019 08:27 PM PST

    I think I am experienced somewhat in programming, yet I am confused about these things. I was thinking how could I follow the programming news, so as an advice from my friend I joined to reddit tho I still have question marks. How could I know which language should I use? They develop languages like fast-fashion. Currently I am into Google's Flutter but I would like to have some advices.

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

    No comments:

    Post a Comment