Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

CarForumPoster posted:

Would this be the same if my web framework of choice is django?

No, in that case Django would replace Flask. They aren't related projects, but Django's featureset is essentially a superset of Flask's. In addition to handling things like routing, gathering input and returning a response, Django also includes an ORM system, user management, more advanced templating tools, form validation tools, etc. You can use Django without touching any of those things if you want, but since they're all there it may take a while longer to get used to Django compared with Flask.

In essence, though, it would work the same way. Your Django app would receive a request from the server, with all associated data, and it would be up to you to use that as inputs to your existing code. Then, after the image/graph is created, Django provides methods to return it in the form of an HTTP response to the client.

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Does anyone know anyone at Facebook or know anything about them starting app reviews again? Their changes that took place on April 4th (requiring additional review for data access via the API) made it so no new users can use our app. I can't find any other info other than their blog post saying "we made changes!" about it. I work for a two person startup and this quite literally could kill our company since our product does guided review of a person's social media posts. :suicide:

fuf
Sep 12, 2004

haha
Just mentioned this in the wordpress thread but I thought I'd ask here because it's just dawning on me how much work it might be.

Does anyone have any good resources on the new GDPR legislation that comes into effect next month? Has there been much discussion in this or other threads?

I mean if I just host basic brochure style sites that don't have "users" but which do use google analytics and have a contact form etc. what do I need to do exactly? A cookie consent process I can get my head around, but I have no idea about contact forms. If a contact form just sends all the entered data out in an email and doesn't actually store it anywhere on the backend, does it still need to get some kind of explicit consent from the person entering it?

It's pretty confusing and some of it sounds pretty extreme - I can't even store server logs any more?

spacebard
Jan 1, 2007

Football~

fuf posted:

Just mentioned this in the wordpress thread but I thought I'd ask here because it's just dawning on me how much work it might be.

Does anyone have any good resources on the new GDPR legislation that comes into effect next month? Has there been much discussion in this or other threads?

I mean if I just host basic brochure style sites that don't have "users" but which do use google analytics and have a contact form etc. what do I need to do exactly? A cookie consent process I can get my head around, but I have no idea about contact forms. If a contact form just sends all the entered data out in an email and doesn't actually store it anywhere on the backend, does it still need to get some kind of explicit consent from the person entering it?

It's pretty confusing and some of it sounds pretty extreme - I can't even store server logs any more?

I’ve been discussing with EU companies about theirs preparations for a while as well as internally. It is pretty vague but all of them mention that intent and taking “reasonable steps” counts. Whatever that means. :argh:

The strategy I’ve taken at work is

1. Document and analyze how you store and use personal data. This will also help you answer any data requests.
2. Work on the opt-in process for web forms and making sure your GA stuff applies. You need to keep logs to confirm right to be forgotten.

Also remember that any legal requirements you have for personal data override right to be forgotten or information requests. This may apply to your server logs but IANAL and that’s not legal advice.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Lumpy posted:

Does anyone know anyone at Facebook or know anything about them starting app reviews again? Their changes that took place on April 4th (requiring additional review for data access via the API) made it so no new users can use our app. I can't find any other info other than their blog post saying "we made changes!" about it. I work for a two person startup and this quite literally could kill our company since our product does guided review of a person's social media posts. :suicide:

I'd try asking in the general questions thread. I know there's at least one goon who works there at a higher level...but I can't for the life of me remember who it is!

Knifegrab
Jul 30, 2014

Gadzooks! I'm terrified of this little child who is going to stab me with a knife. I must wrest the knife away from his control and therefore gain the upperhand.
Alright boys, those who use VS Code, what theme do ya'll use.

I'm eyeing Dracula currently.

the heat goes wrong
Dec 31, 2005
I´m watching you...

Knifegrab posted:

Alright boys, those who use VS Code, what theme do ya'll use.

I'm eyeing Dracula currently.

That looks like like pretty intense and eye tiring colour scheme.

Currently using Monokai Dimmed. No idea why anyone would want a non-black background.

jiggerypokery
Feb 1, 2012

...But I could hardly wait six months with a red hot jape like that under me belt.

Anyone recommend any books for backend developers who live on the command line and want to pretend to have an opinion on design and UX?

Cirofren
Jun 13, 2005


Pillbug
The Design of Everyday Things should tick that box and is also a great book whatever you work on.

