• Breaking News

    Monday, November 30, 2020

    My video lectures on c++ (self promotion, disclosure I am university professor) learn programming

    My video lectures on c++ (self promotion, disclosure I am university professor) learn programming


    My video lectures on c++ (self promotion, disclosure I am university professor)

    Posted: 29 Nov 2020 04:49 PM PST

    Hi everyone, I stumbled here and thought I'd share this. I am a university asst. professor at the University of Nevada, Las Vegas. Here is a link to my profile there: https://www.unlv.edu/people/jorge-fonseca-cacho

    Anyway with remote learning I have been streaming my lectures on twitch but also saving the recordings to Youtube. I have a few classes from the Summer sessions there: Specifically CS 135 and CS 202 which are our first 2 classes for CS majors (C++ basics and then OOP and Linked Lists). For the CS 202 I now have summer and then this semester fall which I have 2 more classes to record. I also have CS 302 (have second half in spring, but I am also teaching it in fall so full class will be there after next week) which is our data structure course but that is mostly conceptual and not programming,

    Here is the playlist link: https://www.youtube.com/c/LeSniperJF1/playlists?view=50&sort=dd&shelf_id=4

    I will be humble and say if you're trying to learn C++ there are probably better and more compressed resources out there ( I personally like Derek Banas: https://www.youtube.com/watch?v=Rub-JsjMhWY ) but at the same time there is some merit if you want to go at a slower pace I guess or see what a university course is like. Also I probably will be teaching the OOP course again in spring 2021 so you could in theory watch along on twitch since it's public and that I think may be cool for those who are unmotivated to watch something that isn't live.

    Anyway I am not really looking for anything but am honestly just sharing in case I can help anyone.

    I read the self promotion rules and hope that this is okay, anyway I wish you all a great day :)

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

    What are some fun programming YouTube channels to watch?

    Posted: 29 Nov 2020 04:23 AM PST

    What are some fun programming YouTube channels to watch?

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

    Can someone excel at programming even though he/she's not good at math?

    Posted: 29 Nov 2020 04:43 PM PST

    Newbie in programming here with no CS backgound. I've been watching CS50 lectures these days, but one thing that's bothering me is if I can excel at it if I only have average math skills.

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

    Best place to learn C++ online

    Posted: 29 Nov 2020 02:14 PM PST

    I don't currently have the time to go back to school physically so I am trying to find the best way to learn C++ online. I am about halfway through the free course on udemy.com and trying to figure out where to go next

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

    Books and courses for improving logical thinking and reasoning for coding challenges

    Posted: 29 Nov 2020 10:49 PM PST

    I would like to know some books and resources where I can improve mu logical reasoning by practicing problems.

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

    hey im 11 years old and i need help

    Posted: 30 Nov 2020 12:02 AM PST

    hello i am 11 and just started programming or at least learning to program i just wanna know what do i write to open a file then add something into the file without having to write the values into the command line

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

    Example of solving bad algorithm complexity with Maths

    Posted: 29 Nov 2020 10:04 AM PST

    /* The followings functions count how many rectangles you can fit inside a grid For instance: within a 2 by 2 grid, you can fit 9 rectangles +---+---+ +---+---+ +-------+ +---+---+ | 1 | 2 | | | | | 7 | | | +---+---+ | 5 | 6 | +-------+ | 9 | | 3 | 4 | | | | | 8 | | | +---+---+ +---+---+ +-------+ +---+---+ */ const slow_rectInGrid = (Y, X) => { let res = 0 for (let y = 1 ; y <= Y ; y++) { for (let x = 1 ; x <= X ; x++) { for (let j = y ; j <= Y ; j++) { for (let i = x ; i <= X ; i++) { res++ } } } } return res } const fast_rectInGrid = (Y, X) => (Y * X * (X + 1) * (Y + 1)) / 4 // for a 10x10 grid, the result is 3025 slow_rectInGrid(10, 10) // 2.635ms fast_rectInGrid(10, 10) // 0.080ms slow_rectInGrid(500, 500) // 18497.199ms fast_rectInGrid(500, 500) // 0.062ms 
    submitted by /u/joeyrogues
    [link] [comments]

    My boss has asked me to code an app for both iOS and Android.

    Posted: 29 Nov 2020 02:10 PM PST

    But I'm not sure where to start, could someone point me in the right direction?

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

    Developer Experience: Which ISO 3166 country code type should you use for filtering posts by country?

    Posted: 29 Nov 2020 06:48 PM PST

    I am building a clone of eBay and would like to add a filter for country by adding a country code to each item.

    I didn't realize there were so many options. Of course there is the country name spelt out completely in English, but that takes up a lot of space and is much longer than the alpha-2/3 codes.

    There's also the numeric codes which is nice because they are language agnostic, but those have downsides too.

    Which would you choose in my situation for the best developer experience?

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

    Learning Java GUI programming?

    Posted: 30 Nov 2020 12:40 AM PST

    For building a Java based desktop app, should i learn JavaFx or Swing or is there any other third party framework/library that i'm unaware of?

    I currently have a good grasp of Java fundamentals and minor experience in making Simple GUIs with Swing.

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

    How much to test on acceptance/integration level when doing TDD?

    Posted: 30 Nov 2020 12:32 AM PST

    I am trying to learn TDD and I have some questions on how much testing should be done on acceptance/integration/system level compared to only on unit level (And about testing the same thing on more than one level)

    For example, lets say I am building something that:

    Loads current state Calls an external API for updates of the state Saves the state again Based on the new state decides if you should be allowed to login (returns a boolean) Lets say that I have unit tests for the API itself, for reading and updating the state and for deciding if the login should be allowed based on the state.

    I don't know how much testing I should then be done on the acceptance level. From the top of my head all these things could be required:

    • Verify that login is allowed when starting with no state and getting an OK state from the API
    • Verify that login is NOT allowed when starting with no state and getting an NOT OK state from the API
    • Verify that login is allowed when starting with an OK state and the updated state is still allowing it
    • Verify that login is NOT allowed when starting with an OK state but getting to an NOT OK state based on the new info from the API (And this could happen in different ways based on the response from the external API)
    • Verify that login is allowed when starting in a NOT OK state that is changed based on the information from the API.

    Basically, I don't know how to start from the business spec that "If you have a valid state based on the information in our system and the external system you should be allowed o login"

    How do I write Acceptance Tests (or system/integration tests) and Unit Tests to drive this? I feel like I need a different acceptance test for every possible different input?

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

    How to make a videoplayer that display embedded subtitles

    Posted: 29 Nov 2020 11:53 PM PST

    This may be a wierd questions but well idk what to do anymore For the past 2 days i have been trying to make a videoplayer in react native(Android only) , I need the player to be able to show subtitles. All the libraries only show how to display external subtitles, so I have been thinking that maybe i have to extract the subtitles first and then display them.

    Or what should i do? How vlc works? How videoplayers work?

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

    I need help with a javascript project which involves context menus

    Posted: 29 Nov 2020 11:29 PM PST

    Everytime i create an element i also create a context menu along with it but for some reason the context menu shows up in front of the first element(which is what i need) but shows up behind all other elements that i create on a page (what i dont want) please halp.

    var sources = document.getElementById("sourceList").getElementsByTagName("a"); //Sources list retrieval function windowProperties(containment, x, y, width, height) { //New Window Style and jQuery Functions $(containment).append( '<div class="windows" id="window' + divCount + '"><p id="windowName' + divCount + '"></p><p id="para' + divCount + '">Source</p></div>' ); var nWindow = document.getElementById("window" + divCount); var paragraph = document.getElementById("para" + divCount); var windowName = document.getElementById("windowName" + divCount); //Conntext menu creation.. $(nWindow).append( '<div id="menu"><a href="#">Bring Forward</a><a href="#">Send Backward</a><hr /><a href="#">Delete Window </a></div>' ); var i = document.getElementById("menu").style; if (nWindow.addEventListener) { nWindow.addEventListener( "contextmenu", function(e) { var posX = e.clientX; var posY = e.clientY; menu(posX, posY); e.preventDefault(); }, false ); document.addEventListener( "click", function(e) { i.opacity = "0"; setTimeout(function() { i.visibility = "hidden"; }, 501); }, false ); } function menu(x, y) { i.top = y + "px"; i.left = x + "px"; i.visibility = "visible"; i.opacity = "1"; } paragraph.style.color = "black"; paragraph.style.fontSize = "20px"; paragraph.style.fontWeight = "bold"; paragraph.style.padding = "20px"; paragraph.style.textAlign = "center"; windowName.style.color = "black"; windowName.style.fontSize = "20px"; windowName.style.fontWeight = "bold"; windowName.style.padding = "10px"; windowName.style.textAlign = "center"; windowName.innerHTML = "Window " + divCount; nWindow.style.width = currentWidth + "px"; //680 nWindow.style.position = "absolute"; nWindow.style.height = currentHeight + "px"; //294.75 nWindow.style.opacity = "0.5"; nWindow.style.background = "#f8f8f8"; nWindow.style.border = "2px solid Black"; nWindow.style.zIndex = "200"; nWindow.style.top = currentY + "px"; nWindow.style.left = currentX + "px"; $(function() { var x, y; $.fn.getPosition = function() { var results = $(this).position(); results.right = results.left + $(this).width(); results.bottom = results.top + $(this).height(); return results; }; $(nWindow).resizable({ maxWidth: 1356, maxHeight: 585.5, grid: [3, 4], aspectRatio: true }); $(nWindow).draggable({ cursor: "move", snapTolerance: "20", snap: nWindow, containment: container, stop: function(e, ui) { console.log($(this).attr("id"), $(this).getPosition()); } }); $(sources).draggable({ cursor: "pointer", helper: "clone", appendTo: nWindow }); $(nWindow).droppable({ activeClass: "ui-state-default", hoverClass: "ui-state-hover", accept: sources, drop: function(event, ui) { $(paragraph) .text(ui.draggable.text()) .appendTo(nWindow); console.log(nWindow); } }); }); } 
    submitted by /u/BruhNeedsHelpinCOde
    [link] [comments]

    ARM Assembly Fibonacci Number

    Posted: 29 Nov 2020 11:08 PM PST

    Background:

    Write an Assembly language program computing the Fibonacci number of the specified order, n.

    The Fibonacci number of order n is F(n) = F(n-1)+F(n-2). Let us assume that F(0) = 0, F(1) = 1. Your code should return the value of F(n) for a specified (stored in a dedicated register) n. F(0) and F(1) are constants stored in registers. Use the "conditional approach". I am doing this on a Raspberry Pi, using the terminal to display output.

    I do not know why R10 is set to 10, that's just what I have seen to compute F(10).

    .global main main: MOV R10, #10 MOV R1, #0 MOV R2, #1 fib: ADD R3, R1, R2 MOV R1, R2 MOV R2, R3 SUB R10, R10 #1 BEQ end BAL fib end: bx lr 

    This is obviously not working correctly and do not know what to do.

    This is how I am seeing output:

    Create file at pi:\

    as -o program.o program .s

    gcc -o program program.o

    ./program ; echo $?

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

    How to make a graph from a list[float] in Python? Need help with a project for a class.

    Posted: 29 Nov 2020 10:45 PM PST

    My CS class requires the creation of a project that produces a graph as the output. My specific project takes a csv file as input. The read function filters it down to the three things that are required: the government type of a country (an enumeration), unemployment rate and GDP. I need to take a government type as an input and have it return a graph (unemployment rate on Y-axis and GDP on X-axis).

    I was able to create functions for filtering the list that contains these three into two individual lists of floats (one for unemployment rate and the other for gdp). How do I take these lists as input for a Python line graph? The graphing program we use is matplotlib.pyplot .

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

    Python help with Class/Subclass/lists/OoP

    Posted: 29 Nov 2020 09:59 PM PST

    Ayyyy so my professor would like me to create a class and subclass, as shown in the link. But for some reason, no matter what I do, I can't make my list work at the end of my code (last block of code). It keeps returning a weird, unreadable math function. (Like car = x . 0182739812) Can anyone help me just make the list readable?

    https://pastebin.com/FSUZfWqi

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

    Best language to make a competitively fast program to send requests to a website?

    Posted: 29 Nov 2020 09:53 PM PST

    I need to write a program using requests to be as fast as humanly possible. I understand the performance bottleneck will mainly be making the actual request itself (can this be sped up in any way?) but any bit of overhead I can remove will help the cause. I am a python developer and have developed extensive programs using the python requests library in the past. I believe java and c# also have requests libraries, but I am not sure about C/C++. I am comfortable learning a language I am not familiar with so I am open to any language best fit for the job.

    PS. This is NOT a blackhat program. This is for competition and will be used on a test website. Running all competitors' scripts at the same time, the first to make the request will be the winner.

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

    What’s a good, relatively simple framework for building a SaaS web app?

    Posted: 29 Nov 2020 09:52 PM PST

    I have some code that I'd basically like to build a web interface around, similar to if it was running like a SaaS on the web. What's a good option to look into?

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

    Free Bootcamp in NYC or Fellowship Program?

    Posted: 29 Nov 2020 11:06 AM PST

    Is there any free Bootcamp or fellowship program either in NYC or Silicon Valley that you know of or recommend? For instance, FullStack Academy has one but not accepting right at the moment. Do you guys know of any other ones?

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

    How to prepare for hackathons?

    Posted: 29 Nov 2020 09:20 PM PST

    Hey guys, so I am a CS undergrad currently in my second year and have been meaning to participate in a hackathon. But I don't really have any knowledge about how to prepare for such things. I have been practicing Data structures and algorithms for a while and am can solve problems in leetcode. I also know a bit of java,c++,c, and python. Besides that, I know a bit of HTML, CSS, and oop concepts. I am literally terrified of timed contests, so I hesitate a lot before participating in similar ones but want to get over my fear of such events and underperforming. So can you guys suggest any online hackathons for practicing for such events or what/how I should prepare for the same?

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

    C# Multiplication table, incrementing the header appropriately. Homework help.

    Posted: 29 Nov 2020 09:10 PM PST

    Hi there, I am sure there is a very obvious solution that I am just not seeing, but any help is appreciated...

    This table is the end goal: (but output into the console, not an actual table)

    N N*10 N*100 N*1000
    1 10 100 1000
    2 20 200 2000
    3 30 300 3000
    4 40 400 4000
    5 50 500 5000

    Here is the code in C# that I currently have...

    https://repl.it/join/karerrbm-steamscript

    I know my issue lies in:

    if (i == 0) Console.Write((i + 10) * 10 + "*N" + "\t");

    But I am not sure how to increment the header without adding another loop (and maybe that is indeed the solution, I am not sure...)

    I have no specific 'musts' on this assignment other than to output the chart above using loops.

    Currently my header row outputs [ N, N*100, N*100, N*100 ] instead of exponentiating* by another 10 each time. [\correction]*

    If you take a peek at my code, I am sure there is a more condensed way of doing it, using switch statements or something similar, however, I am new to object-oriented programming and this was similar to my textbook example... please feel free to suggest improvements.

    Thanks for any assistance!

    [UPDATE]

    I have solved my code, albeit very literally, but maybe I was overthinking the problem?

    Here is the solution I came to:

    https://repl.it/join/htjbocxd-steamscript

    thanks u/canonicalansatz for the literal suggestion!

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

    What software patterns for a card game? (Hearthstone type)

    Posted: 29 Nov 2020 12:05 PM PST

    In computer science I have a module for software design patterns.

    Im doing an assignment that goes towards my final module grade and it's worth 30%. It's essentially a pitch for the game (that's sorta based on hearthstone, Yu-gi-oh, etc). It should include the general pitch, UML diagrams and chosen software design patterns.

    I know my patterns and what they do but I dont know which patterns I can use for a card game? I have some ideas but I don't know if it's a correct way of using it. (E.g: using flyweight for every card but certain attributes like damage and health change). Anyone can give me some advice?

    Appreciate it!

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

    Why I'm learning programming: right track?

    Posted: 29 Nov 2020 06:24 AM PST

    Tl;dr: is focusing on websites and web/mobile apps the right track for my goal of helping others realize(make real) their ideas?

    Computer Science is a huge world, ranging from network security to AI to hardware. I certainly see the value in generalist learning, but also see the need to specialize; you can't do everything!

    I'm starting to clarify what my goal is, and thus what my broad areas of practice will be. It might sound basic, but what I want is to help others find solutions to their goals -not in a "tech support" kind of way, but by building, realizing their ideas.

    This might sound too broad, but for the great majority of everyday users, what are the main things someone would want to build? Consider a small business, what would be most helpful? Probably an effective website and perhaps a mobile app / webapp. Really, these 2 areas would cover much of what everyday users require, imho. If a person has an idea or a need, whether it be to broadcast their expressions, market their business, or offer some service, wouldn't it ultimately come down to this? Perhaps someone would have a desktop application idea, but I understand web apps to have offline capabilities, so this is perhaps not a very important focus for my purposes.

    Do you think I'm on the right track? If my goal is to help others find solutions to their needs, not in a tech support way but by creating, helping to realize their idea, that I should focus on web dev and apps? When you boil it down, isn't that what would be most useful for most people's needs? And really, the boundary between apps and websites is not all that clear itself!

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

    No comments:

    Post a Comment