Where can I go if I get stuck when writing code? Ask Programming |
- Where can I go if I get stuck when writing code?
- Approach to a new codebase
- Intro to Programming Battleship game help (c++)
- [JS] Calculate play time at 1.5x speed
- Reset Array in C
- Programming in R - for a Data Journalist path
- How to communicate processes internally in a system with different languages?
- A screen-color reader
- Trying to build a simple run length encoder in java, but Processing says I'm recurring too much
- A program in python that reads a sequence of values from the user and displays a bar chart of the values.
- NBA clinch/eliminated algorithm (R)
- An object reference is required for non-static field, method, or property
- How does n-way set associativity work for cache address translation?
- How do I install PostgreSQL on Ubuntu Server in VirtualBox and connect via pgAdmin from windows
- Putty help
- How do I use external files in Robot Framework(Pycharm)
- Other than HTML & CSS, what programming languages are present within this website
- How would you create this movie-actors database?
- In Javascript, how is a switch statement executed? Is it random, or in order? Is it better to put more likely scenarios at the start. rather than at the end?
- Is it possible to make a userspace driver for everything?
- I really need help in computer science in python
- I really need help in a computer science program in python.
Where can I go if I get stuck when writing code? Posted: 25 Nov 2019 05:42 PM PST Those of u telling me. I am not talking about small projects but rather class assignments where there is like a 100 tests u have to pass. Like how do you know where u went wrong or what u have to do. I know asking stack overflow but that's for your own personal projects. Like the code runs fine but it doesn't pass the tests the prof created so.... maybe I need to use a debugger?? [link] [comments] | |||||||||||||||
Posted: 25 Nov 2019 10:44 AM PST Hi programmers. What is your approach to a new codebase. Can you guys comment your tips for a learning a new codebase or an open source project. [link] [comments] | |||||||||||||||
Intro to Programming Battleship game help (c++) Posted: 25 Nov 2019 06:42 PM PST I'm having a bit of trouble with Srand. I have a function set to generate a random number based on system time, which is working fine. I call the function and assign the value to coorOne. The first time through, it works perfectly fine. The second time around, either it generates the same random number or it doesn't generate a new one. I'm at a loss as to how to rectify this, short of calling a new srand function every single time. Github link to the code is below. The functions in question are lines 132-182. https://github.com/Lamora-lies/Battleship-/pull/1/commits/28d6e9d9237a5f6bef089a8ef5720129655b9a9e [link] [comments] | |||||||||||||||
[JS] Calculate play time at 1.5x speed Posted: 25 Nov 2019 08:50 PM PST Hello, I watch all my videos at 1.5 speed because why not. I find that I always wonder what the real playback time of that 23:44 clip is. Could someone suggest the logic I could use in JavaScript to make something like that? [link] [comments] | |||||||||||||||
Posted: 25 Nov 2019 01:02 PM PST Say you have a pointer to an int array on the heap in C. It's full of data and you want to set the value at every index to 0. Would it be faster to loop over every index and set it to 0, or to free the memory and call calloc? Or is there another, faster method? Would it depend on the size of the array? [link] [comments] | |||||||||||||||
Programming in R - for a Data Journalist path Posted: 25 Nov 2019 10:41 AM PST Hi, I study media. And I have this class in Text Analysis. I need input on this. [link] [comments] | |||||||||||||||
How to communicate processes internally in a system with different languages? Posted: 25 Nov 2019 03:00 AM PST I have a service in Python, some others in Ruby and another in NodeJS. I want them to exchange data fast and develop it fast and easy, as it's a side project running on a RPI. Which is some proper way to make them communicate? I know there are lots of solutions e.g. files or expose an API for each one (REST) but I need an expert opinion. A protocol maybe like IPC ? Or sockets/websockets? Data can be JSON or simple text. The app uses different kinds of scanner to navigate a local network. What do you think? [link] [comments] | |||||||||||||||
Posted: 25 Nov 2019 06:51 PM PST Hello. I want to make a program that views a part of the screen (in my case the right bottom 200x200 pixels) and analyzes different color changes within that area. I want to use this as a notifier for when a enemy pops up on the minimap. I'm a novice in computer programming. I have spent about 10 hours in C++ and 20 hours in Python 3, do you guys have any tips for starting points on this program, or tell me if im trying to do something waaay out of my skill level? [link] [comments] | |||||||||||||||
Trying to build a simple run length encoder in java, but Processing says I'm recurring too much Posted: 25 Nov 2019 02:24 PM PST It works when the input's something simple like ffff, but breaks when it's something like ffffcccc. Any ideas? Edit: think I formatted it correctly this time, and managed to make some changes so it doesn't blow up the stack, but for the aforementioned input I'm only getting f4. Edit 2: reddit is undoing my indentation how do I get around that Amended code here: https://pastebin.com/Ns0UsYu8 [link] [comments] | |||||||||||||||
Posted: 25 Nov 2019 05:39 PM PST I just really don't know why this problem is stumping me so hard. This is what I have so far.
"Assume that all values are positive. First figure out the maximum value. That value's bar should be drawn with 40 asterisks. Shorter bars should use proportionately less asterisks. " My code right now outputs 40 asterisks for every line, I don't know where to go from here, any help/advice would be nice. [link] [comments] | |||||||||||||||
NBA clinch/eliminated algorithm (R) Posted: 25 Nov 2019 02:54 PM PST I have a data set for the 1983-84, 1984-85, and 1989-90 NBA seasons. For each team, there is an observation for every game that the team played. Each observation includes:
(so each game has 2 observations, one for each team) I would like to create two new boolean variables for each observation: "clinch" and "elim". Clinch is true for an observation if the team had clinched a playoff spot by the date of the game. A team has clinched a playoff spot if and only if the following could occur and the team would still get a playoff spot. (to get a playoff spot, a team must be in the top 8 in its conference in terms of win percentage at the end of the season):
If both of these could occur and the team of interest would still have a playoff spot, then the team of interest has clinched a playoff spot. Elim is true for an observation if the team had been eliminated from the playoffs by the date of the game. A team has been eliminated from the playoffs if and only if the following could occur and the team would still not get a playoff spot.
If both of these could occur and the team of interest would still not have a playoff spot, then the team of interest has been eliminated from the playoffs. I'm not even sure where to start here. Any help would be great! Or even a source with the clinch and elim data pre-made. [link] [comments] | |||||||||||||||
An object reference is required for non-static field, method, or property Posted: 25 Nov 2019 02:51 PM PST So I need to make a memory calculator for my class and I'm running into a snag. All the processes for the memory calculator are put into their own class in a separate cs file. I need to change the textbox on a different file but I'm not sure what's keeping me from doing that. This is the code that handles the GUI And this is the memory [link] [comments] | |||||||||||||||
How does n-way set associativity work for cache address translation? Posted: 25 Nov 2019 07:12 AM PST I have this project where I need to simulate a cache. I understand how a direct mapped cache works, but am having trouble with set associativity. For example, our professor gave us the following input: sets:256 set_size:4 line_size:4 W:160 R: 430 Then, for a 256 4-way set associative entries of line size 4 bytes, the output should look like:
I'm confused as to how the tag / index / offset is calculated. I.e., How is a tag of 0, an index of 88, and an offset of 0 calculated for address 160? I've watched many videos on how the cache works and everything, but I can't figure out how to actually translate these addresses. The set associative stuff is really throwing me off. Our professor gave us this project that's due on saturday, but we're already on thanksgiving break so we can't ask him to help. And stackoverflow couldn't help either, so I'm at my last resort. If anyone could point me in the right direction I'd really appreciate it. Thank you. [link] [comments] | |||||||||||||||
How do I install PostgreSQL on Ubuntu Server in VirtualBox and connect via pgAdmin from windows Posted: 25 Nov 2019 12:41 PM PST I'm very new into setting up servers and working with database connections (except localhost). I followed this tutorial and installed it on VirtualBox. I was also able to connect to the server with putty on my windows machine. But when I want to connect to it via pgAdmin, I have no idea which things I need to fill out to connect successfully. Here are the pictures of what I need to fill out in pgAdmin to connect to a server: https://imgur.com/a/CbgXdT8 I know maybe it is a silly question, but I am not that good in programming and I just started to get into PostgreSQL and whenever I google things it feels like no site can really answer my question. [link] [comments] | |||||||||||||||
Posted: 25 Nov 2019 10:18 AM PST I'm used to using my schools IP however now I can't what should I do? [link] [comments] | |||||||||||||||
How do I use external files in Robot Framework(Pycharm) Posted: 25 Nov 2019 08:45 AM PST Absolutely no matter what I do to try to point one robot file to another it never finds it, what is the general syntax for "resource" ? I see people mentioning that ../ is to go up a directory, I see people mentioning that it is just added to the start of every path since an update, I have no clue, I've spent 2 hours trying to get basic functionality going and I've found no documentation on it. Help me out of my stupidity-induced misery, pleaseExample tree: /// Resources --Folder1 ----Resource file1 --Resource file2 Tests --Test File /// If I want to load resource files 1 and 2 in the test file, what exact syntax do I use? [link] [comments] | |||||||||||||||
Other than HTML & CSS, what programming languages are present within this website Posted: 25 Nov 2019 05:58 AM PST It is quite interactive, which makes me wonder what is at play. I have gone into 'inspect element' but can't seem to find the exact code that makes the website interactive. Programming is awesome ! [link] [comments] | |||||||||||||||
How would you create this movie-actors database? Posted: 25 Nov 2019 02:08 AM PST I got asked to make this dB on an interview and still can't come up with an answer. Basically, the dB has 2 points of data - movies and actors. Each movie has several actors and each actor can have several movies. How would you prepare a dB showing these relations such that you can find all movies given an actor and all actors given a movie? Keep in mind each movie can have varying number of actors! Tbh I neglected databases all this time, thinking CRUD is all I'd need for a junior role but now I think I need to know more about dbs as well. Sorry for any mistakes, am on Mobile and Thanks for your time! [link] [comments] | |||||||||||||||
Posted: 25 Nov 2019 04:39 AM PST Hello! I am interested specifically in javascript (and perhaps PHP and SQL if they have switch statements), but I kind of suspect that this would be rather universal. I always thought, and it was logical to me, that if I put the more likely scenario as case 1, that the switch would be executed sooner. This failed miserably when I tried to test a switch in javascript with the first case being true, and then the last case of 50 being true, and this all being looped about 100 k times, timing it with the google command timer, and the times were all roughly equal, with the scenario where the first case was true being slightly worse.
TnX! :) [link] [comments] | |||||||||||||||
Is it possible to make a userspace driver for everything? Posted: 25 Nov 2019 03:52 AM PST If not userspace drivers can be made for what kind of materials? [link] [comments] | |||||||||||||||
I really need help in computer science in python Posted: 25 Nov 2019 01:43 AM PST and please don't just tell only tell me the code. I'm trying to do this the right way and understand this without taking shortcuts. I'm mainly concerned with the def readstockprice function right now. I'm importing text files and which becomes contents and trying to split the contents list into a new dictionary where items in the text file are the keys and quantity of the items in the text value are the values. I'll post the entire code so you have some context. def printstockprice(stock,price): def readstockprice(itemsfilename, stock, price): def main(): # reading filenames from user # dictionary variables # reading stock & price from file # displaying stock & price after reading # processing order and printing sale detail # displaying stock & price after sale # update stock & price after sale # displaying stock & price after update [link] [comments] | |||||||||||||||
I really need help in a computer science program in python. Posted: 25 Nov 2019 12:34 AM PST It has to do with lists, files, and dictionaries. Just really having trouble iterating through the dictionary list and splitting it to get what I want. Pls dm and help me. Thank you [link] [comments] |
You are subscribed to email updates from AskProgramming. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment