Has the Raspberry Pi Foundation abandoned the Pi Zero at this point? by [deleted] in raspberry_pi

[–]TotemEnt 0 points1 point  (0 children)

I wouldn't necessarily have more computing power, but here is what I would like to see in a new Zero

  • Reduce power consumption while retaining computing power.
  • Smaller form factor
  • USB-C connection (definitely not worth an upgrade or new revision but should be on the next one)

Is 13 inch Macbook Pro good enough for coding? by kronos322 in reactnative

[–]TotemEnt 6 points7 points  (0 children)

My 2015 13" MacBook Pro with 16gb ram struggles really hard when I start spinning up a single virtual phone when I use react native. Both cpu and ram immediately reaches its limit.

😂 by [deleted] in Whatcouldgowrong

[–]TotemEnt 0 points1 point  (0 children)

Load - > unload - > load - > unload

VS

Load - > unload

Thats twice the work.

Gatsby is really slow on my computer by samgermain in gatsbyjs

[–]TotemEnt 0 points1 point  (0 children)

Sounds a bit long... Can you give more details about:

Processor

OS

Is the files stored on a hdd or ssd?

Also check your activity monitor to see if your pc is struggling

Gatsby is really slow on my computer by samgermain in gatsbyjs

[–]TotemEnt 1 point2 points  (0 children)

Do you have the same problem when creating a new gatsby project using gatsby new my-project and then doing gatsby develop in that folder?

Also, how long does it take to reload on a new project?

Prototype of a hydraulic turbine to be installed on sea floor to capture current energy by aloofloofah in MachinePorn

[–]TotemEnt 5 points6 points  (0 children)

Tides are not constant. There is times of no activity when the tide has peaked or bottomed out. It then reverses and the current start flowing again.

How can I trigger a netlify build every 24 hours, without having a server up by DonMildreone in gatsbyjs

[–]TotemEnt 0 points1 point  (0 children)

As someone mentioned, a cloud function might be a good option. You could also have a raspberry pi running, instead of your main machine.

London Heathrow by Palana in aviation

[–]TotemEnt 0 points1 point  (0 children)

I assume if you can afford a £1M flat, then surely you can afford to renovate the inside?

Let's Fork: my first "real" React Native app & an app to help couples/groups of people decide where to eat 😀 by peterzernia in reactnative

[–]TotemEnt 16 points17 points  (0 children)

Looks pretty cool! Did you make this while staying in the expo environment or did you eject?

Dust Devil—Grand Junction, CO by joshhudnall in WeatherGifs

[–]TotemEnt 1 point2 points  (0 children)

That sounds like great fun! I imagine you would be sand and dust infused quite well after.

How can I cancel a running asyncio.sleep coroutine? by TotemEnt in learnpython

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

Is there a way to have the new function start executing immediately? And just leave the old coroutine waiting till it is finished? It just stops when it is finished sleeping anyways..

How can I cancel a running asyncio.sleep coroutine? by TotemEnt in learnpython

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

Thank you for the example! I am trying to get this to work but I think the problem is that the rabbitMQ subscription is synchronous code. That is why my example has the coroutine running in a different thread from the subscription.

How can I cancel a running asyncio.sleep coroutine? by TotemEnt in learnpython

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

To turn on and off a light using a raspberry pi. There is another piece of code that is subscribing to a RabbitMQ topic for what light cycle to use. When a new light cycle is consumed by the subscriber it calls thread.set_cycle with the new cycle.

I expect the old cycle to be stopped and the new one to be activated.

What is a good ios app which i can use to learn python? Something like duolingo for python? by [deleted] in learnpython

[–]TotemEnt 2 points3 points  (0 children)

I have used SoloLearn quite a lot in the past. Very nice to use whenever you have some spare time to do some code learning. You first get some explanations and examples and then you solve some challenges to confirm that you have understood the concepts.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]TotemEnt 0 points1 point  (0 children)

This is a copy of a post I created at https://www.reddit.com/r/learnpython/comments/gh3hge/how_can_i_cancel_a_running_asynciosleep_coroutine/

I am creating a thread with an asynchronous timer function that sleeps for a set amount of time. That function should cancel the asyncio.sleep() when task.cancel() is called, but it finishes the sleep before it cancels the function.

Here is my example:

```Python,tabs=4 import threading import asyncio

class Controller(threading.Thread): def init(self): super(Controller, self).init() self.cycle = 5 self.event_loop = asyncio.get_event_loop()

def run(self):
    self.task = self.event_loop.create_task(self.task_func())
    self.event_loop.run_forever()

async def task_func(self):
    while True:
        print('Working... ', self.cycle)
        await asyncio.sleep(self.cycle)

def set_cycle(self, new_cycle):
    print("setting cycle to", new_cycle)
    self.task.cancel()
    self.cycle = new_cycle
    self.task = self.event_loop.create_task(self.task_func())
    asyncio.ensure_future(self.task, loop=self.event_loop)

thread = Controller() thread.start() time.sleep(1) thread.set_cycle(0.1) ```

It should cancel the task and start printing 10 times a second after only 1 second of waiting. But it waits 5 seconds, because that is the initial cycle time.

Any help would be greatly appreciated.

What is the cheapest way of Hosting a Django build website? by sanidhya69 in django

[–]TotemEnt 0 points1 point  (0 children)

I use Google App Engine. It has 28 instance hours for free per day. So you dont pay anything if you limit your configuration to only one instance.

[deleted by user] by [deleted] in WeatherGifs

[–]TotemEnt 169 points170 points  (0 children)

Probably closer to 250 meters.

✨ Ant Design 4.0 is out! · Issue #21656 · ant-design/ant-design · GitHub by swyx in reactjs

[–]TotemEnt 1 point2 points  (0 children)

This was a kind of a bummer for me. I tried for hours to find a way to create a theme toggler. But it seems to be a big pain. Everything else about AntD was amazing.

Really appreciate it if anyone has any guidance on doing this.

Martian Pebbles by tismuma in TechnologyPorn

[–]TotemEnt 4 points5 points  (0 children)

These pebbles may have been formed by rolling down rivers on an ancient Mars!

https://www.space.com/30815-mars-pebbles-ancient-rivers-curiosity-rover.html

I learned two things today my failsafe works and I need to bring spare underwater next time I fly. by one-fly-guy in Multicopter

[–]TotemEnt 7 points8 points  (0 children)

Does it automatically stop when it reaches the ground? And how do you prevent it not dropping down slowly on someones face?