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
DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Shaggar posted:

I just don't like doing accessors that way, but w/e. I've never used android Linux java but I would guess theres some option to make it auto scale to you're items on screen, but who knows

no the os is open it doesnt support constraint based layouts

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
LOL if Andoird doesn't let you just do the Java equivalent of gridView.center = screen.center;

Doc Block
Apr 15, 2003
Fun Shoe

chumpchous posted:

no the os is open it doesnt support constraint based layouts

LOL

a cyberpunk goose
May 21, 2007

Doc Block posted:

LOL if Andoird doesn't let you just do the Java equivalent of gridView.center = screen.center;

the issue is that the gridview widget has some hardcoded behavior where it fills it's parent. Usually the issue with centering widgets is a child widget not being in "just wrap whatever your content needs" mode and it accidentally fills parent and you go "omfg why is my poo poo left aligned gently caress i told it to be center!" because it's the full possible width.

but even with a static column size there's no way to make it not just... fill horizontally, it will always fill horizontally as i spent a day testing the behavior. unless you set the entire width by hand (which is ugly to do since you shouldnt be working in pixel metrics but in a real life em-style measurement thing)

i mean i could get the viewable rect for the parent of the gridview and then divide it based on the # of columns im working with and do some dpi math to get things consistent across platforms but no matter what solution wins, i lose :(

basically gently caress everything

Doc Block
Apr 15, 2003
Fun Shoe
LOL LMFAO that Android won't let you just say "make a view this big and put it in the center, and no, it can't get any bigger" like you can on iOS.

Nomnom Cookie
Aug 30, 2009



Mido posted:

the issue is that the gridview widget has some hardcoded behavior where it fills it's parent. Usually the issue with centering widgets is a child widget not being in "just wrap whatever your content needs" mode and it accidentally fills parent and you go "omfg why is my poo poo left aligned gently caress i told it to be center!" because it's the full possible width.

but even with a static column size there's no way to make it not just... fill horizontally, it will always fill horizontally as i spent a day testing the behavior. unless you set the entire width by hand (which is ugly to do since you shouldnt be working in pixel metrics but in a real life em-style measurement thing)

i mean i could get the viewable rect for the parent of the gridview and then divide it based on the # of columns im working with and do some dpi math to get things consistent across platforms but no matter what solution wins, i lose :(

basically gently caress everything

this is literally worse than css. good job google

a cyberpunk goose
May 21, 2007

Doc Block posted:

LOL LMFAO that Android won't let you just say "make a view this big and put it in the center, and no, it can't get any bigger" like you can on iOS.

i had to make this application for desktop, ios and android, desktop i was only allowed to use gtk and that was a loving mess

the only fun ive had on this project is the ios version because ios ui stuff was conceptualized by people who want you to actually use their loving widgets

except the apple version of this product will never see the light of day because you cant use the external accessorie framework to talk to arbitrary bluetooth devices unless you have mfi certifications or use bluetooth low-energy tech. but our product isnt gonna use btle because we need that distance but we are literally just trying to make a quick demo our customers can use to get rolling so getting mfi certification just for a quick babby demo seems like a waste of time

also my manager is convinced im wrong about this mfi stuff and there "must be a way" to talk to bluetooth on ios "even if we have to code our own way!!" lol

he looked at the mfi cert page for 1 second and literally skimmed the first paragraph and went "this is talking abut audio mfi stuff is just for audio you should recheck your notes"

the intern sharing my cube read the page after that and understood it more than my manager

Pumprag
Jan 29, 2013

Maybe you should quit your job.

a cyberpunk goose
May 21, 2007

Skeleton Apologist posted:

Maybe you should quit your job.

this ball is already rolling following a convo i had with the vice president and we'll see what a clusterfuck this poo poo will evolve into on monday

anyone hiring in portland? and/or northern cali.

hmu :wink:

MeruFM
Jul 27, 2010

Mido posted:

i had to make this application for desktop, ios and android, desktop i was only allowed to use gtk and that was a loving mess

the only fun ive had on this project is the ios version because ios ui stuff was conceptualized by people who want you to actually use their loving widgets

except the apple version of this product will never see the light of day because you cant use the external accessorie framework to talk to arbitrary bluetooth devices unless you have mfi certifications or use bluetooth low-energy tech. but our product isnt gonna use btle because we need that distance but we are literally just trying to make a quick demo our customers can use to get rolling so getting mfi certification just for a quick babby demo seems like a waste of time

also my manager is convinced im wrong about this mfi stuff and there "must be a way" to talk to bluetooth on ios "even if we have to code our own way!!" lol

he looked at the mfi cert page for 1 second and literally skimmed the first paragraph and went "this is talking abut audio mfi stuff is just for audio you should recheck your notes"

the intern sharing my cube read the page after that and understood it more than my manager

As long as your company is legitimate, an mfi dev license is pretty easy to get. It's only when you want to build mass quantities do you have to talk to a manufacturer who already has a license.

Or become a manufacturer, but that has really stringent rules.

a cyberpunk goose
May 21, 2007

MeruFM posted:

As long as your company is legitimate, an mfi dev license is pretty easy to get. It's only when you want to build mass quantities do you have to talk to a manufacturer who already has a license.

Or become a manufacturer, but that has really stringent rules.

