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
xpander
Sep 2, 2004

Sedro posted:

You can customize the adapter and serializer for that model. By default, the serializer will serialize all attributes and the adapter will use a PUT request when you save().

There's an active community on slack https://ember-community-slackin.herokuapp.com/

Amazing, thank you! There's a lot to wade through with Ember, but I really like it. I got the REST adapter configured so that it can talk to my server, so I kind of know what's up with adapters and serializers, but obviously I have more reading to do!

Adbot
ADBOT LOVES YOU

life is a joke
Mar 7, 2016

Lumpy posted:

Put a max-height on B with overflow-y: auto;

What would I set the max-height: to though? A doesn't have a set height, it's text and some padding on the top and bottom that create the length which I'd like B to match.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

Soylent Pudding posted:

I mean design in the sense that I've never touched HTLM/PHP/ASP. The closest I've come was database class, but I worked solely on the SQL database and other team members did the PHP front end. Basically I want to start learning website development because it's going to be at least a year before I can take any classes on it. I figured building a new website here would be a good project to focus on but I'm unsure of what to look at to start learning.

Hmm, that one's tougher. On the one hand I want to say "just start throwing together stuff in HTML" so you learn the basics, but on the other, almost no one does that any more so I'm not sure if that's a basic that's worth learning. If you have a relatively defined project of static content like you say, I'd still suggest mucking about with WordPress. Get it installed on local and try to brain your way through this:
https://codex.wordpress.org/First_Steps_With_WordPress

Concentrate on getting a lot of content into it first, then you'll have lots of stuff to play around with in regards to styling, menu building, etc etc.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

life is a joke posted:

What would I set the max-height: to though? A doesn't have a set height, it's text and some padding on the top and bottom that create the length which I'd like B to match.

Whatever height makes sense... you said you wanted it to scroll but it kept getting taller and taller. So keep adding content, and "when things start looking stupid", that's your max-height. If you don't want things to be constrained, don't.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Scaramouche posted:

Hmm, that one's tougher. On the one hand I want to say "just start throwing together stuff in HTML" so you learn the basics, but on the other, almost no one does that any more so I'm not sure if that's a basic that's worth learning. If you have a relatively defined project of static content like you say, I'd still suggest mucking about with WordPress. Get it installed on local and try to brain your way through this:
https://codex.wordpress.org/First_Steps_With_WordPress

Concentrate on getting a lot of content into it first, then you'll have lots of stuff to play around with in regards to styling, menu building, etc etc.

Counterpoint: WordPress is one of the worst things you can do to yourself if you want to run a website or learn web design / development. If you have simple content / mostly static stuff, use a static site generator like Jekyll or Pelican. If you have more complex needs, use something that isn't awful like Django.

PT6A
Jan 5, 2006

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

Scaramouche posted:

Hmm, that one's tougher. On the one hand I want to say "just start throwing together stuff in HTML" so you learn the basics, but on the other, almost no one does that any more so I'm not sure if that's a basic that's worth learning.

Almost no one makes full sites out of just HTML any more, but it's still a foundational skill that you need in order to do pretty much anything else, including anything non-trivial in WordPress (if you don't want to use dozens of fragile plugins which are more work to set up and maintain in the long run anyway).

kedo
Nov 27, 2007

PT6A posted:

Almost no one makes full sites out of just HTML any more, but it's still a foundational skill that you need in order to do pretty much anything else

A number of backend developers I've worked with who consider <div> a reasonable element to use for literally every single piece of content or layout on a page would beg to differ.

Anony Mouse
Jan 30, 2005

A name means nothing on the battlefield. After a week, no one has a name.
Lipstick Apathy

kedo posted:

I use this for flexbox. It's just a series of mixins for all the various flexbox properties that includes vendor prefixes. The guy even shows how you can use it to replicate a grid, though I'm not sure why you'd do so.

I use my own media query mixin that looks like this. It's nothing amazing, but it gets the job done.


Even if you don't use exactly this method, you should totally jump on the SASS train. Imagine you have this in Bootstrap:

code:
<div class="container">
  <div class="row">
    <div class="col-sm-12 col-md-4">
      One of three columns
    </div>
    <div class="col-sm-12 col-md-4">
      One of three columns
    </div>
    <div class="col-sm-12 col-md-4">
      One of three columns
    </div>
  </div>
  <div class="row">
    <div class="col-sm-12 col-md-4">
      One of three columns
    </div>
    <div class="col-sm-12 col-md-4">
      One of three columns
    </div>
    <div class="col-sm-12 col-md-4">
      One of three columns
    </div>
  </div>
