• Breaking News

    Wednesday, November 24, 2021

    Real-life applications of CFG's, PDA's and Turing Machines. Ask Programming

    Real-life applications of CFG's, PDA's and Turing Machines. Ask Programming


    Real-life applications of CFG's, PDA's and Turing Machines.

    Posted: 24 Nov 2021 04:10 PM PST

    I just finished learning about Context-Free Grammars (also CYK-algorithm, CNF, parse trees, parsing tables (LL(1)), ...), Push Down Automata and Turing Machines (at University, Comp. Science). I need to make a project (prefferably with intention for real-life use) where I use one or more of these topics (and algorithms that go along with these topics, for example the CYK-algorithm with Context Free Grammars) in my coding. I have been thinking a while about some creative applications/programs that I can make (CFG is used a lot in compilers (and lexical/syntactical analysis,...), but I don't really want to go in that direction), but I can't think of much. I would like to ask if any of you guys maybe have some ideas about programs that could be useful anywhere (can be whatever topic), where you can/need to use the above mentioned constructions and algorithms that connect to them. Examples of projects are: syntax error repairing or even creating your own mini-compiler (not allowed to use these). The programming part itself will probably not be a problem. Thank you in advance. I am sorry if this isn't the right subreddit for this.

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

    Is there a single language I could learn that would allow me to write code for iOS, Linux, and possibly even micro controllers such as the Arduino?

    Posted: 24 Nov 2021 07:02 AM PST

    I am currently a mechanical engineer with a little bit of basic electronics knowledge, and have spent many years running various flavors of Linux and writing small bash scripts to automate various tasks. So I'm not exactly starting from 0 when it comes to learning programming...but still only at maybe a 1 out of 100, lol.

    I am equally interested in coding for hardware, micro controllers, sensors, etc, think IOT devices as well as apps for iPhone, iPad, MacOS, and Linux. But I dont want to end up overwhelming myself by trying to learn multiple languages at once. So is there any 1 language that can be used on all these platforms?

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

    I am an experienced developer, but I can't explain anything to my SO without getting incredibly frustrated and pissed off. Why and what to do?

    Posted: 24 Nov 2021 06:20 AM PST

    My SO has a job that requires some programming, they've been programming in and out for a few years now but they're still struggling with it. And since we both WFH (for different companies) they always asks me to help them figure stuff out, debug their problems, help them architect things, etc. Basically be their personal senior engineer/consultant.

    It always pisses me off, and we end up fighting.

    I hate it because I feel like I'm working for their company for free by doing that, because it is mentally taxing as I have to both figure out the problem but also figure out what is it that's keeping them from understanding it and explain several times the same thing, and because they always refuse to ask online on SO or IRC (it's easier to ask me) or a colleague at their company (all seniors are overworked and have no time to help)

    If I don't help them, they stay stuck and feel like shit. I also feel guilty because I could be helping but selfishly don't.

    Weirdly, I don't have this issue (or nowhere near as bad) when helping out junior engineers at work.

    Has anyone ever experienced that? How are you handling it?

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

    [D] Does ML require a GPU?

    Posted: 24 Nov 2021 11:09 AM PST

    I have like a Surface Pro with an i5 processor. Doesn't really have a proper GPU. I wanted to do some ML for my project and was wondering if the PC would be able to handle it.

    In terms of what kind of ML, well I'm looking towards things like how Autopilot work (e.g. Tesla) however want to adapt it for something like a Mars rover. So might focus on one aspect of the autopilot like say Image processing or so.

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

    Is it possible to create an Executable or API for a script that relies on API's itself? [Python]

    Posted: 24 Nov 2021 03:10 PM PST

    I have a script that is using 2 API calls and multiple libraries, it runs as a .py on my terminal, I want to make it an executable or API call to try and run it on different devices.

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

    Recommended error monitoring / exception logging solutions

    Posted: 24 Nov 2021 01:21 AM PST

    I'm working with a group of students on a web application built with ASP.NET Core and Angular.

    The project is going in production in the near future, but before we go live we want a error monitoring / exception logging solution. I did some research online and found many options:

    • Sentry
    • StackExchange Exceptional
    • Rollbar
    • Raygun
    • Bugsnag
    • LogRocket
    • Airbrake
    • Azure Aplication Insights

    I've been struggling to get a clear picture of which solution is most popular or recommended for production environments.

    My question is: what error monitoring solution, if any, have you used and/or are using in a production environment in which you participated?

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

    Object Recognition and Text to Speech with Raspberry Pi and Python

    Posted: 24 Nov 2021 10:06 AM PST

    Hello! I have followed a video to do an object recognition project. My main goal is for any detected object to be said aloud through headphones using a text to speech software. I'm having trouble with that since the video I followed uses code that only makes a rectangle box and the name around any detected object. Can anyone please help?

    This is the video I followed:

    https://youtu.be/iOTWZI4RHA8

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

    Web Automation with Python

    Posted: 24 Nov 2021 09:09 AM PST

    Hi, i'm new on programming and i'm planning to code a bot to order things automatically, but there's a n issue beside it. My plan is to code one to login, select a product, select the payment method and order it, but with my navigator closed. I mean, i saw too many tutorials with selenium library and chrome webdriver, but i wanna know if it's possible to do it with my navigator closed, doing the order directly on the website backend, because it gonna be faster and better for me.

    Thanks!

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

    Why are full stack developer job posting asking for devops skills ?

    Posted: 24 Nov 2021 08:55 AM PST

    I was browsing for full stack jobs and saw that most of them were also asking for skills such as AWS , AZURE. Isn't full stack developer supposed to be someone that can work on front end and backend stuff. Or is full stack supposed to mean front end + backend + devops ?

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

    Got a 'float object is not iterable error' and I'm stuck

    Posted: 24 Nov 2021 12:07 PM PST

    An overview of what I'm trying to do:

    - I get a reading of the current time and the voltage given

    - Convert the voltage to volts using the function measured(t)

    - Print the time and volts

    The thing is, the class n functions for the conversion is already given by my professor and I don't want to change anything in it in case it breaks (and coz we're not supposed to). Here's the professor's code (scada.py):

    class DAQ: REF_HIGH = +5.0 # high voltage limit on sensor REF_LOW = -5.0 # low voltage limit on sensor BITS = 10 # number of bits used to encode the signal DELTA_T = 0.5 # sample period (s) INSTRUMENTS = ["constant", "ramp up", "ramp down", "course"] def __init__(self): """ create a new DAQ """ import re from blinkstick import blinkstick bstick = blinkstick.find_first() student_id = bstick.get_info_block2() self.instrument = 'None' self.Q = (self.REF_HIGH - self.REF_LOW) / 2 ** self.BITS self.identity = student_id random.seed(student_id) self.initialised = datetime.datetime.now() self.time = 0.0 self.last_reading = time.time() def connect(self, instrument, level=0): inst_type = self.INSTRUMENTS.index(instrument) if inst_type == 0: self.parameter = [level, 0.] elif inst_type == 1: self.parameter = [-4.5, 9 / 60] elif inst_type == 2: self.parameter = [+4.5, -9 / 60] elif inst_type == 3: x = [0, 10, random.uniform(12, 27), 30, random.uniform(32, 47), 50, 60] v = [-3.0, -2.0, 4.0, 4.5, 4.0, -2.0, -4.0] t, c, k = splrep(x, v, s=0, k=5) self.parameter = BSpline(t, c, k, extrapolate='periodic') self.instrument = instrument print("{} connected.".format(instrument)) def trigger(self): self.time = 0.0 print("triggered at {}".format(datetime.datetime.now())) def voltage(self, t): inst_type = self.INSTRUMENTS.index(self.instrument) if inst_type == 3: voltage = self.parameter(t) else: voltage = self.parameter[0] + t * self.parameter[1] return voltage def measured(self, t): volts = self.voltage(t) volts[:] = [x + random.gauss(0.0, 16) * self.Q for x in volts] return np.clip(volts, self.REF_LOW, self.REF_HIGH) def quantisize(self, t): volts = self.measured(t) volts[:] = [math.floor((v - self.REF_LOW) / self.Q) for v in volts] return volts def next_reading(self): # ensure DELTA_T seconds between readings delta = time.time() - self.last_reading delay = max(0.0, self.DELTA_T-delta) time.sleep(delay) self.last_reading = time.time() # increment time and create a reading self.time = self.time + self.DELTA_T volts = self.voltage(self.time) volts += random.gauss(0.0, 8) * self.Q if volts < self.REF_LOW: volts = self.REF_LOW if volts > self.REF_HIGH: volts = self.REF_HIGH volts = int(math.floor((volts - self.REF_LOW) / self.Q)) return datetime.datetime.now(), volts 

    And this is what I did in Jupyter:

    from blinkstick import blinkstick import datetime from scada import DAQ import numpy as np # connect to the DAQ my_daq = DAQ() my_daq.connect('ramp up') my_daq.trigger() # get the reading, convert to volts using measured, print for i in range(60): cur_time, voltage = my_daq.next_reading() volt = my_daq.measured(cur_time.timestamp()) print(("time is {} ;voltage is {}; volt is {}").format(cur_time, voltage, volt[i])) 

    The prof said that measured and quantisize will return continuous values at time t.

    When I call measured(cur_time.timestamp()), I get an error 'float' object is not iterable on the 2nd line of measured(). So they're saying that volts is not iterable, right? But the professor's code is iterating it anyway and making an array(?)

    Please help!

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

    How do you create bidirectional flow on a stream?

    Posted: 24 Nov 2021 10:58 AM PST

    I have a client-server application and I created a TCP stream to pass data. When I know the flow of information, I can just set one side to read and the other to write and everything is fine. How can I monitor the same stream and be able to send commands with it? I know you can loop to check a stream for incoming data, but that seems like it would become the only thing that application did... wait in a loop and respond to something received. Can you do it in a way that allows you to send? Do I need two streams or should I be thinking async?

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

    Self Study Resources to Support Career Switch from Science to Web Development

    Posted: 24 Nov 2021 10:51 AM PST

    I have been given a financial aid for a Full Stack Web Development 120 hours/12 weeks bootcamp, with a job offer on successful completion of the program.

    The website says the program will touch on the PHP, ReactJS and React Native. (Outline image)

    Would you guys suggest the following are a good resources to complement the bootcamp training:

    • The Odin Project
    • CS-50x
    • Leetcode (for eventual job interview)

    I am switching from my current career (related to sciences but not much programming expertise) to web development.

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

    Programming language with all features

    Posted: 24 Nov 2021 09:33 AM PST

    Would it be possible to implement a programming language that supports as many features and paradigms as possible? If you want to use a target runtime, which one would be best? CLR, JVM, GraalVM (with Truffle) or something else?

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

    Best place to learn

    Posted: 24 Nov 2021 09:20 AM PST

    Would anyone be able to point me in a good direction to learn Python and SQL please, any sites or even qualifications would be helpful. Thanks.

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

    Powerpoint to PowerBI (link) and back again - vbs | powershell | other?

    Posted: 24 Nov 2021 04:56 AM PST

    I'm trying to run a powerpoint slide show, then display a web link (PowerBI) for 10 minutes and then go back to the powerpoint slideshow loop through this again.

    I know a little of vbs and a little of powershell, so while it will take me a while I think I would get there in the end.

    Is there a simpler way that I haven't considered?

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

    Is it weird that I kind of like Visual Basic's syntax?

    Posted: 24 Nov 2021 08:41 AM PST

    I know people think it's one of the ugliest programming languages, but I actually kind of like it. I can't explain it, but from the first time I saw it, it just looks nice to me and I kind of gravitated to it. I tried doing a few things with VB.NET and actually liked how the language looks. If it wasn't for me really not liking Microsoft, and switching to Linux a while later which Visual Studio doesn't run on, I probably would have made more little apps with it. I honestly had fun with the language itself, just not the Microsoft parts that it relies on.

    Namely, I know that the part where you have to specifically type out "End Class", " End If" and whatever gets a ton of hate, but you rarely actually have to do that because the IDE does it for you, and I actually like it because in large heavily nested regions, you don't go cross eyed trying to figure out which "end" or close brace is for which statement. It's actually the part I like the most, and IMO really helps me visualize the various nested blocks.

    I also like how it tends to use words to denote most things as opposed go symbols, kind of like pseudocode, which I actually found is easier to both read and type, even with the everything capitalised quirk (which the IDE also does for you so you don't actually have to keep pressing shift if you don't want to).

    What do you think? Anyone else get what I mean? Or am I completely wrong and a fool for liking Visual Basic?

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

    How can I identify a specific visual event in a video and trigger actions once it's located?

    Posted: 24 Nov 2021 07:38 AM PST

    I'm currently planning out an application that takes a video input, searches for a pre-defined event (an existing image) in said video and then triggers actions upon locating a defined event. The actions I am currently looking at are to take the frame where the event occurred, save it as an image and call an API.

    I have already been looking at OpenCV's template matching as a possible solution, but so far I have only found resources discussing real-time searching. As my video input could be 1-3 hours long, Ideally this is not done in real-time.

    Is it possible to use OpenCV's template matching for this purpose or are there other better-suited alternatives?

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

    Front-end web developer wants to make an app on OSX. What programming language do you recommend?

    Posted: 23 Nov 2021 05:31 PM PST

    Hello,

    I wish to make an application using OSX, although it doesn't need to be exclusive to that OS. I have a background in front-end web development, so HTML, CSS, Liquid, JS, React, etc. I haven't really done any programming outside of the web, nor much backend development.

    I essentially wanted to make a flash card app thats tailored to my needs. Maybe one day I'd monetize it. I'm thinking that it would have the capability of reading information from a spreadsheet and auto-creating flashcards out of it, but also having the capability to create them within the app interface as well. It would need to be database functionality to record various metrics in-between sessions.

    Could I please have some recommendations on a programming language? Maybe something not too difficult to pick up, or somewhat similar to web technologies, or something that would be a good fit for what I outlined for functionality? Appreciate it!

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

    Beginner programmer wanting to build a web scraping program that can return webpages based on keywords.

    Posted: 24 Nov 2021 05:15 AM PST

    I'd like to know if this is possible because this is my first major web project using python. I have already created a web scraper to extract keywords, such as the item and price. Are there libraries that I can use said keywords that will return a list of relevant webpages? For instance, my gf wants a list of websites with the relevant items and prices to purchase products for her small business. It would crawl the web and return webpage URLs with a list of items and prices. Eventually, I could even return the average review rating with standard deviation. I'm hoping is possible because it would be a lot of fun.

    Thank you!

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

    Desktop app developement for beginners

    Posted: 24 Nov 2021 01:04 AM PST

    I want to learn desktop development. I could not find a subrredit that is dedicated to desktop app development. Also very few tutorials online for desktop app development. Here are the things which I tried for desktop app development

    1. Flutter => Does only UI. If I want to access native functionalities I will have to create my own native package or rely on third party developer and lot of devs using flutter use it for mobile and don't really care about desktop
    2. React Native => Same issue as that of Flutter
    3. Electron => Bloated mess. I don't want a hello world app to be so big in size.
    4. Qt => Though I have never used this but what I found online is that it is extremely slow and not works well

    My main target is windows and macOS app development. I have tried swiftui for Mac development but have tough times integrating native functionalities like audio, video, navigation, file explorer. Should I learn App kit instead?

    For windows which platform to use. There are so many UWP, Xaml, MAUI etc.

    I want to avoid C, Objective C and C++. I am ok with C# and Swift

    Can you guys recommend how should I go about it and are there any good video tutorials which explain as much as native desktop feature development and not just UI development.

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

    Why does everyone choose the hard way of doing this?

    Posted: 23 Nov 2021 04:09 PM PST

    Basically I was just searching around youtube for some ideas on how to implement an expandable/retractable side nav bar with react (so when you hover over it, it expands and the links show), the issue I'm having is that every video I've seen is like 30 minutes long and the methods to complete this task are to split up the side bar into multiple components and conditionally render the side bar depending on if it's on hover or not, so basically the long way of doing it.

    So my question is, what are the benefits of using these longer methods when I can accomplish this task in a couple lines of css (using :hover and transition)?

    I would understand if it was loading a different page, but using multiple components, state, conditional rendering, all for an expandable side nav just seem like overkill to me, but I'm assuming the benefits of using this longer method compared to my version with css are going over my head, hence why I'm here wondering what they are.

    https://www.youtube.com/watch?v=5I_uGo8-jPs

    These are the types of videos I'm referring to that fill up the first page of results when searching "expandable side bar in react".

    and this is my method below (yes I'm missing styling and other things but just want to get the point across)

    .sideNav{

    width:3em;

    }

    .sideNav:hover{

    width:6em;

    transition: all .5s;

    }

    submitted by /u/Sebastian-dB
    [link] [comments]

    Does anyone know how I can skip to next iteration of For Loop without incrementing index?

    Posted: 23 Nov 2021 06:31 PM PST

    I have a function with two array parameters: source and remove.

    I wan to scan through remove and if any of the elements match the elements in source, remove said element from source.

    The problem is this testcase doesn't seem to work? Just wondering if anyone could have some advice.

    https://replit.com/@Stylebender/ThistleUnitedScope#index.js

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

    Android/Java Mass implementation of buttons.

    Posted: 24 Nov 2021 12:16 AM PST

    I am not sure of the best way to add onClickListener methods to a bunch of buttons. I could just write it out for each button, but years of programming have taught me that when code gets repetitive I am doing something wrong. Any and all ideas are welcome.

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

    What exactly can I do with this degree/certification?

    Posted: 23 Nov 2021 05:54 PM PST

    I am looking to become a web developer and I was wondering what I can do with this certification listed below. It seems too good to be true. Only 20 credit hours for the entire thing. I don't think it is a thing you take after you become a computer scientist because there are no prereqs for the first few courses. I would appreciate some help.

    https://catalog.stlcc.edu/programs/web-developer-certificate-specialization/

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

    No comments:

    Post a Comment