• Breaking News

    Saturday, April 21, 2018

    What are 5 or 10 minute simple tasks I could do daily that make me a better programmer? learn programming

    What are 5 or 10 minute simple tasks I could do daily that make me a better programmer? learn programming


    What are 5 or 10 minute simple tasks I could do daily that make me a better programmer?

    Posted: 21 Apr 2018 06:34 AM PDT

    I am thinking of something I could do before I start my day and slowly develop that into a habit. So far i've come up with either:

    • completing a challenge on codewars/hackerrank (many of them will take longer than that time though)
    • reading about a subject i've never heard of or am interested in

    What other suggestions might there be? Or what simple daily tasks one could do to sharpen their skills and understanding?

    Edit: There is a lot of useful advice here, thank you everyone for your insight and comments! My approach to programming has definitely changed after reading all the different ways a programmer can become a better problem solver and thinker.

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

    Google app ‘Grasshopper’ offers games to help you learn to code

    Posted: 21 Apr 2018 05:29 PM PDT

    "Laura Holmes, a senior product manager at Google, founded Grasshopper as part of Google's Area 120, an internal incubator that works on special projects."

    Article: https://www.dailydot.com/debug/google-app-grasshopper/

    Previous Reddit thread from one of the authors: https://www.reddit.com/r/learnprogramming/comments/8d8oov/sharing_grasshopper_learn_to_code_app_with_yall/

    iOS link: https://itunes.apple.com/us/app/grasshopper-by-area-120/id1354133284

    Android link: https://play.google.com/store/apps/details?id=com.area120.grasshopper

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

    [QUESTION] Can anyone link me to some of the best, up-to-date Java tutorials out there?

    Posted: 21 Apr 2018 10:52 PM PDT

    Want to get a head start since I'm taking a Java course this summer semester

    I learned some Processing already (which is related to java i heard), and was wondering if you guys can link me to the best Java tutorials out there that isn't out of date.

    Like for example for processing i'd recommend daniel shiffman youtube videos. Whats the equivalent of that for Java?

    Easy tutorials that i can follow along and digest with ease, please help! thanks

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

    Is it true that you can't get good until you get a job?

    Posted: 21 Apr 2018 02:07 PM PDT

    I've heard a lot of people talk about how one can only get good at coding after getting a job in the field? Is this true? How can I get similar experience before getting a job in coding?

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

    A new platform for learning to code python

    Posted: 21 Apr 2018 06:11 PM PDT

    Looking for a fun new way to learn coding?

    Over the last two years I've been teaching kids ages 10+ how to code. This work has led me to Predigame - a minimalistic platform (with tons of baked in abstractors) that teaches the fundamentals of coding - even complex arcade games - without having to know all of the complexities of game creation - imaging blitting, frame rates, etc - just code and have fun!

    Here's an example of what can be done in less than 100 lines of code: https://vimeo.com/user83745990/review/265932161/823b04f599

    The full platform is available online at http://predigame.io with many examples and tutorials.

    Let me know if you have questions!

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

    What do I put for registered hosts when configuring DNS?

    Posted: 21 Apr 2018 09:54 PM PDT

    Say I bought "example.com" through Google domains and I am configuring the DNS options, and want to host a website on a computer of mine.

    Following the registered hosts section here: https://support.google.com/domains/answer/6147097?hl=en

    There are two fields. [hostname].example.com and [ip address].

    It seems somewhat clear that the IP address is the name of the computer I am hosting the website on, though I'm not 100% sure. I'm more confused about the different host names. In the linked example they give different host name / ip address combos like "ns1.example.com 74.125.201.121", "ns2.example.com 74.125.201.122" etc.

    I don't know what goes in the host name section and what it correlates to when I am, say, configuring a virtual host file for an apache server and want the server to be listening for the right thing. Is ns1 the name of the computer? Is it the ServerName?

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

    [Android] Any recommended resources for Android development, specifically in information regarding creating and setting proper GUI components.

    Posted: 21 Apr 2018 11:39 PM PDT

    Wanted to learn more about Android development.

    I use Java a lot, but I'm not terribly familiar with Android. The most I've done is create a live wallpaper in the past, but could never get the program to dynamically determine my phone screen's resolution.

    It took me a long time to create the fairly simple app, so I think I should read up on Android before I take 10 years to create a hello worldesque program again.

    Any good books or other resources for a novice?

    I've only read books regarding Java and programming principles that did not revolve around graphical aspects.

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

    What data format should I use for a simple archival project?

    Posted: 21 Apr 2018 05:37 PM PDT

    I want to store some simple relational data for archival purposes, for posterity, that I would like to be readable, uncorrupted, possibly human-readable, and easy to use far into the future (500, 1k+ years).

    I was considering using xml. Maybe just plain ascii would be better.

    Seeking recommendations and resources, thank you in advance for any help.

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

    sql in codeacademy

    Posted: 21 Apr 2018 11:29 PM PDT

    What is the review of sql tutorial in codeacademy.is it worth learning in codeacademy.com

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

    Beginner Programming help!

    Posted: 21 Apr 2018 11:27 PM PDT

    Hi! So I'm trying to get a good base in Python and possibly one of the C languages (C, C++, or C#) before I go to college in September for a Computer Programming Analyst program. Are there any good projects or resources that I could do or go through to help me learn?

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

    Abstract classes vs inheritance vs interfaces in Java?

    Posted: 21 Apr 2018 04:46 PM PDT

    I'm having a little trouble differentiating the three but here's what I understand for all of them

    So abstract classes are classes that you can't create an object for but you can use abstract classes for inheritance.

    Inheritance is when one class is absorbs the methods of another class. Using super allows you to call the superclass. Using super also allows you to call the constructor for the superclass.

    And interface is when one class extends another. This means that the class can use it's methods. This allows you to be able to create an object of the class it extends.

    I think I got that right. My first question is when should you use the three? Also, what's the difference between abstract classes, inheritance and interfaces?

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

    Running a different file in Visual Studio Code

    Posted: 21 Apr 2018 10:34 PM PDT

    I'm working on learning C#, and I just ran my first .cs file. I made a different one and now I want to run that, but my "dotnet run" command still runs my old file. How can I switch the focus to the new .cs file?

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

    Feel pretty comfortable with Python and basic OOP concepts involving classes but now want to go more hard core into C. What are the pitfalls on doing this?

    Posted: 21 Apr 2018 10:32 PM PDT

    What is this beast known as C(not c++) and what should I expect versus learning Python?

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

    [OC] My focused learning tips after hundreds of hours of coding.

    Posted: 21 Apr 2018 04:26 PM PDT

    https://medium.com/@ltp235/on-studying-learning-programming-effectively-c6993d2278b4

    I've also included various links in the article for resources I'm using to practice. Any feedback on the article is great. I've been visiting this sub for a while so I look forward to hearing your feedback.

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

    Getting the loops correct.

    Posted: 21 Apr 2018 02:47 PM PDT

    I am always scared of off by one errors and often do the mistakes, specially in interviews where I hardly have time to write unit tests. These mistakes are dangerous in problems including linked lists and specially you are in stressful conditions like interviews.

    I am thinking that there must be some way to avoid these mistakes.

    I came up with an idea of writing the body of the loop first since its a block statement which is supposed to be executed next anyways, later we can wrap the body with either a for or while loops with care, settings loop variables which doesn't invalidates the statements in the loop body.

    I haven't tested this idea on many problems yet but it seems good to me.

    Until now I was writing the loops first and then populating the body thinking back and forth correcting the condition and body made me really confused.

    I would like to know what tips others have and what they think about this idea?

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

    Why is this for loop initializing without the initializing action being met

    Posted: 21 Apr 2018 04:13 PM PDT

    https://gist.github.com/sb1999/3e4b8764ef9d974a658f763762989c5a

    Why does the loop begin when I set the initialization action to x == 10 Is it just something with for loops? As I have no such problem using while loops. Or maybe this is just the thing the assert macro is useful for?

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

    So frustrated just installing an IDE

    Posted: 21 Apr 2018 06:11 PM PDT

    So recently I've been working on a data science project on python, so I decided to use the Atom IDE, and I downloaded script and autocomplete packages, but when I run it, it says I have to choose a language but I can't see where. Can some please help?

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

    Is it ok to back up a personal website to GitHub?

    Posted: 21 Apr 2018 09:49 PM PDT

    I'm currently building my first website, and it's intended to be my personal website for my graphic design. I'm keeping track of the build using git locally, but I was wondering if there was any reason why I shouldn't back it up to GitHub? Like would it create a security risk somehow or anything like that? Is there any personal metadata associated with building a website that I'm not aware of? I assume it should be fine since people can use the Inspect Element in browser to look at all of my code and assets anyways.

    Also I don't mean host it on GitHub. Strictly just backing up my code and commit history, like with any other program, and also using it to manage different versions of the site as I add to/change it.

    Thanks :)

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

    Need help in optimizing

    Posted: 21 Apr 2018 09:42 PM PDT

    Hi guys, I'm currently developing a class to load set of files(for a given extension) in a given directory (directory can be a string path or a url). The tool is currently working but I'm concerned that this can be optimized more in performance wise.

    Here's the class : https://github.com/Oshan96/CustomStage/blob/master/src/main/java/lk/vivoxalabs/scenemanager/tools/FileLoader.java

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

    [Python] What is wrong with my pop() method?

    Posted: 21 Apr 2018 05:55 PM PDT

    Working on a homework assignment and when trying to use the pop() method on a stack, i get the top item returned, but it is not removed from the stack. Ill post the code below :

    from arraystack import ArrayStack def printStack1(): print("stack1:", stack1) stack1 = ArrayStack([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) print("Removed item:", stack1.pop()) print("After removing the top item from stack1:") printStack1() 

    And i get this output:

    Removed item: 10 After removing the top item from stack1: stack1: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 

    Here is the other files used in my assignment :

    arraystack.py:

    from arrays import Array from abstractstack import AbstractStack class ArrayStack(AbstractStack): """An array-based implementation.""" DEFAULT_CAPACITY = 10 #for all array stacks def __init__(self, sourceCollection = None): """Sets initial state of self, which includes the contents of source collection, if its present.""" self._items = Array(ArrayStack.DEFAULT_CAPACITY) AbstractStack.__init__(self, sourceCollection) #Accessors def __iter__(self): """Supports iteration over a view of self. Visits items from bottom to top of stack.""" cursor = 0 while cursor < len(self): yield self._items[cursor] cursor += 1 def peek(self): """Returns the item at top of the stack. Precondition: the stack is not empty. Raises KeyError if the stack is not empty.""" return self._items[len(self) - 1] #Mutators def clear(self): """Makes self become empty.""" self._size = 0 self._items = Array(ArrayStack.DEFAULT_CAPACITY) def push(self, item): """Inserts item at the top of the stack.""" #Resize array here if necessary self._items[len(self)] = item self._size += 1 def pop(self): """Removes and returns the item at the top of the stack. Precondition: the stack is not empty. Raises KeyError if the stack is empty. Postcondition: the top item is removed from the stack.""" oldItem = self._items[len(self) - 1] self._size -= 1 #Resize the array here if necessary return oldItem 

    abstractstack.py:

    from abstractcollection import AbstractCollection class AbstractStack(AbstractCollection): """An abstract stack implementation""" #constructor def __init__(self, sourceCollection = None): """Sets the initial state of self, which includes the contents of sourceCollection, if it's present.""" AbstractCollection.__init__(self, sourceCollection) #Mutator methods def add(self, item): """Adds item to self.""" self.push(item) 

    abstractcollection.py:

     class AbstractCollection(object): """An abstract collection implementation""" #constructor def __init__(self, sourceCollection = None): """Sets the initial state of self, which includes the contents of sourceCollection, if it's present.""" self._size = 0 if sourceCollection: for item in sourceCollection: self.add(item) def push(self, item): """Inserts item at the top of the stack.""" #Resize array here if necessary self._items[len(self)] = item self._size += 1 def pop(self): """Removes and returns the item at the top of the stack. Precondition: the stack is not empty. Raises KeyError if the stack is empty. Postcondition: the top item is removed from the stack.""" oldItem = self._items[len(self) - 1] self._size -= 1 #Resize the array here if necessary return oldItem def peek(self): """Returns the item at top of the stack. Precondition: the stack is not empty. Raises KeyError if the stack is not empty.""" return self._items[len(self) - 1] def __add__(self, other): """Returns a new collection containing the contents of self and other.""" result = type(self)(self) for item in other: result.add(item) return result def __eq__(self, other): """Returns true if self equals other, or false otherwise""" if self is other: return True if type(self) != type(other) or \ len(self) != len(other): return False for item in self: if not item in other: return False return True def __len__(self): """Returns the number of item in self""" return self._size def __str__(self): return str(self._items) def isEmpty(self): """Returns true if len(self) == 0, or False otherwise. """ return len(self) == 0 def __iter__(self): """Supports iteration over a view of self. Visits items from bottom to top of stack.""" cursor = 0 while cursor < len(self): yield self._items[cursor] cursor += 1 
    submitted by /u/Zelnz
    [link] [comments]

    [Homework][C#] Having trouble with casting in while summing listbox items

    Posted: 21 Apr 2018 05:30 PM PDT

    Hi!

    I have a program where a user selects items using a radio button, inputs quantity and the total is summed and added to a list box. They can do this as many times as they want. Then I need to iterate over the listbox and sum the totals. I'm running into an issue with casting that I cannot figure out.

    My error message is: System.FormatException: 'Input string was not in a correct format.'

    Here is my iteration code:

    private void btnTotal_Click(object sender, EventArgs e) { decimal sum = 0; for (int i = 0; i < lstSales.Items.Count; i++) { sum += Convert.ToDecimal(lstSales.Items[i].ToString()); } lblTotal.Text = "The total is: " + sum.ToString("c2"); } 

    Any help would be appreciated. I'm still a fairly new programmer.

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

    [C] Trying and failing to figure out how to make an output in a table (arrays)

    Posted: 21 Apr 2018 09:15 PM PDT

    This program reads numbers from a file, and calculates the nth root. I'd like it to output a table that looks like:

    | n | S | Root | |power| newGuess | originalNumber | 

    This file will be written to some file, "output.txt".

    My problem: I can't figure out how to make and write that table.

    My program is:

    #include "stdafx.h" #include "math.h" int checkPower(int power); int checkNumber(double numberS, int power); double newtonSquared(double currentGuess, double newGuess, double numberS); double newtonCubed(double currentGuess, double newGuess, double numberS); FILE *inp; FILE *outp; int main() { int input_status; int power; int validPower; int validNumber; double numberS; double olderGuess; double newGuess; double originalNumber; errno_t err; err = fopen_s(&inp, "input.txt", "r"); err = fopen_s(&outp, "output.txt", "w"); input_status = 1; while (input_status != EOF) { input_status = fscanf_s(inp, "%d %lf", &power, &numberS); validPower = checkPower(power); validNumber = checkNumber(numberS, power); if (validPower == 0) printf_s("That power cannot be used in this program.\n"); else { if (validNumber == 0) printf_s("That number cannot be used in this program.\n"); if (validNumber == 2) printf_s("You cannot find an even nth root of a negative number.\n"); else { switch (power) { case 2: case 4: case 6: olderGuess = numberS / 3; newGuess = numberS / 2; newGuess = newtonSquared(olderGuess, newGuess, numberS); break; case 3: case 9: olderGuess = numberS / 3; /* Value that is smaller than newGuess and won't end the while */ newGuess = numberS / 2; newGuess = newtonCubed(olderGuess, newGuess, numberS); break; default: newGuess = 0; break; } originalNumber = numberS; numberS = newGuess; switch (power) { case 4: newGuess = newGuess / 2; olderGuess = newGuess / 3; newGuess = newtonSquared(olderGuess, newGuess, numberS); break; case 6: case 9: newGuess = newGuess / 2; olderGuess = newGuess / 3; newGuess = newtonCubed(olderGuess, newGuess, numberS); break; default: break; } switch (power) { case 2: printf_s("The square root of %5.2lf is %8.6lf\n", originalNumber, newGuess); break; case 3: printf_s("The cube root of %5.2lf is %8.6lf\n", originalNumber, newGuess); break; case 4: case 6: case 9: printf_s("The %dth root of %5.2lf is %8.6lf\n", power, originalNumber, newGuess); break; default: printf_s(" "); break; } } } } fclose(inp); fclose(outp); return 0; } /*********** FUNCTIONS ***********/ /* Funcion to check power */ int checkPower(int power) { int answer; switch (power) { case 2: case 3: case 4: case 6: case 9: answer = 1; break; case 0: case 1: case 5: case 7: case 8: answer = 0; break; default: answer = 0; break; } return answer; } /* Function to check numberS*/ int checkNumber(double numberS, int power) { int answer; if (numberS == 0) answer = 0; if ((numberS < 0) && (power % 2 == 0)) answer = 2; else answer = 1; return answer; } /* Function to do Newton's method */ double newtonSquared(double olderGuess, double newGuess, double numberS) { int counting; counting = 1; while ((fabs(newGuess - olderGuess) > 0.000001) && (counting < 51)) { olderGuess = newGuess; newGuess = olderGuess - (((olderGuess * olderGuess) - numberS) / (2 * olderGuess)); counting = counting + 1; } return newGuess; } /* Function to do Newton's method */ double newtonCubed(double olderGuess, double newGuess, double numberS) { int counting; counting = 1; while ((fabs(newGuess - olderGuess) > 0.000001) && (counting < 51)) { olderGuess = newGuess; newGuess = olderGuess - (((olderGuess * olderGuess * olderGuess) - numberS) / (3 * olderGuess * olderGuess)); counting = counting + 1; } return newGuess; } 
    submitted by /u/ArchangelleAladeen
    [link] [comments]

    Making a dicord bot

    Posted: 21 Apr 2018 09:02 PM PDT

    Hello guys, I want to make a simple discord bot that would bring up info from streaming websites and other useful information. If you are interested to work on this project do let me know.

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

    How can I pull dynamically rendered data from a website (17Track, package tracking site) to a Google Sheet?

    Posted: 21 Apr 2018 08:59 PM PDT

    I'm trying to help a buddy of mine pull the Delivery statuses from 17Track, a package tracking site to a Google Sheet. (https://t.17track.net/en#nums=9374889676090651166265)

    I know that it is possible to use =importxml('url', query) to get the content from a static web page, but the information that I am trying to pull from 17Track is dynamically rendered; the page makes a POST call after the page is loaded to get the delivery status. I'm very new to Google Sheets, and I know it is possible to add scripts using JS, so I was wondering if what I'm trying to do is feasible using something like a JS script in Sheets.

    I've shared the Google Sheet with a sample tracking number and the importxml function that shows empty content. (https://docs.google.com/spreadsheets/d/19rvCOnerluU_WZr-rVfT-dSghIXtayNHLFqnqLmRHhM/edit#gid=0). As you can see it says imported content is empty in the cell because the data is retrieved after the page has been loaded.

    Would love some ideas on how to go about this!

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

    Any Good Dialogflow Tutorials?

    Posted: 21 Apr 2018 08:45 PM PDT

    I want to make an AI that I can use to change songs or videos on my phone. I was looking at Dialogflow since it works with Google Assistant, I believe. I want to be able to customize their reactions and allow them to work with things like YouTube app and my Amazon movie library, is that even possible? I also have no idea where to start. Any recommended tutorials I could go with?

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

    No comments:

    Post a Comment