</div>
You could do this with flexbox with similar (but simpler) markup and all your layout styles in SASS:

code:
<div class="container">
  <div class="container__item">
    One of three columns
  </div>
  <div class="container__item">
    One of three columns
  </div>
  <div class="container__item">
    One of three columns
  </div>
  <div class="container__item">
    One of three columns
  </div>
  <div class="container__item">
    One of three columns
  </div>
  <div class="container__item">
    One of three columns
  </div>
</div>
CSS code:
.container {
  @include flexbox;
  @include flex-wrap(wrap);

  &__item {
    @include flex(1, 1, 100%);

    @include media-query(min,medium) {
      @include flex(1,1,33.33%);
      // If you want all your items to only ever be 33.33% wide, you'd add a max-width here.

      // If you want to support old versions of IE, you have to use floats
      // and widths which is a throwback to grids. Boo.
      .ie9 & {
        float: left;
        width: 33.33%;
      }
    }
  }
}
The result is virtually identical and I didn't need to use a big framework to do it. However now that I'm looking at Bootstrap again for the first time in awhile, it seems like they have better SASS support than they used to, and they also have an option to use flexbox.

Is this better or worse than Bootstrap? I certainly find it far easier to write and maintain.

e: Also, if you're getting started on SASS I'd recommend reading this article to learn a great way to structure your SASS files. Most people start off by dumping all of their styles into one big document just like they might with CSS, but there is a better way.

I really don't mind Bootstrap but this is good info to have. I need to learn more about flexbox.

SASS is great and everyone should use it. I can't think of a single reason you wouldn't use it unless you literally couldn't because of constraints.

PT6A
Jan 5, 2006

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

kedo posted:

A number of backend developers I've worked with who consider <div> a reasonable element to use for literally every single piece of content or layout on a page would beg to differ.

Ignoring for the moment the fact that this, in a sense, proves my point, I was talking about building and maintaining a complete website. You either need to know HTML and CSS to some degree, or be working with someone that does. Someone involved had better know HTML.

treasure bear
Dec 10, 2012

Does anyone know of a way to capture images of web pages with MP4 video embedded server-side on windows? It needs to capture at 1280x720 and allow setting a waiting time for javascript and resources to load, also it needs to be headless.

Annoyingly wkhtmltoimage works aside from video. I found this for linux http://www.leonardteo.com/2011/07/taking-server-side-screenshots-of-websites/ but not windows.

im going to cry

kedo
Nov 27, 2007

PT6A posted:

Ignoring for the moment the fact that this, in a sense, proves my point, I was talking about building and maintaining a complete website. You either need to know HTML and CSS to some degree, or be working with someone that does. Someone involved had better know HTML.

