#algos-and-data-structs

1 messages Β· Page 84 of 1

agile sundial
#

of course, you shouldn't be using bubble sort to actually sort anything

silent girder
#

I have a design patterns course to do next

#

I would use the python built in sort or sorted function myself lol

gaunt forge
#

When you're using bubblesort, it's generally with the assumption of 1) small data set 2) mostly pre-sorted

#

and because you're really tight on memory constraints

agile sundial
#

ehh what about insertion sort

#

worst case is the same as bubble, but on partially sorted data it's much faster

silent girder
#

I was hoping I could do a reverse with an eval statement py def bubble(sorted_list, revers=False): if reverse: direction = eval('<') else: direction = eval('>') amount = len(sorted_list) counter = 0 for i in range(len(sorted_list)-1): swap = False amount -= 1 for i in range(amount): counter += 1 if sorted_list[i] direction sorted_list[i+1]: sorted_list[i], sorted_list[i+1] = sorted_list[i+1], sorted_list[i] swap = True if swap == False: return sorted_list, counter return sorted_list, counter

#

I did it!py def bubble(sorted_list, reverse=True): if reverse: direction = operator.le else: direction = operator.ge amount = len(sorted_list) counter = 0 for i in range(len(sorted_list)-1): swap = False amount -= 1 for i in range(amount): counter += 1 if direction(sorted_list[i], sorted_list[i+1]): sorted_list[i], sorted_list[i+1] = sorted_list[i+1], sorted_list[i] swap = True if swap == False: return sorted_list, counter return sorted_list, counter

agile sundial
#

you could also reverse by changing the sign of every element

fair summit
#

I think the current solution is the preferred one, using negation would make it unable to sort lists of non-numbers

agile sundial
#

yeah

gaunt forge
#

I think insertion sort and bubble sort are roughly equivalent. They're both trash

#

No, no UC, sometimes when you're forced to be in-place it's not terrible

#

on small datasets

lean dome
#

right - Big O is all about how performance changes as the data set grows. For large datasets, insertion sort is terrible. For small ones it can outperform other algorithms.

mortal pewter
#

talking about algos

#

I was looking at the maximum subarray sum problem and came up with an algorithm but I'm not sure it actually works. I came to a proof that more or less works but there are details to work out

#

but I also don't want to reinvent the wheel

#

has anyone heard of a solution like this? basically my idea is to take contiguous terms of the same sign and merge them (add them into a single value) and then also check sequences like +-+ or -+- and also add them up under certain conditions

#

also I independently invented bubblesort in my first year at uni lmao my prof wasn't impressed

silent girder
#

so I made a selections sort now ```py
def selection_sort(iter_nums):
swap = True
marker = 0
count = 0
while swap:
swap = False
marker += 1
for idx, num in enumerate(iter_nums[marker:]):
if iter_nums[idx+marker] < iter_nums[marker-1]:
count += 1
iter_nums[idx+marker], iter_nums[marker-1] = iter_nums[marker-1], iter_nums[idx+marker]
swap = True
return(iter_nums, count)

l1 = [2,10,8,5,3,1,9,6,4,7,]
print(selection_sort(l1))

#

it takes half as many iterations as the bubble sort I made last night

silent girder
#

strange thing is happening though sometimes its not working just sorting a random generated list with randint

agile sundial
#

so with insertion sort, it's possible to not make any swaps

#

i think

#

ah if part is in sorted order

#

tbh i'm probably wrong about everything

brave oak
#

...wrong language...

vapid dagger
#

and ? none of yall know c?? 😭

agile sundial
#

that's also homework too

mint jewel
#

scanf("%d %d %d", &*p, &*q, &*r); is the troublesome line, you cannot dereference uninitialized pointers

brave oak
#

and ? none of yall know c?? 😭
@vapid dagger I think a fair number of us know C, but why would you ask for C help on a Python server...?

quasi oracle
#

@vapid dagger like mentioned this is a Python server. You could discuss your C problem in an off-topic channel, but there are servers for C

silent girder
#

I think I really have it this time ```py
l = [6, 8, 1, 4, 10, 7, 8, 9, 3, 2, 5] # original case
count = 0
def my_insertion_sort(iter_list):
def swap(iter_list):
for num in range(1, len(iter_list)):
global count
count += 1
if iter_list[num] < iter_list[num-1]:
iter_list[num], iter_list[num-1] = iter_list[num-1], iter_list[num]
reverse_swap(iter_list, 1, num)
continue
def reverse_swap(iter_list, start, stop):
global count

for num in range(stop, start-1, -1):
  count += 1
  if iter_list[num] < iter_list[num-1]:
    iter_list[num], iter_list[num-1] = iter_list[num-1], iter_list[num]
  continue

swap(iter_list)

return(iter_list, count)
print(my_insertion_sort(l))```

split garden
#

I'm working on a pixel art editor in tkinter and was wondering what a good way to export the current image was, it uses frames with bindings rather than a canvas widget for the canvas space, I have a way to scan the cells and make a matrix containing the pixel color values in html notation but don't know of a good way to export to a standard file type

hushed berry
#

print("Hello Discord")

fiery cosmos
#

how do i write this syntax so it works:

#
    print("Invalid input. Number must be between 0 and 10")```
mint jewel
#

if 0 > int(user_input) or int(user_input) > 10

fiery cosmos
#

thank you

slim cypress
#

One message removed from a suspended account.

candid osprey
#

Not sure if you actually wanted to take input twice or not though

#

Logically that seems wrong

cold cloak
#


import pickle

def write():
    f=open('file.dat','wb')
    record=[]
    while True:
        roll=int(input("enter roll no: "))
        name=input("enter name: ")
        marks=int(input("enter marks: "))
        rel=[roll,name,marks]
        record.append(rel)
        ch=input("do u want to add more records? ")
        if ch=="n" or ch=="N":
            break
    pickle.dump(record,f)
    f.close()
    
def update():
    new=[]
    ask=input("do you want to update? ")
    if ask=="y" or "Y":
        obj=open('file.dat','rb+')
        roll=int(input("enter the roll number: "))
        name=input("enter name: ")
        new_marks=int(input("enter the marks to be updated: "))
        latest=[roll,name,new_marks]
        new.append(latest)
        pickle.load(obj)
        for i in obj:
            if i[0]==roll:
                del i[3]
                pickle.dump(new,obj)
                print(i)
                print("updated")
            else:
                print("nope")
        obj.close()        
                
                
                
        
        
