Will tutor/answer any questions for free.

by Hex

Hex
Member
Kohai
Posts: 78
Threads: 5
Joined: Apr 2016
Reputation: 0
04-30-2016, 10:07 PM
#58232 (1)
Either post them below, pm me, or add me on Skype.


c.o.g.n.i.t.i.v.e



I won't give help on anything I find to be boring, unless it's a remedial task. tl;dr is I'll only help you if it's interesting or if you're in the progress of learning.


go.
Omoi
LᴏʟɪGᴀɴɢ♡
Kawaii
Posts: 1,974
Threads: 223
Joined: Feb 2016
Reputation: 3
04-30-2016, 10:08 PM
#58233 (2)
Hex you suck more than a yoko.

Hex
Member
Kohai
Posts: 78
Threads: 5
Joined: Apr 2016
Reputation: 0
04-30-2016, 10:09 PM
#58235 (3)
(04-30-2016, 10:08 PM)Mavis Wrote: Hex you suck more than a yoko.

I'll suck your dad off you faggot degenerate.
Yoko
Uguu
Waifu
Posts: 1,393
Threads: 78
Joined: Feb 2016
Reputation: 1
04-30-2016, 10:27 PM
#58238 (4)
how do I make an img hosting website ;/
idk how that would be coded ;/

[Image: 687474703a2f2f693135302e70686f746f627563...672e706e67]

SkullCandyy
Senior Member
Kohai
Posts: 387
Threads: 57
Joined: Mar 2016
Reputation: 2
04-30-2016, 11:09 PM
#58241 (5)
How are babies made? Also, how do I get a waifu?

Elm
Senior Member
Kohai
Posts: 402
Threads: 30
Joined: Sep 2016
Reputation: 0
05-01-2016, 12:06 AM
#58243 (6)
Why do you advertise this thread in a RPG section
Hex
Member
Kohai
Posts: 78
Threads: 5
Joined: Apr 2016
Reputation: 0
05-01-2016, 12:20 AM
#58245 (7)
(05-01-2016, 12:06 AM)Bernkastel Wrote: Why do you advertise this thread in a RPG section

Because the fact that Discord throws highlights current channels is the same way they highlight unread channels, which is fucking autistic. 

(04-30-2016, 10:27 PM)Yoko Wrote: how do I make an img hosting website ;/
idk how that would be coded ;/

Not sure if you're joking or not. Not that it's a stupid question, but the emojis make me uncertain. 


Here
http://Hexpresso.net - made it when I got really bored and wanted a place for me to throw shit up.

The base concept of an image host is fairly easy.
  • Take files with image extensions
  • Save them all to a directory with random names(if you so choose)
  • Output uploaded image urls to users when finished
  • Serve said images when url is requested
That's conveyed fairly simply in the following code using Python's Flask.

Code:
from flask import Flask, render_template, request, send_from_directory

#Configuring Flask to run properly with root privs, and setting static dir
#to serve static files(uploads)
app = Flask(__name__, static_url_path='/static')

#Allowed extensions. 
ALLOWED_FILES = [
    'jpg', 'png', 'gif',
    'c', 'cpp', 'jpeg',
    'txt', 'java', 'pdf'
]

@app.route('/', methods=['GET', 'POST'])
def index():
    return render_template('index.html')

@app.route('/upload', methods=['POST'])
def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        f_ext = f.filename.split('.')[1]
        if f_ext in ALLOWED_FILES:
            f.save('static/uploads/' + f.filename)
            return render_template('index.html', file_name=f.filename)
        else:
            return render_template('index.html', rude_dood=True)
            
#So idiots can actually be served files.
@app.route('/<filename>', methods=['GET'])
def serve_static(filename):
    print(filename)
    return send_from_directory('static/uploads/', filename)

if __name__ == '__main__':
    app.debug = True
    app.run()
Yoko
Uguu
Waifu
Posts: 1,393
Threads: 78
Joined: Feb 2016
Reputation: 1
05-01-2016, 12:27 AM
#58246 (8)
(05-01-2016, 12:20 AM)Hex Wrote:
(05-01-2016, 12:06 AM)Bernkastel Wrote: Why do you advertise this thread in a RPG section

Because the fact that Discord throws highlights current channels is the same way they highlight unread channels, which is fucking autistic. 

(04-30-2016, 10:27 PM)Yoko Wrote: how do I make an img hosting website ;/
idk how that would be coded ;/

Not sure if you're joking or not. Not that it's a stupid question, but the emojis make me uncertain. 


Here
http://Hexpresso.net - made it when I got really bored and wanted a place for me to throw shit up.

The base concept of an image host is fairly easy.
  • Take files with image extensions
  • Save them all to a directory with random names(if you so choose)
  • Output uploaded image urls to users when finished
  • Serve said images when url is requested
That's conveyed fairly simply in the following code using Python's Flask.

Code:
from flask import Flask, render_template, request, send_from_directory

#Configuring Flask to run properly with root privs, and setting static dir
#to serve static files(uploads)
app = Flask(__name__, static_url_path='/static')