I was agreeing with you, albeit with a sarcastic joking reply. :) My point is that there lots of developers out there (more than I'd like to imagine) who think, "I work on websites, but I only do stuff on the backend. Therefore I don't need to know anything about HTML or CSS best practices," and are perfectly happy to have their poo poo spit out nasty markup filled with deprecated or misused elements. I choose not to work with these people again because it's frustrating and there are plenty of other developers in the sea.

Anyone working in this industry, even UX or designer folk, should know enough HTML and CSS that they could mockup a simple page themselves if they had to.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

It's actually an interesting question from a pedagogical standpoint; obviously there is value in knowing how to HTML and style things. But when's the last time you did so from scratch without using any interim/generation tools? Like I remember when IE3 came out and TABLEs were suddenly a big deal (and JPGs!), so obviously I have a grounding in the basics, perhaps too basic. But for people getting into it fresh new, what's the compelling use case for learning HTML and writing it from scratch? I think the most HTML I've written in the last few years has been essentially article level formatting, and the most CSS has been menu tweaking. If anything raw HTML has become something of an adjunct to authoring tools in a way; when's the last time you opened up a new file and started typing "<HTML>...</HTML>"?

Giga Gaia
May 2, 2006

360 kickflip to... Meteo?!

Scaramouche posted:

It's actually an interesting question from a pedagogical standpoint; obviously there is value in knowing how to HTML and style things. But when's the last time you did so from scratch without using any interim/generation tools? Like I remember when IE3 came out and TABLEs were suddenly a big deal (and JPGs!), so obviously I have a grounding in the basics, perhaps too basic. But for people getting into it fresh new, what's the compelling use case for learning HTML and writing it from scratch? I think the most HTML I've written in the last few years has been essentially article level formatting, and the most CSS has been menu tweaking. If anything raw HTML has become something of an adjunct to authoring tools in a way; when's the last time you opened up a new file and started typing "<HTML>...</HTML>"?

Constantly at my god drat rear end backwards company that makes me want to shoot myself.

Thermopyle
Jul 1, 2003

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

kedo posted:

I was agreeing with you, albeit with a sarcastic joking reply. :) My point is that there lots of developers out there (more than I'd like to imagine) who think, "I work on websites, but I only do stuff on the backend. Therefore I don't need to know anything about HTML or CSS best practices," and are perfectly happy to have their poo poo spit out nasty markup filled with deprecated or misused elements. I choose not to work with these people again because it's frustrating and there are plenty of other developers in the sea.

Anyone working in this industry, even UX or designer folk, should know enough HTML and CSS that they could mockup a simple page themselves if they had to.

While I agree it doesn't feel good when generated pages have crap source code, I'm not sure it matters much of the time. The idea is that the prettiness or correctness of the source only matters as far as it takes for the browser to parse it in a performant way. People have no need to be reading it.

I question the usefulness of a backend generating html that a human will have to be looking at.

ModeSix
Mar 14, 2009

Giga Gaia posted:

Constantly at my god drat rear end backwards company that makes me want to shoot myself.

Do they force you to use Notepad or something? If so, please find a new job.

Literally any editor I've ever seen that's been specifically built for writing HTML will throw in some boilerplate code.

Edit content:

Anyone who's looking for a good walkthrough of .NET Core working with MVC/Entity Framework/angular/bootstrap(or not, but it's included in the course), should look at this series: https://app.pluralsight.com/library/courses/aspdotnetcore-efcore-bootstrap-angular-web-app/table-of-contents Pluralsight Membership required of course.

The first 3 or 4 modules are pretty basic, this is what web dev/html/cs/javascript is. Once you skip or slog through that, he starts going into how the .NET MVC works and it's really well presented. He's a total grognard and even says "it's hard to grok" at some point in the Javascript section, which is loving amazing, reminds me of my childhood.

The guy presenting the course is super good and really explains well for anyone (like me) who was/is having a hard time getting their head around the .NET Core framework. I work in education, and this guy should really be a teacher professionally.

ModeSix fucked around with this message at 18:26 on Aug 12, 2016

kedo
Nov 27, 2007

Thermopyle posted:

While I agree it doesn't feel good when generated pages have crap source code, I'm not sure it matters much of the time. The idea is that the prettiness or correctness of the source only matters as far as it takes for the browser to parse it in a performant way. People have no need to be reading it.

I agree for the most part. I'm mostly talking about what it's like as a front-end dev to deal with that sort of crap, not as a browser interpreting said crap. If one one else has to touch it and it's generated in a performant way, that's great and I don't really care. But that hasn't always been the case for me.

Thermopyle posted:

I question the usefulness of a backend generating html that a human will have to be looking at.

Absolutely agree with this.


Scaramouche posted:

It's actually an interesting question from a pedagogical standpoint; obviously there is value in knowing how to HTML and style things. But when's the last time you did so from scratch without using any interim/generation tools? Like I remember when IE3 came out and TABLEs were suddenly a big deal (and JPGs!), so obviously I have a grounding in the basics, perhaps too basic. But for people getting into it fresh new, what's the compelling use case for learning HTML and writing it from scratch? I think the most HTML I've written in the last few years has been essentially article level formatting, and the most CSS has been menu tweaking. If anything raw HTML has become something of an adjunct to authoring tools in a way; when's the last time you opened up a new file and started typing "<HTML>...</HTML>"?