write()
update()```
#

i am trying to write and update a binary file here...the writing part works fine..i need help with the updating part.

#

while writing into the binary file, i have used a "roll" input. After it gets written..i use that "roll" to identify the list in the binary file..and also i have written pickle.load(obj) before. With this..i want to update the marks in the list.
should i use 'ab' as the mode?

bronze sail
#

you should use context manager

#

with

#

if you deal with files, thats a standard

fiery cosmos
#

Hello -

#

I want to do Computer Science in Uni and get a degree but i don't know if i am good enough or smart enough to do computer science

#

I don't know if i should

#

any advices on what paths i should take or anything?

toxic orbit
#

I've just started a degree in CS myself. I think it's a good option because it's relevant and in demand, but it can be quite challenging. It can be quite heavy in terms of mathematics, so that's something you need to be aware of - even though I'm not very good with maths I'm enjoying it so far. I just have to work very hard to keep up with it.

fiery cosmos
#

hmm i see

quasi oracle
#

You can start studying CS regardless of whether you'll go to uni in the end. Plenty of resources online

toxic orbit
#

yeah that's true. There are plenty of free courses and resources available

fiery cosmos
#

is it really heavy on math

#

so far i haven't seen anything difficult in terms of the math

quasi oracle
#

But difficult is a subjective term, right? πŸ˜„
There's quite a bit of math in CS. Depending on the institution, you might be able to minimize the amount of math you do in your degree, but as a field there's plenty of math

shell abyss
#

The most difficult math is some of the discrete and boolean stuff imo. Those can be quite important depending on what you work on. The difficulty in em lies in that it is quite strange math, not very similar to what you are used to from regular school math.

fiery cosmos
#

i could see that

#

i liked the math that i've done so far -- the boolean and even statistics (altho i could do without that last one lmao)

shell abyss
#

statistics is super important if you are going into data science though

quasi oracle
#

Depending on what you choose to specialize in, probability theory and statistics might be very important

fiery cosmos
#

ooooof

shell abyss
#

I made the mistake of not paying much attention to my stat classes and I am eating that up now

fiery cosmos
#

damn, i was half awake during my stats classes too lol

shell abyss
#

statisticians can be increadibly boring xD

fiery cosmos
#

facts lol

shell abyss
#

it gets a lot more interesting when you start with applications of it (data science and ML). You need to have a firm grasp of the fundamentals by that time though

toxic orbit
#

Math really isn't my strong suit, and just done a degree in psych so it's been a while since HS for me. I'm doing discrete mathematics atm and it's isn't too hard I guess. I just need to work hard at it to keep up

#

yeah I've heard the ML stuff is heavy on the math side

fiery cosmos
#

ML would be pretty sick to learn

quasi oracle
#

In theory, yes. A lot of contemporary ML is using the libraries developed by others

fiery cosmos
#

interesting

quasi oracle
#

You can use ready-made tools as building block to create some pretty decent applications. If you want to do more advanced stuff and create something entirely of your own you would need to know a lot of the underlying theory, yes

shell abyss
#

You still need a statistical understanding even if you are using libs. The reason is that you need to shuffle the data correctly into the libs and you need to be able to understand the results that come out properly. Debugging ML stuff without understanding the statistics of it is a painful experience.

#

Otherwise you will get results like many of them failed AI scandals (AI identifying a gorilla as a black man and such)

#

I recently found this awesome yt channel that explains statistics in a very good way. This is gold for people that wanna do ML and Data science
https://www.youtube.com/user/joshstarmer

balmy yacht
#

Thoughts on the books clean code and the pragmatic programmer? I’m a self-taught programmer and I still consider myself a beginner. I do some basic data science/machine learning but I wanna learn more computer science concepts. Are those books good for beginners? Are there any books you can recommend?

grizzled cargo
#

read PEP8 for one

#

thats styling, but it will prevent you from making people cringe when they read you code @balmy yacht

#

learn to use things like list comprehensions and generators, seeing a for-loop when a list comprehension should have been used or an explicit list when a generator is possible is un-"pythonic"

#

the lists comprehensions bit is mostly stylistic, but using generators is more memory efficient

balmy yacht
#

Ohh I should read that, yeah. Thanks!

grizzled cargo
#

anyone here good at regex?

#

re.compile(fr"(?sm)<DOCUMENT>\n<TYPE>{FORM}(.*?)</DOCUMENT>")

#

i've got this

#

and FORM is currently a string

#

but I would like to make it a list and have it match anything in the list

#

could I do something like

#

re.compile(fr"(?sm)<DOCUMENT>\n<TYPE>(?:{''.join(FORM)})(.*?)</DOCUMENT>")

shell abyss
#

I'm not sure I understand the problem properly but can't you just iterate through FORM and pattern match on each element?

grizzled cargo
#

yes, i was hoping to just get it in one line though

#

trying to match an html section like this

#

<DOCUMENT>
<TYPE>N-1A/A

#

where FORM=['N-1A','N-1A/A']

shell abyss
#

When it comes to regex they should be made as simple as possible imo. My personal opinion is that a loop with comments explaining what you do is more maintainable than a single line which packs a lot of different operations into one expression.

#

There might be some function in the re module for searching in lists though, might be worth taking a look

grizzled cargo
#

what i sent actually works haha, but i see what you are saying

#

i have like 10 regular expression right now and some are kinda nasty

#

not-lookbacks and all that

shell abyss
#

Most developers don't work that much with regex so the competence is generally not great. Therefore us that do work a bit with regex have to take some pains to make it understandable for our fellow colleagues πŸ˜„

grizzled cargo
#

its awful

#

especially when the documents you are trying to parse aren't uniform

shell abyss
#

Yeah, I know exactly what you mean. I was doing some regex pattern matching in our test frameworks and people have written the tests in completely different ways. So coming up with a regex pattern that caught all variations was extremely painful. A simple thing that would have solved the issue was to implement a coding standard that people had to follow.

grizzled cargo
#

i'm pulling millions of documents from the SEC's website and certain things are uniform, but other things are just awful

#

and there is no way to verify that i am getting good coverage because there are just too many documents to check haha

shell abyss
#

yeah that is a tough nut to crack. I know there are specific libraries built for data cleaning if that could be of any use. Never dabbled with em myself since I have not been in a situation where manual cleaning did not work.

grizzled cargo
#

there are, but i cant have much overhead using BeautifulSoup or whatever since i dont want this to run forever

#

so therefore regex

shell abyss
#

hmm, might be difficult to guarantee good coverage then.

grizzled cargo
#

yeah, but even using more sophisticated libraries would only do so much

#

it would require training a ml model to actually be confident in coverage

maiden sky
#

I am trying to learn classes, I want to print the value I get from def meanvel(self):

#

I did this without using classes

#

but I want to familiarize myself with classes

#

and start using them

#

but I keep getting this error

grizzled cargo
#

def init instead of ininit might do it

maiden sky
#

OH

#

OMG

#

jesus christ

#

thank you so much @grizzled cargo i'm blind

ancient escarp
#
import numpy as np

def sequence_cut(x):
    sum_half = x.sum()/2
    temp_sum = 0
    y = np.empty(0)

    for value in x:
        y = np.append(y, value)
        temp_sum += value
        
        if (temp_sum >= sum_half):
            return y


main_array = np.array([2, 3, 1, 1, 4, 5, 23, 6, 3, 40])
cut_array = np.array([2, 3, 1, 1, 4, 5, 23, 6])

print(sequence_cut(main_array))
print(cut_array)

Why does my function produce a different looking array?

fair summit
#

most functions have dtype=float by default

#

including np.empty

#

btw, you should not use np.append like this

#
def sequence_cut(x):
    sum_half = x.sum()/2
    temp_sum = 0
    y = []

    for value in x:
        y.append(value)
        temp_sum += value
        
        if (temp_sum >= sum_half):
            return np.array(y)```
#

using a list will give you much better performance as x grows

#

(np.append is not a cheap operation, unlike list.append)

grizzled cargo
#

^

#

in general, numpy and pandas attain their speed increases because the data are fixed-length and fixed-type

#

that lets numpy compile functions underneath python

#

so if you are going to be doing lots of appending, numpy is going to have trouble

shell abyss
#

Numpy and pandas are written in C/C++ and that is why they are so fast. Python have a very good interface for calling compiled code from within python interpreted code.

fluid iron
#

Python is slow

agile sundial
#

if you compare cpu intensive tasks, then yes. otherwise, not really

quasi oracle
#

If you keep it in a predefined format with predefined options, you could write a parser for it

#

The start would probably be having a good grasp on string processesing

agile sundial
#

i think there's an "english" programming language floating around somewhere

fluid iron
#

Yes

#

Use string.split

agile sundial
#

yeah you'd have to tell it how to recognize the commands you're giving it

strange merlin
#

would AI and machine learning fit in this channel?

#

actually yeah, so i have a question about Chatterbot, the python library

#

i tried tensorflow but it doesnt support my gpu

#

so i had to drop that

#

i started working on a little chatbot and first thing i did was download a month's worth of reddit comments, to train the model on that

#

i parsed everything into 2 files:

#

one file contains the original messages and the other contains the most upvoted reply.

#

i have about 100000 lines worth of message data

#

and i wanted to start getting to work on my ai model

#

but tensorflow doesnt work with my gpu so i looked into chatterbot

#

what i want to know is if i can train a model i make with chatterbot using the datasets i created

#

no, tensorflow is used for neural networks mostly but it does have the ability for language processing

#

at least as far as i know

#

so does anyone know if chatterbot can do that

#

to train a model off specific datasets instead of just talking to the user because that will take much longer in my opinion

quasi oracle
#

!mute 704193520373596222 3d trying to ping 90k people to advertise whatever pyramid scheme you're managing is unwise

halcyon plankBOT
#

:incoming_envelope: :ok_hand: applied mute to @fiery cosmos until 2020-08-23 19:58 (2 days and 23 hours).

fiery cosmos
#

@strange merlin i don’t really know about Chatterbot but there is this great dialogue system library which uses pytorch and has a bunch of state of the art models called ParlAI.

#

It can be trained with custom datasets too

strange merlin
#

huh

#

okay thanks for the insight ill check it out and see what i can do

restive tinsel
#

nice

fiery cosmos
#

@strange merlin great idea tho

strange merlin
#

@strange merlin great idea tho
@fiery cosmos which one?

fiery cosmos
#

reddit thing

strange merlin
#

ahh

#

yeah

#

i used only a month's worth tho

#

there were datasets from 2007 all the way through 2019 i think

#

but the files were wayyyyy too large

#

a month was 1.2gb with .xz compression

fiery cosmos
#

thats how u get started tho, and the point is chatbot must learn from chatting

strange merlin
#

yeah

#

of course

#

but i wanted to train it off the data first then it can start learning by talking with people

fiery cosmos
#

yep, thats one side

#

or you can train it yourself

#

:p

tender path
#

I have a dict object mapping key,value pairs in the format int:set(tuple) and I want to get the key,value pairs of subsets with the same value, how would I go about this?
e.g.

map = {1:{(1),(2)}, 2:{(1)}, 3:{(1),(2)}, 4:{(1)}}

and I want to return something like

