• Breaking News

    Sunday, December 10, 2017

    Learn JavaScript By Coding Flappy Bird And Snake Games. learn programming

    Learn JavaScript By Coding Flappy Bird And Snake Games. learn programming


    Learn JavaScript By Coding Flappy Bird And Snake Games.

    Posted: 10 Dec 2017 05:04 AM PST

    [C] Need help getting a function to return (x,y) coordinates to main

    Posted: 10 Dec 2017 09:11 PM PST

    Writing a program that uses several functions to calculate distances between points on a graph. I am having the hardest time ever trying to get a single function to prompt a user for the (x,y) coordinates.

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

    What are some ways to make a site using google material ui or bootstrap look a bit less generic?

    Posted: 10 Dec 2017 08:36 PM PST

    Lots of us are using the same ui-kits. Not the end of the world. But how does someone make their app look a bit less generic? Anyone have experience with this and care to share a couple lines of code/css?

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

    The Teach Yourself Computer Science community is live on Discord! Join us :D

    Posted: 10 Dec 2017 06:58 AM PST

    Hi everybody,

    Thanks a ton for the answers to my first post! I am so surprised and amazed by the responses I got!

    I am really happy to let you know that the community is now live on Discord. It has actually been live since yesterday but I was still wondering what was the best platform to build this. And I think this Discord is a clear winner. Why?

    1. It already has some traction (more than 130 people and counting)
    2. We won't be limited by the message history for the free plan like we would be on Slack

    You can join us by clicking on the following link: https://discordapp.com/invite/D29PZyd

    I have also already built a quick basic landing page on Carrd (https://jointeachyourselfcs.carrd.co/). Do you think we could / should post it in Product Hunt + Hacker News + other reddit channels to let people know about the community?! Please let me know what you think :)

    Could we also contact the people who manage this Subreddit to maybe be including in the side links?!

    Thanks /u/Warrax1776 for building this. Warrax is the admin of the Discord (he created it) and I am not so he will be the one managing it.

    Thanks a ton again to everybody!! I am super excited to learn with all of you! :)

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

    Code while fundraising for refugees!

    Posted: 10 Dec 2017 08:52 PM PST

    Check out http://go.flatironschool.com/code-drive-2017

    They donate $1 for each video lesson completed!

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

    [VisualBasic] [Help] Help with Radio Buttons and Checkboxes

    Posted: 10 Dec 2017 08:19 PM PST

    Hello I was wondering if anyone could help to tell me what I am doing wrong. So for my assignment I need to make it so that whenever you select a specific radio button on the left side of my form it changes the available options for add on items on the right side of my form. For my assignment it says to make one event handler to do this. Here is the exact line from the assignment

    "Code an event handler that changes the text that's displayed for the Add-ons group box and the three check boxes when the user selects a different main course. This event handler should also remove the check marks from the add-ons and clear the order totals. Test the application to be sure this works correctly."

    I cannot figure out why my code won't work. I have tried a few different things now. Any help would be very appreciated. Here is a screenshot of the form for reference and my code underneath that.

    https://imgur.com/a/l2PPG

    Private Sub ClearTexts() txtOrderTotal.Text = "" txtSubTotal.Text = "" txtTax.Text = "" End Sub Private Sub ClearChecks() chbBox1.Checked = False chbBox2.Checked = False chbBox3.Checked = False End Sub

    Private Sub grpAddon_TextChanged(sender As Object, e As EventArgs) Handles grpAddon.TextChanged

    If rbHamburger.Checked Then chbBox1.Text = "Lettuce, tomato, and onions" chbBox2.Text = "Ketchup, mustard, and mayo" chbBox3.Text = "French fries" ElseIf rbHamburger.Checked Then chbBox1.Text = "Pepperoni" chbBox2.Text = "Sausage" chbBox3.Text = "Olives" ElseIf rbHamburger.Checked Then chbBox1.Text = "Croutons" chbBox2.Text = "Bacon Bits" chbBox3.Text = "Bread Sticks" End If ClearTexts() ClearChecks() 

    End Sub

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

    Starter project. Need advice on which direction to go

    Posted: 10 Dec 2017 03:44 PM PST

    I want to build a sales listing tool that will save me time when listing items I have for sale on 2 different websites.

    Neither site has made their API public. (Donedeal.ie and adverts.ie) So I'm thinking a bot may help with this task.

    Each site does not have the same layout or field name. 1 lets ads stay for 90 days while the other expires every 30 days.

    I'm not sure if 1 or 2 bots are required based on the way each website is laid out.

    Can anyone point me in the best direction to start? Is a bot the answer or should I be looking at another solution.

    I've limited knowledge of java, html and css. I would like to use this project to increase my knowledge and automate a time draining task.

    Thanks in advance

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

    Trying to make a carousel with several thumbnails

    Posted: 10 Dec 2017 11:11 PM PST

    I am trying to write a code where in a single carousel i have several thumbnails, but.. everytime i try to it just looks ugly and does not look the way i want it to be. Want to make this kind of carousel. https://imgur.com/a/ZiU1J

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

    Trying to get good early on

    Posted: 10 Dec 2017 07:14 PM PST

    Hello, I am a 17 year old living in the US.

    I've been coding for a few years now, and I can do quite a bit, but I'm clearly not very good or refined in many things. I have to google almost everything. I can program just fine in a few languages (js, php, python) pretty comfortably (where I only have to look something up every few hours), but I want to become really good at SOMETHING before I go into my first real job, or even university. I just want to stand out from other self-taught developers, because I feel like time is ticking away.

    I don't know what direction to go in. Do I learn computer science topics? Do I try to learn more languages or focus a lot on one? Do I get involved in a lot of open source projects? I know a bit of version control, but I really want to learn more about the development process. I hear about things all the time like unit testing, and want to be ready to go into a job having a general idea of what it's like to work with a big team or a really complex environment. Linux interests me a lot, but I dont know it in depth at all, only enough to be considered an average user.

    The only actual experience I have is working with my dad's friend on a website, which im still doing. Its not anything really big, just some front end things.

    I guess when I think about a job for the future, I would love to do embedded stuff, or even high level things if its in something like haskell. I don't know too much about assembly or c, but I can't find any projects I really feel like getting involved in. Everything I find on github in c goes straight over my head, I can't find anything simple to start with. Maybe I just have this fantasy with doing low-level projects because I dont know much about it?

    I guess I just feel like its time that I set some time aside every day to focus on something to really make me stand out. I am not very interested in algorithms or any of that, which is why I am scared of going to university for computer science. I feel like it would be too much struggle (mathematically) for something that really does not interest me. I tried hackerrank but after 10 or 15 puzzles I felt like I was wasting my time and it got boring for me (also the puzzles were getting a bit too difficult)

    If you were in my position, or you are my age and think you can help, please give me some pointers. I don't have any specific person in real life or even online that I know I can ask questions to, and I feel pretty alone at learning this. This is on a throwaway account because I'm afraid I might be misunderstood or judged, since I'm not really a real programmer. Any comments are appreciated, and if I make any friends from this I can join any irc or discord, and of course give my real reddit account. Thank you all in advance, and super sorry if this post is misunderstood

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

    Design your own language for fun!

    Posted: 10 Dec 2017 11:52 AM PST

    Hello,

    I recently started designing my own language, and for anyone who didn't try it themselves, you're missing out on a lot. First, try to define the "report" or the standard (a text file), and then create a compiler / interpreter. It's really fun because you have total control over what you want to make it, and it stretches your mind to think differently than what you would normally think. Give it a try!

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

    Implementing tail call elimination/optimization help

    Posted: 10 Dec 2017 02:39 PM PST

    Currently creating a compiler for a subset of scheme like language, have a pass in which transform everything to CPS so its all in tail position by definition. What is the next step in implementing TCO? Thanks!

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

    Having serious trouble deciding which language to delve in to.

    Posted: 10 Dec 2017 10:09 PM PST

    I want to make video games one day, even though I highly lack the creativity to do so. I plan to do it on a team or something and just handle the coding, or something similar to that.

    I am semi-familiar with Unity so I know that I need C# to code on there. I'm not a total newbie when it comes to coding. I've started learning many different languages before. The problem is that I can't decide which one I really want to move forward in to. And every time get ready to study, this stops me.

    Basically what I am asking is what is an easier way for me to decide which one to use so that I can get in to some more advanced areas of coding and build my understanding of it?

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

    [MPI in C]: Problems with MPI_Allgather with 2D contiguous arrays

    Posted: 10 Dec 2017 09:57 PM PST

    Hello, I am trying to get MPI allgather to work for my problem. Here is the link to a representative code https://codeshare.io/alAAw8

    In this code, I am trying 2 procs only, so I have hardcoded some values, while I will be using more procs in my original code. I am trying to 1.)create a global array of randoms, 2.) broadcast it to the other processor, 3.) Get local arrays from global arrays, 4.) then multiply the local arrays by 10 5.) Send the local arrays to get the same global copy at all processors with allgather.

    I am trying this code out, but it doesnt work for me, the allgather part. Rest everything works perfect. I either get segmentation errors, or the arrays are just not right. Can someone help me? I do not want to convert the 2D arrays into 1D, and then send it, since practically I will be sending millions of elements on many processors, and I want to cut down on time as much as possible.

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

    Windows 7 batch files, variables and subdirs of parent dir.

    Posted: 10 Dec 2017 09:54 PM PST

    Win 7. I'm trying to set up a very old program (from XP days) via batch file for work. This line here seems to be causing my current issue:

    set A_HOME=%~dp0..\Software\A1 

    It produces the variable "C:\xyz\Build\..\Software\A1", but probably should be translating that to "C:\xyz\Software\A1". A_HOME is used later in the batch to get further sub-dirs, giving the error "The system cannot find the path specified." I think it's trying to find a folder literally called ".." It's really hard to get suitable google results for this particular issue. How can I fix this?

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

    I want to make a bit of cash while practicing, are there any ways of doing this without getting a job?

    Posted: 10 Dec 2017 08:53 PM PST

    I specifically want to work on my CSS and HTML, and I am in a bit of need for cash. I don't know enough JavaScript to work on that part of a website yet, but that's coming. What are my options?

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

    Python PLY issue with if-else and while statements

    Posted: 10 Dec 2017 08:50 PM PST

    if statements and while statement keep throwing syntax errors from p_error(p), and PLY tells me that there's a conflict at runtime. The issues are from the if-else and while statements because it was fine before adding them. Any help would be appreciated.

    If possible please don't change the implementation much even if it's in bad practice. I just want help understanding it I don't want a complete overhaul (that'd be plagiarism).

    import ply.lex as lex import ply.yacc as yacc # === Lexical tokens component === # List of possible token namesthat can be produced by the lexer # NAME: variable name, L/RPAREN: Left/Right Parenthesis tokens = ( 'NAME', 'NUMBER', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MODULO', 'EQUALS', 'LPAREN', 'RPAREN', 'IF', 'ELSE', 'WHILE', 'EQUAL', 'NOTEQ', 'LARGE', 'SMALL', 'LRGEQ', 'SMLEQ', ) # Regular expression rules for tokens format: t_<TOKEN> # Simple tokens: regex for literals +,-,*,/,%,=,(,) and variable names (alphanumeric) t_PLUS = r'\+' t_MINUS = r'-' t_TIMES = r'\*' t_DIVIDE = r'/' t_MODULO = r'%' t_EQUALS = r'=' t_LPAREN = r'\(' t_RPAREN = r'\)' t_NAME = r'[a-zA-Z_][a-zA-Z0-9_]*' t_IF = r'if' t_ELSE = r'else' t_WHILE = r'while' t_EQUAL = r'\=\=' t_NOTEQ = r'\!\=' t_LARGE = r'\>' t_SMALL = r'\<' t_LRGEQ = r'\>\=' t_SMLEQ = r'\<\=' # complex tokens # number token def t_NUMBER(t): r'\d+' # digit special character regex t.value = int(t.value) # convert str -> int return t # Ignored characters t_ignore = " \t" # spaces & tabs regex # newline character def t_newline(t): r'\n+' # newline special character regex t.lexer.lineno += t.value.count("\n") # increase current line number accordingly # error handling for invalid character def t_error(t): print("Illegal character '%s'" % t.value[0]) # print error message with causing character t.lexer.skip(1) # skip invalid character # Build the lexer lex.lex() # === Yacc parsing/grammar component === # Precedence & associative rules for the arithmetic operators # 1. Unary, right-associative minus. # 2. Binary, left-associative multiplication, division, and modulus # 3. Binary, left-associative addition and subtraction # Parenthesis precedence defined through the grammar precedence = ( ('left', 'PLUS', 'MINUS'), ('left', 'TIMES', 'DIVIDE', 'MODULO'), ('right', 'UMINUS'), ) # dictionary of names (for storing variables) names = {} # --- Grammar: # <statement> -> NAME = <expression> | <expression> # <expression> -> <expression> + <expression> # | <expression> - <expression> # | <expression> * <expression> # | <expression> / <expression> # | <expression> % <expression> # | - <expression> # | ( <expression> ) # | NUMBER # | NAME # --- # defined below using function definitions with format string/comment # followed by logic of changing state of engine # if statement def p_statement_if(p): '''statement : IF LPAREN comparison RPAREN statement | IF LPAREN comparison RPAREN statement ELSE statement''' if p[3]: p[0] = p[5] else: if p[7] is not None: p[0] = p[7] def p_statement_while(p): 'statement : WHILE LPAREN comparison RPAREN statement' while(p[3]): p[5]; # assignment statement: <statement> -> NAME = <expression> def p_statement_assign(p): 'statement : NAME EQUALS expression' names[p[1]] = p[3] # PLY engine syntax, p stores parser engine state # expression statement: <statement> -> <expression> def p_statement_expr(p): 'statement : expression' print(p[1]) # comparison def p_comparison_binop(p): '''comparison : expression EQUAL expression | expression NOTEQ expression | expression LARGE expression | expression SMALL expression | expression LRGEQ expression | expression SMLEQ expression''' if p[2] == '==': p[0] = p[1] == p[3] elif p[2] == '!=': p[0] = p[1] != p[3] elif p[2] == '>': p[0] = p[1] > p[3] elif p[2] == '<': p[0] = p[1] < p[3] elif p[2] == '>=': p[0] = p[1] >= p[3] elif p[2] == '<=': p[0] = p[1] <= p[3] # binary operator expression: <expression> -> <expression> + <expression> # | <expression> - <expression> # | <expression> * <expression> # | <expression> / <expression> # | <expression> % <expression> def p_expression_binop(p): '''expression : expression PLUS expression | expression MINUS expression | expression TIMES expression | expression DIVIDE expression | expression MODULO expression''' if p[2] == '+': p[0] = p[1] + p[3] elif p[2] == '-': p[0] = p[1] - p[3] elif p[2] == '*': p[0] = p[1] * p[3] elif p[2] == '/': p[0] = p[1] / p[3] elif p[2] == '%': p[0] = p[1] % p[3] # unary minus operator expression: <expression> -> - <expression> def p_expression_uminus(p): 'expression : MINUS expression %prec UMINUS' p[0] = -p[2] # parenthesis group expression: <expression> -> ( <expression> ) def p_expression_group(p): 'expression : LPAREN expression RPAREN' p[0] = p[2] # number literal expression: <expression> -> NUMBER def p_expression_number(p): 'expression : NUMBER' p[0] = p[1] # variable name literal expression: <expression> -> NAME def p_expression_name(p): 'expression : NAME' # attempt to lookup variable in current dictionary, throw error if not found try: p[0] = names[p[1]] except LookupError: print("Undefined name '%s'" % p[1]) p[0] = 0 # handle parsing errors def p_error(p): print("Syntax error at '%s'" % p.value) # build parser yacc.yacc() # start interpreter and accept input using commandline/console while True: try: s = input('calc > ') # get user input. use raw_input() on Python 2 except EOFError: break yacc.parse(s) # parse user input string 
    submitted by /u/bbpgrs
    [link] [comments]

    Where can I find examples of design patterns in an actual software development?

    Posted: 10 Dec 2017 01:09 PM PST

    I'm just done with animals and stuff, when i'm trying to understand design patterns I just couldn't see the bigger picture and completely leaves me blank.

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

    What should I prioritize learning next for this project?

    Posted: 10 Dec 2017 08:36 PM PST

    Tl;dr helping mother update her sites that look like they're from the year 2000 (some of them are). What do I prioritize learning? (Already have a grasp on html and css)

    So I know html and css (not everything, but you never really stop learning with this do you?). I will continue practicing those and am going to be starting in on Javascript next. However, I've found myself in a fortunate situation. My mother does a fair bit of volunteer work for USgenWeb (genealogy type stuff) and I asked her about helping her update some of the sites she helps run. So what are the most expedient things I should learn to do a good job with this? I'll be using this to learn on a real project to get some experience so I can try learn enough to do this full time

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

    [Python][Kivy] The default size of a widget is 100, 100. This isn't the case when using the 'canvas' inside of a .kv file, how come?

    Posted: 10 Dec 2017 08:34 PM PST

    Let's say I have a .kv file here:

    <Widget> canvas: Rectangle: pos: self.center_x - 5, 0 size: 10, self.height 

    This will display a line that is 10 pixels wide going from the bottom of the screen to the top of the screen. Shouldn't it be 100 pixels in height by default though? Why is the height of the rectangle the same height as the screen and not 100 pixels?

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

    question about threads/tasks/elixir spawn

    Posted: 10 Dec 2017 08:21 PM PST

    so. in programming. is it faster to run a function 3 times in a loop. or call 3 threads to run the function. im not worried about resources, i know threads take up plenty.

    and as an example of just some made up code

    fun hello{

    print "hello" }

    would it be faster to call it 3 times

    hello; hello; hello;

    or instead three threads

    thread(hello); x3

    u/pacificmint is the man

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

    I need help finding highest slope value from list of numbers.

    Posted: 10 Dec 2017 08:13 PM PST

    I am trying to figure out how to determine the maximum/highest slope value when I have data in the format below. Columns 2 and 3 are X and Y coordinates, respectively. Basically I want to compute each pair and find the highest possible slope. So I would try with pairs 1 and 2, then 1 and 3, then 1 and 4 and then 2 and 3, and so forth. As a side note I am trying to code this function in Perl but any kind of direction or pseudo code should be helpful.

    Data Format:

    POINT1 6.3 -7.2

    POINT2 -5.6 -2.4

    POINT3 2.1 7.8

    POINT4 5.2 1.4

    The Slope formula is (y2-y1)/(x2-x1). I am having trouble figuring out how I can put each X and Y per line in variables and then grab the next pair and do the computation and keep comparing until I get the highest value. I hope this makes sense and any help is highly appreciated!

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

    C++ while Loops using a string

    Posted: 10 Dec 2017 08:01 PM PST

    I want this to check if a name has been entered yet I don't want to write 100000000 cust_name != tim cust_name != phil cust_name != xena cust_name != Billy Joe


    cout << "Enter Name or use ctrl z to exit: "; getline(cin, cust_name); while ( cust_name != ) { cin.ignore(80, '\n'); cout << "please re-enter name or use ctrl z to exit "; cin >> cust_name; getline(cin, cust_name); }

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

    Need help knowing what to research

    Posted: 10 Dec 2017 07:51 PM PST

    I'm a student that's finished his first semester of csci and I wanted to start a small side project during break. Keep in mind that I'm still a beginner and the only language that we've used is c++ so I would hope to accomplish this side project with c++. If that's not possible then it's okay, I don't mind attempting to learn another language for this.

    So here is what I have in mind, I want to build something that allows me to click an image (like a button) and this image would be grayed out or it would have a lower opacity and when i click on it, it would gain it's original colors back or it would gain 100% opacity (fully visible is 100% right?). So hopefully this is simple enough for me to take on but I have no idea what to research to accomplish this! I don't know how to create a button, I don't know how to incorporate an image at all (the only thing we've incorporated is a text file to read and write to using the fstream library), I don't know how to turn it into a .exe where i can click it and have it work instead of my code being interactive only after I compile it (although I think I'll be able to google this), I don't know how to create a background (if I need to do that). I was hoping somebody could help me by pointing me in the right direction for what to research or do you guys think that since I don't know how to start that the project might be too complicated for me still?

    Thank you all for reading and hopefully this made sense.

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

    How to make tour only happen on first load

    Posted: 10 Dec 2017 07:40 PM PST

    I am planning to follow this guide to add in a virtual tour of my site.

    I am using node.js and express for the backend. How do I make sure the user only sees this tour the first time they log into the site then never again?

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

    No comments:

    Post a Comment