#Allowed extensions. 
ALLOWED_FILES = [
    'jpg', 'png', 'gif',
    'c', 'cpp', 'jpeg',
    'txt', 'java', 'pdf'
]

@app.route('/', methods=['GET', 'POST'])
def index():
    return render_template('index.html')

@app.route('/upload', methods=['POST'])
def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        f_ext = f.filename.split('.')[1]
        if f_ext in ALLOWED_FILES:
            f.save('static/uploads/' + f.filename)
            return render_template('index.html', file_name=f.filename)
        else:
            return render_template('index.html', rude_dood=True)
            
#So idiots can actually be serveed files.
@app.route('/<filename>', methods=['GET'])
def serve_static(filename):
    print(filename)
    return send_from_directory('static/uploads/', filename)

if __name__ == '__main__':
    app.debug = True
    app.run()

Thank you, your concepts made it easier to understand the process!
I don't know Python at all though, I do know Javascript a bit though so maybe I could make it work with that?
Do you know JS?
If I could just set up a simple site like yours that would be really cool, but idk if I want to use Python.

[Image: 687474703a2f2f693135302e70686f746f627563...672e706e67]

Hex
Member
Kohai
Posts: 78
Threads: 5
Joined: Apr 2016
Reputation: 0
05-01-2016, 12:57 AM
#58247 (9)
(05-01-2016, 12:27 AM)Yoko Wrote:
(05-01-2016, 12:20 AM)Hex Wrote: Because the fact that Discord throws highlights current channels is the same way they highlight unread channels, which is fucking autistic. 


Not sure if you're joking or not. Not that it's a stupid question, but the emojis make me uncertain. 


Here
http://Hexpresso.net - made it when I got really bored and wanted a place for me to throw shit up.

The base concept of an image host is fairly easy.
  • Take files with image extensions
  • Save them all to a directory with random names(if you so choose)
  • Output uploaded image urls to users when finished
  • Serve said images when url is requested
That's conveyed fairly simply in the following code using Python's Flask.

Code:
from flask import Flask, render_template, request, send_from_directory

#Configuring Flask to run properly with root privs, and setting static dir
#to serve static files(uploads)
app = Flask(__name__, static_url_path='/static')

#Allowed extensions. 
ALLOWED_FILES = [
    'jpg', 'png', 'gif',
    'c', 'cpp', 'jpeg',
    'txt', 'java', 'pdf'
]

@app.route('/', methods=['GET', 'POST'])
def index():
    return render_template('index.html')

@app.route('/upload', methods=['POST'])
def upload_file():
    if request.method == 'POST':
        f = request.files['file']
        f_ext = f.filename.split('.')[1]
        if f_ext in ALLOWED_FILES:
            f.save('static/uploads/' + f.filename)
            return render_template('index.html', file_name=f.filename)
        else:
            return render_template('index.html', rude_dood=True)
            
#So idiots can actually be serveed files.
@app.route('/<filename>', methods=['GET'])
def serve_static(filename):
    print(filename)
    return send_from_directory('static/uploads/', filename)

if __name__ == '__main__':
    app.debug = True
    app.run()

Thank you, your concepts made it easier to understand the process!
I don't know Python at all though, I do know Javascript a bit though so maybe I could make it work with that?
Do you know JS?
If I could just set up a simple site like yours that would be really cool, but idk if I want to use Python.


Haven't done it in js before, but I'm pretty sure you can just post the file to the directory within a form. I'll look into it.
Yoko
Uguu
Waifu
Posts: 1,393
Threads: 78
Joined: Feb 2016
Reputation: 1
05-01-2016, 12:59 AM
#58248 (10)
(05-01-2016, 12:57 AM)Hex Wrote:
(05-01-2016, 12:27 AM)Yoko Wrote: Thank you, your concepts made it easier to understand the process!
I don't know Python at all though, I do know Javascript a bit though so maybe I could make it work with that?
Do you know JS?
If I could just set up a simple site like yours that would be really cool, but idk if I want to use Python.


Haven't done it in js before, but I'm pretty sure you can just post the file to the directory within a form. I'll look into it.

True, I guess if I can just make the image file go to the directory and then call it back it will work
or something
wut

[Image: 687474703a2f2f693135302e70686f746f627563...672e706e67]

Hex
Member
Kohai
Posts: 78
Threads: 5
Joined: Apr 2016
Reputation: 0
05-01-2016, 01:05 AM
#58249 (11)
(05-01-2016, 12:59 AM)Yoko Wrote:
(05-01-2016, 12:57 AM)Hex Wrote: Haven't done it in js before, but I'm pretty sure you can just post the file to the directory within a form. I'll look into it.

True, I guess if I can just make the image file go to the directory and then call it back it will work
or something
wut

Meh, not sure. Honestly the best thing to do would be setting up a route at like, /upload that takes post data and saves the file it receives. Which can't be done with vanilla JS, as far as I know, since that's server-side work. Node, however, would be fitting. I just prefer Flask over Node for various reasons.