jeudi 26 avril 2018

Web GL. Slow render with texture change

I'm using empscripten. After several tests, I came to the conclusion that if I draw 500 identical textures, everything works fine. But if I draw 2 different textures 500 times, I get a big load on the processor. 14 against 60% on the osx. In windows, almost the same problem (6 versus 16%), only the difference is small. both textures have a size of 2x2 pixels.

Can I somehow optimize this?




Installed PWA manifest changes not applying

I'm having trouble applying updates made to Progressive Web App manifest. Updating stuff works otherwise just fine, but if I change something from my manifest, like background_color, the launch screen color will not change. I have monitored my server to see that manifest.json is indeed fetched. Restarting phone doesn't apply the changes either, the only way seems to be to uninstall the PWA and add back to home screen.

On desktop, chrome developer tools show that the manifest is correctly fetched and the changes can be seen in the dev tools. Is this expected behavior? Is there a way to make changes to manifest apply after the PWA has already been installed?




Looping over large files received from web and saving them - flask

I'm new with flask, and web in general. I need to upload few large files using flask and save them. My script is the following:

UPLOAD_FOLDER = '/home/billy/genesort/dataset_for_chipseq'
ALLOWED_EXTENSIONS = set(['txt', 'txt.gz'])

app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.secret_key = "super secret key"


def allowed_file(filename):   
    if '.gz' in filename:
        return '.' in filename and \
          filename.rsplit('.', 2)[1] in ALLOWED_EXTENSIONS
    else:
        return '.' in filename and \
           filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS


@app.route('/run-pipeline', methods=['POST'])
def run_script():
    treat_files = request.files.getlist('treat_files')
    for my_file in treat_files:

       print(my_file)

       file = request.files[my_file]

       print(file)

       if file and allowed_file(file.filename):
           filename = secure_filename(file.filename)
           file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
           return 'Uploaded successfully'

       return 'Could not upload file'

if __name__ == '__main__':
    app.run(debug=True)

I'm using POSTMAN to demo the web part.

I think the upload is good, since it prints my_file OK, but the second print statement, is not executed, and the following saving part failed. in POSTMAN I got the error: The browser (or proxy) sent a request that this server could not understand Anyone knows how to fix it?




Feefo Widget and Font Awesome

We are working on a website that is using the Feefo integrated widget and Google is flagging up that we are loading unnecessary css, which is due to the Feefo widget loading all of Font Awesome within it, even though we have Font Awesome on our site already.

I had a look through the feefo widget customisation area and couldn't see how to remove Font Awesome from within it.

Has anyone else had this problem and been able to get around it?




Framework to develop a quick CRUD frontend for an API

I have an rather simple API that has GETs PUTs DELETEs and POSTs. I need a simple web front end for this API and I wondered what people would recommend?

I don't need it to be pretty, just functional. I tried to use React but I think it is overkill for what I want to do and I got fed up of the huge ecosystem or yarn, npm, webpack, babel, scss and all that to create a simple web site.

Is there a framework that is more suitable for rather basic API based admin systems or should I just create some pages with Bootstrap?

I thought this would be easier than it turned out to be and I need some guidance.

Thanks!




Redirect the servlet request to another servlet

In our app for all the notification we trigger through mail.

All the templates have non sso link >/Userlogin?param1=param2value&param2=param2value">Link to access app

I need to modify this link in all templates to

>/Userloginsso?param1=param2value&param2=param2value">Link to access app

Since there are many templates and takes lot of manual effort, is there any way we can redirect the request of Userlogin to Userloginsso. Any configuration that we can do in web.xml ?




3D upload forms - where to start?

Guys I do not know where to start, a friend of mine asked me if you can create a site where people upload their own 3d file for online printing, but I do not know if scripts exist, and which people I need to create this site