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
kloa
Feb 14, 2007


chami posted:

Time to see if a vendor software update will break their forms on our site!

Their forms are in a table styled with inline styles, nested in three other tables, in an iframe.

:smithicide:

iframes are still a thing in tyool 2015?

Adbot
ADBOT LOVES YOU

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

kloa posted:

iframes are still a thing in tyool 2015?

Huh, iframes are used by nearly every site that supports embedding in some form.

Ghostlight
Sep 25, 2009

maybe for one second you can pause; try to step into another person's perspective, and understand that a watermelon is cursing me



kloa posted:

iframes are still a thing in tyool 2015?
You may be thinking of frames.

Heskie
Aug 10, 2002

kedo posted:

e: I'm super familiar with WordPress, so... WooCommerce? Any opinions on it?

WooCommerce could be okay depending on your requirements. I rebuilt a store recently and gave it a long glance while weighing up my options.

Unfortunately for me it was a non-starter as some of the stuff I'd personally consider basic functionality, like table rate shipping, were only included as premium plugins (at $199/yr each for licenses) or from third party devs.

Eventually I stuck with Prestashop (don't use Prestashop), as although there's many things I dislike about it, it had all the features I needed out of the box.

I've been trying to find an ecommerce platform I like for years, and have tried many, but not found it yet.

AARO
Mar 9, 2005

by Lowtax
I need a website designed for a music business. It needs to be something like this.

Are there any best places to look for a web designer? Is it possible to have someone build you a site like that for ~$2000?

ufarn
May 30, 2009
If the webshop is separate, which it looks like it is anyway, you could just buy Squarespace and pick one of their themes.

Sonata Mused
Feb 19, 2013

I'll show you... a nightmare...
So, I became a web developer within the last year or so and just noticed that this forum exists...

Just wondering if anyone had any tips or good, basic knowledge that I should know for being a designer/developer.

With my current job, I mostly work with .NET MVC, HTML5, JS, and C# stuff. Does anyone have any kind of knowledge that they wished they knew when they were just starting out compared to now?

I'm also looking for recommendations for books and other things for learning going forward.

DICTATOR OF FUNK
Nov 6, 2007

aaaaaw yeeeeeah

Heskie posted:

I've been trying to find an ecommerce platform I like for years, and have tried many, but not found it yet.

I've discovered that Magento's pretty great if you're willing to spend like a year learning it :v:

Disclaimer: I'm primarily a Python programmer and I work for a Magento shop, and while I hated the poo poo out of it at first (NAMESPACES!!!), once I learned its nuances, like the loving XML file structure and the EAV schema, I found that it's really quite powerful and I enjoy working with it when paired with a good IDE (PhpStorm + Magicento).

I hate it much less than any other PHP software platform I've worked with (although I'd definitely prefer Symfony to Zend as the base framework) and much less than some horrid poo poo like OSCommerce or Drupal (it's better than Drupal at being a CMS too :v:).

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!
https://jsfiddle.net/c7k1vkhw/

What is the silly, obvious thing I'm missing that is preventing the border from showing up?

e: switched it to use SCSS, nested it, and the border now shows up. It appears as though none of my styles were being applies when I had separate selectors for some reason.

enthe0s fucked around with this message at 01:25 on Aug 6, 2015

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

enthe0s posted:

https://jsfiddle.net/c7k1vkhw/

What is the silly, obvious thing I'm missing that is preventing the border from showing up?

You're gonna kick yourself:

https://jsfiddle.net/c7k1vkhw/2/

You used javascript comments in your CSS, which makes everything under it ignored

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!

Lumpy posted:

You're gonna kick yourself:

https://jsfiddle.net/c7k1vkhw/2/

You used javascript comments in your CSS, which makes everything under it ignored

Gah that's so dumb. I knew it was something stupidly simple.


Got a React best practices question (maybe this would be better in the modern front-end dev thread?):

I have a tile component that is rendered as such:

code:
<div className="tile">
  <div className="content">
    <h5>{this.props.tile.name}</h5>
    <p>{this.props.tile.body}</p>
  </div>
</div>
And I'm getting the content from the parent component, tilesContainer, which has an array of data called 'tiles'.

Here's 1 of those tile objects as an example:
code:
{
  name: 'contact',
  body: 'email: lala@example.com\n linkedin\n behance'
}
So what I want is for some of the text to be on a new line, but that doesn't seem to be working. When the tile is rendered I just get everything on a single line with a single space where the newline characters are, so I feel like this isn't the right way to inject data with React. What's a better way to do this?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
It's just HTML mate, white space is collapsed into single spaces unless the block is styled with white-space: pre. If you want to convert the new lines to line breaks to you want a string.split("\n").join("<br/>") so you can dangerouslySetInnerHtml, or split it and then intercalate with React.DOM.br.

kedo
Nov 27, 2007

Sonata Mused posted:

Just wondering if anyone had any tips or good, basic knowledge that I should know for being a designer/developer.

http://www.stilldrinking.org/programming-sucks

Welcome!

Kizurue
Apr 5, 2006

There's somethin' fishy goin' on here...
So I have been tasked with creating a website when I have zero knowledge of how to do so. Well after looking around I got a domain for the site, I setup Apis to host whatever monstrosity I manage to make but I have no idea what to do now. What would be some good literature to start with to learn how the hell to create a website? Are there any books recommended or guides that anyone would feel would be useful? This is something I have always had an interest in learning but never got around to it so I am actually willing to invest a bit of time for it.

Also:
This was hilarious.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Kizurue posted:

So I have been tasked with creating a website when I have zero knowledge of how to do so. Well after looking around I got a domain for the site, I setup Apis to host whatever monstrosity I manage to make but I have no idea what to do now. What would be some good literature to start with to learn how the hell to create a website? Are there any books recommended or guides that anyone would feel would be useful? This is something I have always had an interest in learning but never got around to it so I am actually willing to invest a bit of time for it.

Also:

This was hilarious.

The big question: is the content static, mostly static (somebody writes or edits stuff like a blog), or is there a lot of dynamic content that needs to come out of a database?

Tell us what you are building and we can help. "A website" is very vague these days.

IronDoge
Nov 6, 2008

Codeacademy's guided courses are pretty darn good for someone with zero knowledge of anything.
Start here: https://www.codecademy.com/en/tracks/web

Work your way out from there. HTML and CSS are pretty much the two basic things you'll need to learn to make something that looks halfway decent.

Kizurue
Apr 5, 2006

There's somethin' fishy goin' on here...

Lumpy posted:

The big question: is the content static, mostly static (somebody writes or edits stuff like a blog), or is there a lot of dynamic content that needs to come out of a database?

Tell us what you are building and we can help. "A website" is very vague these days.
Basically they want something that has a basic front screen where people can log in or register then gate any real information behind that. Then it will just be a section of policies, local agreements, current grievances, stuff like that. So primarly static information with minor updates for meetings and findings.

IronDoge posted:

Codeacademy's guided courses are pretty darn good for someone with zero knowledge of anything.
Start here: https://www.codecademy.com/en/tracks/web

Work your way out from there. HTML and CSS are pretty much the two basic things you'll need to learn to make something that looks halfway decent.
Thanks, I will have to look into that site!

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

Kizurue posted:

basic front screen

log in or register
section of policies
local agreements
current grievances

When you say "someone told me to make a website" my immediate reaction is "Wordpress!", but then you mention logins, which means security and user accounts, and then you mention "current grievances" which sounds a lot like "ability to lodge a grievance". Depending on exactly what they want from each of these things (User CRUD?) your requirements, and thus your required abilities, could quickly spiral out of control.

I'd say; step one is to compile a concrete spec for what they want this thing to do, tip to tail. Talk to the people who want it, and those who will use it. You can then short-hand that to us, and we can recommend you something.
"Just get something working" is the first step towards "this is a massive pile of poo poo".

EmmyOk
Aug 11, 2013

code:
  
<script>
	var ul = document.querySelector("#tigerlily");
	for (var i = ul.children.length; i >= 0; i--) 
	{
		ul.appendChild(ul.children[Math.random() * i | 0]);
	}
</script>
I'm using the following code to shuffle a list with the id tigerlily. However I have multiple lists I want to shuffle in the same way. I gave them all the same id but then it shuffled none. I tried querySelectionAll but that shuffled nothing then. What syntax should I be using?

EmmyOk fucked around with this message at 02:25 on Aug 7, 2015

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



EmmyOk posted:

code:
  
<script>
	var ul = document.querySelector("#tigerlily, #skepta");
	for (var i = ul.children.length; i >= 0; i--) 
	{
		ul.appendChild(ul.children[Math.random() * i | 0]);
	}
</script>
I'm using the following code to shuffle a list with the id tigerlily. However I have multiple lists I want to shuffle in the same way. I gave them all the same id but then it shuffled none. I tried querySelectionAll but that shuffled nothing then. What syntax should I be using?

Are you using the same ID with multiple HTML elements? Can't (or not supposed) to do that, use a class if you want to select multiple elements using an attribute.

EmmyOk
Aug 11, 2013

piratepilates posted:

Are you using the same ID with multiple HTML elements? Can't (or not supposed) to do that, use a class if you want to select multiple elements using an attribute.

I edited the code slightly there should only be one thing in that query selector. Yeah it's for ten survey questions with multiple choices and they want the choices to be randomised each time. Ok so what I should do is have in my CSS a class for lists with that script in it?

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

EmmyOk posted:

code:
  
	var ul = document.querySelector("#tigerlily");
	for (var i = ul.children.length; i >= 0; i--) 
	{
		ul.appendChild(ul.children[Math.random() * i | 0]);
	}

This is what you're doing: For X children in my UL, find child #(RANDOM * POSITION or 0 if result < 1), and append it to the UL. Math.random() returns a float (eg. 0.27493) so your outcome from that is going to be weird as.
At best that's going to duplicate your LIs, at worse it's going to do nothing, or duplicate the first few a bunch of times?

I had to google this because apparently [ul].children is an HtmlCollection which isn't a real array and behaves weirdly. This is probably why you can't shuffle the children directly, because you can't mess with that object's element positions, it seems.
code:
// Generic array shuffle: http://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array-in-javascript
function shuffle(o){
    for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
    return o;
}

// Magic list shuffle function
function shuffleList(list) {

    // html to collection: http://stackoverflow.com/questions/222841/most-efficient-way-to-convert-an-htmlcollection-to-an-array
    var arr = [].slice.call(htmlCollection);

    // Shuffle elements
    arr = shuffle(arr);

    // Remove children
    for(var i in arr) { x.removeChild(arr[i]); }

    // Add shuffled children
    for(var i in arr) { x.appendChild(arr[i]); }
}

// Fetch child elements, and shuffle.
var ul = document.querySelector("#tigerlily");
shuffleList(ul);

You probably don't want to run that with multiple ULs in the querySelector or it may shuffle the items between different ULs.

EmmyOk
Aug 11, 2013

v1nce posted:


You probably don't want to run that with multiple ULs in the querySelector or it may shuffle the items between different ULs.

This seems like a much better of the quick and dirty solution I ended up with. I'll try to add that in in the coming days if I get a chance before the deadline.

code:
    var zil = document.getElementsByClassName("tigerlily");
    for(x = 0; x < zil.length; x++){
      var ul = document.getElementsByClassName("tigerlily")[x];
      for (var i = ul.children.length; i >= 0; i--) {
          ul.appendChild(ul.children[Math.random() * i | 0]);
      }
    }
Disgustingly inelegant but it just needs to exists for ten questions on a small unimportant page. Is there anything horrifically exploitable in it?

Also thanks to everyone in the thread for all the help recently!

Pollyanna
Mar 5, 2005

Milk's on them.


Why not keep the questions as text in memory, shuffle those, and then write the shuffled array of question strings to a ul? Keeping your display logic as separate as possible from your business logic makes things a lot easier.

Munkeymon
Aug 14, 2003

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



v1nce posted:

This is what you're doing: For X children in my UL, find child #(RANDOM * POSITION or 0 if result < 1), and append it to the UL. Math.random() returns a float (eg. 0.27493) so your outcome from that is going to be weird as.

No, that's a bitwise OR so it's (random() * position) | 0 which is exactly the same as random() * position :psyduck:

E: oh derp it's a float so I'm wrong. Welp. Gonna leave this here in case anyone else has the same thought.

Munkeymon fucked around with this message at 15:18 on Aug 7, 2015

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Doesn't doing the bitwise or cast the float to an integer? I figured that's what he was doing.

Munkeymon
Aug 14, 2003

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



piratepilates posted:

Doesn't doing the bitwise or cast the float to an integer? I figured that's what he was doing.

Spec says it converts it with ToInt32, yeah.

Unity Gain
Sep 15, 2007

dancing blue

Pollyanna posted:

Why not keep the questions as text in memory, shuffle those, and then write the shuffled array of question strings to a ul? Keeping your display logic as separate as possible from your business logic makes things a lot easier.

This is the Right Way™ to do it.

EmmyOk
Aug 11, 2013

Pollyanna posted:

Why not keep the questions as text in memory, shuffle those, and then write the shuffled array of question strings to a ul? Keeping your display logic as separate as possible from your business logic makes things a lot easier.

Ignorance is why. I have never done web development before a few weeks ago when I was asked to do this project. I normally program in fsharp or Java. Anything I do that isn't the correct or best practise is just because I don't know better. I found the trickiest part of the whole process is not being familiar enough with web dev to even know what things to google. Your solution makes a lot of sense and seems straightforward so I'll spend my evening doing that!

Data Graham
Dec 28, 2009

📈📊🍪😋



That was easy. Let's see what else we can trick him into doing

fuf
Sep 12, 2004

haha
Is rackspace good? Any reason not to use them?

I am going to start managing my own servers again haha. I can't resist...

I'd like to try the WP multisite thing too so I was planning to set up 2-3 rackspace cloud servers with a multisite installation on each one.

revmoo
May 25, 2006

#basta
Rackspace is quite overpriced unless you are a big company with mission critical stuff going on. I like CARI.net

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
What's the best way to POST CSV data to a server? As text? Or as a file? If I send it as a file, is this the proper way to do so?

JavaScript code:
// UserService
service.bulkUploadUsers = function(csvData) {
    return $http.post(SERVER_URL + 'v1/admin_site/bulk_upload_users/', csvData, {
        headers: {
            'Content-Type': 'text/csv'
        }
    });
};

// <input type="file"> Change Handler
var file = event.target.files[0];
UserService.bulkUploadUsers(file).then(function(success) {
    console.log('csv upload success');
}, function(reason) {
    console.log('csv upload failed:', reason);
});
Sending it as text is easy enough, I have that figured out at least from the frontend side of things. I think the Parser I'm using in Rest Framework expects a file, though, because it throws an errors when I try to POST the body of the CSV file as text:

quote:

CSV parse error - iterator should return strings, not bytes (did you open the file in text mode?)

It appears to be a known issue with the library, but I want to rule out anything I'm doing before I go do anything crazy: https://github.com/mjumbewu/django-rest-framework-csv/issues/30

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

fuf posted:

Is rackspace good? Any reason not to use them?

I am going to start managing my own servers again haha. I can't resist...

I'd like to try the WP multisite thing too so I was planning to set up 2-3 rackspace cloud servers with a multisite installation on each one.

Rackspace (as moo said) is great, but expensive. I use Linode for anything that's not "oh god this has to stay up 99.9999999999% of the time and I need anything that goes wrong fixed in under 2 minutes" stuff.

fuf
Sep 12, 2004

haha

revmoo posted:

Rackspace is quite overpriced unless you are a big company with mission critical stuff going on. I like CARI.net


Lumpy posted:

Rackspace (as moo said) is great, but expensive. I use Linode for anything that's not "oh god this has to stay up 99.9999999999% of the time and I need anything that goes wrong fixed in under 2 minutes" stuff.

roger that.

I knew it was expensive but yeah looking closer it's pretty crazy how much a basic stack would be.

I've had a server with oneprovider for a long time (used as a seedbox) and it's always been pretty reliable, so I might give one of those a try as a web server. They have pretty good deals:
http://oneprovider.com/dedicated-servers/london-united-kingdom

Their Paris servers are crazy cheap: http://oneprovider.com/dedicated-servers/paris-france

I also want to find someone I can pay to help me with server setup. PMs welcome :) I can bumble through it myself but I'm always super paranoid about stuff like mysql running out of memory and shutting itself down, and also about the server sending out spam because of hacked wordpress sites. I want some expert reassurance that things are set up properly, and also guidance on installing Varnish (worth it?) and some kind of monitoring software.

