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
fuf
Sep 12, 2004

haha
That's good enough for now, thanks man.

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

fuf posted:

Does anyone know a font that looks kinda like this? (or know how I can find one?)



https://www.fontsquirrel.com/matcherator?matcherator_img=70ncy9s61vtss9qf0k6rlwy02605y7zv#scroll_to_matches

It's "Earthman BB Regular"

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

BJPaskoff posted:

They want the VIN and the options as well. I don't know the calculations it's doing in the back-end to figure out the prices it spits out. Just your/anyone's estimation, how much would something like this cost to program? If I can't do it, I might have to tell them to hire someone.

It's super easy to program, just a collection form pulling from a datasource. The problem is going to be getting that data. I had a similar thing with a client (tire fitment data per vehicle/model) and access to an up to date, accurate, industry-specific datasource cost something like $300/mo.

Data Graham
Dec 28, 2009

📈📊🍪😋



Holy poo poo that's a site I'm bookmarking.

a witch
Jan 12, 2017

BJPaskoff posted:

They want the VIN and the options as well. I don't know the calculations it's doing in the back-end to figure out the prices it spits out. Just your/anyone's estimation, how much would something like this cost to program? If I can't do it, I might have to tell them to hire someone.

From what I remember, Chromes ADS service is a monthly fee plus 1-10 cents per decode. You could probably call them for specific pricing.

The Fool
Oct 16, 2003


Tangentially, is anyone aware of a service that would let me lookup nutrition data from UPC?

Cugel the Clever
Apr 5, 2009
I LOVE AMERICA AND CAPITALISM DESPITE BEING POOR AS FUCK. I WILL NEVER RETIRE BUT HERE'S ANOTHER 200$ FOR UKRAINE, SLAVA
So I'm still having issues with the HTML5 <video> tag and CDN-hosted 1080p video. I'm suspecting its just that the provider we went with (Vimeo) not being up to snuff, but haven't done that much with video before so may be blaming the easy target. While I'm waiting on Vimeo support to get back to me, I'm curious if anyone here might have some insight.

When the video is accessed at full resolution at Vimeo.com, the video we're testing with loads completely in ~30 seconds. When either loaded on our site with the video tag or just accessed directly via the URL they provide, it takes over two minutes, staggering in far slower than it can play. No difference between Chrome and FF.

Are there tricks to speeding up the loading or is Vimeo just throttling the content delivery?

MrMoo
Sep 14, 2000

You really want DASH and not just vanilla video support, DASH enables automagic hopping between different quality streams.

GigaFuzz
Aug 10, 2009


Close, but not exactly right. Look at the S, M and the E, for example. 'Generica Condensed Light' looks to be a closer, if not exact, match:
https://www.myfonts.com/WhatTheFont...71e70&x=93&y=45

fuf
Sep 12, 2004

haha


GigaFuzz posted:

Close, but not exactly right. Look at the S, M and the E, for example. 'Generica Condensed Light' looks to be a closer, if not exact, match:
https://www.myfonts.com/WhatTheFont...71e70&x=93&y=45

Thanks!

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

GigaFuzz posted:

Close, but not exactly right. Look at the S, M and the E, for example. 'Generica Condensed Light' looks to be a closer, if not exact, match:
https://www.myfonts.com/WhatTheFont...71e70&x=93&y=45

Hey, don't blame me, I just type what the font squirrel tells me to! :v:

Dominoes
Sep 20, 2007

Is there a way to unpack multiple return values in a more direct way than this?

JavaScript code:
var events = parseTodaysSchedule()
var lines = events[0]
var sims = events[1]
var duties = events[2]
var meetings = events[3]
Ideally, I want something like this:
JavaScript code:
var lines, var sims, var duties, var meetings = parseTodaysSchedule()

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
Is using/transpiling ES6 an option for you?

If it is, you can use destructuring:
JavaScript code:
const [lines, sims, duties, meetings] = parseTodaysSchedule();

Kekekela
Oct 28, 2004
Use destructuring. Not on an IDE so my syntax may be off but roughly:

var lines, sims, duties, meetings;
[lines, sims, duties, meetings] = parseTodaysSchedule();

Dominoes
Sep 20, 2007

Thanks dudes.

Thermopyle
Jul 1, 2003

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

Dominoes posted:

Thanks dudes.

More generally, if you're already transpiling there's a lot of good ES6 stuff you probably want to use.