{1:{(1),(2)},3:{(1),(2)}}
{2:{(1)}, 4:{(1)}}```
I've tried using functools.reduce but I'm not entirely sure what my lambda function should be in the first argument
Thanks
agile sundial
#

i think you just have to check them all

tender path
#

damn, thats what I was trying to avoid, thank you

runic tinsel
#

!e

from itertools import groupby
map = {1:{(1),(2)}, 2:{(1)}, 3:{(1),(2)}, 4:{(1)}}

groups =  [ dict(group) for _, group in groupby(sorted(map.items(), key = lambda x: x[1]), key = lambda x: x[1])]
print(groups)
halcyon plankBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

runic tinsel
#

sort, by the value, then use groupby to break it up, same key kwarg

tender path
#

okay thats really good, thanks

quasi oracle
#

You might benefit from frozebsets as they are hashable. Might allow you to avoid sorting

#

Logically, simply printing out the results will force you to go over each item, so you can't do any better than that

full relic
#

let me know if this is the wrong help channel I'm new to python and have been trying to figure out what I did wrong. It read the True or false on vacation but it wont read the range number right so that I could get the else print on range(1,6)

tender path
#

it looks like you set
day = wakeUp[0]
on line 2, so when when the function is entered on line 15 and it reaches line 11
day = "Sun"
i.e. you've set the variable day to the String value "Sun" so the if statement will not be true on line 11

#

if you're new to programming in python I would recommend you learn your way around an IDE (integrated development environment) for python I use PyCharm but there are others available. Using an IDE will allow you to set breakpoints in your code (places where you can pause your script) and let you inspect the value of variables while your program is paused

full relic
#

Ok cool I'll check it out thanks for the help

tender path
#

a way to fix your code would be to replace line 11 with either
if day == wakeUp[0] or day == wakeUp[6]:
or
if day == "Sun" or day == "Sat":

silent girder
#

I just finished a half a course on data structures and algorithms I built this analyzer to test all the functions for time how would I check for complexity and could I improve the code at all https://github.com/g4m3rm1k3/data-struct-algo-s

agile sundial
#

the only ways to test for complexity are to either: 1) think about it or 2) plot a bunch of data and do a regression

#

you could look up average case time complexities for your algorithms and compare

#

if yours are worse, you can improve them

fleet thorn
mint jewel
#

is there an algorithm that can find k highest elements of an iterable in a single iteration

#

I know you can sort/partially sort with selection sort, but neither is all that great

brave oak
#

is there an algorithm that can find k highest elements of an iterable in a single iteration
@mint jewel use a heap with max size k and iterate through, popping from the heap whenever a value higher than any in the heap is found?

#

am I misunderstanding the problem

limber zephyr
#
    author = ctx.message.author
    avatar_url = author.avatar_url_as(static_format = "jpg")
    read_avatar = await avatar_url.read()
    print("avatar read")

    bytes_converted = io.BytesIO(read_avatar)```
how do I convert the bytes_converted file to an jpg here? pls help
#

does this q belong here?

agile sundial
#

isn't there nlargest or nsmallest in the heap module

#

oh but creating the heap is O(nlogn) still

sly compass
#

heap with max size k would work

#

but yeah, think you're stuck with O(nlogn), since sort approach is also O(nlogn)

#

heap has a disadvantage of space too, so quicksort probably best bet

fiery cosmos
#

there is quick select too

#

works like quicksort average complexity is O(n)

#

worst is O(n**2)

sly compass
#

actually would heap solution be O(klogk + n)?

fiery cosmos
#

depends how you are doing it ig

sly compass
#

think so, since insertion would be log k

#

but i guess u insert n times

#

so nlog(k)

fiery cosmos
#

first select the k elements of array and build a max heap

agile sundial
#

how are you gonna select those elements lol

sly compass
#

the first k elements

fiery cosmos
#

just in any order

#

then for the other elements

#

compare it to the root

#

if it is greater than make it the root

#

else ignore

sly compass
#

ur heap will have find-min as well as find-max at O(1)?

fiery cosmos
#

no normal max heap

sly compass
#

interesting

#

that makes sense actually

fiery cosmos
#

it does

sly compass
#

hmmm

#

does it break for this edge case?

fiery cosmos
#

Its been long time I've played with heaps tbh

#

no won't break

sly compass
#

[4,3,2,0,1] , start with 4, so heap:{4, 3, 2, 0}?

fiery cosmos
#

what do you wanna find

sly compass
#

find-max would return 4, 1 is not greater than 4, so your result would end up being 4,3,2,0, right?

fiery cosmos
#

the kth largest or smallest?

sly compass
#

kth largest i believe

#

use min heap instead?

fiery cosmos
#

aight so build a min heap

#

yeah

sly compass
#

big brain

fiery cosmos
#

big brain time

sly compass
#

easier to code probably during interview too

#

compared to quickselect

#

fuck that shit LOL

fiery cosmos
#

if you are using built in heap

#

its pretty easy to code

sly compass
#

i'd be very surprised if you weren't allowed to use builtin heap

fiery cosmos
#

lol rip

sly compass
#

where as quickselect you gotta if(partition[]) and swap(i.j)

fiery cosmos
#

I've never coded quickselect myself but it seems similar to quicksort

agile sundial
#

from what i've read in the past minutes or so it's very similar

sly compass
#

ya

#

and I never want to code quicksort during interview

fiery cosmos
#

its not that hard

#

you just need to get a hang of recursion

#

trying solving recursion problems on leetcode

sly compass
#

no bro... leetcode grind is over for a year..

#

after solving DP i am done...

agile sundial
#

hm what about graphs and trees

normal kelp
#

i am new to phython

#

i used to work with javascript

#

but heard phyton better for game dev

#

so decidedpysun to shift

agile sundial
#

what kind of games are you looking to develop

normal kelp
#

2d games

#

i make milkman karson

#

you download in play store

lean ice
#

but heard phyton better for game dev
better than js maybe but not in general

agile sundial
#

python might be too slow for anything beyond 2d

normal kelp
#

oh i see

mint jewel
#

JS has the advantage in having browser as the distribution platform, and is also much more performant. For gamedev, C#, C++ and haxe seem to be the languages of choice novadays

normal kelp
#

but phytho is good right

#

at least i learn new language

mint jewel
#

python is quite nice, but you may run into performance problems quite soon

gusty grove
#

js is faster than python?

#

really?

lean ice
#

there are some libraries (ei: pyglet) that use OpenGL (C++?) but generally you won't be able to 3d render well

normal kelp
#

ya

mint jewel
#

by far, the JIT is insane

normal kelp
#

jit?

mint jewel
#

it is almost C speed in some cases

normal kelp
#

ya

#

dude

gusty grove
#

so what makes webpages so slow sometimes? it cant just be the downloading of images

#

and other content

#

thats only a few hundred mb at most

mint jewel
#

a ton of dynamic JS will still be slow

normal kelp
#

i used js, cs and c for 7 years now

fiery cosmos
#

use unity

normal kelp
#

@outer lake

#

i do use unity

outer lake
#

Hello?

normal kelp
#

ho dat woked

#

you are the onwer right?

outer lake
#

We share the ownership with three people

normal kelp
#

oh ok

#

what you think about phython

quasi oracle
#

There's no reason to ping owners for that

normal kelp
#

i know

#

i by mistake @ ted ves

#

i wanted to talk to @fiery cosmos

fiery cosmos
#

?

normal kelp
#

sorry if i disturbed you

fiery cosmos
#

pygame is used for game dev

normal kelp
#

i use multple devs

fiery cosmos
#

but python is slow man

normal kelp
#

y

#

?

lean ice
#

It’s a dynamic language

#

Also pygame isn’t great

normal kelp
#

dynamic language meaning?

lean ice
#

If you want 2d use arcade

normal kelp
#

ok

#

i will see

lean ice
#

You don’t have to specify a variables type/you can change it

fiery cosmos
#

try this tutorial

#

it will help

lean ice
#

So like:

a = 5
a = str(a)
a = list(a)```
normal kelp
#

yes i am downloading it

lean ice
#

Whereas in a static language you would need:

int a = 5;
``` and can’t freely change the type
feral orbit
#

hey

#

can someone help me?

#

nvm

agile sundial
#

?

normal kelp
#

umm

#

i hear

sonic pilot
#

can someone help in a python program?

fiery cosmos
#

@sonic pilot Sure.

#

What do you need?

sonic pilot
#

i need to create a program to find the maximum 3 values from a dictionary.. how to do it.. without importing any inbuilt module type thing?

fiery cosmos
#

Uh... um... hmmm. I actually haven't touched dictionarys that much so...

#

Im sure there is someone around here who has tho.

sonic pilot
#

i have done in it class 11- but now in 12 i m not much thorough with it-i seached google

#

but in google everywhere its inserting some module

strange merlin
#

Hey! This is not really that related to computer science, but a few days ago i encountered a problem with tensorflow because I dont have a supported GPU so i dropped the tensorflow idea. now i keep hearing about google colaboratory but it never occurred to me that i might be able to do all my coding there and all my testing there because technically i wouldnt have to install tensorflow on my machine. do you guys think it would work on google colaboratory?

candid osprey
#

Why not take a .values and sort the dict

sonic pilot
#

thats y i asked before asking this question

Hey! This is not really that related to computer science, but a few days ago i encountered a problem with tensorflow because I dont have a supported GPU so i dropped the tensorflow idea. now i keep hearing about google colaboratory but it never occurred to me that i might be able to do all my coding there and all my testing there because technically i wouldnt have to install tensorflow on my machine. do you guys think it would work on google colaboratory?
@strange merlin

candid osprey
#

Take the top 3 after sorting

#

Hey! This is not really that related to computer science, but a few days ago i encountered a problem with tensorflow because I dont have a supported GPU so i dropped the tensorflow idea. now i keep hearing about google colaboratory but it never occurred to me that i might be able to do all my coding there and all my testing there because technically i wouldnt have to install tensorflow on my machine. do you guys think it would work on google colaboratory?
@strange merlin yes, should work fine

strange merlin
#

ok man thanks i am now a very happy man :)

#

xd

twin sun
#

guys i made a program to get me roots of a quadratic equation but the issue is i want answers in fraction instead of decimals, how do i do that ?

finite trout
mint jewel
#

you can either use sympy, or use the builtin fractions.Fraction, but that will not let you make a fraction with irrational parts

finite trout
fiery cosmos
#

don't think it matters how much memory u give a VM (in terms of effecting ur actual computer)

#

i'd say give urself enough to run whatever you are planning to on the VM

marble basalt
#

I mean it does matter, your computer will have less memory available to it

#

12 GB is a ton of ram for a VM, what are you running

oblique panther
fiery cosmos
#

my linux prof lied to us 😦

oblique panther
#

@fiery cosmos sue them

fiery cosmos
#

on it

#

what channel would i ask for python help

oblique panther
shut osprey
#