Impotence
Nov 8, 2010
Lipstick Apathy

fuf posted:

roger that.

I knew it was expensive but yeah looking closer it's pretty crazy how much a basic stack would be.

I've had a server with oneprovider for a long time (used as a seedbox) and it's always been pretty reliable, so I might give one of those a try as a web server. They have pretty good deals:
http://oneprovider.com/dedicated-servers/london-united-kingdom

Their Paris servers are crazy cheap: http://oneprovider.com/dedicated-servers/paris-france

I also want to find someone I can pay to help me with server setup. PMs welcome :) I can bumble through it myself but I'm always super paranoid about stuff like mysql running out of memory and shutting itself down, and also about the server sending out spam because of hacked wordpress sites. I want some expert reassurance that things are set up properly, and also guidance on installing Varnish (worth it?) and some kind of monitoring software.

oneprovider paris resells online.net. i pay about 30something euros for ~32/64gb ram machines at online. and more notably, $2/month for 2GB RAM full dedicated servers. they (online.net) are free.fr, one of the larger isps in france, and occasionally have some hilarious deals - i still have a "limited offer" 2x2tb hwraid dual E5 with 64 GB ram for something like $49/m

Impotence fucked around with this message at 12:26 on Aug 8, 2015

fuf
Sep 12, 2004

