• Breaking News

    Saturday, April 10, 2021

    How do websites store videos and images? Can this be done using databases? Ask Programming

    How do websites store videos and images? Can this be done using databases? Ask Programming


    How do websites store videos and images? Can this be done using databases?

    Posted: 10 Apr 2021 08:04 PM PDT

    I'm reading a book about HTTP and it talks about "web resources", which are sources of web content such as HTML documents and images. If we want to persist these images, are they then stored on the server along with other web resources, or are they stored in a database?

    In short, where are videos and images stored on websites such as YouTube or even Reddit? Is this done on the database, and if so, in what form?

    Apologies if this question is trivial or not properly worded, I'm new to this field and I'm curious. If someone could point me in the right direction I would appreciate it. There is a lot that I don't quite understand yet, but I am taking steps to learn.

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

    I am confused about choosing the right programming language for me. (In order to create a blog)

    Posted: 10 Apr 2021 04:21 AM PDT

    Python Help

    Posted: 10 Apr 2021 09:51 PM PDT

    Python Code <-----The Code is here

    I am getting the following error

    ********************************************************

    Is there change is Dollar Rate: Yes

    What is the dollar Value: 90

    Dollar Rate: 90

    what is the value of ARS to be priced: 200

    is there Bkash Charge: Yes

    Traceback (most recent call last):

    File "<string>", line 11, in <module>

    TypeError: can't multiply sequence by non-int of type 'float'

    **********************************************************

    1. How do i get the If statement to 'yes' 'Yes' 'YES' , like all form of Yes, no matter how they input it
    submitted by /u/Glad_Negotiation_863
    [link] [comments]

    How do you choose which Open Source License to use??

    Posted: 10 Apr 2021 09:48 PM PDT

    Most of the time, I use the GNU GPLv3 and/or the BSD 2-Clause License for my projects, depending on the scenario (the latter for my own projects, the former just because of it being used in the many forks I choose to build upon).

    However, I am currently working on building my own website, which may have many elements I would want not to be tampered with and/or used (mainly stuff to do with personal info). Which license should I use ??

    Extending upon this, how do you effectively decide what license to use, instead of mindlessly using the same one license every time like I do??

    submitted by /u/k-u-sh
    [link] [comments]

    Is there a way to make a 32bit application use more than 4 gigs of Ram ?

    Posted: 10 Apr 2021 09:43 PM PDT

    Java as a backend

    Posted: 10 Apr 2021 09:09 PM PDT

    So I recently got an internship as a full stack developer and the stack consists of Java and Vue, with cloud services serving as the db (not sure which services, I think dynamoDB). I'm wondering what kind of frameworks on the Java side that I should learn, and where I could find resources to read. I've found articles here and there and some documentation but my Java knowledge is very limited, exclusively to android development. Also I'm just using visual studio but are there an IDEs that are better for Java dev?

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

    What is the name of the programing language with the rabbit logo?

    Posted: 10 Apr 2021 02:30 PM PDT

    Eliminative Coding Competition Platform?

    Posted: 10 Apr 2021 04:55 PM PDT

    I want to create a contest for my student, on the eliminative basis, that is, Every 15 minutes on so, I could lock the submissions of student who has least points. Any Idea where can I get such platform, or which platform provides this facility?

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

    Google Maps API PHP, JS and MySQL, what link am I supposed to use for this?

    Posted: 10 Apr 2021 03:23 PM PDT

    Hi guys! I'm trying to create a map using data that is in a local mysql database. Using the Google Maps Documentation they use a "downloadUrl" method which points directly to the xml file they use which seems to be hosted by Google Storage which charges for its services. Since I'm doing this as part of coursework, I don't really intend on spending money just to do my coursework. Here's a code snippet of what I'm referring to

    downloadUrl('https://storage.googleapis.com/mapsdevsite/json/mapmarkers2.xml', function(data) {
    var xml = data.responseXML;
    var markers = xml.documentElement.getElementsByTagName('marker');
    Array.prototype.forEach.call(markers, function(markerElem) {
    var id = markerElem.getAttribute('id');
    var name = markerElem.getAttribute('name');
    var address = markerElem.getAttribute('address');
    var type = markerElem.getAttribute('type');
    var point = new google.maps.LatLng(
    parseFloat(markerElem.getAttribute('lat')),
    parseFloat(markerElem.getAttribute('lng')))

    I don't really understand what the point of them getting you to process that information into an XML file is, only to then need to pay for them to host a direct link to it, even if for example it was a static database which wouldn't have any more data added to it, I can't seem to figure out how I'm supposed to have it create markers.

    If anyone can clear up my confusion I would greatly appreciate it! TYIA!

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

    Good C Programming Books for Arabic Speakers?

    Posted: 10 Apr 2021 02:58 PM PDT

    Hi,

    Right now I'm tutoring a second year college student for his C programming class whose native language is Arabic. His English is alright (certainly better than my Arabic) but the language barrier is definitely getting in the way. And he seems to really lack the fundamentals for someone as far along in his education as he is - my guess is part of it has been lots of copying & pasting solutions from the internet, part of it is inadequate teaching, and part of it is that language barrier in his classes.

    I'd like to recommend some sort of programming book - ideally one focused on C programming and lower-level concepts like pointers - written in Arabic that he could use as a reference. The quality of C textbooks varies wildly and I'm not qualified to judge them when they're in a language I can't read - can anyone on Reddit suggest a good one?

    Thanks!

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

    Good Book(s) For Big Picture of Web Development

    Posted: 10 Apr 2021 11:09 AM PDT

    Hello all,

    I was wondering if anyone knew of any big picture books about web development.

    It seems like all the introduction to web development books are primarily HTML and CSS, which is just a small fraction of web development.

    Things like how servers work (both the software and hardware), how they interact with frameworks, and how the internet works (and much more) seem good to know to create a highly scalable and secure web site.

    Even if this information is contained in a couple books, I would love some recommendations.

    Thanks.

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

    What are some transaction/wallet APIs which support multiple cryptocurrencies?

    Posted: 10 Apr 2021 12:12 PM PDT

    What are some transaction/wallet APIs which support multiple cryptocurrencies?
    Not just 3 or 4, something which supports the top 10 or top 25 on coinmarketcap.

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

    Is a selenium-webdriver based web crawler safe.

    Posted: 10 Apr 2021 12:10 PM PDT

    I made an app to crawl and spellcheck webpages (mainly to learn web socket).

    How safe is it to allow anyone on the internet to put in a URL for selenium-webdriver to parse?
    Is there an attack vector of some malicious JS that can 'do something bad' to the server/container?

    The only reason i used selenium is to parse Single-page apps, so ostensibly, the JavaScript in those pages is getting run.

    How does Google crawl the web w/o infecting its servers with whatever content is out there on the Internet?

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

    Python Exponentiation function problem

    Posted: 10 Apr 2021 08:24 AM PDT

    I ran into something I don't quite understand this morning. Can anyone explain the following?

    from operator import pow # Prints "False" print(pow(-1,2) == -1**2) # prints "-1" which isn't correct. Should be 1 print(-1**2) # prints "1" which is correct print(pow(-1,2)) 

    according to the standard library documentation, pow is the ** operator in function form. Why do I get different results?? Am I losing my mind here??

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

    VB.net Help

    Posted: 10 Apr 2021 10:56 AM PDT

    Code

    I am trying to write vb.net after like 5yr and i am getting this error:

    $vbnc *.vb /out:main.exeVisual Basic.Net Compiler version 0.0.0.5943 (Mono 4.6 - tarball) Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved. /home/cg/root/1927728/main.vb (4,28) : error VBNC30205: End of statement expected. /home/cg/root/1927728/main.vb (4,28) : error VBNC90019: Expected 'End'. /home/cg/root/1927728/main.vb (10,16) : error VBNC90019: Expected 'End'. /home/cg/root/1927728/main.vb (11,21) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (13,11) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (14,20) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (15,20) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (16,15) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (18,16) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (19,17) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (21,11) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (22,19) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (23,13) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (24,15) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (25,15) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (27,16) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (28,12) : error VBNC30203: Identifier expected. /home/cg/root/1927728/main.vb (29,11) : error VBNC30203: Identifier expected. There were 18 errors and 0 warnings. Compilation took 00:00:00.7702220

    Using: Compiler

    Not sure what i am doing wrong, help ;(

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

    error in simple python alarm clock

    Posted: 10 Apr 2021 10:48 AM PDT

    I made this simple alarm clock using python which give us input to enter time for alarm and path of mp3 sound file, it was suppose to give notification and ring alarm but it only give notification and give error like below for mp3(sound.mp3) file and code of program is below this error

    error Traceback (most recent call last): File "C:\Users\91844\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__ return self.func(*args) File "c:\Users\91844\Desktop\study\python-projects\alarmclock.py", line 10, in getvalue alarm(set_alarm) File "c:\Users\91844\Desktop\study\python-projects\alarmclock.py", line 23, in alarm playsound(alarmsoundvalue) File "C:\Users\91844\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 35, in _playsoundWin winCommand('open "' + sound + '" alias', alias) File "C:\Users\91844\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 31, in winCommand raise PlaysoundException(exceptionMessage) playsound.PlaysoundException: Error 292 for command: open "" alias playsound_0.16691507259749638 The specified command requires an alias, file, driver, or device name. Please supply one. 

    from playsound import playsound
    from tkinter import * # here starts means import everything from tkinter
    from win10toast import ToastNotifier
    import datetime
    import time
    alarmsoundvalue = ""
    def getvalue():
    set_alarm = f"{hour.get()}:{min.get()}:{sec.get()}"
    alarm(set_alarm)
    alarmsoundvalue = f"{alarmsound.get()}"
    def alarm(set_alarm):
    toast = ToastNotifier()
    while True: #infinite loop
    time.sleep(1) #run this loop after every one second and show current time
    date = datetime.datetime.now()
    now = date.strftime("%H:%M:%S") #time should be in this format(hour, minute , second)
    print(now)
    if now == set_alarm:
    print("Alarm Clock")
    toast.show_toast("Alarm Clock",duration=1) #if time reaches our time of alarm clock then show this notification within 1 second
    playsound(alarmsoundvalue)
    root = Tk()
    root.title("Alarm Clock")
    root.geometry("500x250")
    info = Label(root,text = "(24)Hour Min Sec").place(x = 200, y = 30)
    set_time = Label(root,text = "Set Time(24 hour format)",relief = "solid",font=("Cambria",10,"bold")).place(x = 45, y = 68) #relief solid means background border (black line)
    set_time = Label(root,text = "Enter mp3 file path",relief = "solid",font=("Cambria",10,"bold")).place(x = 45, y = 93)
    # Entry Variables
    hour = StringVar()
    min = StringVar()
    sec = StringVar()
    alarmsound = StringVar()
    # Entry Widget
    hour_E = Entry(root,textvariable = hour,bg = "grey",width = 4).place(x=210,y=70)
    min_E = Entry(root,textvariable = min,bg = "grey",width = 4).place(x=240,y=70)
    sec_E = Entry(root,textvariable = sec,bg = "grey",width = 4).place(x=270,y=70)
    alarmsound_E = Entry(root,textvariable = alarmsound,bg = "grey",width = 20).place(x=210,y=100)
    submit = Button(root,text = "Set Alarm",width = 10,command = getvalue).place(x =212,y=170) #command = getvalue it will take all entered value and getvalue function is defined in line 8
    root.mainloop()

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

    Voice generation over shape-shifting faces.

    Posted: 10 Apr 2021 10:06 AM PDT

    I'm not quite sure if this is the right place for this. If it isn't, please tell me where else to go and I'll delete the post.

    For a while now I was fascinated by these Deepfake generated faces. But at the same time I wondered what it would sound like if we'd consider these faces as a singular shape-shifting entity and gave it a sentence to say. The sound/voice would change just as the faces, from young to old, male, female etc. in a smooth transition.

    Sadly I know nothing about programming. This isn't supposed to be a request or anything. I just wanted to share the idea and maybe someone considers it as interesting as I do.

    Have a nice day!

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

    i bet you can't explain the conditional statement in this code

    Posted: 10 Apr 2021 02:31 PM PDT

    I found this code on developer Mozilla web site. I am a bit confounded by the if statement.

    ```

    let myArray = ['a', 'b', 'a', 'b', 'c', 'e', 'e', 'c', 'd', 'd', 'd', 'd']

    let myOrderedArray = myArray.reduce(function (accumulator, currentValue) {

    if (accumulator.indexOf(currentValue) === -1) {

    accumulator.push(currentValue)

    }

    return accumulator

    }, [])

    console.log(myOrderedArray)

    ```

    In the if statement it says **accumulator.indexOf(currenValue) === -1** how does this make sense given that the accumulator in this case is the value "a" and the current value is "b". does "a".indexOf("b") make sense?

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

    Help with code for a beginner

    Posted: 10 Apr 2021 08:10 AM PDT

    Hey guys I'm really new to programming im in my first year in college . For my end of year project I need to create a website that searches for videos from Youtube Twitter Instagram and Facebook and then posts their links with their like to dislike ratio or like to comment ratio. We are supposed to use either Python or Java, any help on how I should get started and what I should do would be extremely appreciated!

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

    Need help in choosing the next step

    Posted: 10 Apr 2021 07:53 AM PDT

    I am a beginner who wants to learn Data Structures and Algorithms. After learning C++, should I start C++ STL or Data Structures and Algorithms?

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

    Advice on getting data from webpage (in chrome extension)

    Posted: 10 Apr 2021 07:35 AM PDT

    Hello all,

    I am building a chrome extension for fun and want it to take listings from an ecommerce page, get all the prices and the item links, and then display the top 10 cheapest items and their links in the chrome extension popup page.

    I am wondering what would be some efficient ways to get the data from the webpage. For example, I considered getting the entire html data- not sure if implementing a scraper would work as well.

    I appreciate any insight! Thanks~

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

    Programming structure help - Express + TS

    Posted: 10 Apr 2021 07:00 AM PDT

    Hello, r/AskProgramming,

    Hopefully I'm in the correct place and you could help me out. I'm fairly new to writing Express API's in TypeScript however I've written plenty in JS. I've recently been trying to harness to power of a strictly typed languages (i.e., TS in this case) to implement better design patterns in my code.

    To practice, I've been writing a very simple API that stores books, authors etc... and trying to enforce a good separation of concerns. However, I'm struggling to come up with a nice solution of receiving information from the front end (whether it be REST, CLI etc...) in the form of a DTO and parsing it such that the DAL can store it.

    In my current solution I have a generic 'Repository' interface that receives the type that it stores as well as a DTO type for creating the database entry. The implementation of a repository (i.e., BookRepository) is then responsible for mapping that DTO into a DAL friendly format. In most cases the only difference is, is that the DTO doesn't include an 'id' field as that's provided by the DAL but it is present in the stored Repository entry type. Apologies if I butchered that explanation, hopefully looking at my code will clear that up!

    Interface:

    https://github.com/FroopleXP/Express-TS-Example-API/blob/master/src/repositories/interfaces/IRepository.ts

    Implementation:

    https://github.com/FroopleXP/Express-TS-Example-API/blob/master/src/repositories/impl/BookRepository.ts

    I wonder if perhaps this mapping should be done at the service layer however, the service layer would not have access to an 'id'.

    Another solution would be to mark the 'id' as optional in the type's interface that way I can treat the type as the DTO and then add the optional 'id' in the DAL. Which has worked until now but I like the idea of having different DTO's based on different entry points to the API.

    Hopefully at least some of that makes sense and you can provide some guidance!

    Any advice / improvements to this problem or anything regarding my approach to structuring this API would be greatly appreciated!

    Thanks in advance,

    SE21

    PS: The posted code is not complete, I'd just like to iron out this problem before implementing more features!

    submitted by /u/Strange-Education-21
    [link] [comments]

    HELP: finding and connecting to headless raspberry pi regardless of which networks you're on

    Posted: 10 Apr 2021 06:29 AM PDT

    I'm new to programming (python) so i'm not sure this is even possible, but I want my pc to be able to 'find' my raspberry pi zero and then let the pi connect to the network of my pc.

    So if I use wifi A it connects to WiFi A and if I use wifi B it connects to wifi B

    I thought this might be possible by using bluetooth, but are there solutions that don't use bluetooth for this? Ik understand that without a network password the pi wont have internet, so therefore sending stuff to it seems impossible. It would be great if people could point me in the right direction, thanks in advance!

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

    No comments:

    Post a Comment