How do I access an array in one class from another? Ask Programming |
- How do I access an array in one class from another?
- How often do you leave an algorithm unoptimized?
- Is a on UDP implementation of a TCP-like behavior be better than simple and straight TCP socket?
- How do you return an int if you need to return it?
- How do i group the data on Django?
- Does unicode include symbols for specific businesses as in "adopt a character"? Cuz if it does I intend to drop unicode support for those characters.
- I am having a deplorable time trying to link this javascript file to my HTML and it's killing me.
- How would you rewrite this piece of code?
- How to use python subprocess Popen to open a psd(Photoshop template)?
- Netflix Recommendation Engine
- I need help to understand static members in python.
- Best place to do programming exercises?
- Sort an array
- I made an App! How do I get more users ?
- Any algorithm for detecting all cycles in a graph that are smaller than a given length?
- How to learn when reading a programming book?
- How do I fix this? Confused why mxmlc is even in the code
- Learning assistance
- How to check a text document for grammatical accuracy?
- Proposition to work in a new project with old technologies
- Is there any book that covers the topic "how to rank items in my app"?
- Places to look to find Distributed Optimization advice and/or techniques
- Editting Inspect Element HTML/JS/JQUERY/ETC to view Contact Email?
- Linked List getters and setters vs instance variables
How do I access an array in one class from another? Posted: 24 Dec 2020 10:23 AM PST I have a project where I have to create some kind of league table. So I have a class for the players with functions only the players can access such as register,login and to play a match. When a player has logged in it adds them to the player array. I also want to make a class for the admin, where the admin functions are stored where the admin functions can add or remove players. How would I go about doing this? I think it is done using the set and get functions but I don't fully understand them. I want to do something like setPlayer(0) = James, setPlayer(1) = jake. and when I use the get functions getPlayer(0) = James and getPlayer(1) = jake. [link] [comments] |
How often do you leave an algorithm unoptimized? Posted: 24 Dec 2020 02:40 PM PST This is probably a weird question but I wrote a quick function in one of our applications that finds the values in the first list that aren't present in the second list. I just used two nested loops because that was the simplest way. I thought about optimizing it, but the lists are never really going to be above length of like 5 elements because of the nature of the data. Also because of what this data represents, it will never need to handle larger lists. Knowing this, my plan was to just leave it alone and not optimize it. How often do you guys leave things unoptimized? I feel that this is often something people are afraid to do and maybe should be. But in this case, I'm completely ok with it. [link] [comments] |
Is a on UDP implementation of a TCP-like behavior be better than simple and straight TCP socket? Posted: 24 Dec 2020 04:59 PM PST Actually i have a lot of questions but i will start with this one I'm making a networking library because i want to learn how to do networking protocols for a game and do everything from nearly scratch is a lot better than copying and pasting someone elses code into your project The question is: I heard that TCP blocks everything and waits for the missing packet to arrive and until that it doesn't not want to know about anything else, and i also heard that the new http version it will get implemented over UDP instead so maybe is better a TCP kind of approach over UDP (i will end up using UDP anyway for other "packet types") I called my approach TCPly, basically every packet arrives and the program checks for "packet gaps" alias missing packets, if there are gaps it will be request the missing packet(s) via a different approach alias it will get request until arrived (also the other side knows how to handle these continuous requests correctly obv), while doing this other threads will keep to recieve packets and do other things But TCP is low level so might because of this is a lot more faster therefore efficient in comparison with of my C# application Side question: can multithreading cause more packet loss (deadlocks apart)? i'm talking about a single thread per client+two more for special functions like general serverwide tasks) [link] [comments] |
How do you return an int if you need to return it? Posted: 24 Dec 2020 07:19 PM PST I am on a CodeWars problem and I am stuck. It asks to declare any number above 5 to be declared as 1 and any number below 5 as 0. I first used parseInt to turn the string into an int and tried to return inside the an if statement. Now I am stuck. Please help [link] [comments] |
How do i group the data on Django? Posted: 24 Dec 2020 06:58 PM PST i have these 2 models i also created these serializer and then on the view, i try to get number_of_managed_cars by each manager using this way then i try to hit the endpoint: there's no number_of_managed_cars on the result. i followed this : https://docs.djangoproject.com/en/3.1/topics/db/aggregation/ still cant get the results right. where did i miss ? [link] [comments] |
Posted: 24 Dec 2020 06:33 PM PST https://home.unicode.org/adopt-a-character/about-adopt-a-character/ I intend to drop support, and actively block the display of, any character which does not occur in some language or form of communication and is instead certainly an attempt to inject advertising into our methods of communication. So far I am not aware any of that is happening, but this url may imply to look for it. [link] [comments] |
I am having a deplorable time trying to link this javascript file to my HTML and it's killing me. Posted: 24 Dec 2020 06:31 PM PST https://github.com/armanterrell7947/RPS-game Pardon my language, but I'm losing my fucking mind. I was working on this earlier and I was able to access all of my functions in my app.js file. NOW I CAN'T EVEN GET THE CONSOLE TO RECOGNIZE THE FUNCTION I legit don't know what happened. I was working on it earlier and it was fine, then I edited some code around, and now I can't see what computerPlay() would output! Which is SUPER SIMPLE, CHOOSING A RANDOM STRING FROM MY ARRAY I can't do this anymore. Everyone on the odinprojects discord keeps giving me run around answers, implying that I haven't looked everywhere to solve this. Rude AF sometimes. Anyways. I'm using VS Code and Live Server as well. I feel fucked -_- this is SO SIMPLE, and I've spent hours trying to figure out this problem with zero luck. [link] [comments] |
How would you rewrite this piece of code? Posted: 24 Dec 2020 06:10 PM PST The following is a snippet of python code: The goal of the function is to duplicate the top element of the stack. This implementation looks ugly to me so I am trying to think of a better way of writing this out. [link] [comments] |
How to use python subprocess Popen to open a psd(Photoshop template)? Posted: 24 Dec 2020 06:03 PM PST app = 'C:\\Users\\0\\Desktop\\tag-generator\\template.hfp\\Adobe Photoshop 2020\\photoshop.exe' file = 'C:\\Users\\0\\Downloads\\imageOutput\\720template.psd' pid = subprocess.Popen([app, file]).pid above code doesn't work Message=[WinError 2] The system cannot find the file specified *why Popen? Because I don't want the program to wait for photoshop's return [link] [comments] |
Posted: 24 Dec 2020 11:53 AM PST How does Netflix Recommendation engine actual work and how and where this Recommendation engine is stored? [link] [comments] |
I need help to understand static members in python. Posted: 24 Dec 2020 05:49 PM PST Hi all, My college is unfortunately forcing us to learn python, my background is in C#, python seems to logically not have static members, here's what I'm talking about: C# - https://pastebin.com/hEB7kiJJ Surely if I can change the value of dog.limbs then the member cannot be static as that member is not shared between all instances at that point. [link] [comments] |
Best place to do programming exercises? Posted: 23 Dec 2020 11:34 PM PST I recently started using the website edabit.com to stay fresh with python over break and my free trial just expired. I just took my first programming course over the fall semester so I am not an experienced programmer by any means. Are there any other websites like this? [link] [comments] |
Posted: 24 Dec 2020 03:28 PM PST Hello a friend of mine gave me a problem to write an algorithm that sorts an array from lowest to highest value, and i did it. Was a bit complex but i did it then i asked myself doesn't it look a bit complex because just to sort a 1d array i had to put like 3 for loops and i did some calculations and found out that it does x3 number of iterations before it has sorted the array and to me it kinda feels time consuming for a computer to do that many iterations just to sort an array and i googled and stumbled upon a dude's video about that problem(sorting an array it's this guy if anyone wants to watch his video) it was fairly simple and easy to understand it also kinda felt faster because it only has 1 while loop and 1 for loop don't know how many iterations is that but it sure is less than mine and i wanted to check is it really fast if yes then how much. Wrote the program twice one in my way and one in his, compiled both of them and surprisingly mine is faster by 0.006 seconds. Can anyone tell me why mine turns out to faster? I didn't changed the array elements nor their location. [link] [comments] |
I made an App! How do I get more users ? Posted: 24 Dec 2020 07:56 AM PST Hey everyone, I'm 17 and coded my own App. The first step is complete, the second step is to launch it and get some users. But as a 17 y/o I have no Idea how to get a lot or even a few users to my app. What would be a efficient way to get more users ? [link] [comments] |
Any algorithm for detecting all cycles in a graph that are smaller than a given length? Posted: 24 Dec 2020 02:40 AM PST Given that I have all nodes and edge lengths in a graph, I need to find all of the possible cycles starting (well, and ending) on a specific node. I can also set a maximum length so that each cycle that starts to be longer than this value can be discarded. Since I don't know much about graphs, I am having a bad time knowing how to look for it on the internet. Does anyone know any algorithm that matches what I need? PS.: even better if there's already a Python module :D Thanks a lot! [link] [comments] |
How to learn when reading a programming book? Posted: 24 Dec 2020 09:54 AM PST I started reading some books about programming but didn't finish them. Because of the problem which I want, I am not able to find them. I like to learn from books but when working with projects, should I read the complete book to solve that problem if I am not sure what is missing? The Specific solution to a problem is not available all the time online. Another thing is that before making a project every book can't be memorized. It can only possible when someone faces the problem and finds its solution. [link] [comments] |
How do I fix this? Confused why mxmlc is even in the code Posted: 24 Dec 2020 01:34 PM PST [Errno 2] No such file or directory: 'mxmlc' [cmd: ['mxmlc', '/Users/user/go/src/github.com/drk1wi/Modlishka/plugin/autocert.go', '-library-path+=/libs', '-output', '/bin/.swf', '-debug=false', '-static-link-runtime-shared-libraries=true']] [dir: /Users/user/go/src/github.com/drk1wi/Modlishka/plugin] [path: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin] [Finished] [link] [comments] |
Posted: 24 Dec 2020 12:40 PM PST I want to learn the Java programming language and know great object oriented programming. Now I want to expand my knowledge but I am not taught that way. Can I learn Java by coming up with something I want to do and then doing part by part what I envisioned learning and expanding my knowledge. [link] [comments] |
How to check a text document for grammatical accuracy? Posted: 24 Dec 2020 01:03 AM PST Hello all I know of Lingua::EN::Grammarian in Perl which attempts to check the grammar of a document but this module is very immature and it has a lot of false positives and false negatives. Does anything similar exist in any other languages? I have a bunch of English-language text documents and I want to check them for grammar mistakes. Even if the module is not perfect, at this point, anything is better than nothing. Thanks [link] [comments] |
Proposition to work in a new project with old technologies Posted: 24 Dec 2020 10:45 AM PST As a temporary profile in the current project, I have got an offer today to move to another project, in the same company, that uses old technologies like :
I'm more familiar and ambitious about new technologies like angular and JEE frameworks. In the other hand I have never had any experience with GWT and SVN, well it's not a problem because I know I can get my way through these techs, but it feels like I am going to kill my career with this experience. Shall I accept the offer? I'm 25 years, 2.5 years career. [link] [comments] |
Is there any book that covers the topic "how to rank items in my app"? Posted: 24 Dec 2020 04:22 AM PST I've created a marketplace app which has some product listing. I want to rank those products on the basis of the quality, price etc. I want to optimize this for max sales/revenue. Is there any book that takes me through the process of creating a ranking ML Model or a microservice. Edit: Ideally, the book should deal with topics such as Creating Data Pipelines, Feature Creation, ML Model Building, Integrating these model into real time applications, deploying the said service. I have doubts regarding the latency of the service, figuring out if the ML Model if working properly or not etc. [link] [comments] |
Places to look to find Distributed Optimization advice and/or techniques Posted: 24 Dec 2020 07:23 AM PST I have a multi-dimensional optimization task where I have access to a high performance computing ring to run individual tasks in parallel as well as to run them on my local machine. I have implemented/used a few optimization algorithms like MCS and Nelder-Mead that run iterations in series trying to minimize or maximize a cost function. I'm trying to find any reading or advice on what kind of methods can leverage parallel computation to reduce runtime for a task like this, especially for tasks where single iterations can take ~5minutes or longer. If anyone know where to ask this question if its better suited to another subreddit, let me know as well. It is important to note that this is Derivative Free optimization since I have no information about the cost function, other than its values where I evaluate them. [link] [comments] |
Editting Inspect Element HTML/JS/JQUERY/ETC to view Contact Email? Posted: 24 Dec 2020 06:03 AM PST Hello, I am trying to send a rather long email to a company but their content box is cutting me off. I tried googling their email to no avail, so now I'm trying to see if there's anyway it could be viewed within the Contact Us query, but I see a lot of stuff like this: I'm sorry my programming is pretty rudimentary, but is there anyway to edit the Inspect box and get it to reload and show the hidden elements? (I.e., Delete the .prevent part, change disabled to enabled...? Even just the page reloading to show the email when you hover over the button, would be sufficient.) I look around all the .CSS/.JS files and everything seems to be linked to open locations, I just don't see any email domains even while I try to CTRL-F for possible results...? Of course I don't really know where to look when I do, so there's that... but does anybody have any suggestions? I would think the domain has gotta be there somewhere, if it's redirecting to something... Thanks. [link] [comments] |
Linked List getters and setters vs instance variables Posted: 24 Dec 2020 12:20 AM PST Prepping for a data structures class and I've been looking at linked list. However through my research I've noticed that some articles use getters and setters and some use purely instance variables. Java, addNode method example; head.setNext(cur) vs. head.next = cur. Is there an advantage over the other or is there no difference between both? [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