• Breaking News

    Sunday, February 11, 2018

    To all (beginner) programmers! learn programming

    To all (beginner) programmers! learn programming


    To all (beginner) programmers!

    Posted: 10 Feb 2018 07:47 PM PST

    Never give up! When u start coding (or in general just something) There will be good thing and bad things but just keep going. Even when People tell you that u cant make it or that u suck, don't listen to them. I for example, am not the best at math ('something that you really need' is what a lot if people say) but still i continue, why? Because you never need to give up, because even without being good at math you still can be a great coder, and because coding is fund. So don't let people tell you, you cant All The Best!!!

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

    An obvious tip that took me too long - Read The Documentation

    Posted: 10 Feb 2018 06:45 AM PST

    I'm self-taught and when I started I would go through tutorials to figure out how to do most things. As time went on I maintained this habit, to the point where I'd have difficulty figuring out how to do anything if there wasn't a tutorial or example out there for it.

    At first I would avoid reading documentation because it seemed like there was too much of it and it was too technical. Now several years in, I realize that it doesn't take too long to read and most documentation is fairly straightforward. It's necessary to be able to do anything above basic programming.

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

    How do I learn API design?

    Posted: 10 Feb 2018 09:13 PM PST

    Hi everyone! I am a second-year CSE student. I should mention I code in C++, Java and am learning (still at the beginner level) Ruby. I've wondered for a while about how I could go about implementing a basic web-based API.

    Say I want to design a service where I receive a request with a country code/name, and return data about different countries, like their population, capital, languages and currency. I want it to be sent as a JSON response.

    1. How do I implement this?
    2. If I want to design this service for developers to use while programming in, say, Java and Ruby, will I have to I re-write the service appropriately?

    Thanks!

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

    Anyone wanna review C# with me?

    Posted: 10 Feb 2018 10:07 PM PST

    I'm somewhat new to C# , but I've reached up to 2D arrays/Lists...Etc.

    Looking for anyone who wants to review and learn topics together?

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

    Your Advice: Boot Camp: Thinkful, TreeHouse, other.

    Posted: 10 Feb 2018 05:46 PM PST

    Hi!

    I hope to have an opportunity to study software development full-time for a few months. Firstly I am considering online programs as they tend to be less pricey, and I am considering Thinkful's online full-stack program that covers front-end, as well as node.js and more:

    https://www.thinkful.com/bootcamp/web-development/flexible/

    I read complaints here about the curriculum - lots of googling - which yes is part how people do things in tech, but apparently its a bit too much for what is being paid. While on the other hand they do have job services in my local area.

    I've also heard about Tree House(https://teamtreehouse.com/) , any thoughts on that, or any other school? Launch School intrigues me greatly(https://launchschool.com), just the end-time is not certain and that doesn't suit my personal situation. There is even the Odin Project which I just saw, https://www.theodinproject.com.

    I need to make a final decision soon, like this week or coming one.

    I'm actually interested in learning well, but time is of the essence too, particularly now.

    I've been studying about 2 months so far, some ruby, fortunately benefited from Mark Myer's books A Smarter Way to Learn, HTML/CSS, and his JavaScript one as well. Excellent excellent intros, highly recommend for anyone else new. The good thing is, I'm enjoying it, its fun to learn this. I hope thats a good premonition.

    Thanks in advance!

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

    CSS - nth-child is not explained well anywhere that I can find. What is n in An+B?

    Posted: 10 Feb 2018 11:17 PM PST

    I used to think I was somewhat intelligent before trying to learn to code(or at the very least, not a complete moron), yet I'm doubting that now.

    I'm learning about nth-child(). If it's a simple number... nth-child(3)... that makes perfect sense. But the An+B explanation makes no sense to me. Here is the syntax explanation from MDN -

    <An+B> Represents elements whose numeric position in a series of siblings matches the pattern An+B, for every positive integer or zero value of n. The index of the first element is 1. The values A and B must both be <integer>s.

    The explanation on w3.org is about the same. The wording makes no sense. I found a stackoverflow answer that I thought explained it(n basically starts at 0 and increments), but then I see this example on MDN...

    :nth-child(-n+3) Represents the first three elements among a group of siblings.

    I'm so lost. ELI5, but please be nice.

    TL;DR EDIT - I just want a clear and concise explanation of what to plug into "n" to understand the equation.

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

    How does one go about making a bot for something that didn't intended to have one?

    Posted: 10 Feb 2018 07:14 PM PST

    The title is pretty much my question but here are some extra details.
    I did a preliminar quick research and found things like "use this library to send inputs", "use a neural network to determine actions"
    All that is fine but I'm not worried about programming the logic.
    My question is more on the side of "how do you read things you weren't ment to read?", "how do you know that memory address X represents Mario's absolute position and Y represents only his position on the screen?"

    I get it that it may take MUCH reverse engineering and I'm fine with that (actually I hope there is, I like it)
    but how do you even distinguish between foo and bar processes doing their stuff and <insert NES emulator here> making Mario jump?

    P.S.: I know I'm not the most elocuent person on reddit, if you need me to explain further please ask

    EDIT: I put a bad example with emulators, my question is more general, like for PC games (i.e. no man's sky, saints row, AoM) or even regular PC programs

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

    How do you practice specific algorithms?

    Posted: 10 Feb 2018 10:28 PM PST

    For example, I just learned insertion sort, but the book quickly moved to merge sort. How do I make sure I fully understand insertion sort and can figure out when to use it, and when not to?

    submitted by /u/-Xichael
    [link] [comments]

    My program sends an email confirmation. Runs once but get two confirmations.

    Posted: 10 Feb 2018 06:09 PM PST

    My program sends an email confirmation, I have gone through with the debugger many times and it should only send one email confirmation, However it sends two. I put in a print statement and it only executes once. I am working in python and I am importing some of my files. I am thinking that somehow the when I import a file it executes it again?

    from API.Queue import Queue from API.ReadExcel import ReadExcel from API.OrderMaker import ReadQueue from API.Store import Store """ This Program reads from an Excel file, adds each line of the file to a queue (For Scalability). The class 'ReadQueue', reads each item in the Queue, accesses the store as an admin and places an order for the Product. """ if __name__ == "__main__": # Create known store 'jelly' and fill in the info to access the API jelly = Store("Jubilant Jelly") jelly.set_api_key("") jelly.set_password("") jelly.set_header_value("") # Create known store 'jam' and fill in the info to access the API jam = Store("Jubilant Jam") jam.set_api_key("") jam.set_password("") jam.set_header_value("") #all known stores that this program will be abe to access known_stores = [jelly, jam] q = Queue() r = ReadExcel("OrderFromThisExcelFile", q) r.order_from_excel() rq = ReadQueue(q, known_stores) rq.query_from_queue() 

    Order.py

     import shopify class Order(): def __init__(self, store, email): """ Initialize an order :param self: :param store: Store This is the store that the order will be created for :param email: The email of the client """ self.store_name = store.get_name() shopify.ShopifyResource.set_site(store.get_password_url()) self.shop = shopify.Shop.current() #create new order self.order = shopify.Order() self.order.email = email self.order.send_fulfillment_receipt = False #Mark the order status as fulfilled. ToDo: Actually fulfill the order instead of just marking it as such self.order.fulfillment_status = "fulfilled" self.order.send_receipt = True self.order.line_items = [] def add_item(self, item): """ Add an item to the order :param item: dict eg: {"variant_id": 1234567, "quantity": 4 } :return: Nonetype """ self.order.line_items.append(item) def complete(self): """ Complete the Order :return: NoneType """ success = self.order.save() if success: print("Order was successful at " + self.store_name ) else: print("order was unsuccessful at " + self.store_name ) if __name__ == '__main__': pass 

    ReadQueue.py

     import requests from API.Order import Order import base64 from os.path import normpath, basename class ReadQueue: """ Connect to the graphQL endpoint of given Shopify stores, Headers are necessary Before making a query the appropriate headers as well as shop name must be added """ def __init__(self, queue, known_stores): """ Initialize Reading from the Queue :param self: :param queue: Queue :param known_stores: list of stores """ self.order_queue = queue self.email = "" self.shop_name = "" self.new_order = None self.known_stores = known_stores self.accept_orders = False def query_from_queue(self): """ For every item in the queue, make the given query :param self: :return: NoneType """ while not self.order_queue.is_empty(): line = self.order_queue.remove() if line[0] == "email": self.is_email(line) elif line[0] == "shop": self.is_shop(line) else: # Only accepts orders when the shop is a known shop if not self.accept_orders or line[0] == "": continue self.is_product(line) #Helper Function for query_from_queue def is_email(self,line): """ Set the email of the customer and close any precious orders :param line: list of strings :return: NoneType """ if self.email != "": self.new_order.complete() self.new_order = Order(self.store, line[0]) self.email = line[1] # Helper Function for query_from_queue def is_shop(self, line): """ Set the Shop and check if it is a known store :param line: list of strings :return: NoneType """ shop_name = line[1].replace(" ", "").lower() # Check known stores for store known_store = None for store in self.known_stores: if store.name == shop_name: self.store = store known_store = store self.accept_orders = True break if self.new_order is not None and known_store is not None: self.new_order.complete() if known_store is None: self.new_order.complete() self.accept_orders = False print(shop_name + " is not a known Store") # This will cause an error when a product is ordered # For some reason if I put an unknoen store at the end. The store above it does not order. self.new_order = Order(self.store, self.email) # Helper Function for query_from_queue def is_product(self, line): """ Add the product to the Order and complete the Order if it is the last item :param line: list of strings :return: """ self.product = self.prod_to_id(line[0]) self.quantity = int(line[1]) item = {"variant_id": self.product, "quantity": int(self.quantity)} self.new_order.add_item(item) if self.order_queue.is_empty(): self.new_order.complete() # Helper Function for is_product def prod_to_id(self, product): """ Precondition: the product name must be similar to the product handle as made by the store owner: Ex: product "Almond Butter", handle "almond-butter". This will work product "Almond Butter", handle "coffee". This will not work Return the variant id of the given product :param self: :param product: String :return: String """ product = product.replace(" ","-").lower() # graphQL query query = '{shop{products(first:1, query:"title=' \ '' + product + '"){edges{node{variants(first:1){edges{node{id}}}}}}}}' response = self.make_query(query) # variant_id is returned as a scalar encoded_variant_id = response['data']['shop']['products']['edges'][0]['node']['variants']['edges'][0]['node']['id'] decoded_variant_id_url = base64.b64decode(encoded_variant_id) # convert tp string decoded_variant_id = basename(normpath(decoded_variant_id_url)).decode("utf-8") return decoded_variant_id # dict = {"Almond Butter": "6797069778989", "Peanut Butter": "1573432655890", # "Jelly Fish Sandwich": "6862783905837"} def make_query(self, query): """ Return query response :param query: String :param graphQL: Boolean clarify if the query is for a graphQL API :return: Dict """ request = requests.post(self.store.get_url_graphQL(), json={'query': query}, headers=self.store.get_headers()) if request.status_code == 200: return request.json() else: raise Exception("Query failed to run by returning code of {}. {}".format(request.status_code, query)) if __name__ == '__main__': pass 
    submitted by /u/xXxwiskersxXx
    [link] [comments]

    Competitive Programming: Learn C++ stack, queue, priority_queue, multiset and multimap in 5 minutes (YouTube)

    Posted: 10 Feb 2018 09:36 PM PST

    https://www.youtube.com/watch?v=j0IF9YMMUBg

    This video covers the basics of 5 data structures in C++. Enjoy!

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

    Learning by doing

    Posted: 11 Feb 2018 12:27 AM PST

    Hello, I don't know anything about coding. But after going deep into crypto currencies I want to jump in and learn. And maybe even make programming a career in the future.

    I want to try and build something that resembles "NEON wallet". For those who don't know, it's just a wallet that gives you dividends or rewards as time goes by. Or each block. I want different rules when it comes to the time it takes to update and different decimal points etc. I guess that's the easy part.

    How should I start this project?

    Should I go with python since it's what I've dabbled with in the past and beginner friendliness it provides?

    I'm not sure how to build a program, or is it called an API? The lingo is not clear to me.

    I also have the idea that the rewards must continue without the program to be open. So it has to sync to the computer without being able to cheese the timer 100 years forward in time.

    Since this is just for me I guess I don't have to think about the internet clock or anything yet.

    Is there any specific python I need to make a "window" so to speak? Flask? Or Django?

    If anyone can decipher my ramblings and help me with some search phrases. Is stack exchange the best place to ask specific code related questions and is it best for me to commit my project straight into github so I also learn that part?

    Thank you for all your replies.

    Robhimself

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

    I want to make an android app that has a database and the data base can be accessed by a pc as well.

    Posted: 11 Feb 2018 12:15 AM PST

    Basically trying to share data between computer and android phone via a database, and each user should be able to add their own content.

    I am alright with Java, and have made a few apps. Can anyone recommend a resource to learn about databases, and what this endeavor would entail? Also, can anyone recommend a free service that would host this data - if there is one?

    Thanks

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

    FFMPEG: making a longer video from a sequence of images. More details below.

    Posted: 10 Feb 2018 11:42 PM PST

    I wrote a program that gave me some images named fig01.png to fig24.png i then used ffmpeg to make it into an mp4 video. I used a framerate of 25 and hence my video was only 1 sec long. I wanted to have a longer video so that i can better see what was happening so i set a framerate of 5 but in that case I can no longer view the video as my video player (vlc) hangs and I am unable to see the video. What is the correct way of making a longer video (say 5-10s long)?

    for reference here is the command i used:

    ffmpeg -framerate 10 -i fig%02d.png output.mp4 
    submitted by /u/basyt
    [link] [comments]

    Reading to learn about dictionary based compression?

    Posted: 10 Feb 2018 02:56 PM PST

    Here's the question I want to answer.

    If I have a megabyte of random data what are the odds that I can compress it given I have a dictionary of 1 million randomly generated megabytes of data to reffer to?

    I don't expect this sub to give me an answer but I would like help on what to start reading to get me on a path (long as it may be) to answering that question. Anyone have tips on text, articles, etc. ?

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

    Help with my sorting algorithm

    Posted: 10 Feb 2018 07:52 PM PST

    Hey all looking for some guidance on my code. This is the pseudocode given by my professor:

    algorithm stoogesort(array L, i= 0, j= length(L)- 1) if L[j] < L[i] then L[i] <-> L[j] if j- i > 1 then t= (j- i + 1)/ 3 stoogesort(L, i, j- t) stoogesort(L, i+ t, j) stoogesort(L, i, j- t) return L` 

    And this is the python code that I translated it into:

    import math def stoogesort(L, i, j): temp= 0 if L[j] < L[i]: temp= L[i] L[i]= L[j] L[j]= L[i] if j- i > 1: t= (j- i + 1)/ 3 stoogesort(L, i, j-t) stoogesort(L, i+ t, j) stoogesort(L, i, j- t) return L` 

    I am supposed to argue that it is correct.. but after going over it with whiteboard it doesn't appear to be as it doesn't scan the last half or third of the array, but it may be that I am not thinking of the recursion properly. Anyway, when I run an array through the code I just wrote, it gives me values of 1 for all indices except for the last one, which comes out as the original final value. What am I doing wrong here?

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

    Setprecision in a loop [c++]

    Posted: 10 Feb 2018 11:38 PM PST

    struct movie{ int week; int month; int year; int rating; }; 

    In the loop below, I am trying to print out all the information in the vector of struct and I only want decimals in the ratings but this makes it so that there are decimals in all lines after the first iteration.

    for(int i = 0; i < info.size(); i++) { cout << info.at(i).week << endl; cout << info.at(i).month << endl; cout << info.at(i).year << endl; cout << fixed << setprecision(2) << info.at(i).rating << endl; } 

    Anyone know how I can fix this?

    Also, if I'm not using pointers and haven't allocated dynamic memory, is it still possible to have memory leaks?

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

    [C++] Need some help filling out the beginning of this hpp file code

    Posted: 10 Feb 2018 11:28 PM PST

    So the comments are the directions that indicate what I should fill in. For the first section, the constructor, i put C = new int [S](); SZ = S; For the destructor part I wrote delete[] C;

    But when I compile it says that C and SZ are undeclared. I just need a bit of a push in the beginning of this header file and I'll be good. Thanks.

    class ordered_array { public: /* constructor Construct a new ordered_array with the given capacity (maximum size). The size of a new ordered_array should be 0. */ ordered_array(int cap); // destructor ~ordered_array(); /* size() Returns the size (number of elements in the array). */ int size(); 
    submitted by /u/AR96
    [link] [comments]

    Program that records user input - help

    Posted: 10 Feb 2018 07:14 PM PST

    I am trying to find information on how i would create a program or script that would allow me to record user inputs and then take a group of user inputs and run them one after the other. If anyone has any advice or even some resources where i could find out on my own it would be greatly appreciated

    Edit: I'm working with java for a mobile application on android devices, and I'm unsure how to record the user input and then set playback for the recording

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

    My first experience at a hackathon and lessons learned

    Posted: 10 Feb 2018 10:47 PM PST

    First, thanks for stopping by and reading/giving advice.

    I attended my first hack today after maybe 1 month of doing FCC, apparently some people were there from FCC too. I made it all the way down to the end of basic algorithims section and understood everything why it was done .

    The issue was, when it came down to make something at the hack, I couldn't. I didn't know how to use my JS knowledge of arrays, strings etc into a transferrable Android App. I didnt even know what software to use to write my stuff in cause I'm so used to writing code in the FCC browser terminal.

    Talked to a few friends and really tried to understand where I wanted to be. I want to make apps and or a chrome extension etc. I still think front end is where I want to go. Maybe just approach it differently.

    Im still debating if I should go to another hack in another 2 weeks. I'd love to hear about any parallel resources I should attempt on top of restarting FCC . This was a failure in terms of hack but a sucess to measure what I know and where to go next

    Thanks for reading

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

    Tips on becoming a better problem solver?

    Posted: 10 Feb 2018 04:48 PM PST

    Hey Reddit, I've been doing javascript practice problems on codewars and other places to prepare for an admissions test for the coding bootcamp I want to attend. However, it seems on some of the problems I get stuck and am lost, but when I look at the solution code, I understand it completely and just didn't know how to start. Is there anything you guys did to become a better problem solver? Critical thinker? Do I just have to do more and more practice problems until I develop it?

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

    What web technologies are used to make the popular ".io" browser games?

    Posted: 10 Feb 2018 04:47 PM PST

    I work with kids and they are crazy about these ".io" games.

    • Agar.io
    • Supersnake.io
    • mope.io

    What web technologies are being used to animate the game? I have seen them described as HTML5 games, but what does that entail? Are they using a JS framework, flash, unity, or some other organization that I am unaware of?

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

    trouble adding a package in MonoDevelop

    Posted: 10 Feb 2018 10:23 PM PST

    I am about to create a telegram bot and when to go to NuGet package manager and try to add the telegram.bot package it shows me an error and I don't know that this selected item caused the error if so how do I remove the selected reference.

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

    Controlling HDMI with ARM assembly

    Posted: 10 Feb 2018 05:06 PM PST

    I have done some work with FPGA programing to control a CRT and would like to try using ARM to drive a more modern display. I need help getting started with how to initialize the screen resolution and refresh rate as well a what to write into the frame buffer. I am working with a ADV7511KSTZ-P HDMI transmitter in a zynq 7000 microprocessor

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

    Udemy course for Java & Spring? I want to change careers from Front End to Backend

    Posted: 10 Feb 2018 05:57 AM PST

    Hi Reddit!

    I've been hired as Jr. Software Engineer for my company for about 8 months now. I had 0 JavaScript experience at first, and for those 8 months I've been working on a complex React app through mentor ship of my peers.

    I told my manager throughout the months I would like to eventually do backend work in Java. I haven't approached him again about it, but Im considering asking after I reach my 1 year of working.

    I would need to learn Spring, since that's what our backend is.

    Can I get advice on what practices and tools are essential for Java backends? My company is providing me with a free Udemy corse of my choosing so I would like to know a good one for this.

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

    No comments:

    Post a Comment