• Breaking News

    Sunday, August 25, 2019

    My first Python WebApp is a Multi-room Soundboard learn programming

    My first Python WebApp is a Multi-room Soundboard learn programming


    My first Python WebApp is a Multi-room Soundboard

    Posted: 25 Aug 2019 04:53 PM PDT

    It has been exactly a year since I started learning Python(3) for my study and job, learned much by lurking here, in (e)books and Youtube videos and wanted to create a fun project using Flask and SocketIO for ASync programming.

    So I created a soundboard :P

    Features:

    - Soundboard rooms (different sounds per room)

    - MP3/WMA/WAV Supported

    - Mute button

    - Sounds are saved as base64 blobs (which was nice to practice with)

    - Admin Panel (for banning IPs of bad users) (authentication is based on a custom set cookie)

    Things for the future:

    - Recognizing/Limiting sound upload count by IP

    - TV Mode for just hearing the sounds on a big screen

    See it working here:

    https://imgur.com/a/B2hIgTW

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

    Need help with C# array homework

    Posted: 25 Aug 2019 05:49 PM PDT

    I have an assignment to create a program that the user can input unique numbers one at a time up to 5 unique numbers, if the number is unique it gets displayed in a unique number text box, if it's not then -1 gets displayed instead, after the 5 numbers are entered the entire set gets display in a different text box. So far everything seems to work but I have a small problem, that I don't know if it's my logic or if I'm missing something that has to do with arrays.

     int numberEntered = int.Parse(txtEnteredNumber.Text); int notUnique = -1; if (numberEntered >= 10 && numberEntered <= 100) { Array.Sort(uniqueNumbersArray); int isInArray = Array.BinarySearch(uniqueNumbersArray, numberEntered);//i thinks this where my problem is if (isInArray >= 0 && isInArray <= 4)//also here { txtUniqeNumber.Text = notUnique.ToString(); txtEnteredNumber.Text = String.Empty; } else { uniqueNumbersArray[buttonClick] += numberEntered; txtUniqeNumber.Text = numberEntered.ToString(); txtEnteredNumber.Text = String.Empty; buttonClick++; } if (buttonClick == 5) { string stringArray = ""; foreach (int number in uniqueNumbersArray) { stringArray += number + " "; } txtCompleteSet.Text = stringArray; Array.Clear(uniqueNumbersArray, 0, uniqueNumbersArray.Length); //buttonClick = 0; 

    This is the main logic in my code, with an array of 5 variables declared outside the button click event, and a counter named "buttonClick" that when it reaches 5 displays the array. This code takes care of the main problem in the assignment, but there is a small problem, the values inputted in the array seem to be random for some reason. When I take out the Array.Sort it seems it works, but if I input the same number multiple times it takes a while to know that the number is already in the array and I don't know why. I will appreciate any help.

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

    Async/Await Explanation

    Posted: 25 Aug 2019 10:35 PM PDT

    let printHello = async () => { console.log('0'); await setTimeout(() => console.log('Hello'), 2000); console.log('1'); } printHello(); console.log('2'); 

    Running this in Node shows 0, 2, 1, Hello.

    Can someone please explain why the 2 gets printed before 1?

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

    Why is my output printed in chunks, not line by line?

    Posted: 25 Aug 2019 08:42 PM PDT

    I've noticed that when I am printing some output in a loop, the output is always printed in chunks, i.e. if I have some print statement to tell me what loop number I'm on, printing the number, it will not print every time the loop finishes but every thousand loops or so. (I just checked, it prints a whole block at loop 1550, 2916, 4282, 5648 etc.) Why does this happen?

    I'm writing in python, and running code through the terminal in git bash.

    An example of simple code that does this is:

    For i in range(10000): print(i) time.wait(0.001)

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

    Is it me? Or is everything (code/environment) wise much harder to setup on Windows?

    Posted: 25 Aug 2019 06:49 AM PDT

    I have been tinkering with the vue.js and as simple as sitting up node.js seems to be on windows, I've had so many hiccups. Not blaming node in any way. A lot of the things I see, responses or something along the lines of "well on Mac, do this"...."oh windows I don't know." It's frustrating. I'm honestly not sure if this was just a rant, but if anybody has any direction with building vue apps on Windows, I am all ears. Thanks.

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

    Confused with translating Algebraic Equations into Python

    Posted: 25 Aug 2019 05:39 PM PDT

    I'm going through the first few chapters of the textbook "Starting out with Python 4th Edition" for my Intro to Sdev course. I'm a little familiar with programming going into the course, I've taken a couple on HTML, CSS, and Javascript. Not Python, although I have dabbled around a bit on codecademy and other places and learned quite a bit of syntax. What I'm wondering is, in my textbook it discusses translating an algebraic equation into a Python statement. Ok, fair enough. The book shows that the statement:

    y=3x2 would equal the Python statement y = 3 * x / 2

    Where does the division come from? I'm pretty rusty with math but I don't see where a division operator would come in to play, although I thought it looked strange that the variable was directly between the two numbers.

    The example below shows:

    z=3bc+4 which equals Python statement z = 3 * b * c + 4,

    which makes perfect sense.

    I tried to search the sub, maybe I didn't word it correctly but I couldn't find anything. Is this something foolish I'm not seeing?

    Any help is appreciated. Thanks!

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

    Is it common to get hung up on one small dumb thing for a while?

    Posted: 25 Aug 2019 05:36 PM PDT

    I was just writing a little webscraper in python for practice, when I got 99% of the way there and then got hung up on the final thing, writing the link to a file. I probably just spend 30 mins trying to figure out what is going on, freaking out that I don't understand things as much as I thought I did, etc... Then finally I realized I didn't actually know what that error code meant (I just assumed what it was), so I google it and low and behold I was using the open method wrong. I feel like an absolute moron (which I probably am), but is this a common thing for developers even further on? I feel like I always get hung up on the simple things, not the more complicated stuff and it really bothers me.

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

    [Python] I've successfully installed Selenium, but having the hardest time configuring the webdriver

    Posted: 25 Aug 2019 11:29 PM PDT

    This is what i'm getting

    _______________________________________________________________________________

    >>> from selenium import webdriver

    >>> browser = webdriver.Firefox()

    Traceback (most recent call last):

    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start

    stdin=PIPE)

    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__

    restore_signals, start_new_session)

    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child

    raise child_exception_type(errno_num, err_msg, err_filename)

    FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver': 'geckodriver'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

    File "<pyshell#1>", line 1, in <module>

    browser = webdriver.Firefox()

    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__

    self.service.start()

    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 83, in start

    os.path.basename(self.path), self.start_error_message)

    selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

    ___________________________________________________________________________________

    If someone can help me out i'd really appreciate it

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

    Is it bad if I'm not good at technical stuff? How to get better at it?

    Posted: 25 Aug 2019 11:18 PM PDT

    I've been a front end developer for 7 years. I started as a web designer and moved into development because I find it more interesting. I started with just static website but over the years I've also made sites for CMS and web applications. I also had made some wordpress theme. I feel like I am quite experienced but I still feel I am really lacking on the technical aspect. For example, I can't really explain MVC well, or how GPU or CPU affecting the animation, or maybe any basic of programming really. I only learnt about pass by value or reference after maybe 4 years as dev. I took a short course in IT, thinking maybe it can help my basic. They taught me C++, phyton, network, etc. After the course, I forgot all of them since I don't use them much daily. When other devs hang out at a meet up, I feel really inferior cause they would be able to chat about latest technology or about how some stuff works.

    How should I progress from here? Thanks!

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

    Help with Webpage having "preview feature of your implementations and projects" Feature?

    Posted: 25 Aug 2019 11:09 PM PDT

    I am making to make a web page but I wanted to have a preview feature that shows my implementations and projects. Is this possible or how would this be done? can this be done using front end like using js or angular or other language like python or java?

    Like for example (other than smack dab putting the git repo link) auto play a video or looping video of the project's feature. Kind of like youtube hovering over thumbnail of video it plays a few seconds of the video. I was thinking the only solution would be screen record the project or implementation and then put that record video into the code but the next problem is how to make the video play depending on command such as hover or when clicked. Of course once somehow this feature is implemented into my web page then I can try to re-approach the problem again with a better solution since I would have a base idea of how it would be implemented even if crudely implemented.

    sorry if I didn't explain it well. articulating everything I had pictured in my mind here didn't go so well as I thought.

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

    What Python libraries/modules should I learn?

    Posted: 25 Aug 2019 10:47 PM PDT

    I have been learning Python for about 3 months now, and have all the basics done, and a few built in modules like random done. I just need help at what modules I should learn now. I am learning Django at the moment, but I am also interested in Data Science and Machine Learning

    Thanks :)

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

    How do I remember what goes in my constructor arguments?

    Posted: 25 Aug 2019 10:42 PM PDT

    I will give an example of the problem. If I write a constructor with more than 2 parameters, I tend to forget what goes into the constructor and in what order. Say I make a Stock object:

    public class Stock { private StockType stockType; private double currentPrice; private float divYield; private long marketCap; public Stock(StockType stockType, double currentPrice, float divYield, long marketCap) { this.stockType = stockType; this.currentPrice = currentPrice; this.divYield = divYield; this.marketCap = marketCap; } 

    When I create a stock I tend to get confused. Ctrl+space on eclipse or hovering over the squiggly red line isn't really helpful since I hardly can recall if set my divYield to be declared with double or float.

    This creates an uncomfortable situation where I need to go back to Stock file to check my constructor so I remember what to type.

    Isn't there a way to solve this problem? If I recall correctly, android studio ctrl+space inserted the arguments with their variable names so you would know what to write.

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

    Improper tool selection

    Posted: 25 Aug 2019 10:38 PM PDT

    Hello everyone!

    I am a newbie in the field of development...well actually I am a PM and recently I decided to explore the question of when the wrong tool is selected for the project. Like Redis instead of SQL DB. The main thing is to understand that I am interested in tools for organizing work, and not programming tools - SharedPreferences or ngrok.

    I believe it might help me improve my in-field understanding and the overall performance of my team.

    So, please if anyone has relevant experience you are welcome to share it.

    I would much appreciate any help and piece of experience.

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

    [C++][short] copying this "class" definition from my book and its implementation, i really like the way it does what it does and the usage of new, but cannot run it on VS. get told to use strcpy_s instead and cannot figure out how to implement it...

    Posted: 25 Aug 2019 06:47 PM PDT

    So like the title says, i really like how this example from my book works and i was examining it and learning a good bit! Unfortunately though when i copied it and ran it, i guess something changed since the book was released as it wont work unless i put some warning exception which iv never done before, or use strncpy_s,...i figured it should be a minor detail but i cannot figure it out =(

    https://pastebin.com/KA9PqJCK

    line 15 & 16 are where the issue is =(

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

    Good OS to start programming?

    Posted: 25 Aug 2019 10:29 PM PDT

    What's the best OS to start programming with?

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

    Hey i have a problem with making a game restart whe circles collide C#thank you in advance

    Posted: 25 Aug 2019 10:02 PM PDT

    //i am super noob

    private void OnTriggerEnter2D(Collider2D collision)

    {

    if (collision.tag == "Circle")

    {

    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);

    }

    }

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

    Is this project possible?

    Posted: 25 Aug 2019 09:49 PM PDT

    Hello!

    I have an idea for a project but I don't really know where to start. This is my first real project.

    I want to use python to pull info from Google Maps (a list of retailers and restaurants in my town) and export it into an Excel spreadsheet.

    How would I begin this? I think I'd need to use Google Maps API but I don't know what to do with it.

    Are there any examples of projects or apps like this? Sorry, I don't know what I should be asking for

    submitted by /u/lumos-
    [link] [comments]

    New to java

    Posted: 25 Aug 2019 05:53 PM PDT

    I'm learning Java and I'm quite new to object oriented language. I didn't understand how objects ,classes and methods(functions ) work in java .Can anyone give me a better and clear explanation and how to use it

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

    Bootcamps like WozU

    Posted: 25 Aug 2019 01:55 PM PDT

    Do companies take people seriously that don't have formal degrees in computer science?

    Are Boot-camps affiliated with WozU (from Steve Wozniak) considered legitimate or are they laughed at in a sector like this?

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

    Questions concerning heaps.

    Posted: 25 Aug 2019 09:05 PM PDT

    I understand many of the basic principles of a min or max heap. However, I am confused on the some things.

    For one, it seems like I must have ALL of my data before I start heap sorting. To heap sort, I need all my data in a min/max heap. It doesn't make sense to sort all of my values and then add an additional value.

    So, first question is: Would I wait until all of my data is collected before turn it into a heap and then sort? If I receive an additional value after the heap sort, what's the best course of action?

    My second question is: A max heap sort will produce an array of ascending values and a min heap sort will produce an array of descending values right?

    Thanks for any help!

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

    Am I the only one?

    Posted: 25 Aug 2019 08:49 PM PDT

    Hey gang! So I can't be the only one who drowns in analysis paralysis on a reg basis? See a great course or book or whatever, start and then decide I don't like it, or mabe I've found something better. Only to move on and do the same all over again! The only luck I've had in sticking with a resource is a book I've started called "Eloquent JavaScript ". There is just so much great stuff out here, it's a good problem, but a problem nonetheless.

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

    Learned a few languages now what? Needing Help.

    Posted: 25 Aug 2019 08:40 PM PDT

    So I've been in college working on a computer science degree and i'm worried that i'm not learning what i need to know to actually apply it in the real world. I know a bit of C, C++, Java and Python. However everything I've done so far has been from a website learning environment. I have messed around in unity for fun but can only get things done if I keep googling how to do things. How do I get past this point? I'm interested in doing literally anything with programming.

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

    i know this is off from topic

    Posted: 25 Aug 2019 01:48 PM PDT

    I don't know what happening with me whenever my professor teach us lecture in some time i concentrate on him but suddenly after 5 min i found myself thinking something else i not able to control this plss help me

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

    50 min written test of HTML, CSS, JavaScript, PHP, and MySQL

    Posted: 25 Aug 2019 07:03 PM PDT

    To apply for a job, the first round that I have to pass is a 50 min written test of HTML, CSS, JavaScript, PHP, and MySQL. I do not understand why the company would do this because if I want a website layout I usually just tweak the HTML and CSS, refresh the page after I done the code, repeat until the layout is like what I wanted. Do you have any idea what a written test of HTML, CSS, etc. will ask for as we can't test our code? It feels strange for me. Thank you

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

    No comments:

    Post a Comment