Knowing what can and cannot be done and what's easy vs. hard. I'm coming from the perspective of someone who worked with print designers and web designers (who didn't know how to code) for several years, and their lack of knowledge made my job incredibly difficult. I was in the position of saying, "No we can't do that because it's literally impossible," or "No we can't do that because it's more complex than the budget allows," and they weren't very helpful in coming up with alternative solutions.

Like all things, there's a car analogy here. To sell cars you don't need to know how to build one by hand and in fact you don't even need to know how one runs. However knowing how the various pieces fit together and why engine A is better than engine B, or why you can't put wheels X on car Y makes you a more informed salesperson which in turn makes you a more valuable resource to your clients and your employer.

Even if you're using Angular or WordPress or whatever framework/CMS/tool, you're still probably writing at least some structural HTML. If you didn't have a solid grounding in how and why it works the way it does, wouldn't it make your job a lot harder?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

kedo posted:

Even if you're using Angular or WordPress or whatever framework/CMS/tool, you're still probably writing at least some structural HTML. If you didn't have a solid grounding in how and why it works the way it does, wouldn't it make your job a lot harder?

Oh yeah, and I'm not arguing against it even. But I don't think I've written my own <HTML>, <HEAD>, and <BODY> information in a dog's age, which is a significant (thought not total) part of HTML. It seems like everything up until the first <div class="content"> is getting handled for you now by various tools, and the lumbering ever-expanding CSS/Javascript juggernaut handles everything else. Another example is that I haven't used TABLE in forever either, because CSS columns are pretty cool. Or <IFRAME>. I think the only old school HTML only structures I use on the reg are:
- <Hx> (hilariously only for the obsolete SEO intangibles that people insist on having; formatting wise CSS handles anything H does)
- <p>/<br/>
- <ul>/<ol>/<li>
- <div>
- <strong>/<em>

That might be though that I'm not really a display guy, having come up through databases/server side, and am a weak scrub compared to the rest of you.

Heskie
Aug 10, 2002
I'm a bit confused by this as I write html/body tags constantly for the layouts and partials that my framework or static site generator. Yeah its not an .html file but I couldn't imagine going years without rewriting a body tag unless I worked on the same product for all those years that all extended from the same single layout file that never got updated.

I used an iframe yesterday to make a 'preview panel' in an admin interface to show how something appeared to the customer by literally displaying what the customer saw in a borderless iframe. Also tables are good for tabular data :v:.

HTML is cool and good.

treasure bear
Dec 10, 2012

Heskie posted:

I used an iframe yesterday to make a 'preview panel' in an admin interface to show how something appeared to the customer by literally displaying what the customer saw in a borderless iframe.

wish i could do that in m y application but it would be way too heavy

Carbon dioxide
Oct 9, 2012

I am managing an extremely simple site for my dad. He's got a brick-and-mortar store and he wants it to have a web presence. It's a bunch of pages that are all basic html, and a css file for the style stuff.

Now, this is something I do to the side, it only needs a content update like once a year, so I don't want to put much effort into it. I'm not a designer, either. The website is completely usable and I made it easy for visitors to find the information they need, but it looks like it was made in the 90s. I don't really care about that part, if he wants something better he should hire someone with the right skills for it.

When my dad asks me to update the content, there's two things that somewhat annoy me:
- Because it's barebones html, stuff like the menu bar on top of every page is literally duplicated in every html file. A change to the menu is a lot of work.
- My dad doesn't understand html so he cannot fix stuff like typos himself. He does have a wordpress blog elsewhere and has no trouble with its wysiwyg editor.

For the first point, I'd normally use some kind of templating engine with the ability to inherit from a global page definition or to include reusable components. We use Java-backed jsp and ftl templates at work. The thing is, my dad uses a simple webhost that only supports php, and client-side stuff of course. And because I don't spend enough time on it to want to put hours of work into upgrading it, I don't want to have to wade knee-deep into php or javascript to set up an engine. I would like something quick and simple, where I dump some files on the server, add a tag or two to the existing html pages, and that's it.

For the second point, which might be mutually exclusive with the first - I'm wondering if there's some kind of tool, perhaps a CMS, that doesn't force any kind of default layout on me and can just take the existing html and css files and allows my dad to edit pages in a WYSIWYG editor on the fly, so that he doesn't need to use FTP to upload changed files.

As I said I want simple and quick. If that's asking too much, it's easier for me to push through those annoyances and just keep updating the website old style.

Carbon dioxide fucked around with this message at 20:44 on Aug 13, 2016

PT6A
Jan 5, 2006

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

Scaramouche posted:

Oh yeah, and I'm not arguing against it even. But I don't think I've written my own <HTML>, <HEAD>, and <BODY> information in a dog's age, which is a significant (thought not total) part of HTML. It seems like everything up until the first <div class="content"> is getting handled for you now by various tools, and the lumbering ever-expanding CSS/Javascript juggernaut handles everything else. Another example is that I haven't used TABLE in forever either, because CSS columns are pretty cool. Or <IFRAME>. I think the only old school HTML only structures I use on the reg are:
- <Hx> (hilariously only for the obsolete SEO intangibles that people insist on having; formatting wise CSS handles anything H does)
- <p>/<br/>
- <ul>/<ol>/<li>
- <div>
- <strong>/<em>

That might be though that I'm not really a display guy, having come up through databases/server side, and am a weak scrub compared to the rest of you.

<table>s are cool and good, because sometimes you need to display tabular data. Why would you go through the hassle of formatting that all with css when there's absolutely no point?

If you are not displaying tabular data, though, you should not be using a table.

Xik
Mar 10, 2011

Dinosaur Gum

Carbon dioxide posted:

I am managing an extremely simple site for my dad. He's got a brick-and-mortar store and he wants it to have a web presence. It's a bunch of pages that are all basic html, and a css file for the style stuff.

It sounds like you have a pretty good use case for a static site generator.

Basically, markdown/template goes in => HTML comes out. You then upload the generated HTML wherever you want to host it. Markdown should be teachable and if you just setup a shortcut that runs the generator or something your dad could could probably do everything end to end.

Alternatively (and depending how much hosting is already costing you), something like squarespace might be a better solution if you're already thinking "I don't want to deal with this".

Carbon dioxide
Oct 9, 2012

Thanks, that page was very useful. I decided to go with jbake because it uses the freemarker templates I'm used to.

I also made the menu bar a generic include in every page. At the very least this will make it easier for me to change things, and perhaps I can even teach my dad how to do edits himself.

fuf
Sep 12, 2004

haha
If your dad already knows how to use wordpress maybe you should just rebuild it as a wordpress site? Easy for your dad to edit, no more menu problems, and you can replace the 90s design with something modern.

fuf
Sep 12, 2004

haha
Is there a jsfiddle equivalent that does live reload? Why do I have to click "run" every time what is this 2015 or somethin

ModeSix
Mar 14, 2009

fuf posted:

Is there a jsfiddle equivalent that does live reload? Why do I have to click "run" every time what is this 2015 or somethin

http://codepen.io/

fuf
Sep 12, 2004

haha
thank you my man

Anony Mouse
Jan 30, 2005

A name means nothing on the battlefield. After a week, no one has a name.
Lipstick Apathy
Careful with codepen, its "hot reloading" is so aggressive that sometimes I've had it fall into an infinite and loop and crash because it's trying to run my code as I'm writing a for loop or some other thing.

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I'm redoing my personal website/blog completely. Do people still use css resets? My current/old one is using normalize.css. Is that one still the one to use?

kedo
Nov 27, 2007

I see it pretty regularly on projects, yeah.

kedo
Nov 27, 2007

Okay, is it just me or is Drupal a huge pain in the rear end? I know there are a million and five modules that exist for it, but finding one that does what I want is loving impossible. Is there a better place for me to look besides just Googling whatever function I'm trying to achieve?

For example: I'm trying to figure out if there's some way to generate a linked list of the content on a page based on its headline structure. I have zero clue how to Google this in Drupal-speak.

ModeSix
Mar 14, 2009

Crossposting from the .NET Megathread.

I'm in the process of learning .Net Core and I have a question about DbContext.

I'm using an override in my DbContext and want to tell it to use a Postgres SQL server, but the Npgsql documentation is loving wondrously inadequate.

This is what I've got in my WorldContext.cs file:
code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;

namespace TheWorld.Models
{
    public class WorldContext : DbContext
    {
        private IConfigurationRoot _config;

        public WorldContext(IConfigurationRoot config)
        {
            _config = config;
        }

        public DbSet<Trip> Trips { get; set; }
        public DbSet<Stop> Stops { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);


            optionsBuilder.UseSqlServer(_config[""]); // I don't want to use SQL Server, I want to use PgSQL.  
            //The connection string will also be moved into a config file after I figure out how to actually do it.
        }

        

    }
}
Here are the Dependencies in my project.json