I think what your professor means is that if you give it less ram than it needs it will just struggle or crash. Its okay that the host has less memory because it allows the guest to run properly

agile sundial
#

12GB is a LOT for a vm

sharp ore
#

how do i use a virtual env? and should i?

strange merlin
#

@sharp ore you can use the venv python module

fresh mulch
#

hey, is there a way to loop a python code a certain amount of times?

#

basic example: you rolling a dice, and you want the players to have 5 rounds, is there a way to loop the random code 5 times before ending?

vocal gorge
#

A for loop?

fresh mulch
#

well yes

#

i cant remember how to use it

tender path
#
for i in range(5):
  print(i)```
will print

0
1
2
3
4

#

everything in the indented block is what is iterated

fresh mulch
#

hmmm ok

fiery cosmos
#

anyone know where I can get free malware samples for testing?

elfin sage
#

hello .... i wanted to learn selenium with python ! is there any good free resource to learn it ?

normal kelp
#

yo

#

@sharp ore

halcyon plankBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

oblique panther
elfin sage
#

@oblique panther but this isnt web dev topic ig

#

i changed my name from bund killer !

oblique panther
#

@elfin sage Selenium is more closely aligned with web development than it is with computer science

elfin sage
#

ahh shit ! i didnt notice i asked in computer science

#

@oblique panther thanks a lot bro !

oblique panther
#

πŸ‘πŸ»

fast stream
#

what is macro

zenith pasture
#

what is macro
@fast stream You mean computer macros? Consider them to be set of instructions to be executed or carried out in a certain order. They are scripts so when you run it, it would execute these instructions.

fast stream
#

@fast stream You mean computer macros? Consider them to be set of instructions to be executed or carried out in a certain order. They are scripts so when you run it, it would execute these instructions.
@zenith pasture oh thank you very much

bronze sail
#

how to generate map?

#

there was some noise if I remeber

warm ravine
#

i have a question ..i have an array that looks like 1 2 2 1 3 3 ...and i want to write it like 1 2 3 1 2 3 do i have a function for it in python?

runic tinsel
#

what does it do for other arrays?

slender sandal
#

that is either a really cool looking painting or a baby in a womb... i can't decide

bronze sail
#

if freaking mointains

fresh mulch
#

im still a beginner at python, how do i use a while true loop anyone ;-;

#

having to ask online since there hasnt been classes due to corona

slender sandal
#
while True:
  # code right here
fresh mulch
#

do you mind if i explain my code to u

slender sandal
#

go ahead

fresh mulch
#

basically, ive made this dice game

#

wheres theres 2 players who roll 2 dices 5 times

#

ive done all the actual dice rolling and things

slender sandal
#

aren't you the guy who posted "how to use a for loop"

fresh mulch
#

yea

#

didnt need it in the end

slender sandal
#

lol okay

fresh mulch
#

so like, if a total score of the 2 dices is even, score=score+10

#

if total score of the 2 dices is odd, score=scre-5

#

at the end, if the 2 players have the same score, they have to keep rolling until 1 beats the other

#

like this is the bit i dont understand, how do i use the while true to keep looping until 1 beats the other?

slender sandal
#

at the end i assume both players get a chance to roll?

fresh mulch
#

yea

slender sandal
#
while score_1 - score_2 == 0:
  # let them both roll another dice here
#

wait

fresh mulch
#

this is right at the bottom of all the coding

slender sandal
#

this will work however i don't think they both get a chance to roll

while score1 == score2:
  ...
#

never mind they will both get a chance

fresh mulch
#

but what if they both roll even or both roll odd ._.

slender sandal
#
while score1 == score2:
  roll_for_player_one()
  roll_for_player_two()
#

then it will keep looping/rolling

fresh mulch
#

yes but my dice=random.randint(1,6)

#

once that loads once, it stays with whatever number it already has

#

so wouldnt just produce the same numbers over and over again

slender sandal
#

are you uh

#

aware that variables can change value

fresh mulch
#

well yes

slender sandal
#

dice = random.randint(1, 6)

fresh mulch
#

but my dice codes kept giving me the same

slender sandal
#

just over and over again

fresh mulch
#

so i had to make seperate variables for every dice

slender sandal
#

dice1 and dice2 aren't going to call random.randint(dmin, dmax) every time

#

they are being set once to that

fresh mulch
#

yea i changed it to (1,6) later

#

actually i had 1,6 orginally, the variable spammed 2 and 3, which is why i changed to dmin and dmax hoping for change

#

after i changed it, it spammed 5, 3 instead of 2, 3, to solve this i just made seperate variables for every dice rolled

slender sandal
#
>>> import random
>>> dice = random.randint(1, 6) # dice is set to a random int
>>> dice
2
>>> dice
2
>>> dice = random.randint(1, 6) # dice is set to a random int
>>> dice
1
fresh mulch
#

ohh

#

ok

#

i understand now, thanks

slender sandal
#

my pleasure.

fresh mulch
#

btw how do you type like that

slender sandal
#

```py
>>> import random
>>> dice = random.randint(1, 6) # dice is set to a random int
>>> dice
2
>>> dice
2
>>> dice = random.randint(1, 6) # dice is set to a random int
>>> dice
1
```

fresh mulch
#

so ' ' '

#

wha

slender sandal
#

it's backticks

fresh mulch
#

uhh

#

\\

slender sandal
#

this character `

fresh mulch
#

oh

#
hello
#

ah, ok thanks

#

once again thank you for your time and effort πŸ™

slender sandal
#

πŸ‘

fresh mulch
#

last question

#

how do i use external file codes when im using an online editor (repl.it) to run python ._.

slender sandal
#

if you import stuff that isn't listed in your files menu it will search for this stuff somewhere and install it. it does it at the start of the program, it takes time to install "dependencies"

fresh mulch
#

uhhhh what?

slender sandal
#

for god sake it does all the magic when it starts the program

fresh mulch
#

im gonna have to get this right first try, cause i dont think i can test ;-;

slender sandal
#

if you're using standard libraries it's not going to install anything new, but if you're using external libraries it's going to try and search for it and then install it

#

import random & import time will work if that's what you're wondering

fresh mulch
#

i dont understand these high tech terms

#

im just a schoolboy in england whose trying to do home learning during corona crisis ;-;

#

still new to python

#

anyways i wont bother you any longer, thx for your time, enjoy the rest of your day πŸ™

slender sandal
#

thank you

valid parrot
#

@fresh mulch
Python is a language that comes batteries in
Which means there is a standard library
Like let's say math or time
But there are still external libraries that you can install with pip
This editor does it for ypu

fresh mulch
#

oh ok

leaden monolith
#

Hi,i just have a doubt that lists in python are analogous to arrays,then what are singly linked lists in python(i know deque is doubly linked list)

fresh mulch
#

good to know

runic tinsel
#

@leaden monolith unless you write your own there aren;t any

#

although generators behave similarly

agile sundial
#

there's llist

silk knoll
#

Is there a set operator that returns the number of elements in a set?

#

I mean like a specific mathematical notation, not how to do it in python

marble basalt
#

||

silk knoll
#

Cheers

marble basalt
#

It's the cardinality

#

|{1, 2, 3}| = 3

bronze sail
#

that two lines are basically overused in math

#

πŸ˜„

#

exploited af πŸ˜„

vocal gorge
#

Admittedly, they all mean about the same - some kind of measure πŸ™‚

rare shadow
#
import itertools
import pygame as pg


pg.init()

BLACK = pg.Color('black')
WHITE = pg.Color('white')

screen = pg.display.set_mode((800, 600))
clock = pg.time.Clock()

colors = itertools.cycle((WHITE, BLACK))
tile_size = 20
width, height = 8*tile_size, 8*tile_size
background = pg.Surface((width, height))

for y in range(0, height, tile_size):
    for x in range(0, width, tile_size):
        rect = (x, y, tile_size, tile_size)
        pg.draw.rect(background, next(colors), rect)
    next(colors)

game_exit = False
while not game_exit:
    for event in pg.event.get():
        if event.type == pg.QUIT:
            game_exit = True

    screen.fill((60, 70, 90))
    screen.blit(background, (100, 100))

    pg.display.flip()
    clock.tick(30)

pg.quit()

gaunt finch
#

t;his is strangely pretty

#

the code

oblique panther
bronze sail
#

awesome πŸ˜„