https://github.com/lukehoban/es6features

also, in case you're not aware there's a javascript-specfic thread: https://forums.somethingawful.com/showthread.php?threadid=3070034&goto=lastpost

McGlockenshire
Dec 16, 2005

GOLLOCKS!
Not to belabor the point, especially after being pointed to the JS thread, but I'm irritated that all the transpiling solutions are so focused on the node ecosystem. I have no interest in installing a thousand dependencies so that I can invoke a tool every time I save a file to recompile the world before I can see if my code works.

Are there any ES6 shims or transpilers that work reliably just in browsers, as something I can just drop in and use script tags with? Google suggests that the only project(s) that did this (Babel) pivoted to be 100% preprocessed server side bullshit within the past two years.

I'm trying to tinker and get around to learning ES6 here, not build something for production.

McGlockenshire fucked around with this message at 19:25 on Mar 18, 2017

Chenghiz
Feb 14, 2007

WHITE WHALE
HOLY GRAIL

McGlockenshire posted:

Not to belabor the point, especially after being pointed to the JS thread, but I'm irritated that all the transpiling solutions are so focused on the node ecosystem. I have no interest in installing a thousand dependencies so that I can invoke a tool every time I save a file to recompile the world before I can see if my code works.

Are there any ES6 shims or transpilers that work reliably just in browsers, as something I can just drop in and use script tags with? Google suggests that the only project(s) that did this (Babel) pivoted to be 100% preprocessed server side bullshit within the past two years.

I'm trying to tinker and get around to learning ES6 here, not build something for production.

Sounds like you want babel-standalone: https://github.com/babel/babel-standalone#usage

I went here: http://babeljs.io/docs/setup/#installation and clicked "Prototyping in the browser".

Xik
Mar 10, 2011

Dinosaur Gum

McGlockenshire posted:

I'm trying to tinker and get around to learning ES6 here, not build something for production.

Couldn't you just get bleeding edge chrome or dev/nightly firefox and go nuts?

McGlockenshire
Dec 16, 2005

GOLLOCKS!

Chenghiz posted:

Sounds like you want babel-standalone: https://github.com/babel/babel-standalone#usage

I went here: http://babeljs.io/docs/setup/#installation and clicked "Prototyping in the browser".

"Hey guys, you know what's a great idea? Let's put instructions that create dot files and invoke npm in the same expandy block as we're going to use to describe how to use our tool for people that don't want to use the node ecosystem! Nothing could possibly go wrong if someone hits page down only once!"

Thanks for going back and making me re-read that. You would think that they'd make a much bigger deal out of actually using the tool immediately instead of skipping to the "oh and here's how to make it all way more complicated than you might actually want at first." Judging from the way they minimize this use case, either this doesn't work at all or there are so many downsides to it that they feel they need to not talk about it. That makes me uneasy.



Xik posted:

Couldn't you just get bleeding edge chrome or dev/nightly firefox and go nuts?

Actually, if I'm reading this compatibility table right then the current versions of Chrome and FF seem to have better ES6 compatability than Babel, so maybe this ended up being a completely useless exercise.

lunar detritus
May 6, 2009


McGlockenshire posted:

Thanks for going back and making me re-read that. You would think that they'd make a much bigger deal out of actually using the tool immediately instead of skipping to the "oh and here's how to make it all way more complicated than you might actually want at first." Judging from the way they minimize this use case, either this doesn't work at all or there are so many downsides to it that they feel they need to not talk about it. That makes me uneasy.

Of course they don't want you to use it, transpiling in real-time is an awful idea for most use cases.

huhu
Feb 24, 2006


I've noticed that the website I'm building is labeling my website as "Not secure" in Chrome. I get this, however I've noticed that other websites, WordPress sites for example, are also not secure, however they are labeled with just the "!" instead of "Not secure". Anyone know why this is?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

huhu posted:



I've noticed that the website I'm building is labeling my website as "Not secure" in Chrome. I get this, however I've noticed that other websites, WordPress sites for example, are also not secure, however they are labeled with just the "!" instead of "Not secure". Anyone know why this is?

Click on the icons and it will tell you IIRC. On my phone so I can't double check.

McGlockenshire
Dec 16, 2005

GOLLOCKS!

huhu posted:



I've noticed that the website I'm building is labeling my website as "Not secure" in Chrome. I get this, however I've noticed that other websites, WordPress sites for example, are also not secure, however they are labeled with just the "!" instead of "Not secure". Anyone know why this is?

