photonsters / photonprograminginterface Goto Github PK
View Code? Open in Web Editor NEWAPI protocol that defines a standard for sharing and manipulating photon file data
License: Other
API protocol that defines a standard for sharing and manipulating photon file data
License: Other
@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])
`
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.