primal dock
#
def topKFrequent(self, words, k):
        count = collections.Counter(words)
        candidates = count.keys()
        candidates.sort(key = lambda w: (-count[w], w))
        return candidates[:k]```
#

A bit confused what's going on with the lambda function

quasi oracle
#

@primal dock when you sort tuples, it will first sort by the first position. If two tuples are equal in it, it will order them by the second position, and so on

#

So it sorts by the count in reverse (hence its negative), and then by the word itself

primal dock
#

Thank you!

shut osprey
#

usually means a firewall issue

#

Also there is no reason to censor your private ip address, its meaningless to anyone not in your network

oblique panther
#

@fiery cosmos that question would be more relevant to the topic of #networks

maiden moon
#

hi, is anyone explain how to check is bipartite or not

brave oak
#

hi, is anyone explain how to check is bipartite or not
@maiden moon sorry, could you rephrase that?

maiden moon
#

well i am trying to determine the graph is bipartite or not

#

@brave oak i got some edges and node numbers

brave oak
#

oh, a graph

#

you missed that word in your original question I think

#

can you use a library?

#

or do you have to do it with just an edge list

#

in Python

maiden moon
#

@brave oak i am a newbie and dont understand any of it. It is so frustrating

#

@brave oak just a python

brave oak
#

do you understand how graphs work?

maiden moon
#

@brave oak enlighten me please

brave oak
#

hm I'm not really sure if that's within the scope of this channel but okay

#

so basically a graph is a collection of nodes (points) and edges (lines)

maiden moon
#

okay

brave oak
#

you can use graphs to model connections between objects

#

super good example, social media

#

your Facebook can be modelled as a graph, where nodes are people and edges are friend relationships

#

the edges can be undirected, as in this case (if I am your friend, you are my friend)

#

or directed (meaning a line goes one way)

#

to model Instagram as a graph, you need a directed graph, since I might follow you without you following me

#

but I believe your question is about undirected graphs

#

so, do you know what a "bipartite graph" is?

maiden moon
#

I perceived it as, node which has 2 edges and once node has 2 edges it can not create edge with others

#

@brave oak maybe i understand it wrong

brave oak
#

hm

#

no, that's not really right

#

side question: why do you need to do this?

maiden moon
#

i am a student

brave oak
#

so it's for school?

maiden moon
#

yeah, whole concept is fairly new to me.

brave oak
#

okay, I feel like your school is not teaching you properly...?

maiden moon
#

plus language difficulty is the problem i guess

brave oak
#

but anyway let's continue

#

basically, a bipartite graph is a special kind of graph

#

where you can split nodes into two groups

#

and there are only edges between members of different groups.

#

does that make sense to you?

maiden moon
#

so that means, once node in a specific group can not have edges in same group?

brave oak
#

edges to other nodes in that group

#

okay, example.

#

say I own a company where I have sales representatives

#

and I have customers

#

and an edge represents a sales relationship.

#

it makes sense for my sales reps to sell stuff to customers, right?

#

but it doesn't make sense for my sales reps to sell stuff to other sales reps

#

or customers to sell stuff to other customers

#

so every single edge is always between a sales rep and a customer.

#

and a node represents either a sales rep or a customer.

tired arrow
#

is there any good python dev who can help me out with one problem

brave oak
#

if I were to represent that as a graph, it would be a bipartite graph, where the two groups are "sales rep" and "customer", and there are no edges between any of the "sales rep" nodes, or between any of the "customer" nodes

tired arrow
#

i am developing an app which main aim is to protect users privacy.

#

so i am having problem in creating a program.

#

like if someone send you a ip grabber link

#

who many of the user don't know whether it a safe url or a ip grabber

maiden moon
#

@brave oak oh i see. very thorough explanation. And there is calling self-loop regarding to bipartite graph

brave oak
#

@brave oak oh i see. very thorough explanation. And there is calling self-loop
@maiden moon wait, what?

#

what do you mean by the last part

#

oh, okay

#

yes, there should be no self-loops in a bipartite graph

#

since a node is in its own group

tired arrow
#

so in that case there will be an program which will automatically gives the final url as ip grabber are bind with some real url. so the program will detect the real url and instead of that ip grabber link real url will come.

#

so can anyone help me out ?

brave oak
#

so can anyone help me out ?
@tired arrow what's your problem

tired arrow
#

my problem is that

#

to solve ip grabber links

maiden moon
#

@brave oak well its is now clear for me. Graph can be described as 2d array right

tired arrow
#

i mean that ip grabber links are bind with a real url. so if anyone click on that ip grabber their ip address is captured. so i have a solution to solve this problem.

#

basically like auto correction of words we would be correcting the links.

#

for example there is a link which is shopify.co/watch/id=. so this is ip grabber link but this ip grabber link is bind with a normal url. basically when a person click on that ip grabber he will be redirect to a normal url and the person ip will be captured.

brave oak
#

@brave oak well its is now clear for me. Graph can be described as 2d array right
@maiden moon yes, that is one way to represent a graph in memory

tired arrow
#

so if some one is typing www.shopify.co/ then it will automatically correct to the right link. the final link which will open.

brave oak
#

as an "edge list", which is a 2D array where each row has 2 elements representing the IDs of the two nodes being connected

#

@tired arrow no, I mean, what do you want someone to help you with?

#

as an "edge list", which is a 2D array where each row has 2 elements representing the IDs of the two nodes being connected
@brave oak you can also model this 2D array as a Python list of lists

#

and finally, going back to your original question: there are certain algorithms that can operate on an edge list to tell you if it represents a bipartite graph or not.

#

for that, I suggest Google or Wikipedia.

tired arrow
#

i want some one to tell me which python package will help me to create such program.

brave oak
#

there is also an excellent Python graph library called networkx which you can look at

#

but I would strongly suggest you familiarise yourself with the basics of graph algorithms

#

before using the library @maiden moon

#

i want some one to tell me which python package will help me to create such program.
@tired arrow it's not that simple.

tired arrow
#

yeah i know

brave oak
#

I mean

tired arrow
#

but my app main aim is security of the user.

brave oak
#

it's really not that simple

#

that's not relevant

#

how noble your goals are doesn't affect how complex a project it is

#

okay, actually it's not that complex either TBH

#

but it depends on how you want to implement this

#

it sounds like you want it to be a browser addon

tired arrow
#

no

maiden moon
#

@brave oak does this mean 1 and 2 are connected and 3,3 are connected?

[[1,2], 
 [3,3]]
brave oak
#

yes

#

that is correct

tired arrow
#

it will be implement in the app only which is messaging app.

#

if some is type message then in that message it will auto correct that ip grabber link to the normal url.

maiden moon
#

@brave oak
but it has 3 nodes, 3,3 is kind of a self loop ???

brave oak
#

yes, it is

#

nothing wrong with that

#

it's a valid edge

maiden moon
#

it is still not clear that how can i validate it is a valid edge ?

brave oak
#

why do you think a self loop is not valid?

maiden moon
#

for that case, 2,2 is a valid edge too right?

brave oak
#

yes, of course

#

we must distinguish between the graph itself and the business concept we intend it to represent

tired arrow
#

like the below link is a ip grabber but don't open it

brave oak
#

there is nothing wrong with a graph having self loops

maiden moon
#

that being said, 2 it self alone node that is a valid too ???

brave oak
#

but if your graph represents, say, Facebook, it doesn't make sense for there to be a self loop, right?

#

because you can't be friends with yourself

#

that being said, 2 it self alone node that is a valid too ???
@maiden moon no, that would not be valid

torpid crown
#

@tired arrow We're not going to let you post that ip grabber link

brave oak
#

an edge must always be between two nodes

tired arrow
#

oh discord had done a good job to solve ip grabber problem.

brave oak
#

it's just that those two nodes can be the same node

tired arrow
#

@torpid crown i was just saying that how ip grabber can captured your ip

brave oak
#

so like [2, 2] is an edge from node 2 to node 2 (valid)

tired arrow
#

i am ethical person.

brave oak
#

[2] is an edge from node 2 to nothing (invalid)

torpid crown
#

Just dont post the link again.

tired arrow
#

i am also trying to fix ip grabber link .

#

okay bro.

maiden moon
#

ah, so i have to check 2d array has more than 1 element?

brave oak
#

well

tired arrow
#

so any idea how to create such programs

brave oak
#

I think most algorithms assume that your edge list is already validly formatted

#

anyway @maiden moon I need to do stuff but I hope I've given you an idea of how to start

#

good luck!

maiden moon
#

@brave oak so, as for valid input, i just have to check input is making a valid connection?

#

@brave oak oh alright, thank you so much. It is a huge help.

torpid crown
#

@tired arrow so if I'm understanding this correctly, you're trying to detect IP grabbers?

tired arrow
#

yes

#

i am developing a secure messaging and social media platform app

#

which will not do data mining

#

like facebook

torpid crown
#

Alright. Us moderators get pinged every time a IP grabber is posted, just so you know.

tired arrow
#

but then that whole message is remove.

iron sierra
#

Hi I am a new python coder I only know the basics can someone teach me some advanced ??

#

πŸ₯Ί

fiery cosmos
#

im new too

trail reef
#

@iron sierra hit the docs , figure out why you want to learn python explore lib that match your interest , learn Data structures and algorithms

summer reef
#

Yeah, you can't just say "Hey, please, teach me".
Especially not in a topical channel; did you read the server's rules ?

#

Rule 7
Keep discussions relevant to channel topics and guidelines.

night grove
#

Please allow me to reformulate Rocky's question

dawn steeple
#

help

night grove
#

After learning the basics, what do you recommend to someone who does not have a cs degree. What do they teach at uni that you don't learn from the docs/googling?

#

Does someone have a cs book recommendation?

glass robin
#

Look up Operating Systems in Three Easy Pieces. They have free PDFs of the chapters and while the example code is in C, the concepts are immensely helpful for understanding computer science.

#

One of the best books I’ve read regarding computer science as a topic and I recommend it to anyone. Helps you look at a lot of topics in a new way, including but not limited to pointers, arrays, abstract data types, threading/multi threading/concurrency/parallelism.

brave oak
#

After learning the basics, what do you recommend to someone who does not have a cs degree. What do they teach at uni that you don't learn from the docs/googling?
@night grove nothing much, really.

#

it might just be more conveniently packaged

#

IMO

#

well, low-level stuff might be more accessible in an academic context

main wyvern
#

So Im interested in making websites and I have already learned css and html do any of you recommend me learning python next or no

fading juniper
#

LOOOOL

main wyvern
#

@fading juniper tf u mean LOOOOOL

fading juniper
#

oh i wasn't talking to you, sorry if that was rude. Learn python! it's great for most applications! nezNice

main wyvern
#

ok thank you so much

fiery cosmos
#

@fading juniper Is python only for web apps?

fading juniper
#

Usually you would us JS for webapps (front end) Python is mainly for backend, but no, it's not only for webapps, it has several different uses

prisma stratus
#

@main wyvern if your goal is to build websites then you’ll have a hard time without knowing JavaScript

#

You need it if you want an interactive UI

#

There might be some python bindings for webassembly now which lets you write ui code? Not sure. But in any case pretty much all learning materials for websites will be in JavaScript

summer reef
#

Python is nice for the backend of website, i.e. it it a great replacement for PHP, thanks to Django

gritty python
#

@oblique coyote please do not do that you degenerate

uneven geyser
#

@gritty python what makes you think this is okay.

#

!tempban @gritty python 2w spamming some bullshit drama message calling another member a degenerate in tons of topical channels.

halcyon plankBOT
#

failmail :ok_hand: applied ban to @gritty python until 2020-09-10 12:32 (13 days and 23 hours).

blazing bronze
#

I don't know if this is the right place

#

but, I'm trying to draw a line on an image in python, any ideas on how to do that?

runic tinsel
#

are you on windows?

#

if drawing the line is the end goal you could jsut use imagemagick

blazing bronze
#

Nope, it's not just the end goal. Only a small piece of a larger project

#

I'm trying to draw a line given two (x,y) coordinates on a fresh 2D image

#

using python

#

and ultimately export/save the image to some folder

runic tinsel
#

turtle then

mint jewel
#

I can suggest pillow for drawing on images

runic tinsel
#

but turtle works if it's a fresh canvas

mint jewel
#

ye, either is probably fine, depending on what else it needs to do

blazing bronze
#

Pillow is pretty much the standard lib

#

I was just wondering

#

other than PIL

#

What's the most efficient way of drawing a line? Since I'll be using this to draw a curve

#

by connecting hundrends or thousands of points with small lines

#

Is the fastest way the pillow way?

mint jewel
#

the fastest way would probably be to do this in Cairo or sth in C/rust/nim

#

but for now, I would just try pillow and see if it is acceptably performant

blazing bronze
#

Good idea

#

I'm not sure I can move the whole drawing logic to C, because honestly, I don't think I can make it work for now

pallid coral
#

You can translate a PIL image to a numpy array, and use fancy indexing/etc to get a good near-c speedup

mint jewel
#

doing drawing with np indexing sounds painful

pallid coral
#

Honestly I was thinking for a perfect curve, good point ><

mint jewel
#

julia may be nice for this actually

stable pecan
#

I've done some numpy image stuff, but never by individually plotting lines

#

I might recommend something with a canvas like pygame or kivy or whatever else is out there and then you can convert the canvas texture to a numpy array or save directly to some image format

#

that way you can use simple drawing functions without reinventing the wheel so-to-speak, though having a numpy drawing library might be fun to make

mint jewel
#

pillow does have drawing functions

stable pecan
#

that's convenient

drifting drum
#

You can translate a PIL image to a numpy array, and use fancy indexing/etc to get a good near-c speedup
@pallid coral could you give an example of the fancy indexing thing?
Or a link to a place which explains doing that, cuz I can't find any

pallid coral
#

See "advanced indexing"

#

you can index a square, compute a circle matrix and apply it, etc

#

one thing to consider is you can make a square, use a rotation matrix multiplied with it, use that rotation matrix with > 0 to get a mask, use the mask to multiply it appropriately and use that for close to pixel-perfect roatations

oak geyser
#

also check out upbge and using curves / splines / meshes to draw stuff

#

it also has a GPU module

gusty bay
#

Guys tears of joy emoji is represented with this 11111011000000010, this i think is represented with continuous bits... why is it not represented by multiple byte

brave oak
#

Guys tears of joy emoji is represented with this 11111011000000010, this i think is represented with continuous bits... why is it not represented by multiple byte
@gusty bay why do you say that?

#

tears of joy emoji is represented with this 11111011000000010

#

this part

gusty bay
#

i just confused is it necassary that bits are always stored as byte?

brave oak
#

hm.

#

the simple answer to your question is "yes"...but I would be more interested in understanding what exactly you're confused about

gusty bay
#

oke so this is what is in my head

brave oak
#

because a byte is a group of bits (most often 8)

#

so asking "are bits always stored as bytes" is kind of a strange question

gusty bay
#

1 bit is on or off, and 1 byte is 8 bits...so to represent the letter 'A' we can need an input of 65 which is 010000001 (this is represented within the limit of a byte). but if i were to represent an emoji i would need to have an input of 128514, and the binary for this is 11111011000000010 shouldn't the bits be divided into bytes bcuz they are continuous with growing power (2^0, 2^1 ...2^10...) .... In byte we only have 8 bits and the maximum power would be 2^7... so wouldn't the emoji be represented with series of byte with different values equal to or less that 128 then we could add them to form 128514

#

._.

brave oak
#

HM.

#

okay

#

so the thing is

#

characters are not just numbers

#

characters have encoding

#

the most common of which is UTF-8

gusty bay
#

so UTF is continous bits?

brave oak
#

so wouldn't the emoji be represented with series of byte with different values equal to or less that 128
but even then this would not be true

#

it would (basically) be more like...(byte_1 * 128 ^ 0) + (byte_2 * 128 ^ 1) + ...

#

just like if you look @ it on a bit level it's (bit_1 * 2 ^ 0) + (bit_2 * 2 ^ 1) + ...

#

pty sure encoding is "a list that has all the characters and their numerical value"
@fiery cosmos not just that...?

brave oak
#

or rather, that would not cover variable-width encodings, which UTF-8 is

gusty bay
#

@brave oak thankuuuuuuu

zenith bay
#

How much time did you take to finish MIT 6.006?

agile sundial
#

about a month or so

leaden monolith
#

Even i started 5 days back(MIT6.006)...I am targeting 1 lecture and recitation per day..Hope I'll continue without any distractions

fiery cosmos
#

can somone explain this to me

#
#include <stdio.h>

void swap(int *x , int *y)
{
  int *temp;
  temp = x;
  x = y;
  y = temp;
}

int main()
{
  int x = 5;
  int y = 10;
  
  printf("x = %d\ny = %d\n", x, y);
  swap(&x, &y);
  printf("x = %d\ny = %d\n", x, y);

return 0;
}```
#