"Not Secure" now pops up if it detects that there's a login form on the page. For a demo, check out https://badssl.com/ and scroll to HTTP Input. It even flags as Not Secure dynamically if the form is hidden.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe

huhu posted:



I've noticed that the website I'm building is labeling my website as "Not secure" in Chrome. I get this, however I've noticed that other websites, WordPress sites for example, are also not secure, however they are labeled with just the "!" instead of "Not secure". Anyone know why this is?
I'm not sure about the second scenario but I do know that Chrome was updated to display the "not secure" style warning when a site has an <input type="password"> and is not served over HTTPS.

huhu
Feb 24, 2006

McGlockenshire posted:

"Not Secure" now pops up if it detects that there's a login form on the page. For a demo, check out https://badssl.com/ and scroll to HTTP Input. It even flags as Not Secure dynamically if the form is hidden.
Ah OK. I went to a login page on WordPress and it gave the same thing, good to know.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Recommendations on where to learn to work with RESTful APIs and working with returned JSON data?

I've started working with the BigCommerce API since I work in eCommerce, using Curl to connect toe API, and now that I'm connected, I'm not really sure what to do/how to use the returned data.

Gotta learn this stuff for work, and it's really out of my comfort zone. Only thing I've done with PHP is CRUD apps, and I've only used AJAX/JSON sparingly.

Thermopyle
Jul 1, 2003

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

Grump posted:

Recommendations on where to learn to work with RESTful APIs and working with returned JSON data?

I've started working with the BigCommerce API since I work in eCommerce, using Curl to connect toe API, and now that I'm connected, I'm not really sure what to do/how to use the returned data.

Gotta learn this stuff for work, and it's really out of my comfort zone. Only thing I've done with PHP is CRUD apps, and I've only used AJAX/JSON sparingly.

You just used whatever your language/framework uses to parse the json and then you've got objects, arrays, maps, whatever and the same for sending it but in reverse. That's about all there is to it.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I think it really depends on what's doing things with the returned JSON. Are you building a full JavaScript web client or a server that renders templates using information from the API.

Usually the biggest questions to ask about using third party apis are what information needs to be stored by, and what can you get just in time.

For instance, if you're using product descriptions and stock counts, it would probably make sense to store that stuff on your own server so you're not calling every page you serve. Most of the thought around using APIs is really just thought about how you'll deliver information from the API and transform into information useful to the user.

There are lots of different ways to do that depending on what your building.

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Maluco Marinero posted:

I think it really depends on what's doing things with the returned JSON. Are you building a full JavaScript web client or a server that renders templates using information from the API.

Usually the biggest questions to ask about using third party apis are what information needs to be stored by, and what can you get just in time.

For instance, if you're using product descriptions and stock counts, it would probably make sense to store that stuff on your own server so you're not calling every page you serve. Most of the thought around using APIs is really just thought about how you'll deliver information from the API and transform into information useful to the user.

There are lots of different ways to do that depending on what your building.

Yeah I mean what I'm trying to do right now is grab all the products in my store, and parse through the data and format it better. I got as far as grabbing all my products in JSON format and I'm pretty lost. I have zero experience with this stuff.

I'm not really building anything. I'm just messing around.

Thermopyle posted:

You just used whatever your language/framework uses to parse the json and then you've got objects, arrays, maps, whatever and the same for sending it but in reverse. That's about all there is to it.

This is pretty much where my problem lies. I don't even really know how to do this stuff.

I guess what I'm really asking is for a tutorial to parse JSON data with Javascript? Correct?

teen phone cutie fucked around with this message at 22:11 on Mar 20, 2017

ddiddles
Oct 21, 2008

Roses are red, violets are blue, I'm a schizophrenic and so am I
Depending on how you get the JSON into the browser, you just run the JSON string through JSON.parse()

Odette
Mar 19, 2011

Reading the PoC of the recent RCE for Moodle is interesting. Good writeup here.

darthbob88
Oct 13, 2011

YOSPOS
Near-impossibility for the thread; I have a chunk of CSS describing a background for the <body> section of my website, and I want to display different backgrounds on different pages, but I also want to keep everything in one CSS file if possible. What is a good way to do this? @document sounds like a good solution but it's also supported only by Firefox. At present I just have a <style> element saying which background to use in the template for each page, plus a default in the main CSS sheet, but this feels unwholesome and I would prefer a better solution.