code:
"dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.EntityFrameworkCore": "1.0.0",
    "Npgsql": "3.1.0-*",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0"
  }
How do I use the Npgsql module to have my override use Npgsql to connect to a Postgres DB as opposed to a regular MSSql server? This is an issue because it will in the end be deployed on Linux and MSSql's fabled Linux port hasn't appeared yet, and I'd like to use the Json features of PGSQL as well.

ModeSix fucked around with this message at 16:20 on Aug 19, 2016

nexus6
Sep 2, 2011

If only you could see what I've seen with your eyes

kedo posted:

Okay, is it just me or is Drupal a huge pain in the rear end? I know there are a million and five modules that exist for it, but finding one that does what I want is loving impossible. Is there a better place for me to look besides just Googling whatever function I'm trying to achieve?

For example: I'm trying to figure out if there's some way to generate a linked list of the content on a page based on its headline structure. I have zero clue how to Google this in Drupal-speak.

It's just that Drupal has quite a steep learning curve. It sounds like you're trying to make a table of contents, like on wikipedia pages? Try looking at the Comparison of Table of Contents / TOC modules to see if there's one there that does what you're looking for.

Opulent Ceremony
Feb 22, 2012
I need help streaming a file download to file on disc.

What I've got going so far: My server is streaming the file from the database into the HTTPResponse. Client-side, I'm using the HTML5 File API to write to a file on disc within a Chrome App writing sequential Blobs to a location, works great.

