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.
 
  • Locked thread
Bloody
Mar 3, 2013

redleader posted:

pfft, all you ivory tower types with your highfalutin "oo design"

just vomit code into your editor until a few cursory manual tests look alright, then throw that poo poo up to production

this unironically

Adbot
ADBOT LOVES YOU

akadajet
Sep 14, 2003


i agree with this guy. java is bad. he's clearly advocating for idiomatic javascript at the end which is a much better language for large programs.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

leftpad() syscall, anyone? anyone? https://lkml.org/lkml/2016/3/31/1109

code:
From	Richard Weinberger <>
Subject	[PATCH] Implement leftpad syscall
Date	Fri, 1 Apr 2016 00:33:32 +0200

From: David Gstir <david@sigma-star.at>

Implement the leftpad() system call such that userspace,
especially node.js applications, can in the near future directly
use it and no longer depend on fragile npm packages.

Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/x86/entry/syscalls/syscall_64.tbl |  1 +
 include/linux/syscalls.h               |  1 +
 kernel/sys.c                           | 35 ++++++++++++++++++++++++++++++++++
 kernel/sys_ni.c                        |  1 +
 4 files changed, 38 insertions(+)
diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
index cac6d17..f287712 100644
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
@@ -335,6 +335,7 @@
 326	common	copy_file_range		sys_copy_file_range
 327	64	preadv2			sys_preadv2
 328	64	pwritev2		sys_pwritev2
+329	common	leftpad			sys_leftpad
 
 #
 # x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d795472..a0850bb 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -898,4 +898,5 @@ asmlinkage long sys_copy_file_range(int fd_in, loff_t __user *off_in,
 
 asmlinkage long sys_mlock2(unsigned long start, size_t len, int flags);
 
+asmlinkage long sys_leftpad(char *str, char pad, char *dst, size_t dst_len);
 #endif
diff --git a/kernel/sys.c b/kernel/sys.c
index cf8ba54..e42d972 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2432,3 +2432,38 @@ COMPAT_SYSCALL_DEFINE1(sysinfo, struct compat_sysinfo __user *, info)
 	return 0;
 }
 #endif /* CONFIG_COMPAT */
+
+
+SYSCALL_DEFINE4(leftpad, char *, src, char, pad, char *, dst, size_t, dst_len)
+{
+	char *buf;
+	long ret;
+	size_t len = strlen_user(src);
+	size_t pad_len = dst_len - len;
+
+	if (dst_len <= len || dst_len > 4096) {
+		return -EINVAL;
+	}
+
+	buf = kmalloc(dst_len, GFP_KERNEL);
+	if (!buf)
+		return -ENOMEM;
+
+	memset(buf, pad, pad_len);
+	ret = copy_from_user(buf + pad_len, src, len);
+	if (ret) {
+		ret = -EFAULT;
+		goto out;
+	}
+
+	ret = copy_to_user(dst, buf, dst_len);
+	if (ret) {
+		ret = -EFAULT;
+		goto out;
+	}
+
+	ret = pad_len;
+out:
+	kfree(buf);
+	return ret;
+}
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 2c5e3a8..262608d 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -175,6 +175,7 @@ cond_syscall(sys_setfsgid);
 cond_syscall(sys_capget);
 cond_syscall(sys_capset);
 cond_syscall(sys_copy_file_range);
+cond_syscall(sys_leftpad);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
-- 
1.8.4.5

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

akadajet posted:

i agree with this guy. java is bad. he's clearly advocating for idiomatic javascript at the end which is a much better language for large programs.

his description of how perfect encapsulation would theoretically work is basically a description of how elm actually works irl

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

redleader posted:

pfft, all you ivory tower types with your highfalutin "oo design"

just vomit code into your editor until a few cursory manual tests look alright, then throw that poo poo up to production

the weirdest thing about oop is how many people think it's the only possible way to organize code.

HoboMan
Nov 4, 2010

redleader posted:

just vomit code into your editor until a few cursory manual tests look alright, then throw that poo poo up to production

HoboMan
Nov 4, 2010

all this react/redux/webpack talk got me thinking. where do i start if i want to make my webpages not look like an engineer made them?
"but it's functional, what more do you need?" *entire page is enclosed in <ul> tag and just depends on list wraparound to have any vertical placement* also: "lol, what's css?"

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

work with an actual designer. if you have to ask you're in over your head

Jerry Bindle
May 16, 2003
TEX2page

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
don't try and design in CSS. do it in a real design app because you can always tell. if you can't use a real design app because you can't do design, you're not gonna be able to escape your stuff looking like a dev did it unfortunately. it's two separate modes of thinking.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Finster Dexter posted:

nah, there's some pretty useful design patterns.

design patterns are really just trying to get around the limitations of oop. no first class functions? use the Strategy Pattern™

HoboMan
Nov 4, 2010

Maluco Marinero posted:

don't try and design in CSS. do it in a real design app because you can always tell. if you can't use a real design app because you can't do design, you're not gonna be able to escape your stuff looking like a dev did it unfortunately. it's two separate modes of thinking.
i guess then my question boils down to what's a good design app?

unrelated: how's a way i can manually allow or deny POST requests going through my browser (after reviewing them)?

MononcQc
May 29, 2007

HoboMan posted:

i guess then my question boils down to what's a good design app?
Designers I know may usually start with a paper draft regarding placement of main elements and stuff like that.

Eventually they move to Photoshop or some equivalent with a possible grid guideline in there (if they're doing responsive -- and they do more and more), and just go to town on it. There's some web-made apps that allow this right now with a bit more hand-holding, but I forget the names. I'd have to ask around to know.

Then you take the design, figure out how to build the underlying HTML+CSS to make it work and reflow fine, and then you just slice it off (still in photoshop) to get individual assets, and integrate the thing with a good ol' editor.

gonadic io
Feb 16, 2011

>>=
I just use jeckyl for my personal site

HoboMan
Nov 4, 2010

MononcQc posted:

Designers I know may usually start with a paper draft regarding placement of main elements and stuff like that.

Eventually they move to Photoshop or some equivalent with a possible grid guideline in there (if they're doing responsive -- and they do more and more), and just go to town on it. There's some web-made apps that allow this right now with a bit more hand-holding, but I forget the names. I'd have to ask around to know.

Then you take the design, figure out how to build the underlying HTML+CSS to make it work and reflow fine, and then you just slice it off (still in photoshop) to get individual assets, and integrate the thing with a good ol' editor.

*black-and-white montage of designer doing this workflow with them breaking their pencil, dropping their mouse, etc.* "there's got to be a better way!"

come on guys, i know there exists stuff to fill in the gap between just throwing up raw bespoke html and hiring an experienced professional graphic designer

AWWNAW
Dec 30, 2008

you could probably get MS front page 2008 to run in a vm

Jerry Bindle
May 16, 2003

HoboMan posted:

*black-and-white montage of designer doing this workflow with them breaking their pencil, dropping their mouse, etc.* "there's got to be a better way!"

come on guys, i know there exists stuff to fill in the gap between just throwing up raw bespoke html and hiring a professional graphic designer

what kind of content are you looking to do? if its a technical document, you can get a nice website out of docbook. there is a free for commercial version of xmlmind editor that includes a nice css file that you can modify with your own colors. checkout the freebsd docs for an example of what a docbook generated site looks like.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

HoboMan posted:

*black-and-white montage of designer doing this workflow with them breaking their pencil, dropping their mouse, etc.* "there's got to be a better way!"

come on guys, i know there exists stuff to fill in the gap between just throwing up raw bespoke html and hiring a professional graphic designer

lol

no, there's no reasonable middle ground between "use actual design tools to make an actual design", and "just throw up whatever". if you're going to spend literally any effort beyond throwing up whatever, the easiest and best option is to just do it right.

you don't have to hire a professional graphic designer, you just need to follow a sensible design process (you know, the way a professional graphic designer would do it).

piratepilates
Mar 28, 2004

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



HoboMan posted:

all this react/redux/webpack talk got me thinking. where do i start if i want to make my webpages not look like an engineer made them?
"but it's functional, what more do you need?" *entire page is enclosed in <ul> tag and just depends on list wraparound to have any vertical placement* also: "lol, what's css?"

More important than the look of it is how it feels to use. Put yourself in the shoes of a user and think about it in their perspective. What requires familiarity with it to use. What is inconsistent. What is your eye immediately attracted to and is that thing important enough to deserve that. Are different items clearly visibly separated and related items visually related.

And just take bootstrap or foundation or whatever and use those for basic styling since those look good enough and will be better than most internal things that don't have a real designer behind them

Share Bear
Apr 27, 2004


man gently caress april fools day, even though this is implemented

MononcQc
May 29, 2007

HoboMan posted:

*black-and-white montage of designer doing this workflow with them breaking their pencil, dropping their mouse, etc.* "there's got to be a better way!"

come on guys, i know there exists stuff to fill in the gap between just throwing up raw bespoke html and hiring an experienced professional graphic designer

developers can use frameworks so their backends all work the same and end up having the exact same structure. That's a thing you don't want in design since that sounds like plagiarizing. You still want a uniform user experience though, which means common elements (hamburger menus, fonts practices and so on, pretty much all of UX as a field) and their work is far more similar to 'knowing best practices' and 'design patterns' than 'plug in a library' or 'use a framework'.

So there's a whole lot of process, practice, and knowledge into it.

If you really want to take a shortcut, you can go look at template websites and buy one of them. They're usually fairly cheap and will undercut a lot of web designers if you had to have a custom job.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

HappyHippo posted:

the weirdest thing about oop is how many people think it's the only possible way to organize code.

HappyHippo posted:

design patterns are really just trying to get around the limitations of oop. no first class functions? use the Strategy Pattern™

You are in the right place, friend.

Share Bear
Apr 27, 2004

MononcQc posted:

That's a thing you don't want in design since that sounds like plagiarizing.

*reuses same 2 row 1 column/3 column grid for every web site since 2012*

gonadic io
Feb 16, 2011

>>=

Finster Dexter posted:

You are in the right place, friend.

yeah its actually the visitor pattern

Shaggar
Apr 26, 2006

MononcQc posted:

developers can use frameworks so their backends all work the same and end up having the exact same structure. That's a thing you don't want in design since that sounds like plagiarizing. You still want a uniform user experience though, which means common elements (hamburger menus, fonts practices and so on, pretty much all of UX as a field) and their work is far more similar to 'knowing best practices' and 'design patterns' than 'plug in a library' or 'use a framework'.

So there's a whole lot of process, practice, and knowledge into it.

If you really want to take a shortcut, you can go look at template websites and buy one of them. They're usually fairly cheap and will undercut a lot of web designers if you had to have a custom job.

is that why people hate bootstrap? as a developer it makes designing poo poo that doesn't look terrible easy as hell and I don't really care if it looks like everything else.

MononcQc
May 29, 2007

Share Bear posted:

*reuses same 2 row 1 column/3 column grid for every web site since 2012*

There's a difference between page structure and the rest of design too. You know how you can tell all bootstrap websites are bootstrap websites? That's the thing you want to avoid usually.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

MononcQc posted:

developers can use frameworks so their backends all work the same and end up having the exact same structure. That's a thing you don't want in design since that sounds like plagiarizing. You still want a uniform user experience though, which means common elements (hamburger menus, fonts practices and so on, pretty much all of UX as a field) and their work is far more similar to 'knowing best practices' and 'design patterns' than 'plug in a library' or 'use a framework'.

So there's a whole lot of process, practice, and knowledge into it.

If you really want to take a shortcut, you can go look at template websites and buy one of them. They're usually fairly cheap and will undercut a lot of web designers if you had to have a custom job.

I think Bootstrap is p good. I suck at design but with Bootstrap I can still make forms and stuff that don't look like caveman drawings. It can get you really far without getting too bogged down in "process".

e:^^ lol why? if it's an admin interface or internal site, who cares. But maybe HoboMan is asking about customer-facing stuff. I didn't think so, though.

ee: gently caress why did I write backbone... got bad jarvascript frameworks on the brain

Finster Dexter fucked around with this message at 16:41 on Apr 1, 2016

Shaggar
Apr 26, 2006
I'd much rather have a thing that looks like all the other things and is easy to navigate than a thing that looks unique but sucks to use. all of those 3 column sites suck because of that garbage infinite scrolling poo poo. that specific design is garbage because its garbage, and not because everyone uses it.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

gonadic io posted:

yeah its actually the visitor pattern

aren't they both trivial with first class functions?

Shaggar
Apr 26, 2006
the other thing about bootstrap is you can start with something that works in terms of responsive design and then gently caress w/ the styling for ~MY BRAND~ after.

HoboMan
Nov 4, 2010

i don't give a poo poo about ~providing a memorable and professional user experience~ i just want something that looks like it was made this century.
we don't have a designer and poo poo looking like a my first html tutorial on the page makes dumb managers think i'm terrible at my job. (i am, but for different reasons)
also i like my poo poo to not look like poo poo.

AWWNAW
Dec 30, 2008

use bootstrap

MononcQc
May 29, 2007

To designers, this discussion is the equivalent of people going "I don't know what's the big deal, I just install wordpress/joomla (and then never upgrade it) and there's no problem" when the opposite takes place.

It's kind of great because everyone dismisses the other side's expertise for the sake of "I don't care, I got the thing I wanted" while the other side looks in terror.

FamDav
Mar 29, 2008
visitor pattern is obsoleted by pattern matching. strategy is first class functions (though less boilerplate reduction compared to visitor IMO)

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
i type the code and then the thing happen and then i am given money. its a very nice pattern.

HoboMan
Nov 4, 2010

MononcQc posted:

To designers, this discussion is the equivalent of people going "I don't know what's the big deal, I just install wordpress/joomla (and then never upgrade it) and there's no problem" when the opposite takes place.

It's kind of great because everyone dismisses the other side's expertise for the sake of "I don't care, I got the thing I wanted" while the other side looks in terror.

i'm sorry you got an arts degree

HoboMan
Nov 4, 2010

LeftistMuslimObama posted:

i type the code and then the thing happen and then i am given money. its a very nice pattern.

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo

HoboMan posted:

i'm sorry you got an arts degree

lmao

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

FamDav posted:

visitor pattern is obsoleted by pattern matching. strategy is first class functions (though less boilerplate reduction compared to visitor IMO)

i look up these design patterns on wikipedia and they make my head go :psyduck:

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

im too stupid to use java i think

  • Locked thread