haha

Biowarfare posted:

oneprovider paris resells online.net. i pay about 30something euros for ~32/64gb ram machines at online. and more notably, $2/month for 2GB RAM full dedicated servers. they (online.net) are free.fr, one of the larger isps in france, and occasionally have some hilarious deals - i still have a "limited offer" 2x2tb hwraid dual E5 with 64 GB ram for something like $49/m

Oh neat, that's interesting.

If most of my traffic comes from the UK then I wonder if I'd be better off with a less powerful server in London or a more powerful server in Paris?

My priority is really to speed up the sites I host because that's what some clients have been complaining about. Especially the initial response time or time to first byte or whatever.

hayden.
Sep 11, 2007

here's a goat on a pig or something
I am having 500 Internal Server errors on my Digital Ocean VPS and I am not sure what the cause is.

I have a Laravel install and a public folder where obviously all the public facing stuff is. It's the document root for Apache.

I can make any folder and add any file to the public folder and access it just fine. However, whenever I put a huge pile of files in the folder, whenever I try to access any of them it gives me the Error 500 "Internal Server Error".

For instance, I added this image by itself to the test3 folder and it still works just fine:

http://104.131.4.238/test3/5.jpg

and then here's one of the images that was added in bulk:

http://104.131.4.238/test3/image002400.jpg