What I need is to stream the data from the download occurring over XHR into that location, but as far as I can tell the XHR (https://developer.mozilla.org/en-US/docs/Web/API/ProgressEvent) doesn't give you the option to take pieces of the file as they appear, you simply get to know how many bytes have transferred so far and wait until it's complete before you can see the data all put together in memory.

I think I need this because my Chrome App crashes and the logs show 'Out of memory', to which my response is "probably shouldn't load the whole file download into the Chrome App memory before writing to disc." I'm shipping some large files (500MB+) as well. I'm aware of the Chrome Blob limit issue (is it still?) (https://bugs.chromium.org/p/chromium/issues/detail?id=375297) but don't think this is my problem, since I break up the ByteArray of the file download into small Blobs that I write to disc.

So, does anyone know how to get the current transferred bytes in an XHR so I can stream a download to disc?

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Assuming no one can answer your question directly, you could consider breaking the large file up on the server side and then downloading each chunk separately with a single XHR each, then assembling the chunks again client-side as required. Possibly not ideal, but it would work.

Opulent Ceremony
Feb 22, 2012

PT6A posted:

Assuming no one can answer your question directly, you could consider breaking the large file up on the server side and then downloading each chunk separately with a single XHR each, then assembling the chunks again client-side as required. Possibly not ideal, but it would work.

Yea that's a possible solution, similarly (http://stackoverflow.com/questions/20058339/use-xhr-onprogress-to-process-large-ajax-download-without-running-out-of-memory) suggests using Range headers with multiple XHRs, though I'm not sure to what extent my IIS server can just sort of deal with that by itself rather than me having to change the server-side code to manually grab just that range of bytes and then set the Content-Range header on the Request.

Edit: MVC needs you to handle that manually, so after trying that it of course turns out that my asynchronous SqlDataReader Stream isn't seekable.

Opulent Ceremony fucked around with this message at 19:13 on Aug 19, 2016

kedo
Nov 27, 2007

nexus6 posted:

It's just that Drupal has quite a steep learning curve. It sounds like you're trying to make a table of contents, like on wikipedia pages? Try looking at the Comparison of Table of Contents / TOC modules to see if there's one there that does what you're looking for.

Thanks much!

22 Eargesplitten
Oct 10, 2010



I'm sorry if this is a bad question, but I'm kind of overwhelmed with all of the framework language options. I want to make something with a LAMP stack, or maybe RoR. Out of those four languages, which is in the highest demand or the most versatile? I'm leaning towards Python since I work in ops/infrastructure and that would serve me well even before I get into development.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Python + Django is a pretty good framework to get started with. The documentation is world class compared to most of the competition, including Ruby on Rails. The framework is reasonably well designed too, with a decent balance between getting poo poo done and flexibility for your own code. If you want more flexibility, you can go with flask, but you'll get a lot less 'out of the box' compared to Django.

Adbot
ADBOT LOVES YOU

Data Graham
Dec 28, 2009

📈📊🍪😋



Seconded. Though Django's ORM will shield you from having to learn SQL, which might be a plus for you at this stage (you can learn how to do SQL properly later on, and meanwhile the ORM lets you internalize object-oriented data modeling practices).

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