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
redleader
Aug 18, 2005

Engage according to operational parameters

fleshweasel posted:

basically if your org is ie9 or earlier you're looking at bootstrap.

it's disgusting that ie9 is still a thing

Adbot
ADBOT LOVES YOU

Share Bear
Apr 27, 2004

is there something that's really good at doing async http requests in java because apache-commons is annoying horseshit

i just gotta blast off like a million rest updates, in java

this is to replace a script written with asyncio in python

comedyblissoption
Mar 15, 2006

Maluco Marinero posted:

it's concerning how much stock developers put into not understanding css. or at least, they want a framework to 'take the pain of css away', missing that most frameworks aren't nice clean abstractions of CSS and thus don't really obviate the need to actually understand CSS unless you follow their examples.

I guess what I'm saying is, it'd be real swell if people acknowledged that maybe having someone on staff who actually knew how CSS worked, how it's used to achieve standard design patterns, and could dictate best practices. maybe then CSS wouldn't be this inscrutable language of mystery it seems to be for most people.

I'm not saying CSS is a good language, far from it, but like if you had a MUMPS codebase, you don't suddenly turn around and get a developer who knows nothing about the lang to make fundamental implementation decisions.
the problem with css is it wasn't designed properly for common UI lay out concerns for graphical applications and you had to learn a bunch of hacks and "css tricks" for what should otherwise be straightforward concerns. of course people are going to get frustrated having only absurd hacks as their primitives for composing what they want.

a lot of the "css frameworks" like bootstrap are a blessing because they help get you some basic layouts without having to learn absurd hacks.

even flexbox alone isn't good enough for general purpose layout

afaik region based layouts are still experimental poo poo

comedyblissoption
Mar 15, 2006

what im saying is people would probably in general be more open to properly learning css if it wasn't historically such a steaming pile of poo poo. idk if it's actually gotten any better (i have low hopes)

brap
Aug 23, 2004

Grimey Drawer
i think there are 3 steps you can take that make css pretty powerful for designing user interfaces:

1. read this, take with a grain of salt: http://maintainablecss.com/chapters/introduction/
2. use less or sass or whatever the gently caress you want preprocessor that gives you variables and so on
3. keep the flexbox cheat sheet handy when you're learning: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

honestly, I am finding react/typescript/flexbox based web apps to be a lot more productive to create than native apps at this point.

comedyblissoption posted:

the problem with css is it wasn't designed properly for common UI lay out concerns for graphical applications and you had to learn a bunch of hacks and "css tricks" for what should otherwise be straightforward concerns. of course people are going to get frustrated having only absurd hacks as their primitives for composing what they want.

a lot of the "css frameworks" like bootstrap are a blessing because they help get you some basic layouts without having to learn absurd hacks.

even flexbox alone isn't good enough for general purpose layout

afaik region based layouts are still experimental poo poo

can you tell me about some case where flexbox wasn't adequate to create the user interface you were trying to create? and what do you mean by region-based layouts

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

Share Bear posted:

is there something that's really good at doing async http requests in java because apache-commons is annoying horseshit

i just gotta blast off like a million rest updates, in java

this is to replace a script written with asyncio in python

OkHttp by Square?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

good news: someone fixed GCC 6 so you can cross-compile to 68k amigas again hooray

bad news: I can't get the C standard library to work yet

lambdas!

Sapozhnik
Jan 2, 2005

Nap Ghost

Share Bear posted:

is there something that's really good at doing async http requests in java because apache-commons is annoying horseshit

i just gotta blast off like a million rest updates, in java

this is to replace a script written with asyncio in python

asynchttpclient

which in turn is a wrapper around netty

you might be able to use netty directly but it's low-level as gently caress; you operate at the level of objects that model individual http request and response messages that are in flight. which gets complicated if, say, you need to be able to transparently handle redirects and re-issue your requests to whatever you get redirected to. so, if transparent handling of redirects is a thing you need to worry about then use ahc, otherwise try going with netty.

why are you replacing a perfectly good script written in python though? i don't like python very much but java's support for async io is loving garbage. check my post history for my rants about java's stdlib future class being abominably lovely

Sapozhnik
Jan 2, 2005

Nap Ghost
edit: it's so bad that Netty defines its own Future interface which files off some of the worst of the following list of shittyness. and of course ahc also defines its own similar-but-not-quite-identical Future interface, because netty is an implementation detail of ahc.

Sapozhnik posted:

Throws the checked InterruptedException like most other multithreading things in Java. It's consistent at least, but it's still a pain.

Signals any and all failures using ExecutionException. This alone turns any error handling involving standard Futures into a godawful mess because you have to disentangle the cause of the exception manually instead of using multiple catch blocks. And you have to catch ExecutionException whether or not what you're doing can actually fail. There are limits to what you can do with Java here but defining Future as interface Future<T, X extends Throwable> { T get() throws X; } would have done a lot to mitigate this problem (you can e.g. set X to RuntimeException if you don't want the client to have to deal with any checked exceptions at all).

Not natively chainable until Java 8. This imposes some nontrivial constraints on the implementation (making futures chainable means that a client is able to seize a potentially unbounded amount of execution time from your thread, so you either need to host a thread pool for this purpose or be very clear about your expectations around non-blocking IO or whatever) but a non-chainable future is almost useless. The whole point of futures is to put some structural lipstick on callback functions, after all.

The way they added chaining is pants-on-head retarded. Instead of defining a ListenableFuture<> derived interface like literally every single async IO framework for Java did (see Netty et al) they created a concrete CompletableFuture class. This thing has a bajillion methods for some reason and in addition to allowing clients to chain off of a CompletableFuture completion it also allows those same clients to fulfill the promise :psyduck:

I'm sure you could design a worse standard Future type if you put your mind to it but loving it up to an even greater extent would be legitimately challenging. As it stands it would be almost impossible to retrofit into a c# style async/await mechanism further down the road, if for no other reason than the compiler cannot guarantee anything about an async operation's exception specification.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


HoboMan posted:

still better than that same person crashing the filesystem (and server) by spamming a 2 mb xml every second into a random folder somewhere

we once had a hilarious issue where a service crashed trying to send a 17mb xml message then sent the log out via email including the message to like 50 people. it also got stuck in a loop doing this every 10 seconds so it crashed all the messaging servers.

edit: if you clicked the mail in outlook with preview on it would just crash as well lol

Powerful Two-Hander fucked around with this message at 01:47 on Mar 25, 2017

AggressivelyStupid
Jan 9, 2012

Call the python script from Java, imo

ulmont
Sep 15, 2010

IF I EVER MISS VOTING IN AN ELECTION (EVEN AMERICAN IDOL) ,OR HAVE UNPAID PARKING TICKETS, PLEASE TAKE AWAY MY FRANCHISE

Luigi Thirty posted:

bad news: I can't get the C standard library to work yet

You might want to try newlib - it's a smaller standard library designed for embedded systems that builds for a number of systems including 68k ones.

It's also the C library cygwin uses.
https://sourceware.org/newlib/

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
I have some sort if spatial impairment and I have to close my eyes and think really hard to remember which element is vertical and which is horizontal in a coordinate pair (and then I have to figure out what horizontal even means, man). So, luigis adventures in 3d programming make me sick to my stomach.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

ulmont posted:

You might want to try newlib - it's a smaller standard library designed for embedded systems that builds for a number of systems including 68k ones.

It's also the C library cygwin uses.
https://sourceware.org/newlib/

yeah the toolchain includes newlib, clib2 (the old amiga C standard library), and libnix, i just can't get my junk set up right for it

Sapozhnik
Jan 2, 2005

Nap Ghost

MALE SHOEGAZE posted:

I have some sort if spatial impairment and I have to close my eyes and think really hard to remember which element is vertical and which is horizontal in a coordinate pair (and then I have to figure out what horizontal even means, man). So, luigis adventures in 3d programming make me sick to my stomach.

the horizon is horizontal dood

redleader
Aug 18, 2005

Engage according to operational parameters

Sapozhnik posted:

the horizon is horizontal dood

:wth:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

don't worry my adventures in 3d programming make me sick too. how did they figure this poo poo out way back when without yospos, snack overflow, and doing it in 486s/NeXT cubes?

Sapozhnik posted:

the horizon is horizontal dood

+X is right
+Y is up
+Z is into the screen

KSP is fun since there's no up in space

prograde is in the direction of your velocity vector, retrograde is opposite your velocity vector. you use this axis to increase and decrease your orbital altitude
normal is perpendicular to your velocity vector facing high inclination relative to the body you're orbiting, antinormal is facing low inclination. you use this axis to change your orbital inclination
radial/antiradial faces toward/away the orbit's focal point parallel to the orbital plane but people don't use it for maneuvering because it's inefficient compared to the other axes

anyway, i got the cross-compiler working :toot:

