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
Khorne
May 1, 2002
And here I am thinking that C++11 and beyond bloated the language a bit.

Adbot
ADBOT LOVES YOU

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Khorne posted:

And here I am thinking that C++11 and beyond bloated the language a bit.

I''m not sure if the author of the paper is aware of this, but there is a very easy to use library that just loving does all this webview stuff for you - the CEF (https://bitbucket.org/chromiumembedded/cef). Example applications that use CEF include Adobe Acrobat, Steam, Battle.NET, Unreal Engine, Unity, Discord.... It works on Mac/PC/Linux, and in addition to working with C/C++, also has bindings for Python, Java, .NET, Ruby, Go, Swift, Delphi....

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

ryde posted:

Just curious, are there reasons beyond console SDKs and time investment, or is there some fundamental problems with Rust that make it a subpar option for games?

The fundamental problem with Rust is that it is not the language their game engine is already written in.

Ola
Jul 19, 2004

ryde posted:

Just curious, are there reasons beyond console SDKs and time investment, or is there some fundamental problems with Rust that make it a subpar option for games?

It's not the wrong answer to "which language should I port my poo poo to, since I totally have the time and opportunity", it's just an annoying answer to every other question.

Carbon dioxide
Oct 9, 2012

A Practical Lesson On E-Mail Address Validation

https://twitter.com/errbufferoverfl/status/1019766775561445376 thread

MrMoo
Sep 14, 2000

Gmail could have used this instead of + addresses then?

https://twitter.com/errbufferoverfl/status/1019776223713538048

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I'm technically correct and super smug about it, also i wish anyone would actually accept my email address for anything at all

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
I spend all my free time writing angry emails to people whose software doesn't accept my email addresses with extra "@" signs in them enclosed in double quotes. Unfortunately none of those emails are ever received because i send them all from an email address that is composed entirely of punctuation characters, vertical tabs, and probably that one that makes the computer beep as well. "It's in the RFCs" I howl to an uncaring, poorly implemented void

Ola
Jul 19, 2004

MrMoo posted:

Gmail could have used this instead of + addresses then?

https://twitter.com/errbufferoverfl/status/1019776223713538048

Tested sending to myemail@gmail.com(test). It came through, but the to-field didn't include the (test) bit so you couldn't use it for figuring out which service sold your email.

Jeb Bush 2012
Apr 4, 2007

A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.
calling up my senator to demand that RFCs be made legally binding

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
I'm gonna build a webserver into a teapot, stick an antenna and a battery on it, and launch it into orbit somewhere between Earth and Mars. If you can find it, you can request a page from it, but it'll only ever respond with a 418 error code.

The Fool
Oct 16, 2003


I'd throw :10bux: at that gofundme

rarbatrol
Apr 17, 2011

Hurt//maim//kill.

TooMuchAbstraction posted:

I'm gonna build a webserver into a teapot, stick an antenna and a battery on it, and launch it into orbit somewhere between Earth and Mars. If you can find it, you can request a page from it, but it'll only ever respond with a 418 error code.

If you can figure out the solar power situation, you could probably re-house a CubeSat pretty easily.

xtal
Jan 9, 2011

by Fluffdaddy

TooMuchAbstraction posted:

I'm gonna build a webserver into a teapot, stick an antenna and a battery on it, and launch it into orbit somewhere between Earth and Mars. If you can find it, you can request a page from it, but it'll only ever respond with a 418 error code.

HTTP 418 I'm Russell's teapot*

Xerophyte
Mar 17, 2008

This space intentionally left blank

Jeb Bush 2012 posted:

calling up my senator to demand that RFCs be made legally binding

Doomed to be blocked by the International Federation of American Homing Pigeon Fanciers over RFC 1149 I'm afraid.

Mega Comrade
Apr 22, 2004

Listen buddy, we all got problems!

itskage posted:

I started making my employees use the code spell checker extension in vs code and it's great...

I recently got the devs in my department to do the same and yeah it's pretty great, it's surprisingly clever at knowing what to check and what to leave, it's a clear a lot of thought went into it.

Munkeymon
Aug 14, 2003

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



Hey GWH, I found a property name just now that should make you feel better by comparison: IsHavingUpdateRights

ChickenWing
Jul 22, 2010

:v:

TooMuchAbstraction posted:

I'm gonna build a webserver into a teapot, stick an antenna and a battery on it, and launch it into orbit somewhere between Earth and Mars. If you can find it, you can request a page from it, but it'll only ever respond with a 418 error code.

my crowning achievement in my career thus far is implementing an endpoint that will return HTTP 418 in an Actual Real App and getting it through code review

ChickenWing
Jul 22, 2010

:v:

it's access restricted I'm not a complete idiot but also yes I am the security horror

Athas
Aug 6, 2007

fuck that joker
code:
/*****************************
 * CUDA Likelihood Kernel Function to replace FindIndex
 * param1: arrayX
 * param2: arrayY
 * param2.5: CDF
 * param3: ind
 * param4: objxy
 * param5: likelihood
 * param6: I
 * param6.5: u
 * param6.75: weights
 * param7: Nparticles
 * param8: countOnes
 * param9: max_size
 * param10: k
 * param11: IszY
 * param12: Nfr
 *****************************/
__global__ void likelihood_kernel(double * arrayX, double * arrayY, double * xj, double * yj, double * CDF, int * ind,
int * objxy, double * likelihood, unsigned char * I, double * u, double * weights, int Nparticles, int countOnes,
int max_size, int k, int IszY, int Nfr, int *seed, double* partial_sums) {

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
thats basically what i expect from researchers writing cuda code

Athas
Aug 6, 2007

fuck that joker

Suspicious Dish posted:

thats basically what i expect from researchers writing cuda code

There is nothing in CUDA that prevents you from re-numbering your parameters when you add more.

QuarkJets
Sep 8, 2008

Athas posted:

code:
/*****************************
 * CUDA Likelihood Kernel Function to replace FindIndex
 * param1: arrayX
 * param2: arrayY
 * param2.5: CDF
 * param3: ind
 * param4: objxy
 * param5: likelihood
 * param6: I
 * param6.5: u
 * param6.75: weights
 * param7: Nparticles
 * param8: countOnes
 * param9: max_size
 * param10: k
 * param11: IszY
 * param12: Nfr
 *****************************/
__global__ void likelihood_kernel(double * arrayX, double * arrayY, double * xj, double * yj, double * CDF, int * ind,
int * objxy, double * likelihood, unsigned char * I, double * u, double * weights, int Nparticles, int countOnes,
int max_size, int k, int IszY, int Nfr, int *seed, double* partial_sums) {

I'm param6.75

Dr. Stab
Sep 12, 2010
👨🏻‍⚕️🩺🔪🙀😱🙀

If you want to insert a new parameter, you don't want to have to bump the indeces of all the other ones.

Also, If you name things properly, you don't need comments. So, if you do make a comment, just repeat the names of the variables.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Athas posted:

There is nothing in CUDA that prevents you from re-numbering your parameters when you add more.
whoosh (the problem, therefore, would be the researchers)

QuarkJets
Sep 8, 2008

Dr. Stab posted:

If you want to insert a new parameter, you don't want to have to bump the indeces of all the other ones.

Also, If you name things properly, you don't need comments. So, if you do make a comment, just repeat the names of the variables.

Proper names like "I" and "u" and "k"

Athas
Aug 6, 2007

fuck that joker

Gazpacho posted:

whoosh (the problem, therefore, would be the researchers)

Well, the researcher problem is to document a parameter called "u" with the description "u". The weird parameter indexing is just... I don't know.

This is from Rodinia, a benchmark suite that is unfortunately very popular. These superficial issues are the smallest problem. The bigger problem is that this benchmark suite is not even consistent in how it does profiling or validation (but that's harder to fit in a code block).

There are also Actual CUDA Problems with this code; in particular a charming naivety about how you should access memory on a GPU. But that is now what we are here for. This is what we are here for. Here's a teaser:

code:
	// variable references
	int offset_1;
	int offset_2;
	int offset_3;
	int offset_4;
	int offset_5;
	int offset_6;
	int offset_7;
	int offset_8;
	int offset_9;
	int offset_10;
	int offset_11;
	int offset_12;
	int offset_13;
	int offset_14;
	int offset_15;
And then later:

code:
	offset_1 = valu_offset;
	offset_2 = valu_offset+1;
	offset_3 = valu_offset+2;
	offset_4 = valu_offset+3;
	offset_5 = valu_offset+4;
	offset_6 = valu_offset+5;
	offset_7 = valu_offset+6;
	offset_8 = valu_offset+7;
	offset_9 = valu_offset+8;
	offset_10 = valu_offset+9;
	offset_11 = valu_offset+10;
	offset_12 = valu_offset+11;
	offset_13 = valu_offset+12;
	offset_14 = valu_offset+13;
	offset_15 = valu_offset+14;
How are these handy constants used, you ask?

code:
	// decoding input array
	CaM				= d_initvalu[offset_1];
	Ca2CaM			= d_initvalu[offset_2];
	Ca4CaM			= d_initvalu[offset_3];
	CaMB			= d_initvalu[offset_4];
	Ca2CaMB			= d_initvalu[offset_5];
	Ca4CaMB			= d_initvalu[offset_6];           
	Pb2				= d_initvalu[offset_7];
	Pb				= d_initvalu[offset_8];
	Pt				= d_initvalu[offset_9];
	Pt2				= d_initvalu[offset_10];
	Pa				= d_initvalu[offset_11];                            
	Ca4CaN			= d_initvalu[offset_12];
	CaMCa4CaN		= d_initvalu[offset_13];
	Ca2CaMCa4CaN	= d_initvalu[offset_14];
	Ca4CaMCa4CaN = d_initvalu[offset_15];

Pollyanna
Mar 5, 2005

Milk's on them.


Munkeymon posted:

Hey GWH, I found a property name just now that should make you feel better by comparison: IsHavingUpdateRights

Update Rights? Lmao!!!

Khorne
May 1, 2002

Athas posted:

Well, the researcher problem is to document a parameter called "u" with the description "u". The weird parameter indexing is just... I don't know.
The other problem is half of them are constants that likely don't change. It's almost like a struct could be useful there so you don't have 13.75 parameters that largely don't describe what's happening, what state is modified, etc. Instead you'd have the business side of the variables being passed in 6 parameters and a struct containing "constant" environmental stuff that's likely passed to other functions, or 'kernels' as the gpu nomenclature goes, as well.

Maybe I am the horror here, I don't know.

edit: for example, one instance of my program will have 12 variables that don't change during the life of the program but you might stop your program, change the settings, and restart your program. I usually establish a struct for "settings" and then either pass it to relevant functions or keep it as a global. Stuff like time step size when it's constant, bounding box, particle count if it never changes, that kinda stuff.

Khorne fucked around with this message at 16:29 on Jul 21, 2018

fritz
Jul 26, 2003

Munkeymon posted:

Hey GWH, I found a property name just now that should make you feel better by comparison: IsHavingUpdateRights

Not to be confused with shavingUpdateRights

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
"u" and "k" are almost certainly taken straight from an equation

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Munkeymon posted:

Hey GWH, I found a property name just now that should make you feel better by comparison: IsHavingUpdateRights

At my last company, English was the second language of a lot of my coworkers and they'd use things like IsHasUpdateRights.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

HappyHippo posted:

"u" and "k" are almost certainly taken straight from an equation

Yeah, that was my guess. Someone wrote up a paper saying "here's some math to accomplish this desired result", then the math got turned into a program with as few changes as possible. Happens all the time, sadly. I very much doubt the software engineer aspiration of "meaningful variable names" is going to shift several centuries' worth of single-letter variable names in the world of mathematics.

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

TooMuchAbstraction posted:

Yeah, that was my guess. Someone wrote up a paper saying "here's some math to accomplish this desired result", then the math got turned into a program with as few changes as possible. Happens all the time, sadly. I very much doubt the software engineer aspiration of "meaningful variable names" is going to shift several centuries' worth of single-letter variable names in the world of mathematics.

Single letter variables are cool and good if used sparingly and carefully. 'i', 'j' and maybe 'k' are nice loop indices ('l' would be pushing it). Shut up, weirdoes who use quaternions.

Athas
Aug 6, 2007

fuck that joker
Single letter variable names are fine; I use them myself. But writing C like it's transpiled from FORTRAN is not fine.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Zopotantor posted:

Single letter variables are cool and good if used sparingly and carefully. 'i', 'j' and maybe 'k' are nice loop indices ('l' would be pushing it). Shut up, weirdoes who use quaternions.

At the very least use ii, jj and kk - doing find and replace for "i" even in a single source file is going to be painful.

Xarn
Jun 26, 2015

Bruegels Fuckbooks posted:

At the very least use ii, jj and kk - doing find and replace for "i" even in a single source file is going to be painful.

Can I have a moment of your time to talk about our lord and saviour, semantic refactoring?

Soricidus
Oct 21, 2010
freedom-hating statist shill

Bruegels Fuckbooks posted:

At the very least use ii, jj and kk - doing find and replace for "i" even in a single source file is going to be painful.

If you’re doing textual find and replace on variable names in 2018, you’re doing something wrong. Use the “rename variable” function in your editor. If you’re using an editor without such a function, get a better editor.

(If you’re using a language without such an editor, I suggest polishing your resume.)

Athas
Aug 6, 2007

fuck that joker

Bruegels Fuckbooks posted:

At the very least use ii, jj and kk - doing find and replace for "i" even in a single source file is going to be painful.

Even an 80s Emacs supports word boundaries in regular expressions, I would think.

Adbot
ADBOT LOVES YOU

raminasi
Jan 25, 2005

a last drink with no ice

Bruegels Fuckbooks posted:

At the very least use ii, jj and kk - doing find and replace for "i" even in a single source file is going to be painful.

I cannot think of a time I have ever needed to rename a loop index variable.

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