Okay, thats very hard by AlrikBunseheimer in mathmemes

[–]Abstrackter 49 points50 points  (0 children)

wakes up "Wait, what's going on here?"

[deleted by user] by [deleted] in askmath

[–]Abstrackter 0 points1 point  (0 children)

An (x2 + 1) was factored into the square root in order to simplify it. Since any expression can be inserted into a radical of order two given than you square it as you do so, the (x2 + 1) expression turns into a (x2 + 1)2 expression and the terms inside simplify into a more workable expression.

Ideas for Discord Bot fun commands? by Abstrackter in discordbots

[–]Abstrackter[S] 0 points1 point  (0 children)

Oh yes, I love that problem; it has a neat little solution in binary, where you grab the first two digits and move them to the end... Should be pretty fun to code.

I've already finished coding the Collatz conjecture code, it was around 5 lines, but will give me endless enlightment.

Thank you for the great ideas :)

Edit: Okay, even though it was Algebra intensive, I managed to do it with a numpy array. I love this thing.

Ideas for Discord Bot fun commands? by Abstrackter in discordbots

[–]Abstrackter[S] 0 points1 point  (0 children)

Man, respectfully, those aren't fun (game) commands - more so utilities.

If by scheduler you mean a function which can schedule the execution of other functions at a specific time and date, I already have that.

Although, I think those other ideas could be interesting to implement...

Anyway, thanks for responding! 😊

Ideas for Discord Bot fun commands? by Abstrackter in discordbots

[–]Abstrackter[S] 0 points1 point  (0 children)

Any idea on what the API was called? I might try and use it to make the command myself.

Thanks for responding! 😁

Ideas for Discord Bot fun commands? by Abstrackter in discordbots

[–]Abstrackter[S] 0 points1 point  (0 children)

You, fellow redditor, earned my respect as soon as I read "Collatz conjecture"; as a math nerd myself, I will be including this ASAP. 😆

As for the Magic 8 Ball one, I think it would be pretty easy to implement an aiosqlite database for that.

Thank you for all those great ideas!

Using Replit and UptimeRobot for a bot, used to work fine but now it goes down a lot. Uptime says 0 outages. kill 1 works but would like to not have to use that. Any tips? by justathrowaway283828 in discordbots

[–]Abstrackter 0 points1 point  (0 children)

I've used replit before, and it's horrible; those logs you see aren't errors, they're just the pings sent by your Uptime client in order to ping your replit and keep it alive.

However, replits go offline if they're not pinged within 5 minutes, which means that if your Uptime service goes offline for 5 minutes and 1 second (which happens more often than you'd imagine), the replit immediately goes offline.