why doesn't this switch the values?

#

is it cause the addresses are call by value as well?

#

why does it work if I dereference them

quasi oracle
#

@fiery cosmos because you want to swap the values the pointers are referencing, and not the pointers themselves.
That said, this is a Python server, so I'm not sure why you're posting it here

fiery cosmos
#

this is a computer science channel

quasi oracle
#

as it relates to python

fiery cosmos
#

πŸ‘Œ

lavish dune
#

Can someone please tell me what this line of code does? :return "({}x {} {})".format(commonfactor(d), '-', abs(n))

grizzled cargo
#

each {} refers to an argument of .format()

#

it can also be written f"({commonfactor(d),}x - {abs(n)})"

vocal gorge
#

stray comma. It's just f"({commonfactor(d)}x - {abs(n)})"

grizzled cargo
#

in multiprocessing can i do something like this

writer = mp.Process(target=write_to_db,args=(q,))
with mp.Pool(initializer=init,initargs=(q,)) as pool:
    for i in pool.imap_unordered(append_to_queue,iter):
        writer.run()
writer.join()
writer.close()
#

i'm just running into too many locking issues with sqlite3

#

is this better for the databases channel?

#

the locking issues are why i am trying to make a dedicated writer process which will have exclusive access to the database

oblique panther
#

@grizzled cargo there isn't really a topical channel that encompasses parallelization. If you're still having trouble with this issue you might open a help session.

ebon bison
#

Holy shit this all looks so complicated

#

What would those programmes even do

gusty grove
#

i've been doing some runtime analysis and wanted to graph how bad the algorithm is if you dont optimize it.

#

actually had to switch to a log scale lol

#

but its pretty much perfectly "linear" in log scale then πŸ™‚

#

haha

#

if you just dont add "in log scale" it looks like O(n)

vocal gorge
#

Is that done with perfplot? I love it too, such a nice library.

agile sundial
#

what's the x axis?

vocal gorge
#

I assume it's a plot of 10**n

dry obsidian
#

Hi everyoneβ€” I’m fairly new to discord so apologies if this is the wrong channel. I have a question regarding time series analysis/handling missing data in a df. Is this the proper channel to ask that type of question?

quasi oracle
tranquil hamlet
#

can anyone help me?

#

my question is write a code that prints yur name and your birthday as separate strings

#

im new to python

late fable
tranquil hamlet
#

no lol its for comp sci class in school hehe

late fable
#

that is general/basic python and belongs in one of the regular help channels

tranquil hamlet
#

ok then

gusty grove
#

@vocal gorge no, matplotlib, whats perfplot? sounds cool

#

@agile sundial x asis is just N, y axis is the output size

#

its kinda like a function f(n) -> List[...] where y elements are returned

viral zenith
#
def pinv_method(A, bx, by, bz):
    Af = np.linalg.pinv(A) # pseudoinvese A
    x = Af @ bx
    y = Af @ by
    z = Af @ bz
    return np.vstack((x, y, z)).T

def linalg_solve(a, bx, by, bz):
    x = np.linalg.solve(np.dot(a.T, a), np.dot(a.T, bx))
    y = np.linalg.solve(np.dot(a.T, a), np.dot(a.T, by))
    z = np.linalg.solve(np.dot(a.T, a), np.dot(a.T, bz))
    return np.vstack((x, y, z)).T