and it gives 500 error. Here's the stat for each and it seems identical in any way that matters:
code:
  File: ‘5.jpg’
  Size: 26398           Blocks: 56         IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 1246061     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-08-09 00:33:08.036187999 -0400
Modify: 2015-08-08 20:41:58.692187999 -0400
Change: 2015-08-09 00:32:49.344187999 -0400
 Birth: -

  File: ‘image002400.jpg’
  Size: 348             Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 1246064     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-08-08 20:41:59.156187999 -0400
Modify: 2015-08-08 20:41:59.376187999 -0400
Change: 2015-08-09 00:34:03.532187999 -0400
 Birth: -
Any idea what's going on here? Why is adding stuff piecemeal okay but not in bulk?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

hayden. posted:

I am having 500 Internal Server errors on my Digital Ocean VPS and I am not sure what the cause is.

I have a Laravel install and a public folder where obviously all the public facing stuff is. It's the document root for Apache.

I can make any folder and add any file to the public folder and access it just fine. However, whenever I put a huge pile of files in the folder, whenever I try to access any of them it gives me the Error 500 "Internal Server Error".

For instance, I added this image by itself to the test3 folder and it still works just fine:

http://104.131.4.238/test3/5.jpg

and then here's one of the images that was added in bulk:

http://104.131.4.238/test3/image002400.jpg

and it gives 500 error. Here's the stat for each and it seems identical in any way that matters:
code:
  File: ‘5.jpg’
  Size: 26398           Blocks: 56         IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 1246061     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-08-09 00:33:08.036187999 -0400
Modify: 2015-08-08 20:41:58.692187999 -0400
Change: 2015-08-09 00:32:49.344187999 -0400
 Birth: -

  File: ‘image002400.jpg’
  Size: 348             Blocks: 8          IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 1246064     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-08-08 20:41:59.156187999 -0400
Modify: 2015-08-08 20:41:59.376187999 -0400
Change: 2015-08-09 00:34:03.532187999 -0400
 Birth: -
Any idea what's going on here? Why is adding stuff piecemeal okay but not in bulk?
Maybe your first result is cached: both are 500 errors for me. What do the Apache logs tell you?

Adbot
ADBOT LOVES YOU

Impotence
Nov 8, 2010
Lipstick Apathy
check error.log, probably has nothing to do with file itself

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