Code Monkey home page Code Monkey logo

photonprograminginterface's People

Contributors

nardj avatar x3msnake avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

photonprograminginterface's Issues

Speedtests with Memory Mapped Files in python

@Photonsters/photonsters I found several options to exchange data between programs on https://en.wikipedia.org/wiki/Inter-process_communication.

I did some tests using Ram Mapped Files in python on an old laptop using a hard drive. I think this simple method could already fast enough for our purposes. For a 100M file, reading takes 0.09 sec, writing also takes 0.09 sec. What do you think?

Below the code I used.

Master.py (reader)
`

import mmap
import time

with open("hello.txt", "wb") as f:
    h=b"Hello Python!"
    b=bytearray(100*1000000)
    m=h+b
    f.write(m)

with open("hello.txt", "r+b") as f:
    # memory-map the file, size 0 means whole file
    mm = mmap.mmap(f.fileno(), 0)
    while True:
        mm.seek(0)
        t=time.time()
        ret=mm.readline()  # prints "Hello Python!"
        d=time.time()-t
        print ("Done in ",d," secs.")
        print (ret[:20])
        time.sleep(2)

    # close the map
    mm.close()

`

Slave.py (writer)
`

import mmap
import time
with open("hello.txt", "r+b") as f:
	# memory-map the file, size 0 means whole file
	mm = mmap.mmap(f.fileno(), 0)
	mm.seek(0)
	f.seek(0)
	txt="Hello world+" + str(time.time())
	m=txt.encode('ascii')
	h=b"Hello Python+"
	b=bytearray(10*1000000)
	m=h+b

	t=time.time()
	mm.write(m)
	d=time.time()-t
	print ("Done in ",d," secs.")
	print (m[:20])

`

Bricked Photon Zero S Mainboard

Hello. Is there a way to reinstall the factory firmware onto photon zero s mainboard? A friend of mine attempted to upgrade the firmware and installed the wrong firmware. The printer takes a while to power on and immediately turns off when it does. Contacted anycubic and they recommended that I purchase a new board since I am out of warranty. Their website does not deliver to the U.S. Is there anyway to restore the firmware using the USB slot? Ive got the factory .bin files. Any help would be appreciated. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.