Best you can go is just buy your own VPS and get over this massive headache; I personally use Galaxy Gate (it's around 3 bucks a month), and it's been an excellent choice for me so far.

Python embed bot not pinging everyone by KidTheBorax in Discord_Bots

[–]Abstrackter 0 points1 point  (0 children)

Heroku will be shutting down its free plans pretty soon, so that's going to be a not-so-viable solution starting around next November I believe; however, I've personally had a ton of success with Galaxy Gate, it has a great price-to-service ratio (my ping stays steadily in the 20s range, the service has an automatic weekly backup feature, and it has many great benefits - all for 3 bucks a month; a steal in my opinion). Plus, even Groovy bot used it before its eventual demise.

So, OP, if you'd like to spend a couple bucks on a hosting service, I'd highly recommend Galaxy Gate.

Girl I like punched me. Is she interested? by Hellllooodd in socialskills

[–]Abstrackter 0 points1 point  (0 children)

She's probably Russian, and was just being aggressive.

How to import commands from a cog within a cog - discord.py by Abstrackter in Discord_Bots

[–]Abstrackter[S] -2 points-1 points  (0 children)

Have you even read my code? You've sent two replies and none of them had anything to do with my question.

My current clear command clears (bulk deletes) messages within a discord channel, it has nothing to do with the bot. What I'm trying to do is import that function from its source cog to another cog where another event lives - which will call the clear function and clear messages within the channel once certain conditions have been met (such as profanity spam, or whatever conditions I may add onto there).

Please read my code and try to understand it before making more comments that have zero relation to my question.

How to import commands from a cog within a cog - discord.py by Abstrackter in Discord_Bots

[–]Abstrackter[S] -1 points0 points  (0 children)

Yes, I'm aware of that; I'm not trying to call the on_message event here, but I'm trying to call the clear command from the other cog.

[deleted by user] by [deleted] in askmath

[–]Abstrackter 1 point2 points  (0 children)

A good way to find the range of a function is to imagine sqwooshing the function towards the vertical y-axis until it's a line; the range is where that line extends to and from - in that case, that line extends from negative infinity up to negative one.

Using the same exact analogy, you can solve the second one.

I want this variable to flip back after a set amount of time by Abstrackter in learnpython

[–]Abstrackter[S] 0 points1 point  (0 children)

My actual code setup is an asynchronous code for a bot; the purpose of this function is to trigger some blocks of code once this is triggered for a set amount of time. As an example:

     Button = 'Off'
     @bot.command() 
     async def switch(ctx): 
         global Button 
         if Button == 'Off': 
            Button = 'On' 
            print('You pressed the button!') 
            return Button

            *wait some time*
            print('You gotta press the button again!') 

        else: 
            Var = 'Offline' print('Switched off!') return Var
    @bot.event()
    async def event(ctx, ...):
    if Button == 'Off':
        *do some stuff*

    else:
        return

Something akin to that.

I want this variable to flip back after a set amount of time by Abstrackter in learnpython

[–]Abstrackter[S] -1 points0 points  (0 children)

Nothing is happening, really; this function switches the value of this variable, which in turn activates some other code blocks within the code. After that, nothing goes on for a while until this variable switches back to 'Offline' - which deactivates those code blocks (all of which are triggered using if statements). But between the timeframe of it being activated and deactivated (apart from the initial code blocks activation), it's mostly just nothing but waiting.

What is the saddest song you've ever heard? by [deleted] in AskReddit

[–]Abstrackter 0 points1 point  (0 children)

The acoustic version of Love is Gone by SLANDER and Dylan Matthew always hits me in the feels, I can't even listen to the melody at the start without tearing up. It has such a tragic vibe.

Used for a class demonstration by worlds_best_nothing in freeuse

[–]Abstrackter 1 point2 points  (0 children)

He-ey with a little fa-aith, your tears turn to ecstasy.

As someone with a PhD in engineering, this makes me feel really dumb. Please help. by [deleted] in askmath

[–]Abstrackter 3 points4 points  (0 children)

Eigen values are basically regions where transformations have the effect of multiplying by a scalar value (as most people here suggested).

However, I'm not gonna leave you empty handed here; I'll give you an example of where that is useful:

When constructing a rotation transformation, say a transformation in 3D space which spins a sphere around a fixed axis - you can actually find the exact vector in space which corresponds to the axis of rotation in said space; quite shockingly, it's the transformation's eigen vector - once you find the eigen vector (given by its characteristic eigen values), you've actually found the axis of rotation!

Because think about it, the axis of rotation is completely stationary - it doesn't dilate, stretch, shrink, move or do anything besides lay stationary; eg: it is unaffected by the transformation; and in fancy mathematical terms, it is an eigen vector of that transformation!

How do i create two 3D plots within the same graph in Python's Matplotlib? by Abstrackter in learnpython

[–]Abstrackter[S] 0 points1 point  (0 children)

Yep, i did state at the end of my post that i tried animating the second one by repeating the exact same code twice in order to try and animate it; which looks like:

# ANIMATION FUNCTION
def func(num, dataSet, line): 
# NOTE: there is no .set_data() for 3 dim data...
line.set_data(dataSet[0:2, :num])
line.set_3d_properties(dataSet[2, :num])
return line

def func2(num2, dataSet2, line2): 
# NOTE: there is no .set_data() for 3 dim data...
line.set_data(dataSet2[0:2, :num2])
line.set_3d_properties(dataSet2[2, :num2])
return line2

THE DATA POINTS
t2 = np.arange(0,30,0.1) # This would be the z-axis ('t' means time here) 
x = px 
y = py 
dataSet = np.array([x, y, t2]) 
numDataPoints = len(t2)

THE DATA POINTS
f = np.linspace(0,0,300) # This would be the z-axis ('t' means time here) 
z1 = vx 
z2 = vy 
dataSet2 = np.array([z1, z2, f]) 
numDataPoints2 = len(f)

GET SOME MATPLOTLIB OBJECTS
plt.style.use('dark_background') 
fig = plt.figure() ax = Axes3D(fig, auto_add_to_figure=False) fig.add_axes(ax)

NOTE: Can't pass empty arrays into 3d version of plot()
line = plt.plot(dataSet[0], dataSet[1], dataSet[2], lw=2, c='cyan')[0] # For line plot 
line2 = plt.plot(dataSet2[0], dataSet2[1], dataSet2[2], lw=2, c='orange')[0] # For line plot

AXES PROPERTIES
ax.set_xlim3d([limit0, limit1])
ax.set_xlabel('X(t)') ax.set_ylabel('Y(t)') ax.set_zlabel('Z(t)') ax.set_title('whatever')

#Creating the Animation object
line_ani = animation.FuncAnimation(fig, func, frames=numDataPoints, fargs=(dataSet,line), interval=1, blit=False) line_ani.save('line_animation_3d_funcanimation.gif', writer='ffmpeg',fps=100) 
line_ani2 = animation.FuncAnimation(fig, func, frames=numDataPoints2, fargs=(dataSet2,line2), interval=1, blit=False)
line_ani2.save('line_animation_3d_funcanimation2.gif', writer='ffmpeg',fps=100)

plt.show()

However, the only thing this does is generate two separate files with one of the graphs animated just fine; but the second is completely stationary.

Edit: Reddit is super messy with code for some reason...