we're building our own poo poo so we'd need the mfg license i believe

Miley Virus
Apr 9, 2010

guys i really want to use a goto

uG
Apr 23, 2003

by Ralp

Orbi posted:

guys i really want to use a goto

goto LABEL is fine just dont use goto LINE_NUMBER

uG
Apr 23, 2003

by Ralp
:getin:

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

uG posted:

goto LABEL is fine just dont use goto LINE_NUMBER

use COMEFROM

a cyberpunk goose
May 21, 2007

Orbi posted:

guys i really want to use a goto

have you considered exceptions as program flow

:getin:

Bloody
Mar 3, 2013

then your program design will truely be exceptional!!!

a cyberpunk goose
May 21, 2007

Bloody posted:

then your program design will truely be exceptional!!!

use singletons everywhere


everywhere

a cyberpunk goose
May 21, 2007

UserManager::GetUserManager()->findUser("Mido")->setLaughs(UserManager::GetUserManager()->findUser("Mido").getLaughs()+1);

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Mido posted:

UserManager::GetUserManager()->findUser("Mido")->setLaughs(UserManager::GetUserManager()->findUser("Mido").getLaughs()+1);

NULLERROR

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
I think I use way too much breaks and continues in my code.

Bloody
Mar 3, 2013

Mido posted:

UserManager::GetUserManager()->findUser("Mido")->setLaughs(UserManager::GetUserManager()->findUser("Mido").getLaughs()+1);

i have written code that is this but with different names

it gets really bad when you're manipulating the same user (or w/e) multiple times in a short number of lines and every time you add a new line of it youre like 'yeah if i add one more line of this imma just make a local variable' but you never do because youre a terrible programmer

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

Symbolic Butt posted:

I think I use way too much breaks and continues in my code.

this seems improbable

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
idk it may be a symptom of my inability to decompose poo poo in small and smart looking functions





but using gotos not even once

a cyberpunk goose
May 21, 2007

Bloody posted:

i have written code that is this but with different names

it gets really bad when you're manipulating the same user (or w/e) multiple times in a short number of lines and every time you add a new line of it youre like 'yeah if i add one more line of this imma just make a local variable' but you never do because youre a terrible programmer

the code i wrote wasnt a joke














it was a cry for help

:smith:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i really hate that arrow syntaxs for structs/dicts whatever you want to call them

it makes me feel like i'm doing some crazy haskeel mondashit whenever i see it

Bloody
Mar 3, 2013

Mido posted:

the code i wrote wasnt a joke














it was a cry for help

:smith:

you are in the right place :unsmith: welcome brother

tef
May 30, 2004

-> some l-system crap ->

Mido posted:

UserManager::GetUserManager()->findUser("Mido")->setLaughs(UserManager::GetUserManager()->findUser("Mido").getLaughs()+1);

[✓] Global Variable, or as we call them now, Singleton Pattern
[✓] Getters and Setters instead of methods that do things
[✓] Possible Race Condition

:shrek:

Miley Virus
Apr 9, 2010

its okay i didn't use a goto, crisis averted

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

tef posted:

[✓] Global Variable, or as we call them now, Singleton Pattern
[✓] Getters and Setters instead of methods that do things
[✓] Possible Race Condition

:shrek:

what's the race condition?

Sang-
Nov 2, 2007

prefect posted:

what's the race condition?

between the call to getLaughs and setLaughs, some other thread changes the value of Laughs.

Shaggar
Apr 26, 2006
singletons have valid uses and db proxy objects is one of them (assuming that's what usermanager is)
the getter setter stuff on a db proxy is still dumb tho and my guess is hes not wrapping that in a transaction so the race condition is still a problem.

Shaggar
Apr 26, 2006
altho that's some serious p-langer syntax so whatever it is probably cant even do transactions.

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

singletons have valid uses and db proxy objects is one of them (assuming that's what usermanager is)
the getter setter stuff on a db proxy is still dumb tho and my guess is hes not wrapping that in a transaction so the race condition is still a problem.

I have no objection to passing in a singleton, but it seems a bit bad to use a global to find it, it can make code harder to test and in effect tightly coupling parts together.

Bloody
Mar 3, 2013

don't forget the findUser by static string in two different places

Shaggar
Apr 26, 2006

tef posted:

I have no objection to passing in a singleton, but it seems a bit bad to use a global to find it, it can make code harder to test and in effect tightly coupling parts together.

in my case the singletons im pulling out of a global store (spring proxies) implement a specific interface. I pull them out of spring and shove them into whatever is using them. Then my tests can be built against the interface and I can inject proxies the same way to test implementations.

tef
May 30, 2004

-> some l-system crap ->

Shaggar posted:

in my case the singletons im pulling out of a global store (spring proxies) implement a specific interface. I pull them out of spring and shove them into whatever is using them. Then my tests can be built against the interface and I can inject proxies the same way to test implementations.

you'll note in the example above it pulls it out of a global and doesn't use a dependency hth

Shaggar
Apr 26, 2006
oh, you mean tests on the proxy consumer. right. my bad.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

:stare:

has this ever happened before?

Adbot
ADBOT LOVES YOU

JewKiller 3000
Nov 28, 2006

by Lowtax

prefect posted:

:stare:

has this ever happened before?

he does it once in a while to make the other posts more believable

  • Locked thread