Luigi Thirty fucked around with this message at 05:22 on Mar 25, 2017

VikingofRock
Aug 24, 2008




Luigi Thirty posted:

+X is right
+Y is up
+Z is into the screen

Ewww, left-handed coordinates. Is that standard in graphics programming?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

VikingofRock posted:

Ewww, left-handed coordinates. Is that standard in graphics programming?

DirectX and Glide are left-handed, OpenGL is right-handed.

i didn't really know what i was doing when i wrote the rasterization code so i made it left-handed

floatman
Mar 17, 2009
Help guys Android wifi direct a poo poo.
Do I need to join the wifi direct group first before I can connect to a service?
I'm asking this because if seems that you can discover services before you connect to a group so what's group connection for anyway?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Terrible programmer status: better than whoever did this

https://twitter.com/robotlolita/status/845361020038266880

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

Luigi Thirty posted:

Terrible programmer status: better than whoever did this

https://twitter.com/robotlolita/status/845361020038266880
it was noticed in this bug report almost a year prior lol https://bugzilla.redhat.com/show_bug.cgi?id=1102343#c0

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

that taskbar? dock? texture, tho :kiss:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
since i'm at a startup where I have a chance to influence the direction of the codebase, I've been working really hard on commenting my code and writing better unit tests. be the change you want to see in the world.

it's hard but it's getting easier. my comments are getting a lot better. i've never really appreciated how much a few simple comments in a pipeline operation can break up the chunks into something much more digestible.

writing good tests is and always will be harder than writing good code but i'm starting to see them as one and the same.

also my excel exporter works really well. some of the better code i've written. we might open source it.

DONT THREAD ON ME fucked around with this message at 17:34 on Mar 25, 2017

PokeJoe
Aug 24, 2004

hail cgatan


assertThat(myAss).contains(dicks);

PokeJoe
Aug 24, 2004

hail cgatan


my current project has me writing at least some unit tests with each feature i make. last project here the whole thing contained a single unit test (the example one when you make a new project)

it's an improvement i guess, but i think the tests have only caught a single bug to date

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Wheany posted:

that taskbar? dock? texture, tho :kiss:

every 90s operating system needs a clone of the nextstep dock

the texture is bad because it's a 256-color image and the desktop is set to 16 colors because OCS

TheresNoThyme
Nov 23, 2012

Share Bear posted:

is there something that's really good at doing async http requests in java because apache-commons is annoying horseshit

i just gotta blast off like a million rest updates, in java

this is to replace a script written with asyncio in python

Is there a reason you're writing your own asynch threading for what sounds like a generic batching job?

I've written millions of updates (including REST calls for some POC Elasticsearch indexing) using spring integration with zero issues. IIRC they have support for asynch gateways.

double edit: oh wow disregard this post, took a second read to realize you only care about the asynch http implementation

TheresNoThyme fucked around with this message at 18:29 on Mar 25, 2017

Sweevo
Nov 8, 2007

i sometimes throw cables away

i mean straight into the bin without spending 10+ years in the box of might-come-in-handy-someday first

im a fucking monster

Luigi Thirty posted:

every 90s operating system needs a clone of the nextstep dock

the texture is bad because it's a 256-color image and the desktop is set to 16 colors because OCS

ditch the crappy dock and use ToolsDaemon to put all your most-used software in a menu.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Sweevo posted:

ditch the crappy dock and use ToolsDaemon to put all your most-used software in a menu.

i have the dock and ToolsDaemon :smug:

the guy fixing up GCC 6.3 also got g++ working for amigas too. at last, modern language features

code:
auto rp = window->RPort;

comedyblissoption
Mar 15, 2006

if youre writing tests make sure the only things you ever mock are interfaces external to your program (e.g. file system, network calls). mocking too much and having a bunch of useless tests is a very common trap

someone told me that you shouldn't even mock at all and design your program so it's easy to test everything w/o even calling out to external systems. i dont have experience w/ this at all but maybe he's right.

redleader
Aug 18, 2005

Engage according to operational parameters

PokeJoe posted:

assertThat(myAss).contains(dicks);

why are you asserting against a constant value

brap
Aug 23, 2004

Grimey Drawer

comedyblissoption posted:

if youre writing tests make sure the only things you ever mock are interfaces external to your program (e.g. file system, network calls). mocking too much and having a bunch of useless tests is a very common trap

someone told me that you shouldn't even mock at all and design your program so it's easy to test everything w/o even calling out to external systems. i dont have experience w/ this at all but maybe he's right.