darthbob88
Oct 13, 2011

YOSPOS

ddiddles posted:

Depending on how you get the JSON into the browser, you just run the JSON string through JSON.parse()
And you might not even need to do that; if your API framework is kind enough to label it as Content-Type:application/json;, your AJAX handler should be able to just turn it directly into an object. Mind terribly giving us access to an example of what you're dealing with?

MrMoo
Sep 14, 2000

darthbob88 posted:

Near-impossibility for the thread; I have a chunk of CSS describing a background for the <body> section of my website, and I want to display different backgrounds on different pages, but I also want to keep everything in one CSS file if possible. What is a good way to do this? @document sounds like a good solution but it's also supported only by Firefox. At present I just have a <style> element saying which background to use in the template for each page, plus a default in the main CSS sheet, but this feels unwholesome and I would prefer a better solution.

Just add a new class to the body tag for each page. Easy.

darthbob88
Oct 13, 2011

YOSPOS

MrMoo posted:

Just add a new class to the body tag for each page. Easy.
Using JS at pageload? I was considering that, but rejected it as too inelegant, compared to just slapping a lump on the template. On the other hand, now that I think about it, it is simple enough to do $("body").removeClass().addClass("poop") at the top of each page's JS controller.

McGlockenshire
Dec 16, 2005

GOLLOCKS!

darthbob88 posted:

Using JS at pageload? I was considering that, but rejected it as too inelegant, compared to just slapping a lump on the template. On the other hand, now that I think about it, it is simple enough to do $("body").removeClass().addClass("poop") at the top of each page's JS controller.

Do it server side if at all possible to minimize client impact.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
I've hated wordpress for a while now, but I'm actually coming to admire how exquisitely bizarre it is. It's getting to the point that multiple plugins on this one site I'm trying to unfuck for a friend, have created an ecosystem of sorts. Some plugins are fighting with others; some are symbiotic, and gently caress knows nothing can be disturbed even the smallest amount without catastrophic consequences. Encapsulation? What the gently caress is that??? Let's just expose everything to everyone!

It's absolutely fascinating, even though it makes me want to smash the dev team's balls with a hammer.

LargeHadron
May 19, 2009

They say, "you mean it's just sounds?" thinking that for something to just be a sound is to be useless, whereas I love sounds just as they are, and I have no need for them to be anything more than what they are.
I want to write a desktop application that can download/upload XML or JSON files from/to a server and, while offline, use those files (stored locally) to render interactive forms using HTML/CSS/Angular. I'm picturing an embedded browser that can interact with the file system and function without network connectivity, except to transfer files when necessary. I see there are various options for embedded browsers, but what I'm concerned about is that Javascript won't be able to access the local file system. Am I thinking about this the wrong way?

An alternative would be to ditch the desktop app idea and just run it as a webpage that supports offline mode by caching the files I need. Is the HTML5 Application Cache suitable for this? I'm pretty sure I'd be able to download XML/JSON files to the cache while online, and then access them while offline. Would I then be able to modify one of those files in-app (or create new files), save them to the cache, then later upload the cache files to the server once I'm online again?

Adbot
ADBOT LOVES YOU

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

LargeHadron posted:

I want to write a desktop application that can download/upload XML or JSON files from/to a server and, while offline, use those files (stored locally) to render interactive forms using HTML/CSS/Angular. I'm picturing an embedded browser that can interact with the file system and function without network connectivity, except to transfer files when necessary. I see there are various options for embedded browsers, but what I'm concerned about is that Javascript won't be able to access the local file system. Am I thinking about this the wrong way?

An alternative would be to ditch the desktop app idea and just run it as a webpage that supports offline mode by caching the files I need. Is the HTML5 Application Cache suitable for this? I'm pretty sure I'd be able to download XML/JSON files to the cache while online, and then access them while offline. Would I then be able to modify one of those files in-app (or create new files), save them to the cache, then later upload the cache files to the server once I'm online again?

You want to use Electron. This will give you full access to the file system while writing your application entirely as a web app. A pure web app that works offline will likely be harder, simply because even with the various caching options available, you still need to answer the question of how the 'webserver' is hosted, and making the online/offline part seamless is non-trivial.

https://github.com/electron/electron

https://scotch.io/tutorials/creating-desktop-applications-with-angularjs-and-github-electron

Skandranon fucked around with this message at 16:15 on Mar 23, 2017

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