#voice-chat-text-0
1 messages · Page 618 of 1
try get_channel.send()
put message in "()"
its 12 32pm
get_channel.send(f'{member} Welcome on {server}, have fun :D')
i do web dev as well
i do js and py and java
Noice
@whole bear have u tried it
ok
no
what?
no
ye
what is error
im sorry but i have to go and get dinner
ill try solve
tho
wait
async def on_member_join(ctx, member):
get_channel = bot.get_channel(746407943246708778)
await ctx.send.get_channel(f'{member} Welcome on 'f'{server} ,have fun :D')```
try
but gtg so bye
ill be back tho
await channel.send(f'{member, mention}join he server') ^ TabError: inconsistent use of tabs and spaces in indentation
@bot.event
async def on_member_join(member):
channel = discord.utils.get(member.guild.channels, name="welcome")
await channel.send(f'{member, mention}join he server')
no
o
can i get all code except token?
so i can test
hlo?
@whole bear ?
helllooo??
#BOT CREATED BY NeKro
#Version 0.6.5
#######################################################################################################################################################################################################################################################################TOKEN="token"
#######################################################################################################################################################################################################################################################################
Hey @whole bear!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
ok
import discord
from discord.ext import commands, tasks
import random
import youtube_dl
import asyncio
bot = commands.Bot(command_prefix = "!", description = "FREE ACCES IS THE KEY!")
musics = {}
ytdl = youtube_dl.YoutubeDL()
bot.remove_command('help')
bot.remove_command('start')
@bot.event
async def on_ready():
print("Ready !")
#status
status = ["!help"]
@bot.event
async def on_ready():
print("Ready !")
changeStatus.start()
@bot.command()
async def start(ctx, secondes = 5):
changeStatus.change_interval(seconds = secondes)
@tasks.loop(seconds = 5)
async def changeStatus():
game = discord.Game(random.choice(status))
await bot.change_presence(status = discord.Status.dnd, activity = game)
#welcome
@bot.event
async def on_member_join(member):
channel = discord.utils.get(member.guild.channels, name="welcome")
await channel.send("welcome")
#bot-commands
Hey @whole bear!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
###################################################
########## HELP ##############################
###################################################
#!help
@bot.command()
async def help(ctx):
await ctx.send("**Wait,we work on it 😉 **")
#!invite
@bot.command()
async def invite(ctx):
embed = discord.Embed(title="https://urlz.fr/dHe5", url = "https://urlz.fr/dHe5", description = "You can invite me with on your server with this link :D")
embed.set_author(name="INVITATION")
embed.set_thumbnail(url="https://cdn.discordapp.com/app-icons/746407135633473596/8a440678a9c87462d7c2a587b907ff15.png?size=64")
await ctx.send(embed = embed)
###################################################
########## FUN ##############################
###################################################
#!credit
@bot.command()
async def credit(ctx):
await ctx.send("Creator : @[TPB]NeKro#7781**\n\nDeveloper :** @[TPB]NeKro#7781 \n\nDesigner : @[TPB]NeKro#7781")
#!serverInfo
@bot.command()
async def serverInfo(ctx):
server = ctx.guild
numberOfTextChannels = len(server.text_channels)
numberOfVoiceChannels = len(server.voice_channels)
numberOfPerson = server.member_count
serverName = server.name
message = f"The server {serverName} have {numberOfPerson} members ! \nThis server have {numberOfTextChannels} text channel and {numberOfVoiceChannels} voc channel."
await ctx.send(message)
and ur intent for program?
#!say
@bot.command()
async def say (ctx, *texte):
await ctx.send(" ".join(texte))
#!chinese
@bot.command()
async def chinese(ctx, *text):
chineseChar = "丹书匚刀巳下呂廾工丿片乚爪冂口尸Q尺丂丁凵V山乂Y乙"
chineseText = []
for word in text:
for char in word:
if char.isalpha():
index = ord(char) - ord("a")
transformed = chineseChar[index]
chineseText.append(transformed)
else:
chineseText.append(char)
chineseText.append(" ")
await ctx.send("".join(chineseText))
#!russian
@bot.command()
async def russian(ctx, *text):
russianChar = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ"
russianText = []
for word in text:
for char in word:
if char.isalpha():
index = ord(char) - ord("a")
transformed = russianChar[index]
russianText.append(transformed)
else:
russianText.append(char)
russianText.append(" ")
await ctx.send("".join(russianText))
###################################################
########## MUSIC ##############################
###################################################
class Video:
def init(self, link):
video = ytdl.extract_info(link, download=False)
video_format = video["formats"][0]
self.url = video["webpage_url"]
self.stream_url = video_format["url"]
#!disc (disconnect)
@bot.command()
async def disc(ctx):
client = ctx.guild.voice_client
await client.disconnect()
musics[ctx.guild] = []
#!stop (pause)
@bot.command()
async def stop(ctx):
client=ctx.guild.voice_client
if not client.is_paused():
client.pause()
elif client.is_paused():
client.resume()
#!skip
@bot.command()
async def skip(ctx):
client = ctx.guild.voice_client
client.stop()
#play music on youtube
def play_song(client, queue, song):
source = discord.PCMVolumeTransformer(discord.FFmpegPCMAudio(song.stream_url
, before_options = "-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5"))
def next(_):
if len(queue) > 0:
new_song = queue[0]
del queue[0]
play_song(client, queue, new_song)
else:
asyncio.run_coroutine_threadsafe(client.disconnect(), bot.loop)
client.play(source, after=next)
#!play
@bot.command()
async def play(ctx, url):
print("play")
client = ctx.guild.voice_client
if client and client.channel:
video = Video(url)
musics[ctx.guild].append(video)
else:
channel = ctx.author.voice.channel
video = Video(url)
musics[ctx.guild] = []
client = await channel.connect()
await ctx.send(f"Now playing : {video.url}")
play_song(client, musics[ctx.guild], video)
###################################################
########## ADMIN ##############################
###################################################
yea i think so
bot.run(Token)
and ur problem is welcoming people?
and also there was an indentation error if you scroll up
im not sure about that one
Post longer code snippets here : https://paste.pythondiscord.com/
where is ur problem?
@azure kayak
ok
what is the problem so i can solve
is it on_member_join?
is it on_member_join?
on_member_join?
@whole bear
ok
read above
ill try and do that
you find something @azure kayak ?
Brasov
hey @hushed elm
hi @ocean forge
yeah, you build a web by python ?
no, by javascript
but you can build a web server in flask, i did so a long time ago
now i use express.js and javascript
got it 😋
you wanna learn web development?
i use python, i want to learn to build a web by flask
very nice @ocean forge
@green peak look at express.js if you want to build a web server in javascript
@whole bear i solve ur welcome prob
realy?how?
i think
try
async def on_member_join(member):
channel = client.get_channel(741338987373002922)
await channel.send('hi!!')
that
sends hi when user joins
to channel
umbers
change id to channel id
because it worked fine for me
leave server then join again
did it work?
......
hmmmmm
does it give error
ok
Ignoring exception in on_member_join Traceback (most recent call last): File "D:\lib\site-packages\discord\client.py", line 312, in _run_event await coro(*args, **kwargs) File "c:/Users/fxgam/OneDrive/Bureau/code/Python/PATATOR BOT/bot - Copie.py", line 54, in on_member_join channel = client.get_channel(746407943246708778) NameError: name 'client' is not defined
change client to bot
if that it correct?
import discord
bot = commands.Bot(command_prefix='@')
@bot.event
async def on_ready():
print('Start up successful')
@bot.event
async def on_member_join(member):
channel = bot.get_channel(741338987373002922)
await channel.send('hi!!')
my code
and after
it works ^^
me 15
are emulators against rule5 😳 ?
I need to double-check how to do this, one sec
it's fine, @ me if come back perhaps maybe?
It'll be maybe 2 minutes
ok will wait
and game
The funny thing is when you glitch it like this, the rain never stops
and now, rain
Though it's not raining at the Zora Waterfall 
this is weird
this'll be neat to watch
A guy suggested me to learn all kind of terms related to data types,alogrithims and mathematical computer science etc its a lot of stuff do it worth it spending all my time for that
need help?
yeah
get on voice chat
its like 100 of videos all being 1 hour long and a lot of books for that
is it important to clear concepts
python error problem
no like data bases aqlogrithim data and data bases
all kind of terminlogy and concepts
@sweet pulsar WTF
o
i didnt understant
ur language
ok
or i didnt hear correctly
its ok
so whats ur problem?
1/3 pendants
hi
@gentle flint no cat pics today???
noo dont bother
there we goo
it's a cat
its a dogg
hello guys
no doggo
@crimson light you like dogy dogy
oopsss
found a cool dog pic on internet
woah very kulll
oh cute
adorable fluffball
like squirrels
I'm looking
🔵 Python Programming Certification Course: https://www.edureka.co/python-programming-certification-training
This Edureka Python Tutorial for Beginners will help you learn Python programming language and its core concepts with examples from scratch. This Python tutorial video h...
wack
Kaggle is the world’s largest data science community with powerful tools and resources to help you achieve your data science goals.
JAVA GANG 4 LIFE
open aı. is gpt-3
What module did you use for the game @whole bear ? Pygame?
That's.. Just The Legend of Zelda: A Link between Worlds to the Past
a link to the past
@whole bear top right and bottom left
nice
What did ya got?
Top right was the first one I did, and it was the heart
Nice
lextoll is a troll
i aint troll
HE IS RUDE
<@&267629731250176001>
!ban 448499826682888193 goodbye
:incoming_envelope: :ok_hand: applied ban to @long karma permanently.
f1re
where do i repory
hello Floppy
report
Please change you nickname to comply with our nickname policy @whole bear
okay sorry
i need to make a report
!superstarify @whole bear 2d
Your previous nickname, RETARED BLACK BOY, was so bad that we have decided to change it. Your new nickname will be Madonna.
You will be unable to change your nickname until 2020-08-30 16:03.
If you're confused by this, please read our official nickname policy.
Repairing a laptop may sound like a brain surgery, but in fact it is more like a nose job if you are careful. With some experience, you can fix wires, connectors or cooling fan easily, or not. It could be worth a shot!
Read my articles at: http://www.electroboom.com
Follow me...
RyZe coding while drinking vodka
prnt("hlo wrld")
prnyet("rush B")
This is a quick tutorial for getting started with C# in VS Code on Windows with .NET Core! -------- Transcript Hi, this is a video tutorial for getting started with Visual Studio Code, a lightweight c
My Resume Review Service: https://codingisforyou.com/review-my-resume/
👍👍 Best Online Code Training: https://pluralsight.pxf.io/27xKz
👍👍 BEST Web Hosting: http://www.SmarterASP.NET/index?r=codingisforyou
👍👍 Screen Recording Software Used: https://techsmith.pxf.io/XLkDM
👍👍👍 ...
dotnet : The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ dotnet new console --force
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (dotnet:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
.dotnet\tools
The template "Console Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on D:\Python\CSHARPTEST\CSHARPTEST.csproj...
Restore completed in 136.24 ms for D:\Python\CSHARPTEST\CSHARPTEST.csproj.
Restore succeeded.
PS D:\Python\CSHARPTEST> dotnet restore
Restore completed in 43.39 ms for D:\Python\CSHARPTEST\CSHARPTEST.csproj.
PS D:\Python\CSHARPTEST> dotnet run
Hello World!
PS D:\Python\CSHARPTEST>```
namespace CSHARPTEST
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
@potent quest hi kitty kitty
Dev-C++
no
sad noises
Easiest way to kill these things, lol
aight good night guys
genite
i'm just watching that in the background trying to learn kotlin
No problem 👍
@whole bear why no sound on your stream?
Good question, figured I got that set up
I'll see what I can do, gimme a sec
@quasi condor Lemme know if this works
nope @whole bear
no sound is heard
it may be that you're sharing a screen instead of the application
???
Gimme a sec
still don't hear audio
I'm guessing it's just some funkiness where sound isn't possible
just a buzzing from you mic
Sure ain't
This work?
resre@dapper meteor Aşa gelsene
haha
@dapper meteor Türküm knk bu
No sound?
correct
tevbe
Kay, lemme see what's going on
i can't hear a thing
i think we might be hearing your mic instead of the game? idk
@pure ginkgo iranli
There we go
yapamyin
tevbe
@supple marsh they wan tyou to speak turkish
dont listen to them
@dapper meteor ok
Hey folks, can we stick with English?
@crimson light Gonna head off for the time being
ok
guys
how can i put the pdf in my folder on github? i try this: <embed src="https://my.github.io/my.pdf" type="application/pdf" /> but dont works
mention me
godot
i see... youuuu are talking
nope that not my voice
im playing a stream
i like math
check out po shen loh
i call him a freaking math god
oh... i thought you said that youuu were talking
nope
lol
np dude im cool, just playing
ok
Welcome to the Official YouTube Channel of the Daily Challenge with Po-Shen Loh! Please subscribe to stay in touch.
In this daily livestream, Po-Shen Loh will improvisationally create mini-lessons based on questions asked interactively by the audience. He will prioritize ques...
here his stream
anyone play brawlhalla
thanks for the help
OpenResty
A lightning talk by Gary Bernhardt from CodeMash 2012. The sarcasm in this talk does not represent anyone's actual...
You should try brainfuck, it's actually a pretty interesting language.
Whitespace is another fun one.
Brainfuck is actually useful, for computer scientists to prove that another language is Turing-complete.
Because bf is turing-complete, if you can implement a bf interpreter in another language, then that other language is also turing-complete.
https://cs.nyu.edu/courses/fall13/CSCI-GA.2130-001/tiger-spec.pdf
this is the project we did in college. had to write a compiler for this fictitious language called Tiger. the average grade in the class as 60%. i think only two of us finished the actual project
i am no
also i cant play fortnite i lag to much
immortal im guessing your 17
@whole bear i have a question can you unmute me for a second
@versed hare how is your game going
pencolor("green")
pencolor("green")
speed(0)
size=1
penup()
right(60)
setposition(0,0)
for i in range(360):
for j in range(3):
pendown()
circle(50,360,3)
right(-5)
done()
t = turtle.Turtle()
t.pencolor("green")
t.speed(0)
size=1
t.penup()
t.right(60)
t.setposition(0,0)
for i in range(360):
for j in range(3):
t.pendown()
t.circle(50,360,3)
t.right(-5)
t.done()
Ah, I had a similar experience: programmed a bit when I was young, gave up, learned again as an adult.
You want to change the size of the turtle?
t = turtle.Turtle()
t.pencolor("green")
t.speed(0)
t.pensize(20)
t.penup()
t.right(60)
t.setposition(0,0)
for i in range(360):
for j in range(3):
t.pendown()
t.circle(50,360,3)
t.right(-5)
t.done()
You want to cycle through different colours?
hmm
You could do something like this:
(I'm not that familiar with turtle library sorry)
from itertools import cycle
colors = 'red orange yellow green blue purple'.split()
for i, color in zip(range(360), cycle(colors)):
t.pencolor(color)
...
The dots are just to say 'fill in your own code'.
Oh, you could do color = colors[i % len(colors)]
Sorry, didn't catch that?
here's a fun thing to try to implement with turtle: https://en.wikipedia.org/wiki/Dragon_curve
color=['indianred, lightcoral, salmon, darksalmon, lightsalmon, crimson, red, firebrick, darkred']
colors=['indianred', 'lightcoral', 'salmon', 'darksalmon', 'lightsalmon', 'crimson', 'red', 'firebrick', 'darkred']
ill see you guys in a few hours gn
You might actually find statically-typed languages easier to use in the long-run
Python's dynamic typing leads to run-time bugs that would typically be caught by the compiler in other languages (like Java)
An army of ants army are going to fetch food at the opposite end of a thin twig
Nest-> a1a2a3 -> (Food*)
Each ant goes pick up a piece of food and comes back the same way. En route, she headbutts with each of the ants coming in the opposte way.
a1 a2 a3
a1 a2a3*
a1a3* a2
a3 a1a2*
In the above case with 3 ants there are totally three headbutts represented by the *
What is the total number of headbutts for an army of ants of size n assuming each ant does a single trip from Nest to Food and home?
Input Format
3
Constraints
n > 0
Output Format
3
Sample Input 0
5
Sample Output 0
10
someone please :(
wow
godot
Try this @somber heath
from turtle import Turtle
from colorsys import hls_to_rgb
from itertools import cycle
shelly = Turtle()
shelly.screen.colormode(1.0)
shelly.screen.bgcolor('black')
shelly.screen.tracer(0, 0)
rainbow = [
hls_to_rgb(hue/1000, 0.5, 1.0)
for hue in range(1000)
]
F, R, L = 'forward(5)', 'right(90)', 'left(90)'
path = [F]
for i in range(12):
path = path + [R] + [
{F: F, R: L, L: R}[command]
for command in reversed(path)
]
shelly.speed(0)
for command, color in zip(path, cycle(rainbow)):
shelly.color(color)
eval(f"shelly.{command}")
shelly.screen.update()
input()
Yeah, but you can go too far in that direction @somber heath
Hold up, here's an interesting video on this topic...
To listen to more of Richard Gregory’s stories, go to the playlist:
https://www.youtube.com/playlist?list=PLVV0r6CmEsFy2MVGeme_tPtQWxEmFkvof
The late British psychologist Richard Gregory (1923-2010) is well known for his work on perception, the psychology of seeing and his lo...
I did, there's now a big argument going on between Ofqual and the Royal Statistical Society
They weren't able to sit exams this year
So they had to use whatever information they had to estimate the grades that the students would have achieved
It's massively unfair to the brightest students at the worst schools
@somber heath
I honestly hated school. I just hate having to jump through arbitrary hoops.
All hobbies eventually become a chore when they become your job.
You can fall into the trap of doing the easy jobs first, then eventually you're left with only the hard jobs and you grind to a halt.
raise @hushed elm
Make use of python's help function
To quickly look up documentation
oh, ty
Or, if you use IPython, you can do, e.g. str.join? to get the documentation
oooh ok
I think the best approach is to use both
Read a chapter of a book, then watch a video on the same topic
If you get the information in multiple different forms, you're more likely to remember it
The difficulty there is you need lots of data @raven mural
You should join some kind of group project, that way you're more likely to keep going because you're held accountable @raven mural
Also, working with other people is one of the most important skills to learn in software development
The next big thing is probabilistic programming languages
The thing is, a lot of social media apps are explicitly designed to be addictive @warm nacelle
They use the same techniques as casinos
Those are rookie numbers @ember hazel
Is someone on a train?
Also, university education typically isn't meant to be vocational, that's not the point of university education.
He means it takes a year to prepare.
@raven mural you just apply
They will usually do a phone screen
Where they ask you basic subject questions, to screen out people aren't suitable
For a long time Google literally only hired graduates from Ivy League universities @jovial meadow
But they changed that policy
@raven mural
System design questions have become a standard part of the software engineering interview process. Performance in these interviews reflects upon your ability to work with complex systems and translates into the position and salary the interviewing company offers you. Most engi...
All the resources you need to give yourself a world class computer science education
gtg
FANGMULA
@daring depot you mean it's not one-dimensional?
But that might be confusing with Alec
It means you're invested in the company's future
Spanish Flu was terrible because it mostly affected young adults
Epidemiologist @daring depot
👍
even if I don't work at FANG, the stuff I spoke can be verified by just doing the interviews or looking at what Cracking the coding interview says. Its not important that I work in FANG at all, its what I've explained in the process that is important. @whole bear
I'm actually thinking of training to be an epidemiologist
But office work only
No field work 😅
It's a pretty cool field though, and is related to data-science and statistics.
you work at diamondback?
C is nice because it's designed to map easily to assembly @daring depot
True ^
Because when it was made programs were mostly compiled by hand
It's cool to take concepts from Python and apply them back to C code.
@vague urchin are you a programmer?
imagine him being like
nahh i dont program
but its part of my gospel to convert all the servers
that mhm tho
@warm nacelle cya man, hope to talk with u again someday u are fun
quine
@bronze night
@viral sierra
bio engineering for example
George Hotz was trying to re produce and schow how the corona virus works
Why are you getting into an argument?
I think I muted them like 5 seconds after they joined the chat.
However many hours ago that was.
No jpeg
I think they were playing sounds or something annoying, can't remember.
Ohh, ok
Guys, this is kind-of off-topic for this server.
Can we steer the conversation towards programming?
they are at it for 3h now
Talking about politics is bound to get people riled up.
Is anyone here a mod?
@fickle orbit Maybe try the code/help chat room
This is exactly like the arguments I used to have with my brother.
You can't win.
condition_flag = False
while condition_flag == False:
input('What is 1+1? ')
if input == '2':
print('hi')
From the movie, "WarGames".
All rights go to their respective owners.
@warm nacelle
while (1==1):
if (FajrHL == datetime.datetime.now().hour and FajrML == datetime.datetime.now().minute ):
print('hi')
while conditionflag1 == False:
FajML = input("Would you like to snooze for 10 min? ")
if FajML == 'yes' or ' Yes' or 'YES' :
conditionflag1 = True
else:
print('Error: Please type yes or no.')
if (FajML == 'yes' or 'Yes'):
snooze = datetime.datetime.now().minute + 1
if snooze == datetime.datetime.now():
print('SNOOZE IS OVER')
break
FajML.lower() =='yes'
@candid venture you could try some of the challenges at codingame.com
They have a competition coming up soon I think
They're usually pretty fun
@candid venture what kind of things interest you?
Maybe you could do something related to a hobby.
while (True):
if FajrHL == datetime.datetime.now().hour and FajrML == datetime.datetime.now().minute:
print('hi')
while conditionflag1:
FajML = input("Would you like to snooze for 10 min? ")
if FajML.lower() == 'yes':
conditionflag1 = True
else:
print('Error: Please type yes or no.')
if (FajML.lower() == 'yes'):
snooze = datetime.datetime.now().minute + 1
if snooze == datetime.datetime.now():
print('SNOOZE IS OVER')
break
for default every statement is True
while conditionflag1: means also "while conditionflag1 == True:"" but jsut the short way of writing it
@severe elm why do u have a mia khalifa pfp
async def clear_data(self,msg):
"""
Clear the local dict data
name - remove file name from dict
remove file and filename from directory
remove filename from global audio file names
"""
name=self.player[msg.guild.id]['name']
os.remove(name)
self.player['audio_files'].remove(name)
when i do a song i have this problem :
File "C:\Users\Ordinateur\Desktop\Muzik bot\music.py", line 238, in clear_data os.remove(name) FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable: 'ivez8dAaved5TPuXzhzP9'
@severe elm why do u have a mia khalifa pfp
@candid venture i am mia
someone can help me ?
go into "how-to-get-help" channel
or join the voice channel and ask someone, i think this channel here is for ppl who are actually in the voice channel and also talking
just join code/help or the general vc
random.choices(population, weights=None, *, cum_weights=None, k=1)```
Return a *k* sized list of elements chosen from the *population* with replacement. If the *population* is empty, raises [`IndexError`](exceptions.html#IndexError "IndexError").
If a *weights* sequence is specified, selections are made according to the relative weights. Alternatively, if a *cum\_weights* sequence is given, the selections are made according to the cumulative weights (perhaps computed using [`itertools.accumulate()`](itertools.html#itertools.accumulate "itertools.accumulate")). For example, the relative weights `[10, 5, 30, 5]` are equivalent to the cumulative weights `[10, 15, 45, 50]`. Internally, the relative weights are converted to cumulative weights before making selections, so supplying the cumulative weights saves work.... [read more](https://docs.python.org/3/library/random.html#random.choices)
You can use random.choices with weights @bronze night
is he saying probability?
Here is the source for random.choices:
def choices(self, population, weights=None, *, cum_weights=None, k=1):
"""Return a k sized list of population elements chosen with replacement.
If the relative weights or cumulative weights are not specified,
the selections are made with equal probability.
"""
random = self.random
n = len(population)
if cum_weights is None:
if weights is None:
floor = _floor
n += 0.0 # convert to float for a small speed improvement
return [population[floor(random() * n)] for i in _repeat(None, k)]
cum_weights = list(_accumulate(weights))
elif weights is not None:
raise TypeError('Cannot specify both weights and cumulative weights')
if len(cum_weights) != n:
raise ValueError('The number of weights does not match the population')
total = cum_weights[-1] + 0.0 # convert to float
if total <= 0.0:
raise ValueError('Total of weights must be greater than zero')
bisect = _bisect
hi = n - 1
return [population[bisect(cum_weights, random() * total, 0, hi)]
for i in _repeat(None, k)]
They appear to do a binary search on the CDF.
I believe this may be the standard way to do this. @bronze night
from PIL import Image
image = Image.open("1980268.jpg")
foodlist = ["hello"]
while (1 == 1):
foodlist.append("world")
print(str(foodlist))
PS C:\Users\ejliu\Desktop> .\app.py
Traceback (most recent call last):
File "C:\Users\ejliu\Desktop\app.py", line 5, in <module>
File "C:\Python38\lib\site-packages\PIL\Image.py", line 2878, in open
OSError: [Errno 24] Too many open files: '1980268.jpg'
PS C:\Users\ejliu\Desktop>
I don't think it is completely read into memory?
This is a lazy operation; this function identifies the file, but
the file remains open and the actual image data is not read from
the file until you try to process the data...
PS C:\Users\ejliu\Desktop> .\app.py
Traceback (most recent call last):
File "C:\Users\ejliu\Desktop\app.py", line 5, in <module>
File "C:\Python38\lib\site-packages\PIL\Image.py", line 2878, in open
OSError: [Errno 24] Too many open files: '1980268.jpg'
PS C:\Users\ejliu\Desktop>
Cooking=True
Fitness=False
if Cooking and Fitness=True:
print('You are eligible for Job')
elif Cooking=False and Fitness=True:
print('You dont know Cooking but you are Fit, Hence ineligible for Job')
elif Cooking=True and Fitness=False:
print('You know Cooking but you are not Fit, Hence ineligible for Job')
else:
print('Get out of here you are rejected')
Bye @warm nacelle
does someone can tell me what mathematical background i need to start with data science
/ what background is recommended
linear algebra
statistics
alright thx gfever
def counter(arrline):
count = 0
start = 0
sum_of_raw = {}
for i in range(len(arrline)):
if (count == 1):
start = 1
elif (count == 2):
start = 2
elif (count == 3):
start = 3
for j in range(start,start+2):
if (arrline[j] in sum_of_raw.keys()):
sum_of_raw[count] += arrline[j]
else :
sum_of_raw[count] = arrline[j]
count+=1
return(sum_of_raw)
```
File "Solution.py", line 22, in counter
sum_of_raw[count] += arrline[j]
KeyError: 2
use for loop
and take input at string
for i in range(0,len(arline),3)
this will work??
wt is it??
leetcode?
thanks for that
All the resources you need to give yourself a world class computer science education
A lot of comments here are out-of-context
Because you can't hear what people were saying at the time
Are we shit-talking now? 😆
Alright
Wow that other guy earlier was a character.
Sorry, I love gossip.
Like a deadweight loss?
I'll have you know, I have a C in intro economics.
Here's what I think: the measure of the performance of an economy should be social good, but a well-regulated market economy does a pretty good job of producing social good.
Anyone got any server recommendations? @wicked viper @whole bear @fringe bramble @somber heath
Oh btw, what is your mother's maiden name?
Not really
Wintergatan is cool
They have a server
Where they organise the project
Get the audio track "Marble Machine" by Wintergatan:
https://wintergatan.bandcamp.com/track/marble-machine
Marble Machine built and composed by Martin Molin
Video filmed and edited by Hannes Knutsson
Costume designed by Angelique Nagtegaal
See Sommarfågel music video by Wi...
This guy is building a marble music machine
He's building another one
But it's a big project, and it's become like a community thing
With people providing different parts
Watching his videos is actually a pretty good way to learn about project management
I'd recommend it for software engineers
i just wanna say https://www.youtube.com/watch?v=rvz3cQ2KC4Q
your breathtaking
#KeanuReeves #YoureBreathtaking #CyberPunk2077 So today at the Xbox E3 Briefing, I may or may not have become apart of a meme.
i like marxism conventions in australia
its all just australian cussing
racism = bad
Melbourne is a cool city
what is this 🤣
what isnt this
was afk for a bit and i come back to this 🤣
They're about to bring in legislation that forces YouTube to give preferential treatment to large news organisations
damn
What happens if you talk about Marxism at a Marxism Conference...
🔴 SUBSCRIBE TO CATCH FUTURE VIDEOS 🔴
🔵 SUPPORT THE SHOW ON PATREON 🔵 https://www.patreon.com/LewSpears
🎤 WATCH MY STAND UP COMEDY SPECIAL 🎤
Stream/Download: https://lewspears.com/watch
💥SPEARHEAD SUNDAYS PODC...
entertainment
Actually,
Just this week the Home Office vilified human rights lawyers
One sec
xD
us on there 😦
one of the richest country in the world have some of the most common human rights violations
dissapointing
Yeah, but the point is that lawyers are just doing their jobs
being passionate advocates for their clients
I think though, it tends to be more complicated than that
People may have family ties to the UK
Migration also tends to be a positive thing for the target country
On average
I honestly don't know, but that sounds exagerated?
Ok?
Barriers to migration account for something like a halving of global GDP (at least)
Something I learned on my intro economics course
Alright, you're ranting a bit now.
damn i was half listening
Can we change the topic.
but yeahhh rip iranian refugees xD
Perfect wedding gift for that couple that has everything... A Jackalope toaster! https://imgur.com/gallery/VXLZau5
cactus? what was ur point, who was talking about immigration 👀
i was half listening so yeh im intrigued
that is quite a fire risk xD
🤣
You could hang the toast on the antlers
OMG XD
Or bagels
thats actually smart
I'm self conscious 😅
I have a thing about talking on the phone and other people being able to hear half the conversation. Is that weird?
Opal, you sound like a better leader than most ¯_(ツ)_/¯
Btw, I wasn't trying to argue with you earlier, just provide some contrasting points
Chop chop
You need to break up the flow sometimes otherwise people can spiral into a rant
I'm pretty middle-of-the-road, politically speaking
thank god we are considered "useful" immigrants 👀, racisim is scary >->
tru, but saying hi im mohammad isnt a good start, but yeah u can easily fix it if ur actually a decent person
cuz its easier to judge people that way ig
¯_(ツ)_/¯
if obama was here i wouldve studied in the US :p
fucking trump i cant study in the US cuz of him 🤣
trump is like the mosquito in the animal word
rip
regrets
as an iranian , and arab, boy am i in a decent spot 🤣
politics and crap is hard ;-;
ikr, science is easier ngl
lol
humans are weird xD
comp sci easier than politics
it issss tho
mhm
Just want to put it out there not everyone who is white and lives in the suburbs NOT EVERYONES RACIST
edit: dont judge my grammar punk
not as bad as the memes tho
yes we all are a bit biased
Listen to that lecture
yeh u 100% right opal
But bear in mind: explanation is not exculpation
People develop prejudices over the stupidest things.
There was this experiment where they classified people according to which abstract painter they preferred (the classification was actually random)
really?
and people started to develop a negative opinion of people who liked a different painter to them.
when was this?
Or, at the very least, assign certain qualities to them.
pack mentality causes this btw
We think in terms of examplars.
I can demonstrate:
Here are some random lines:
Is it easier to estimate the average length, or the sum of the lengths?
aaaa im afk for a bit and all of this happens
Yep
Yeah, I couldn't find an image that wasn't cut off at the edges (ignore the ones that are cut off)
nono i think its better to ask
is it easier to estimate the average of each black line, or the length of each black line? i think thats ur point
Yeah, exactly.
average = sum/amount of items tho
Because you can stereotype the lines with a typical example
lmao import 🤣
am I wrong?
oh wait i thought u were sending a math thing without context oops xD
e = cm^2
cm ;-;
Alright alright, I was trying to do a psychology demonstration 😅
e = mc^2 ;-;
It's from Danial Khaneman's book
omg lxnn i doubt sum of em get it >->
standard deviation?
You're talking to programmers. People who, by virtue of their vocation, pick apart problems all day long.
@stuck furnace your comparing this to racism yeh? and how its easier to just like avg people out as similar?
idk if that made any sense? 🤣
Yeah, that was the point I was trying to make
we went so off his idea, this is sad xD
How it's easier to be prejudiced (but not correct)
👍
Alright, but the point is that we fundamentally find it easier to think in terms of exemplars.
I'm not explaining this well. It's from Thinking Fast and Slow
Cya @wicked viper
Wasn't someone earlier asking about how to take a random sample from a probability distribution?
I realised what the answer is.
It's a nice book. Totally changed how I think about thinking
View full lesson: http://ed.ted.com/lessons/the-immortal-cells-of-henrietta-lacks-robin-bulleri
Imagine something small enough to float on a particle of dust that holds the keys to understanding cancer, virology, and genetics. Luckily for us, such a thing exists in the form o...
This course will give you a full introduction into all of the core concepts in python. Follow along with the videos and you'll be a python programmer in no time!
⭐️ Contents ⭐
⌨️ (0:00) Introduction
⌨️ (1:45) Installing Python & PyCharm
⌨️ (6:40) Setup & Hello World
⌨️ (10:23...
This course will give you a full introduction into all of the core concepts in python. Follow along with the videos and you'll be a python programmer in no time!
⭐️ Contents ⭐
⌨️ (0:00) Introduction
⌨️ (1:45) Installing Python & PyCharm
⌨️ (6:40) Setup & Hello World
⌨️ (10:23...
help me please
i need help o0n my school project
i will be eternally greatfull
to anyone that can help me
All the resources you need to give yourself a world class computer science education
ok
._.
lol
fractal
try this:
from turtle import Turtle
from colorsys import hls_to_rgb
from itertools import cycle
shelly = Turtle()
shelly.screen.colormode(1.0)
shelly.screen.bgcolor('black')
shelly.screen.tracer(0, 0)
rainbow = [
hls_to_rgb(hue/1000, 0.5, 1.0)
for hue in range(1000)
]
F, R, L = 'forward(5)', 'right(90)', 'left(90)'
path = [F]
for i in range(14):
path = path + [R] + [
{F: F, R: L, L: R}[command]
for command in reversed(path)
]
shelly.speed(0)
for command, color in zip(path, cycle(rainbow)):
shelly.color(color)
eval(f"shelly.{command}")
shelly.screen.update()
input()
Vim
Macbook Air connected to monitor
Ever wondered how graphics cards actually work and what they do to deliver visuals in video games? We explain.
Follow Falcon On Twitter: https://twitter.com/FalconTheHero
Subscribe for more: http://youtube.com/gameranxtv
Thumb Source: Natalia P. Gutiérrez (http://goo.gl/GAA5h...
we found the BBC
you've got a big PPI?
hi mia
yeah ty
Porn by Programmers
welcom to p by p
"Are you a hard working programmer? Take your breaks and dont forget to fab, your Mia"
that is homepage product
@stuck furnace this is a SFW server man
i will have to report you next time
@rapid crown
fluent python
libgen
ssh?
In cryptography, a certificate authority or certification authority (CA) is an entity that issues digital certificates. A digital certificate certifies the ownership of a public key by the named subject of the certificate. This allows others (relying parties) to rely upon si...
letsencrypt
@whole bear turn your volume up
yes
is this a 'technical co-founder' situation?
father it isnt my birthday yet
i don't get it bro
but i do
who is he
he's a meme
what even is Vice?
Why aren't there more Wallace and Gromit memes?
because your on the wrong side of the internet
small PPI
smoll pp macro
what even is Vice?
@stuck furnace youtube channel
I mean, how do they decide what stories to cover?
by watching porn
probs ask a 2 year old
🔵 Python Programming Certification Course: https://www.edureka.co/python-programming-certification-training
This Edureka Python Tutorial for Beginners will help you learn Python programming language and its core concepts with examples from scratch. This Python tutorial video h...
2:39:05
brb
screen realstate
that's 24"
noice
yeeeeeeeeet
hello !
ohh, I did
you can build fractals in blender using sorcar(the first picture)
and a tesselation plugin to build l-systems(the second pic)
nah
oh oke. i use it to build 3D stuff, like fractals similar to those ones
ok
he's definitely inspiring me to want to get into game development
oooh i've seen him around youtube, he builds cool things yeah
ey you might like https://www.youtube.com/watch?v=G2M45AlxdtU&t=180s
Townscaper is an procedural generation city-building toy with an oceanic, medieval aesthetic and minimalist design. As of now, it's a bare-bones click-and-build experience with no gameplay to speak of, in early access while the developer is looking into ways to expand the game...
it's so cute and chill
ohh yeah, I was watching the development of that game on twitter
very nice, right?
yeah, it's nice
he was using some kind of wave-collapse algorithm to generate those buildings
I liked this video:
Clouds are lovely and fluffy and rather difficult to make.
In this video I attempt to create clouds from code in the Unity game engine.
Project source (Unity, HLSL, C#) is now out of early access:
https://github.com/SebLague/Clouds
If you'd like to support the creation of mor...
he's so casual about it, but it's pretty impressive
nice
what does an api do ?
also check out https://twitter.com/TheRujiK/status/1244618492692713472?s=20
Procedural animations and pixel art. This 6-legged beast animates smoothly on almost any terrain. #pixelart #GameMakerStudio2 https://t.co/Y4TUnFIWpq
3737
18474
it's fucking sick
click... noice
godot
Is anyone else getting non-stop adverts for that new Nolan film?
like waiting for godot
I heard that
I'm normally pretty out-going, if I'm getting out of the house
5'10"/5'9" is average height
177.8 cm
UK units are messed up
do you mean centimeters?
Sometimes we use metric, sometimes imperial
oh shit
We measure fuel efficiency in miles per gallon, but we measure fuel in litres
lol really? that's a bit messed up
loool
@sleek tiger
@whole bear what?
wowo do not take that tone with me boy
wdym?
@whole bear what?
@sleek tiger
i was asking a question
prbs
Yeah, ask away @green pollen
India Sucks
you Suck
Ok
I thought That I was the only one with poor accent
hey
I'm trying to help someone in one of the help channels
but I've had a few beers
and now I have no idea what I'm doing
AWS
amazon web services
a bit tipsy
vodka
It is Saturday night
What u Guys were asking?
Like kirsh?
If u guys are meant to discriminate i can leave the chat
We Speak English in the accent we speak our native language
I am not ashamed of my accent
Play nice, people.
@subtle orchid idk what happend, but i know for sure that your voice was bad. It sounded like you were trying to talk while being underwater
It was my mic
you should fix your mic settings man
As figured out earlier no it’s my mic



ho sorry