this sometimes works. all you do is write a deterministic function that does your business logic, then write a wrapper function that does I/O or network poo poo and then runs your business logic on the stuff that come from disk or network. it falls short when you conditionally need to do a fetch based on the results of another fetch, etc. because you either have to just fetch everything upfront or do some kind of sequencing in your function that directly touches I/O that pretty much turns it into a business logic function.

comedyblissoption
Mar 15, 2006

fleshweasel posted:

this sometimes works. all you do is write a deterministic function that does your business logic, then write a wrapper function that does I/O or network poo poo and then runs your business logic on the stuff that come from disk or network. it falls short when you conditionally need to do a fetch based on the results of another fetch, etc. because you either have to just fetch everything upfront or do some kind of sequencing in your function that directly touches I/O that pretty much turns it into a business logic function.
im wondering if there's a generalized solution to this problem of falling short w/o mocking or polymorphism where you have a test version. maybe this is just inherent and essential complexity.

rust doesnt really have a mocking library afaik and i was wondering how people do tests in rust. i guess the best you can do is passing in a test version that mocks a trait and try to limit this to the outermost shell of your program.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

AmigaOS 3.1 posted:

Flood fill is a technique for filling an arbitrary shape with a color.
The Amiga flood-fill routines can use a plain color or do the fill using a
combination of the drawing mode, FgPen, BgPen and the area pattern.

Flood-fill requires a TmpRas structure at least as large as the RastPort
in which the flood-fill will be done. This is to ensure that even if the
flood-filling operation "leaks", it will not flow outside the TmpRas and
corrupt another task's memory.

sorry, flood fill overwrote the operating system

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

fleshweasel posted:

it falls short when you conditionally need to do a fetch based on the results of another fetch, etc. because you either have to just fetch everything upfront or do some kind of sequencing in your function that directly touches I/O that pretty much turns it into a business logic function.

my brother have you heard the good news of our lord and savior Moh-n'ad

Luigi Thirty
Apr 30, 2006

Emergency confection port.

aaag makefiles

i have main.cpp, reversi.cpp, and board.cpp. main.cpp includes reversi.h. reversi.h includes board.h.

when I make with this makefile, I get a linker error saying /home/Luigi/dev/reversi/src/main.cpp:40: undefined reference to `ReversiBoard::initForNewGame()' which is defined in board.h. what's wrong here? (yes, CC and CXXFLAGS is correct here)

code:
CC = m68k-amigaos-gcc -g
CXX = m68k-amigaos-g++ -g
CFLAGS = -noixemul -m68000 -Os -Wall -fomit-frame-pointer -Wno-pointer-sign -Wno-int-conversion -fpermissive
CXXFLAGS = -noixemul -m68000 -Os -Wall -fomit-frame-pointer -fpermissive

INCDIR = ../include
OBJDIR = obj
BINDIR = ../bin

BINS = reversi

_OBJS = main.o reversi.o
OBJS = $(patsubst %,$(OBJDIR)/%,$(_OBJS))
	
$(BINDIR)/reversi: $(OBJS)
	$(CC) $(CXXFLAGS) -o $@ $^
	
$(OBJDIR)/main.o: main.cpp reversi.cpp board.cpp
	$(CC) -c $(CXXFLAGS) -I$(INCDIR) -o $@ $<
	
$(OBJDIR)/reversi.o: reversi.cpp board.cpp
	$(CC) -c $(CXXFLAGS) -I$(INCDIR) -o $@ $<

clean:
	rm -f $(BINDIR)/$(BINS)
	rm -f $(OBJDIR)/*.o *~
here's a bonus screenshot of my now OS-friendly reversi program

Ator
Oct 1, 2005

from Living Clojure, chapter 5

Here’s an illustration of each naming convention:

this_is_snake_case

this-is-kebab-case

ThisIsCamelCase

edit: oops, meant to post this in the lang thread. oh well

PokeJoe
Aug 24, 2004

hail cgatan


redleader posted:

why are you asserting against a constant value

do you know what thread you're in

Adbot
ADBOT LOVES YOU

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Ator posted:

from Living Clojure, chapter 5

Here’s an illustration of each naming convention:

this_is_snake_case

this-is-kebab-case

ThisIsCamelCase

edit: oops, meant to post this in the lang thread. oh well

c'mon snake case is obviously like this:

thissssssIssssssSsssnakeCasssseee~

  • Locked thread