fuf
Sep 12, 2004

haha

spacebard posted:

I’ve been discussing with EU companies about theirs preparations for a while as well as internally. It is pretty vague but all of them mention that intent and taking “reasonable steps” counts. Whatever that means. :argh:

The strategy I’ve taken at work is

1. Document and analyze how you store and use personal data. This will also help you answer any data requests.
2. Work on the opt-in process for web forms and making sure your GA stuff applies. You need to keep logs to confirm right to be forgotten.

Also remember that any legal requirements you have for personal data override right to be forgotten or information requests. This may apply to your server logs but IANAL and that’s not legal advice.

Thanks. The intent and reasonable steps stuff is actually kind of reassuring because it implies you probably won't get in trouble if you can show you've at least been thinking about these things.

But I can't believe how hard it is to get a straight answer on some basic questions. All the stuff I read is geared towards organisations that are actually storing lots of personal data, but I really just wanna know:
1) if a site has basic google analytics setup (no events relating to email addresses, no complicated urls etc.) with no other cookies, does it need a cookie consent / warning message for every visitor?
2) if a site has a contact form that asks for a name and email address and sends this data by email (and doesn't store it anywhere once sent), does the form need an opt-in checkbox to get explicit consent to send the data?

the heat goes wrong
Dec 31, 2005
I´m watching you...

jiggerypokery posted:

Anyone recommend any books for backend developers who live on the command line and want to pretend to have an opinion on design and UX?

"Don't make me think" should cover enough of the basics.

jiggerypokery
Feb 1, 2012

...But I could hardly wait six months with a red hot jape like that under me belt.

the heat goes wrong posted:

"Don't make me think" should cover enough of the basics.

The original edition good enough? It's like 10% of the price haha

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

jiggerypokery posted:

The original edition good enough? It's like 10% of the price haha

The examples are outdated, but it should get the job done. Better yet, get work to buy you the new one!

jiggerypokery
Feb 1, 2012

...But I could hardly wait six months with a red hot jape like that under me belt.

I don't want them to know. The whole point is to infiltrate design conversations undetected and reduce the percentage of time I spend staring vacantly when icons and buttons are discussed.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

jiggerypokery posted:

I don't want them to know. The whole point is to infiltrate design conversations undetected and reduce the percentage of time I spend staring vacantly when icons and buttons are discussed.

Ahhh... stealth UI. I like it! The Design of Everyday Things is also a great read. Both books are probably in your local Library if you don't want to pony up the big :10bux: for the newest editions.

huhu
Feb 24, 2006
I've got a website I've built with React and Django Rest Framework. Curious if there's anywhere within those two I could shove a blog editor. All I really want want is basically an easy way to wrap text around images, otherwise I don't foresee having to modify/apply any other styling. I'd rather not have to write the HTML myself for each post. I feel like maybe there's an easy way to just create a form served on the backend that gives me full controls, not sure where to look though.

Edit: From what I've seen so far I either have to develop from scratch on their platform or it looks like it'd take a bunch of effort to serve the content over an API. Really I guess what I'm looking for is an easy to setup form that would give me basic text editor functionality and when I click save generates HTML and saves it to the DB.

huhu fucked around with this message at 14:54 on Apr 17, 2018

prom candy
Dec 16, 2005

Only I may dance

jiggerypokery posted:

Anyone recommend any books for backend developers who live on the command line and want to pretend to have an opinion on design and UX?

The Non-Designers Design Book is really good.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

Knifegrab posted:

Alright boys, those who use VS Code, what theme do ya'll use.

I'm eyeing Dracula currently.
I try out new themes from time to time but I always come back to One Monokai Theme:

https://marketplace.visualstudio.com/items?itemName=azemoh.one-monokai

I spend most of my time these days neck-deep in JavaScript, JSON, Python, YAML, and Markdown, and for those this color scheme is terrific. I imagine it's equally great for all the other languages as well.

bigmandan
Sep 11, 2001

lol internet
College Slice
I really like the Material Theme. It's available in a bunch of other editors as well.

my bony fealty
Oct 1, 2008

Knifegrab posted:

Alright boys, those who use VS Code, what theme do ya'll use.

I'm eyeing Dracula currently.

Black Ocean is my jam

https://marketplace.visualstudio.com/items?itemName=zamerick.black-ocean

I also use Bracket Colorizer which adds a bit of spice. Turned off the horizontal & vertical lines though, too obtrusive.

Unrelated: any recommendations for a lightweight CMS that I can use to house data for personal projects? Needs to offer api endpoints and preferably is free and can be thrown on something like a DigitalOcean droplet. I'm using WordPress right now, any better options out there? I haven't encountered any problems with WP so far, but it does feel a bit cumbersome for what I'm trying to do. Maybe I should just roll my own setup?

vv looks like just what I'm looking for, I'll check it out, thanks!

my bony fealty fucked around with this message at 16:26 on Apr 18, 2018

Cirofren
Jun 13, 2005


Pillbug
Check out prismic.io
It's headless and the Rest API delivers JSON.
Free for 1 user.

kedo
Nov 27, 2007

Can anyone recommend an open source captcha script or service that'll run on LAMP? I've used reCAPTCHA for years but have a client that is very anti-proprietary anything and I need to find an alternative.

porksmash
Sep 30, 2008

Cirofren posted:

Check out prismic.io
It's headless and the Rest API delivers JSON.
Free for 1 user.

Holy poo poo, it is difficult to read their site. I've never seen so many buzzwords per sentence. Despite that it looks interesting - I've been looking for a Contentful type of service that has a pricing plan that makes sense for my use case.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
Anyone here have fun with jQuery's CDN being unavailable earlier?

lord funk
Feb 16, 2004

I'm going to teach a course in China and I wanted to make a glossary for the class. I think a good way to do it is make a webpage with a column of terms on the left, and a main body on the right that loads a single image and accompanying text, like this:

code:
|Term|             |
|Term|   [image]   |
|Term|             |
|Term| Definition. |
|Term|             |
I'd like the column on the left to scroll independently.

I've made webpages before, but I thought I'd ask: does anyone have a template for this kind of thing? I could do it by hand, but I also have access to Dreamweaver if there's a preset available.

edit: ugh why do I even post. I'm good, found a good example and I'm off and running.

lord funk fucked around with this message at 18:08 on Apr 25, 2018

The Fool
Oct 16, 2003


lord funk posted:

edit: ugh why do I even post. I'm good, found a good example and I'm off and running.

I find writing a post out to be helpful in thinking through a problem. There have been a number of times that I don't even hit the submit button because I've figured it out while writing.

These forums are my rubber ducky.

lord funk
Feb 16, 2004

The Fool posted:

These forums are my rubber ducky.

Yep. Aaaaand I'm back. My example didn't get me so far after all.

Ideally I want to put pairs of text files and PNGs ("Butterfly.txt", "Butterfly.png") into a data folder, iterate through, and build the left hand list from the .txt file names. Each list becomes a link that, when clicked, loads the .png file into the main body along with the text contents of the .txt file.

JavaScript? HTML 5 <embed>? I don't know what direction to take.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

lord funk posted:

Yep. Aaaaand I'm back. My example didn't get me so far after all.

Ideally I want to put pairs of text files and PNGs ("Butterfly.txt", "Butterfly.png") into a data folder, iterate through, and build the left hand list from the .txt file names. Each list becomes a link that, when clicked, loads the .png file into the main body along with the text contents of the .txt file.

JavaScript? HTML 5 <embed>? I don't know what direction to take.

The big question here is are you just stuffing things into the folder randomly, or is there a fixed number of files / images? If the former, you'll need to have some sort of server-based scripting to read through the directory for you. If the latter, then you can do it all client-side in js.

lord funk
Feb 16, 2004

Lumpy posted:

The big question here is are you just stuffing things into the folder randomly, or is there a fixed number of files / images? If the former, you'll need to have some sort of server-based scripting to read through the directory for you. If the latter, then you can do it all client-side in js.

I think I should also mention that this will be distributed on a flash drive for users to run locally on their machines (I've been told they don't have good / reliable internet access, and that passing around a USB drive is the common way to distribute content). I figured they'd all have a web browser, and it lets them copy / paste text into translation services.

It will be a fixed list of terms, so stuffing that into an array at the top level isn't a problem.

The more I think about it, the more I might make a giant array of elements for the terms, definitions, and images name in the top level .html file and not bother at all with text files with the terms / definitions. Might just be easier.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

lord funk posted:

I think I should also mention that this will be distributed on a flash drive for users to run locally on their machines (I've been told they don't have good / reliable internet access, and that passing around a USB drive is the common way to distribute content). I figured they'd all have a web browser, and it lets them copy / paste text into translation services.

It will be a fixed list of terms, so stuffing that into an array at the top level isn't a problem.

The more I think about it, the more I might make a giant array of elements for the terms, definitions, and images name in the top level .html file and not bother at all with text files with the terms / definitions. Might just be easier.

Yeah, sounds like an array of objects with name, image name and text. I'd be glad to assist if you need any help.

Dominoes
Sep 20, 2007

Yo dawgs. Trying to get my head around WebAssembly. Googled it. Tell me if this is right:

Webassembly is a protocol that lets you write C, C++, or Rust code that executes in the Browser that way JS does, but at speeds commensurate with these low-level languages. It is currently supported in all browsers, unlike ES6. You may also be able to make an ES6 or Typescript compiler that compiles to webassembly rather than traditional JS, resulting in faster speeds.

How'd I do?

Dominoes fucked around with this message at 02:42 on Apr 29, 2018

Analytic Engine
May 18, 2009

not the analytical engine
But will WA get you laid at a JS meetup?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Ehh...kind of.

webass is (potentially) faster than JS, but not (necessarily) commensurate to lower level languages. Yes, TS can compile to webass (i assume it's possible for any language to compile to webass), but if you're compiling to webasss and want a statically typed language, you might as well use something real like C#.

When webass is faster than JS, its' for a few reasons. For one thing, it is smaller than JS so it downloads faster. The browser can parse it faster than it can javascript because it doesn' thave to go through an AST conversion, and its faster to compile to machine code.

Of note, the amount of time saved for each of those steps varies depending on what exactly the code is doing...sometimes it will just not be much of a savings at all.

Oh, another thing is that since webass does not have aJIT compiler, its performance can be more consistent than JS. Sometimes, the JIT engine in your browser has to throw out a compiled version of some function and run it through the baseline interpreter because of type changes in your JS code. This leads to hiccups in performance that you don't have with webass. Also webass doesn't support garbage collection...memory management is manual. Garbage collection introduces its own performance hiccups.

To expand a bit: Modern JS engines use a JIT. This means that your JS code is already compiled where the JS engine has been able to make guesses about the types your code is using. But, as mentioned, when it makes wrong guesses, this leads to performance problems. But, part deux, the JS engines are pretty good at these guesses...and if your code base is "guessable" then the delta between webass and JS will be pretty small. But, part tres, a lot of code can just un-guessable.

The reason C-compiled-to-webass is not necessarily as fast as C-compiled-to-x86-or-whatever is that webass targets a virtual machine in your browser rather than x86 or ARM, and thats just going to be slower. Though, it can get pretty close depending on circumstances.

The reason webass targets the browser VM, is that that is kind of the whole point of a browser. People write web pages targeting browsers, not specific operating systems / hardware platforms.

The browser is the new operating system.

In other words, the answer to the question "is webass faster?" is "maybe".


(I am not an expert at this (or anything))

reversefungi
Nov 27, 2003

Master of the high hat!
I am wholly in support of using webass as the shortened form of WebAssembly, moving forward.

Dominoes
Sep 20, 2007

The Dark Wind posted:

I am wholly in support of using webass as the shortened form of WebAssembly, moving forward.
Seconded.

Thanks Therm!

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Thermopyle posted:

Ehh...kind of.

webass is (potentially) faster than JS, but not (necessarily) commensurate to lower level languages. Yes, TS can compile to webass (i assume it's possible for any language to compile to webass), but if you're compiling to webasss and want a statically typed language, you might as well use something real like C#.

When webass is faster than JS, its' for a few reasons. For one thing, it is smaller than JS so it downloads faster. The browser can parse it faster than it can javascript because it doesn' thave to go through an AST conversion, and its faster to compile to machine code.

Of note, the amount of time saved for each of those steps varies depending on what exactly the code is doing...sometimes it will just not be much of a savings at all.

Oh, another thing is that since webass does not have aJIT compiler, its performance can be more consistent than JS. Sometimes, the JIT engine in your browser has to throw out a compiled version of some function and run it through the baseline interpreter because of type changes in your JS code. This leads to hiccups in performance that you don't have with webass. Also webass doesn't support garbage collection...memory management is manual. Garbage collection introduces its own performance hiccups.

To expand a bit: Modern JS engines use a JIT. This means that your JS code is already compiled where the JS engine has been able to make guesses about the types your code is using. But, as mentioned, when it makes wrong guesses, this leads to performance problems. But, part deux, the JS engines are pretty good at these guesses...and if your code base is "guessable" then the delta between webass and JS will be pretty small. But, part tres, a lot of code can just un-guessable.

The reason C-compiled-to-webass is not necessarily as fast as C-compiled-to-x86-or-whatever is that webass targets a virtual machine in your browser rather than x86 or ARM, and thats just going to be slower. Though, it can get pretty close depending on circumstances.

The reason webass targets the browser VM, is that that is kind of the whole point of a browser. People write web pages targeting browsers, not specific operating systems / hardware platforms.

The browser is the new operating system.

In other words, the answer to the question "is webass faster?" is "maybe".


(I am not an expert at this (or anything))

The problem with compiling any language that assumes GC (C#, Java, JS, etc) to webass is that you have to package a garbage collector with your webass and it's almost certainly going to be worse at the job than the one built into the browser. Well, that or write code that manages the memory by hand like you can do in unsafe sections in C#, which is going to be more work, so you've got to have a good reason to spend the extra time. What I'm getting at is that it's probably only good for the sorts of things you'd write in C, C++ or maybe Rust right now.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Munkeymon posted:

The problem with compiling any language that assumes GC (C#, Java, JS, etc) to webass is that you have to package a garbage collector with your webass and it's almost certainly going to be worse at the job than the one built into the browser. Well, that or write code that manages the memory by hand like you can do in unsafe sections in C#, which is going to be more work, so you've got to have a good reason to spend the extra time. What I'm getting at is that it's probably only good for the sorts of things you'd write in C, C++ or maybe Rust right now.

Yeah, this is a good point.

Pure speculation here: I wonder if the GC is necessarily going to be worse...it wouldn't have to be a hand-crafted implementation, you could just compile in the collector used by your language of choice which will surely be a solid implementation.

The problem then might be that you're bloating your download size which wipes out one of the pillars of webass performance.

reversefungi
Nov 27, 2003

Master of the high hat!
If I'm understanding this right, you'll have to manually manage memory if you're writing front-end code that eventually compiles down to webass. And if you don't do this right, you're potentially creating memory leaks all over the place which could be exploited. While I'm not immediately sure what additional vulnerabilities this creates on top of normal front-end JavaScript, it sounds like this could be potentially be a serious gun to shoot yourself in the foot with. Is this right?

prom candy
Dec 16, 2005

Only I may dance
Like most things, I think the wise approach for the average working developer is going to be to wait for larger organizations to figure a lot of this stuff out. I don't think I've ever been served well by super early adoption of something on the web unless it's the only way to satisfy a business requirement.

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

The Dark Wind posted:

If I'm understanding this right, you'll have to manually manage memory if you're writing front-end code that eventually compiles down to webass. And if you don't do this right, you're potentially creating memory leaks all over the place which could be exploited. While I'm not immediately sure what additional vulnerabilities this creates on top of normal front-end JavaScript, it sounds like this could be potentially be a serious gun to shoot yourself in the foot with. Is this right?

Yes...but it's not as bad as it sounds either. You have to manually manage your memory, but it's memory in the browser VM (I assume, but am not positive that it is a per-tab memory pool), not your general system memory pool, so it's not like you can accidentally grant access to random memory addresses.

Assuming the sandbox is not vulnerable, the worst you're going to do is gently caress up your own web app.

(because browsers never have security vulnerabilities!)


prom candy posted:

Like most things, I think the wise approach for the average working developer is going to be to wait for larger organizations to figure a lot of this stuff out. I don't think I've ever been served well by super early adoption of something on the web unless it's the only way to satisfy a business requirement.

I think this is right.


React will probably see good performance gains by writing their reconciler in C or something compiled to webass. One of the older, but not ancient frontend web frameworks...maybe Ember? I can't remember which...anyway one of them is already working on moving their DOM reconciliation to webass.


Another thing about webass is that there is a ton of misleading hype and much of it is because lots of people haven't really grasped what it is.

Thermopyle fucked around with this message at 17:52 on Apr 30, 2018

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply