How to say -> when reading code Ask Programming |
- How to say -> when reading code
- I want to access my printers firmware, how should I proceed?
- Where do I dig to learn how to query a system's hardware information, regardless of the system OS?
- Remove console logs in production build?
- manually trigger lazy load for images inside iframe
- Variable value disappearing in nested loop in Python
- Anything wrong with having global components in my application this way?
- Agda: how can I define this induction principle?
- Batch Create JSON Files from CSV input
- Streaming my webcam to the world
- Where should I be more focused on?
- how does this work?
- Putting all the code in the front end? Is it okay?
- Facebook Bot Resources/Brainstorm
- Python Selenium/Regex Help!
- [C; Linux; audio] How to check whether Alsa audio is muted, in C?
- Books/Blogs/Tutorials for understanding GUI development from bottom up?
- Optimal ecosystem simulation class hierarchy?
- Pattern hacking Using Automated Scripts
- How does computer know of key is being pressed?
- I can't get my messages to show up properly.
- Does this look like some sort of code or programming? I found it and I don't know what it is
- Watch2Gether/AndChill alternative for bad connection
- How to get this bookmarklet to copy the content in clipboard?
- Hypothetical DOSBox-like application using hardware VM instead of emulation
How to say -> when reading code Posted: 18 Apr 2021 03:14 PM PDT So I am a C# kind of fellow. When I occasionally read other languages that use the arrow operator rather than a dot, I find it super annoying because the voice in my head has no idea what to say, so I usually just replace the '->' with '.' when reading it. I will read foo->bar as 'foo dot bar' or leave a pause 'foo bar', and it annoys me everytime, because I don't know the proper way to say it, and I can't seem to phrase it right to find out using Google. Now. There is an ever so slight possibility that one of you guys programs in a language that uses the arrow operator over a dot, and I was wondering if you could please tell me what noises to make from my mouth hole when reading such code. Thank-you kindly. Much more appreciated than you will ever know [link] [comments] |
I want to access my printers firmware, how should I proceed? Posted: 18 Apr 2021 07:11 PM PDT Will probably vary from printer to printer but I want to know the general steps in "printer tinkering" Any idea on how to get started? [link] [comments] |
Where do I dig to learn how to query a system's hardware information, regardless of the system OS? Posted: 18 Apr 2021 10:15 AM PDT Windows has this um... I forget what it's even called, but it lets you look up bits of information on a systems hardware, and that's great, but it's windows specific. Is it possible to code low-level enough to get this information in a platform-independent fashion? If so, where do I go to learn how? [link] [comments] |
Remove console logs in production build? Posted: 18 Apr 2021 03:46 PM PDT As the title says, I wanted to understand the reason behind this. For context, I work with Angular and dont understand why we need to remove all consoles from the production build. I am not talking about sensitive info, just the debugging consoles. Any pros and cons with leaving in the code would be appreciated [link] [comments] |
manually trigger lazy load for images inside iframe Posted: 18 Apr 2021 09:51 PM PDT so I have an iframe where the images in the iframe are set to lazy load but the lazy load won't trigger on small screens or some browsers. is there a way to trigger the lazy load within the iframe on page load. maybe or How to interact with the content of an iframe using js or jQuery [link] [comments] |
Variable value disappearing in nested loop in Python Posted: 18 Apr 2021 09:18 PM PDT I'm really not sure how this is possible so I thought I'd post it here to see if anyone could point the problem out to me if its something super obvious. I have some code setup like below in python: And the first print statement will print j at values 0-3 but the second print statement will only print j when it's value is equal to 0. Some example output is below: Can anyone explain to me why j is being treated differently when it inside the nested loop? [link] [comments] |
Anything wrong with having global components in my application this way? Posted: 18 Apr 2021 08:56 PM PDT I'm creating a large C++ GUI application where I'm finding I need a lot of utility classes to provide info I need. I'm thinking of creating one global object singleton that groups all these information components. They get initialized once at startup, then they're called and used from wherever. I wouldn't do this for writable data, just read-only data, factories where the caller is responsible for the lifetime of the created object, etc. I might make an exception for Config, and allow a single designated class to write to it, while everyone else can only read. Giving the dependencies in the constructor on a need-to-have basis seems like I'd be creating more work for myself for no major benefit that I can see. I've read about dependency injection libraries, but I'm not comfortable including libraries that are too advanced for me to understand their code, I'm not an expert C++ developer. Example: Then throughout my code I would do stuff like: Is there anything bad with this? I read about how it makes testing harder, but I don't see why I couldn't make MyApp an interface, and have myapp() return a TestableMyApp based on a flag. [link] [comments] |
Agda: how can I define this induction principle? Posted: 18 Apr 2021 04:52 PM PDT Hello! I just started learning Agda, and I'm wondering how I might define this induction-type thing for trees. Any idea how I can convince agda that if Ind a b, then a is structurally less than b? I'm guessing it's very easy. Edit: it's easy to prove if we get rid of trans, so maybe you can use something like the proof that strong induction is equivalent to induction to have it work with trans, too. [link] [comments] |
Batch Create JSON Files from CSV input Posted: 18 Apr 2021 03:55 PM PDT Hello, I do not have any programming experience and I have a manual data entry task that I think can be automated given this subreddit's expertise. I need to create ~1000 json files that look like I plan on starting the data entry that looks something like this Looking to use this data to create, and populate those json files. I know enough to execute something using PowerShell, python, bash/shell or similar scripting languages. The output file could use another field in the csv or use "name". Something like... Thanks for any help! [link] [comments] |
Streaming my webcam to the world Posted: 18 Apr 2021 03:29 PM PDT I want to make a website that lets anyone from around the world see my webcam (pointed at a fishtank). I was planning to use a raspberry pi 3b to get the video feed then host the site on the pi or somewhere else. I wanted to also add a chatbox on the side so people can chat with each other, nothing fancy just a chat where people pick a username, no logins. Is this possible? ive found no info about streaming webcams to anywhere in the world. [link] [comments] |
Where should I be more focused on? Posted: 18 Apr 2021 06:40 PM PDT So I've been struggling to where should I be more focused on? That thing that my school teaching us which is Programming (Java and Python stuff) or the one, that what my dream is all about which is a web developer/designer. It feels whenever we have an activity, it's like my attention is being diverted in being Web Dev./Designer. Like I'm stuck between the two, that to be able to pass this subject and have a good grades, I need to learn this, I need to learn that. Also, to be able to have this career, I need to learn this and that. What and where should I pay attention? [link] [comments] |
Posted: 18 Apr 2021 06:08 PM PDT my noob level programmer didn't understand one thing, for example minecraft java edition is written in java language you can install it and play it with out bothering to download jdk and jarfix but when you try to write a java code and run it you need jdk especially java this is what all the programming language requires but how does this work? [link] [comments] |
Putting all the code in the front end? Is it okay? Posted: 18 Apr 2021 03:27 AM PDT I'm building a website and I have very little back end to the website other than php code that connects to a mysql database. I can see that users have access to all my js code but I plan on re-writing it all in node js eventually and it should be very simple right? Am I wrong? [link] [comments] |
Facebook Bot Resources/Brainstorm Posted: 18 Apr 2021 04:44 PM PDT Hi there! I have been trying to find an appropriate forum in regards to creating a Facebook Marketplace bot (or seeing if one with the right specs I need already exist) I've been an avid retro game collector for a few months now and am really enjoying it. Due to lockdown protocols (thanks COVID) Facebook Marketplace is really one of the only options for my city. The market for retro gaming is...cutthroat. So, I am proposing to try and discover resources available to cut down my response times to new listings. Basically, have a bot scan the marketplace groups I belong to on a frequent interval (maybe every minute or two), plug-in keywords and a budget. Have the bot auto message the seller of a brand new listing within seconds if the keyword and budget criteria are met (eg. keyword Gameboy, Budget: $80) every minute it scans the groups looking for brand new postings and uses the built-in auto inquiry buttons that Facebook already has. In my area, it's heavily first come - first serve, even if you haven't tendered an offer sellers will usually allow you some time to make an offer as long as you're the first in line. That is what I want to try and achieve instead of scanning every group and listing manually. Thank you for any help you guys and gals can provide! :D [link] [comments] |
Posted: 18 Apr 2021 04:36 PM PDT I need help figuring out how to print the correct statement. More details are shown in the stackoverflow post! [link] [comments] |
[C; Linux; audio] How to check whether Alsa audio is muted, in C? Posted: 18 Apr 2021 03:59 PM PDT Dear all [Edit: problem solved.] I need to check whether audio output is muted. I need to do this on Linux, on a computer running the Alsa audio software, and in C.1 By 'output' I think that I mean the output of the current device, i.e. speakers or headphones as may be (and irrespective of any per-application settings). I have working C code, adapted from code on this webpage, which reports the audio volume.2 Yet, that code returns one and same volume level whether or not the mute is on. I have posted the code - my version of the aforementioned code - here. What I want it to do is to report that audio is muted, if it is, and, otherwise, to report the volume level.3 I should say that my ability in C is that of a beginner - I can just about write my own C functions.4 Thanks. 1 I need to use C as against another language because: the code needs to be very fast (for, it will be running every few seconds); I want to integrate the code into the C code that I have on already and that I provide in a moment. 2 I compile the code, on Linux Mint Cinnamon, thusly: 3 The manner in which the program reports it does not matter - in the sense that I can change that to suit my purposes. 4 There is documentation on the web of the Alsa C api, but I have not managed to find anything therein about detecting muting. My lack of knowledge of C may be hindering me here, though. [link] [comments] |
Books/Blogs/Tutorials for understanding GUI development from bottom up? Posted: 17 Apr 2021 11:39 PM PDT For working on a project, I was introduced to WPF and MVVM. During my learning about WPF. I came to understand that GUI's follow an event-driven paradigm. And every GUI framework has an event loop interanally, waiting for messages and as consumer's of the framework, we use event handlers (or overriding Button's protected onClick method) to describe the actions that would be performed on receiving a particular event. Event after working for about 4 months in wpf (also having basic android knowledge). When I try to read about MVC, MVVM, MVP etc. I can't really wrap around my head what the material is implying and what are the pros and cons of each pattern. Leaving this, we also have reactive programming, event-bus etc. which are a lot of different terms, and I understand the implications of everything to a certain extent. I have also worked in a bit of react and understand how the web browser works at a high level. But overall event after all this, I am not able to gain confidence in these because I feel I do not understand the low-level details somewhere or I am unable to connect with the exaplanations of MVC, MVVM, MVP etc. I know these are abstract concepts, but I really want to gain a strong understanding of these and how things work from the bottom up, so that I can make better decesions while arctitecting things that I am working on. Is there any book/blog posts series I can read to build a stronger foundation ? Any other general advice for such scenarios ? Thank you very much for helping! [link] [comments] |
Optimal ecosystem simulation class hierarchy? Posted: 18 Apr 2021 11:11 AM PDT Similar questions have been asked many times before, mainly because this usually manifests itself as some Intro-to-OOP homework-esque question about polymorphism. Usually, something a long the lines of "a Dog / Cat class both derive from the Animal but implements a their own speak() method" or something very simple like that. Unfortunately for those actually looking to make some complex projects around an animal/plant based ecosystem, these simple answers actually make it quite hard to find discussion about a complete class hierarchy around an entire ecosystem. To some extent, all class hierarchy designs will be specific to how detailed the project gets. For example, I'm not interested in enough detail to make photosynthesis() function for my plant class and model out that kind of fundamental energy relationship from the sun -> plants. But I'd like this class hierarchy boilerplate to be inclusive enough that it wouldn't be too hard to make something like that happen if a project wanted to. So I'm hoping we can come to a consensus about an optimal class hierarchy for an ecosystem that will be general enough to minimize the pain in future refactors/expansions. By "ecosystem" simulation, let's take this as an example. There are rabbits that eat the plants, and foxes that eat the rabbits. There are behaviors specific to each class. Reproduction (with genes considered) matter. All LivingEntity's can be "consumed", and all LivingEntity's have some genes that will vary over time. Here are just some initial ideas: LivingEntity (Abstract) Animal : LivingEntity (Abstract) Plant : LivingEntity (Abstract) Shrub : Plant Tree : Plant Rabbit : Animal Fox : Animal Probably want something more expandable though. Also need to think about interfaces. Here are just some ideas that I'm not sure what to do with currenty: Species? Tribe? (red rabbits vs. blue rabbits) Habitats? (burrows, dens) Hitpoints (ie. a rabbit can "survive" an attack from a fox)? Just using the concrete examples of rabbits and foxes, but ideally should be expandable to all types of living entities at any level of the food chain. In my "big projects" I neglected to optimize the polymorphism before starting, which led to many refactors and a bad experience with OOP. Trying to optimize this before I get too deep. Thanks so much for your help! [link] [comments] |
Pattern hacking Using Automated Scripts Posted: 18 Apr 2021 01:48 PM PDT Shouldn't it be possible to hack or 'brute force' attack a phone's pattern security by automating a code or python script to try every possible combination for 4 dots, then 5 dots, up till the maximum number of dots (which I think is eight) I'm no expert programmer, but I did a Google search and was curious why this already isn't a thing? Is this a ridiculous idea? If so, why? [link] [comments] |
How does computer know of key is being pressed? Posted: 18 Apr 2021 01:33 PM PDT I'm learning programming and I'm curious if computers always checks if keys are being pressed or how they make something happen. If I click on a mouse is there a code running that is checking if mouse is being pressed? [link] [comments] |
I can't get my messages to show up properly. Posted: 18 Apr 2021 01:32 PM PDT I have two buttons - one that sends two messages with a one-second interval, and the other only sends one message, with the second left as undefined (this will be clearer once you see the code). How do I stop undefined from showing up? [link] [comments] |
Does this look like some sort of code or programming? I found it and I don't know what it is Posted: 18 Apr 2021 01:25 PM PDT B NC flagb00 z g 54 0 kpp8 Papworth bu unlock free ospreys GLC j lo I'll l Lupton 8 today q ashe quality7lb p lmk [link] [comments] |
Watch2Gether/AndChill alternative for bad connection Posted: 18 Apr 2021 12:14 PM PDT I just had an idea... I don't even know if this is the right place for it, but I wanted to share it and get some feedback. I recently started watching a lot of different TV series with a friend. We'd meet on Discord, decide on a new series or pick up where we left off yesterday, and just go "3, 2, 1, go!" and both click play. If we watched on Netflix, we could use a browser extension (netflixparty.com) that does the same thing as websites like w2g.tv or andchill.tv, but most of the time, we'd watch on... other websites, which is why we resorted to doing this countdown thing. However, my friend has one big problem: His internet connection is very bad. Sometimes everything works fine, but sometimes, the videos don't load fast enough, or don't load at all. If we're also using Discord to talk, that's just to much for his connection. That's why I - having much faster internet - offered to just download whatever we're watching at the moment and give the videos to him on an USB stick (we don't live that far from one another). That way the only application that needs internet is Discord. But then I thought: Wouldn't it be fairly easy to code a program that detects when you press play/pause in your video player, and just submits this information, which could be literally a single bit, to the other person, which in turn starts/pauses their video. We could manually open the correct video in our players, but this would help a lot with staying in sync if we have to pause midway and don't want to check each time if we're still both at the exact same spot. So that's why I'm here. While I started getting into coding recently, I don't have a lot of experience, and basically no idea how to do something like this. I just like to imagine it as something rather simple, but I could be totally wrong. Maybe some more experienced people could help me out a bit and tell me if I'm correct, or even explain how this would work (Where do you even start coding something like this? What language would you even use?) Or is there perhaps a comepletely different and much simpler solution to this problem that I just can't see? [link] [comments] |
How to get this bookmarklet to copy the content in clipboard? Posted: 18 Apr 2021 07:05 AM PDT
This bookmarklet code converts the github url into the SSH url. But on clicking the bookmarklet the converted SSH url is opened in a page rather than copied on clipboard. How to get this bookmarklet to copy the content in clipboard? [link] [comments] |
Hypothetical DOSBox-like application using hardware VM instead of emulation Posted: 18 Apr 2021 10:13 AM PDT Would it be possible to make a hypothetical DOSBox-like application, but instead of emulating the CPU, it uses hardware virtualization, kind of like a DOSBox VM, where it has the host-guest integration and the hardware emulation? I guess the closest thing I've seen to this is Nintendont which (I think) uses the Wii CPU to emulate I/O like an ISO, or even WBFS replacing a physical disc, emulated memory cards, and also Wii-specific peripherals used as normal GameCube controllers. But of course, the Wii already has 99% of a GameCube there and probably some extra hardware to make stuff like this easier. But if this kind of idea was applied to VM technology, using full graphics, sound, and I/O emulation, there could be a ultra-fast DOSBox. Not that it's necessary; most computers can run DOSBox fine, and most DOS applications don't use alot of resources compared to today's applications anyway. Would something like this be possible? If so, would it be better or worse than DOSBox speed-wise? Would there be any extra complications to the end user? How complicated would a project like this be? Would there be any other advantages to this other than extra unnecessary speed? [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