def basic(a, bx, by, bz):
    Af = np.dot(np.linalg.inv(np.dot(a.T,a)),a.T)
    x = Af @ bx
    y = Af @ by
    z = Af @ bz
    return np.vstack((x, y, z)).T

def pinv_no_factorization(A, bx, by, bz):
    x = A @ bx
    y = A @ by
    z = A @ bz
    return np.vstack((x, y, z)).T

def lsqr_method(A, bx, by, bz):
    x = lsqr(A, bx)[:1]
    y = lsqr(A, by)[:1]
    z = lsqr(A, bz)[:1]
    return np.vstack((x, y, z)).T
#

@flat sorrel @vocal gorge

flat sorrel
#

Is is good now?

#

I suppose those times were for 1k points

viral zenith
#

for 1.5k

#

times are good now but result are not very smooth

#

i mean it is what it is in the paper

#

i think its because we minimize the sum of point to neighbors distances, not the distances itself per point

#

im not sure if it would still have least squares solution in that case

flat sorrel
#

so now you're basically setting the target distance to zero?

viral zenith
#

yes

#

i mean, thats what they do in the paper, and I switched from my initial task since least_squares failed with speed and i couldnt come up with Ax=b solution for it

flat sorrel
#

I see

#

Just a random thought, have you considered using a physics-based iterative solution?

#

with connected points attracting/repelling each other based on whether they are further away or closer than the target distance

viral zenith
#

i've tried iterative solution, but i wouldn't say it was physics-based - i just was calculating the neighbors average on one iteration, putting points in there on the next, checking edge lengths and making alterations on further iterations etc. several hundred iterations per point to get some fair results - it wasnt that fast
and it wasn't, lets say, robust )

flat sorrel
#

I see

vocal gorge
#

https://bellard.org/pi/
at the top it says they computed 2700 billion digits of pi with a regular computer
but it also says the best algorithm for finding n digits of pi is O(n^2)
how is this possible
shouldn't n >= 10^4 be infeasible
@winged moon
https://en.wikipedia.org/wiki/Gauss–Legendre_algorithm, which seems to still be the most useful:
The algorithm has quadratic convergence, which essentially means that the number of correct digits doubles with each iteration of the algorithm.

#

so that's very much not O(n^2)

winged moon
#

oh I incorrectly assumed "quadratic convergence" meant O(n^2)

#

when in reality it's O(sqrt(n))

vocal gorge
#

the way they say it, it's actually more

#

if that's not a mistake and the number of digits doubles every iteration, it's O(log(n)) iterations.

#

though maybe the time per iteration increases too and that works out to O(sqrt(n)) time.

winged moon
#

oh right

#

yea it probably is O(log(n))

sudden ember
#

I don't want the answer I do want to figure this out but I've been searching for 30-40 mins and have gotten no closer to figuring out how to interpret any of this

vocal gorge
#

Ah.

#

It just wants you to apply the very simple idea: when writing the asymptotic complexity, you leave only the fastest-increasing term, with no constant.

#

So O(2*n^2 + 2n + 1) is O(2*n^2) (drop all other terms) which is O(n^2) (constant doesn't matter).

#

O(3n^2 + 2^n) is O(2^n).

#

And so on.

sudden ember
#

So like say 2n^3 + 3n^2 would be like 0(n^3)?

vocal gorge
#

yup

sudden ember
#

Thnx that's very helpful

vocal gorge
#

for big enough n, it scales like n^3 - that's what the O-notation means.

sudden ember
#

Ok got it. So basically it doesn't really care about the equation after the initial part?

oblique panther
#

It's all about the dominant term, no matter where it is in the runtime formula.

vocal gorge
#

Uhh, no, 3n^2 + 2n^3 is still O(n^3).

sudden ember
#

Ok

#

0.001n^2 + 10000000n is tripping me up then would that be like 0(n^2 n) or something?

winged moon
#

yea you could have like

#

O(n^3 + 1000000000000000000000000000000000000000000000000000000n^2)

#

and it would be the same as

#

O(n^3)

sudden ember
#

OHH

#

Ok I'm starting to understand

winged moon
#

(but in practice this is probably false lol)

oblique panther
#

0.001n^2 + 10000000n is tripping me up then would that be like 0(n^2 n) or something?
@sudden ember it might seem counter intuitive, but if you have 0.001n^2 or 10000000n, 001 and 100... are still constants

winged moon
#

but by definition it is true

oblique panther
#

and there's some value of n for which the first one is going to be much larger than the other.

vocal gorge
#

@sudden ember Basically, the O-notation describes the behavior as n goes to infinity. Here's a formal proof that
n^3 + 10**100 * n^2 is O(n^3):

f(n) = n^3 + 10**100 * n^2
Let us divide f(n) by n^3. We get:
f(n)/(n^3) = 1 + 10**100 /n

When n goes to infinity, this goes to 1, a nonzero constant. Therefore, by definition, f(n) is O(n^3)
#

f(n) is O(<something>(n)) means (f/<something>) (n) goes to a nonzero constant when n goes to infinity.

lean dome
#

Crucially, big O notation doesn't tell you anything at all about relative performance of two algorithms except when N grows arbitrarily large. One algorithm being O(N) and another being O(1) doesn't tell you that the O(1) one is always faster, only that given enough items eventually some tipping point will become reached where it will become faster.

#

Inserting into a hash table - O(1) - will not always be faster than inserting into a dynamic array - O(N) - because when N is small, the constants can dominate the runtime. For a contrived example, imagine that your hash function takes a consistent 1 second to hash one item. That's constant, and doesn't vary based on the number of items previously inserted, so your hash table insertion is still O(1), but it isn't fast, so plenty of O(N) algorithms will be able to beat it for most values of N.

fallow yew
#

Hey guys anyone here that studies at a UK university

oblique panther
#

@lean dome something I thought of when learning hash tables is that even though all the operations are best case O(1) for n entries, that doesn't tell you anything about the hash algorithm

#

So you could probably get some bad performance in python if you're using long tuples as keys up to a certain number of dict values.

lean dome
#

even though all the operations are best case O(1) for n entries
@oblique panther not just best case, average case, and amortized as well

oblique panther
#

Right

grand river
#

Hi , I want to ask something about taking offer , I am high school student and I want to learn deep learning. before start that I work on image processing with OpenCV. now , I can't improve here because I purchase a course but it's insufficient. after I look another source lot of books , essays , videos but all of these blurred in my mind so I don't know how can I start that I watched Neural Networks from scratch series in these days. now what I should to do ? when I click get started button exist in Keras main site after I dont know which options suitable for me, so what I should ???

#

I write that here I don't know is it true place

vocal gorge
#

#data-science-and-ml, generally.
You might to take one of the many coursera ML courses; they can be done for free in audit mode (can't take quizzes, but that's the only limitation). It sounds like you learned a lot of theory without any practice, so you need a course that guides you though an actual project.

grand river
#

should that start at ML

#

because when talk with who knows about that he says learn DL

vocal gorge
#

because when talk with who knows about that he says learn DL
I mean, that's like saying "don't bother with arithmetics, learn calculus instead" πŸ™‚

grand river
#

I was entered that

#

okay , thanks

rugged oasis
#

Hi i am wondering if i can get the explanation to 100110111111 in hexidecimal

vocal gorge
#

16 = 2**4 - a single digit of a hexadecimal number represents exactly as much information as 4 bits.

#

As a result, to convert binary to hexadecimal, split it into blocks of 4 digits(pad with zeros to the left if necessary, then convert each block.

#

so:

1001  1011  1111
  9     B     F
9BF
#

@rugged oasis

rugged oasis
#

ok i was just confused because there were more than usual

vocal gorge
#

10111010011 would be:

101 1101 0011  - length not divisible by 4, add a zero to the left
0101 1101 0011
  5    D    3
5D3
lament portal
#

ok, so could I ask in here where to find a good tutorial for using python to make a basic AI?
Trying to get it to learn a number game by playing against a player...

maiden moon
#

how can i check interval scheduling job is compatible ?

fiery cosmos
#

how is life like when you do cs?

upper marsh
vocal gorge
#

ok, so could I ask in here where to find a good tutorial for using python to make a basic AI?
Trying to get it to learn a number game by playing against a player...
@lament portal Read on from here:
https://discordapp.com/channels/267624335836053506/303906556754395136/750077678996160643

In short, that'd require learning quite a lot of ML. A basic value-learning tic-tac-toe AI is also discussed in the first chapters of this nice book: http://www.incompleteideas.net/book/the-book-2nd.html (downloadable for free from the official site)

lament portal
#

thank you!
I also waas told to look at Convulational Neural Networks, but I will look at this also!

vocal gorge
#

that can be somewhat relevant, but game AIs pretty much require reinforcement learning, which is quite different from both supervised and unsupervised.

#

(In supervised, you give examples of the right things to do and the network generalizes from them. In RL, you don't give any examples at all, but you give rewards/punishments for actions - so the network needs to experiment and learn what gets it the highest rewards, and also balance exploration and exploitation).

vivid horizon
#

Hey, I want to become an embedded developer. Does anyone know someone who's an embedded developer that I can talk to?

#

I want to develop a roadmap so that I can know what to learn.

fiery cosmos
#

what is the maximum number of addresses that can be referenced? (1 byte store memory address)

#

anyone know^^

#

??

mint jewel
#

on 32bit, 4GB, on 64bit, its complicated

fiery cosmos
#

on 1 byte

#

so 8 bit

mint jewel
#

I mean architectures with 32bit long machine words have 4GB of address space, and architectures with 64bit long machine words have more, but how much more depends. Generally 48bit addresses, so 281TB of address space.

fiery cosmos
#

@mint jewel i am talking about 8 bit

mint jewel
#

there are no 8bit architectures novadays

fiery cosmos
#

yes ik

#

wait

#

can u go priv

#

whatever

#

thanks for nothing

gusty grove
#

Lol

agile sundial
lean dome
#

depends how many bits the byte has. 🀷

vale sable
#

for or_dist_xor
would be ((x xor y) or z) == ((x or z) xor ( y or z)) ?

rare thorn
#

@north zealot The legend himself

#

I love this dude

north zealot
#

Yup, he's great

rare thorn
#

Not even in university do you learn all this stuff and apply them.Meanwhile this man without asking for any fee gives it for free.

#

LEGEND

north zealot
#

Tbh, I want to study microelectronics because of him

rare thorn
#

There is also a post in /r/electronics

#

Searching by top

#

You can find it

#

Its a 16 mb computer

#

Inspired by bens project

#

And the poster has built his own semi-terminal

#

Its pretty cool

#

@north zealot its an interesting field but probably one of the most difficult ones.

#

If some field cuts ties with electrical or mechanical engineering you know its difficult.

#

Also you must have calc 1 and 2 , algebra/linear, pysichs(electricity) hammered in since high school.

viral zenith
#

matrix 99% sparse but sparse inversion is 3x times slower than regular numpy inv

  a = sc.sparse.csc_matrix(np.dot(a0.T,a0))
  b = sc.sparse.linalg.inv(a)
#

any suggestions to check smth?

#

~19000 non-zero elements in 2250000 matrix

#

which means less than 1% density

#

on top of that it is square and symmetrical... dafuq

#

This computes the sparse inverse of A. If the inverse of A is expected to be non-sparse, it will likely be faster to convert A to dense and use scipy.linalg.inv.
mkay... )

gusty grove
#

i assume the part where numpy finds out what elements arent sprase is something like O(n) where as just a array operation is closer to ~O(1) because of vectorization

viral zenith
#

is this 24ms?

#

i cant believe my eyes

#

ok, so sparse inversion was not suitable in my case because result was a dense matrix
but sparse cholesky performs really well

#

btw im surprised i was able to replace inversion with cholesky without any changes to my equation

#

or wait...

#

damn im so stupid

#

ok, so how do I get inverse of A, if i've got cholesky of A which is factorized upper triangular matrix i think.... right?

#

well , in case of scipy its upper by default i think

viral zenith
#

ok, so here i found the equation to compute A inversed through cholesky decomposition
I found out that scipy.linalg.lapack.dtrtri is very fast with inverting triangular matrices

#

but...

#
def basic(a, bx, by, bz):
    X = np.dot(a.T,a)
    # working equation Af = np.dot(np.linalg.inv(X),a.T)
    # calculating inverse of X by finding cholesky decomposition 
    # upper triangular matrix U, invert it, and then
    # X_inv = U_inv @ U_int.T
    U = sc.linalg.cholesky(X)
    Ui = sc.linalg.lapack.dtrtri(U) # triangular inverse, VERY FAST
    Ui = np.asarray(Ui) # convert to array since lapack returns tuple or smth
    Xi= np.dot(Ui,Ui.T)
    Af = np.dot(Xi,a.T)
    
    x = Af @ bx
    y = Af @ by
    z = Af @ bz
    return np.vstack((x, y, z)).T
#

this ^ doesnt work as expected, just plain wrong results
Af = np.dot(np.linalg.inv(X),a.T) - this line gives correct Af

#

replacing lapack inversion with numpy np.linalg.inv(U) works fine
so the problem is lapak output...

#

ok, I think lapak tuple has a strange format

#

ok, it works

#

thanks everyone )

fresh mulch
#

how do i put while and elif in the same line ;-;

loud trail
#

@fresh mulch

  1. this isn't really a computer science question, see #β“ο½œhow-to-get-help
  2. please post your code as text and not a screenshot when possible, a screenshot can be hard for some people to read
fresh mulch
#

oh ok

#

sorry this is for the subject computer science so i thought...

snow swift
#

@fresh mulch indent while loop and its body

icy swallow
#

when you try
to test for a happy number by squaring and adding the digits
does the loop for non-happy numbers always go back to the beginning?

agile sundial
#

huh?

oblique panther
#

@icy swallow what's a happy number?

icy swallow
agile sundial
#

don't you just keep looping until it's 1?

gusty grove
marble basalt
#

What?

median tangle
#

Have my controlled assessment for making a game this year don’t have many details yet on it but any one who has already done it yr10 uk help would be greatly appreciated

slender quiver
#
def int2DArrayToString(list2D):
    return ', '.join(str(item) for innerlist in list2D for item in innerlist)

I pass a 2D list to this function but after each row of the list how can I add a new line character to it? Currently the output looks like this if I pass a random 2D list to it.

2643072647183320516, 6188249542919180808, 4366718118959125391, 3988393958240311701, 7792024028097894202, 6521062128143204340

But I want it to be formatted like this

2643072647183320516, 6188249542919180808, 4366718118959125391
3988393958240311701, 7792024028097894202, 6521062128143204340

also sorry if this is the wrong text channel to post in for this question

quasi oracle
#

join on the inner list, you don't need the second loop

vocal gorge
#

It's a bit of a weird channel choice, yeah. A help channel would probably be better.

What you want, though, is something like:

def int2DArrayToString(list2D):
    return '\n'.join(map(", ".join,(map(str,innerlist) for innerlist in list2D)))
#

hmm, can do a nested map...

quasi oracle
#

Or a nested join

#

Oh mb

#

Yeah you're right

slender quiver
#

ok i see what you did thank you for the help

viral zenith
flat sorrel
#
Dotted two 4096x4096 matrices in 1.18 s.
Dotted two vectors of length 524288 in 0.18 ms.
SVD of a 2048x1024 matrix in 0.86 s.
Cholesky decomposition of a 2048x2048 matrix in 0.15 s.
Eigendecomposition of a 2048x2048 matrix in 8.53 s.

This was obtained using the following Numpy configuration:
blas_mkl_info:
  NOT AVAILABLE
blis_info:
  NOT AVAILABLE
openblas_info:
    library_dirs = ['C:\\projects\\numpy-wheels\\numpy\\build\\openblas_info']
    libraries = ['openblas_info']
    language = f77
    define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
    library_dirs = ['C:\\projects\\numpy-wheels\\numpy\\build\\openblas_info']
    libraries = ['openblas_info']
    language = f77
    define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
  NOT AVAILABLE
openblas_lapack_info:
    library_dirs = ['C:\\projects\\numpy-wheels\\numpy\\build\\openblas_lapack_info']
    libraries = ['openblas_lapack_info']
    language = f77
    define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
    library_dirs = ['C:\\projects\\numpy-wheels\\numpy\\build\\openblas_lapack_info']
    libraries = ['openblas_lapack_info']
    language = f77
    define_macros = [('HAVE_CBLAS', None)]

I have a i5-8500

viral zenith
#

yeah, taking your results and results i've seen on the internet, seems like my mkl BLAS works fine, no need to manually compile numpy with OpenBLAS or ATLAS or some shit to speed it up

#

but it's strange how people in the paper solve two linear systems on Pentium4 10x faster than I do single Matrix-Vector multiplication with BLAS

viral zenith
#

how the f...

#

and matrix multiplication in numpy performs the same as a good c++ code

oblique panther
#

@viral zenith numpy is implemented in C

viral zenith
#

it uses BLAS library

#

that maybe C too,
but it doesnt matter

#

i mean its the fastest you can get

gusty grove
#

Cough cough gpu cough cough

viral zenith
#

yeah, i was talking about CPU since on my original question I was comparing it to CPU method from the paper

autumn blaze
#

I assume this is somewhere in this channel, but what's a simple way to run a script (or a certain loop) on the GPU?

#

I've looked at some options but I dunno if theres a simpler way

oblique panther
#

@autumn blaze that question isn't on topic for this channel, but you'll want to look into Cuda.

autumn blaze
#

Oh okay sorry

fair summit
#

that's only for nvidia gpus tho

autumn blaze
#

I'll look into it

#

I have a 2060

#

Where should I ask about that?

fair summit
#

I'm not sure there's really a room for gpu computing in the server, it's generally within some other context

#

Also if you're directly using cuda it's no longer relevant to python either (until you eventually possibly bind it to python)

autumn blaze
#

Yeah ok

#

I'm doing some machine learning in python and wanted to see if I could make it any faster

fair summit
#

You also won't need to use cuda directly, machine learning (deep learning really) libraries will use it under the hood

autumn blaze
#

Yeah that probably makes more sense

#

I'm not using a library

#

Well thanks

gusty grove
#

Check out "numba"

fair summit
#

If you're not using a library, don't worry about the performances, because it will be terrible either way

autumn blaze
#

Hah yeah probably

gusty grove
#

It can run in the gpu

autumn blaze
#

Deal

undone ore
#

Hi I'm trying to code a RC robot and was wondering if i could get that help here or is there a better channel that i could go to? I'm beginning to code so i don't exactly know the basics either.

gusty grove
#

hm, you can always ask, if its out of place someone will tell you where to go

undone ore
#

Is there a better channel that i could go to or is this one fine?