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
pseudorandom name
May 6, 2007

This surprises you? From the company that has a BOOL functions returning TRUE, FALSE or -1 and the official mouse input API has no way to correctly size the output buffer?

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

pseudorandom name posted:

the official mouse input API has no way to correctly size the output buffer?

whaaaat??

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

pseudorandom name posted:

This surprises you? From the company that has a BOOL functions returning TRUE, FALSE or -1 and the official mouse input API has no way to correctly size the output buffer?

mother of god

pseudorandom name
May 6, 2007

code:
    VERIFY(GetRawInputBuffer(NULL, &cbSize, /*0, 
            */sizeof(RAWINPUTHEADER)) == 0);
    cbSize *= 16;            // this is a wild guess
    Log(_T("Allocating %d bytes"), cbSize); 
    PRAWINPUT pRawInput = (PRAWINPUT)malloc(cbSize); 
This is the official example.

FrantzX
Jan 28, 2007
Isn't everything in the System.Drawing namespace just a thin wrapper over the GDI API?

ijustam
Jun 20, 2005

I'm not quite sure what the context is here, but I can only imagine the horrors that are in a system that requires this as a troubleshooting doc: http://www.irs.gov/PUP/efile/Fixing_Your_Rejection.pdf

quote:

Did you receive an XML Error Validation Message about an Other Withholding Amount? In Step 2, E-file Tax Forms, Section 2,
Box B, if you do not have any other Form 1099 federal withholdings to report, instead of an entering a zero, "0" in box B, leave Box B
blank. This will prevent you from getting an XML Error Validation Error, X0000-005.

You should use the “Find” function of Adobe to search for text and find a solution to your error.
Every error has an Xpath and all Xpaths begin with text similar to this, "Field/Xpath: /efile:Return[1]/efile:ReturnData[1]/efile:" When
performing a text search, exclude the beginning error text and any bracketed numbers in your search. Your search should only
include portions of the Xpath text that is unique. Generally, unique text will start after “Field/Xpath:
/efile:Return[1]/efile:ReturnData[1]/efile:” and after every instance of “ /efile:”

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

ijustam posted:

I'm not quite sure what the context is here, but I can only imagine the horrors that are in a system that requires this as a troubleshooting doc: http://www.irs.gov/PUP/efile/Fixing_Your_Rejection.pdf

In some small way, this implicit trust in the user's ability to precisely follow inscrutable instructions is admirable. It's ok to sometimes treat your users as able beings.

That must be what the implementer of this fine system had in mind.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

pseudorandom name posted:

This surprises you? From the company that has a BOOL functions returning TRUE, FALSE or -1 and the official mouse input API has no way to correctly size the output buffer?

They are dealing with the biggest pile of rotted, bloated legacy code in the history of software.

Gul Banana
Nov 28, 2003

I see you've never worked on IBM System z, some parts of which descend from the original System/360 code...

To be fair it was a lot better designed than Win32, and has held up better when extended. But it is still fifty years old.

Sir_Substance
Dec 13, 2013

Tesseraction posted:

I'd struggle to name an influential CS figure who wasn't primarily self-taught in their field of excellence.

That's because people who are self-taught seem to be gripped by the need to tell people they are self-taught. People who are formally educated seem less inclined to penis-waving, so you never find out how they were educated.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
It's also because CS is a young enough field that all the leading lights were self-taught to at least some extent because there was no prior generation to teach them. Eg. Dijkstra got his degree in Physics, I think.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

pseudorandom name posted:

BOOL functions returning TRUE, FALSE or -1
Really not a horror in view of the alternatives, which is why the Unix fork call does the same kind of thing.

b0lt
Apr 29, 2005

Gazpacho posted:

Really not a horror in view of the alternatives, which is why the Unix fork call does the same kind of thing.

Using 'BOOL' when you mean 'char' or 'int' is understandably going to confuse people.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
They don't mean those things. They mean BOOL, in all its subtlety.

zergstain
Dec 15, 2005

Gazpacho posted:

Really not a horror in view of the alternatives, which is why the Unix fork call does the same kind of thing.

I thought it returned either -1 or a pid. Unless you're the child process, then it returns 0.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
So, as a follow-up, turns out the dude posted a Pull Request removing the "reserved identifiers", so good on him:

https://github.com/cockpit-project/cockpit/pull/218

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Otto Skorzeny posted:

It's also because CS is a young enough field that all the leading lights were self-taught to at least some extent because there was no prior generation to teach them. Eg. Dijkstra got his degree in Physics, I think.

Still quite funny to overhear a lecture for a construction management course where the professor said something along the lines of "this technique is relatively new, having been in use for only 30 years or so." That's more than half the time our field has even existed!

Ego Trip
Aug 28, 2012

A tenacious little mouse!


Just saw what my coworker is up to.

code:
switch(isSomeBoolean)
{
	case true:
		//stuff
		break;
	case false:
		//stuff
		break;
}
:suicide:

Nippashish
Nov 2, 2005

Let me see you dance!

Ego Trip posted:

Just saw what my coworker is up to.

He'll get the last laugh when booleans stop being binary valued and all he needs to do is add a default case.

Smugdog Millionaire
Sep 14, 2002

8) Blame Icefrog
I'll just leave this here http://dotnetpad.net/ViewPaste/PwjcuvX5RkSqkZXCGI8oeg

Look Around You
Jan 19, 2009


I would imagine that's happening because if (b) is just testing whether it's a truth-y value or not (meaning whether it's non-zero or not), while switch (b) is testing actual strict value equality, and from the way the code is acting, the true literal value is not represented by all 1s (it's probably defined as 1 or something, not -128 or MIN_INT) in the machine. That also looks like mega undefined behavior and I'm kind of surprised it works at all in all honesty.

Macichne Leainig
Jul 26, 2012

by VG

2banks1swap.avi posted:

This is the loving .NET standard library.

WTF, Microsoft?

At least their enterprise library fits all the bullet points:

-Reads nice on paper
-Easy to implement
-Buggy piece of poo poo

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Tha Chodesweller posted:

At least their enterprise library fits all the bullet points:

-Reads nice on paper
-Easy to implement
-Buggy piece of poo poo
To be fair, trying to wrap their legacy-as-gently caress Win32 API into something sane-looking is an achievement in itself.

omeg
Sep 3, 2012

http://msdn.microsoft.com/en-us/library/windows/hardware/ff554572(v=vs.85).aspx

MSDN posted:

The MmIsAddressValid routine checks whether a page fault will occur for a read or write operation at a given virtual address.

Warning We do not recommend using this function.

Wait, what? Now I'm curious...

MSDN posted:

Even if MmIsAddressValid returns TRUE, accessing the address can cause page faults unless the memory has been locked down or the address is a valid nonpaged pool address.

:allears:

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
That's a dumb function in general. Why would you ever want to ask whether you can access a memory address? Shouldn't you know?

omeg
Sep 3, 2012

Suspicious Dish posted:

That's a dumb function in general. Why would you ever want to ask whether you can access a memory address? Shouldn't you know?

When you're a driver receiving unknown poo poo from usermode you should check it. There are better ways to do this though.

Flownerous
Apr 16, 2012
Is that just a timing thing? It could change between the call and the access?

pseudorandom name
May 6, 2007

Its probably a first-pass "is every page in this list theoretically possible?" check, which has some utility when portions of the address space can't ever be valid, but there isn't really a point to it when you have to map and lock the pages before you use them anyway.

pseudorandom name fucked around with this message at 09:10 on Feb 19, 2014

omeg
Sep 3, 2012

Yeah, from what I see it's mostly internally used by the memory manager itself which knows what it's doing I guess.

Jewel
May 2, 2009

A mix of coding horror and version control horror: I was using perforce's official client and I tried to get a directory from the server. While that was loading I tried to grab one more file. It opened two "Get Revision Progress" windows with their own percent bars for each operation. I decided I'd wait to get the single file later, so I hit stop on that window. It closed both revision progress windows and stopped both operations. Nice programming cool perforce.

pseudorandom name
May 6, 2007

On the other hand, there's a function-like macro in the Windows DDK that expands to a multiple lines without a block to contain them. I can't remember the name of it, though. Think it was a Ke* function.

omeg
Sep 3, 2012

pseudorandom name posted:

On the other hand, there's a function-like macro in the Windows DDK that expands to a multiple lines without a block to contain them. I can't remember the name of it, though. Think it was a Ke* function.

I also like various macros that need double parentheses for arguments.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Suspicious Dish posted:

So, as a follow-up, turns out the dude posted a Pull Request removing the "reserved identifiers", so good on him:

https://github.com/cockpit-project/cockpit/pull/218

As a follow up to your follow-up, it apparently doesn't compile.

https://github.com/cockpit-project/cockpit/pull/218#issuecomment-35474133

So, boo on him for not even trying it before submitting it. Bad robot!

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
https://github.com/alopexc0de/HashPass/blob/master/HashPass.php

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal


What's sad is that this is probably the most useful comment this guy has made.

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.
So we use google closure at work for our javascript stuff. Somebody decided we needed to annotate all our JS with the google closure jsdoc comments (that became a fad until people realized putting annotations for hundreds of thousands of lines of legacy code was loving boring and stopped doing it.)

But anyway, I was looking through some C++ code from other groups, and some moron actually wrote google closure type annotations ... for C++ methods. You know, that esoteric language is statically typed and has a header and doesn't use google closure compiler to compile.

What the gently caress?

Hughlander
May 11, 2005

Bruegels Fuckbooks posted:

So we use google closure at work for our javascript stuff. Somebody decided we needed to annotate all our JS with the google closure jsdoc comments (that became a fad until people realized putting annotations for hundreds of thousands of lines of legacy code was loving boring and stopped doing it.)

But anyway, I was looking through some C++ code from other groups, and some moron actually wrote google closure type annotations ... for C++ methods. You know, that esoteric language is statically typed and has a header and doesn't use google closure compiler to compile.

What the gently caress?

Do you mean doxygen tags so you can autogenerate offline documentation and browse class hierarchies in a web-browser or other tool?

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal

Hughlander posted:

Do you mean doxygen tags so you can autogenerate offline documentation and browse class hierarchies in a web-browser or other tool?

No he means these: https://developers.google.com/closure/compiler/docs/js-for-compiler

types for the typeless.

Spatial
Nov 15, 2007

I think I'm gonna vomit

Adbot
ADBOT LOVES YOU

SurgicalOntologist
Jun 17, 2004

my stats homework posted:

2b+c) Generate the trajectory X^(k) (t_n) of a realization X^(k) of a white noise process in two
different ways using MATLAB

2b) Use the command normrnd() to generate one sequence of 5 independent normally
distributed random variable and plot the trajectory
E.g. use
code:
X=normrnd(0,sigma,5,1);
tgrid=[1:1:5];
plot(tgrid,X)
2c) Use the command normrnd() five times in the row.
E.g. use
code:
Xkis1_t1=normrnd(0,sigma,1,1);
Xkis1_t2=normrnd(0,sigma,1,1);
Xkis1_t3=normrnd(0,sigma,1,1);
Xkis1_t4=normrnd(0,sigma,1,1);
Xkis1_t5=normrnd(0,sigma,1,1);
Xkis1_t=[Xkis1_t1 Xkis1_t2 Xkis1_t3 Xkis1_t4 Xkis1_t5];
tgrid=[1:1:5];
plot(tgrid,Xkis1_t)

Last week I called out the prof (my PhD advisor, incidentally) for providing unvectorized example code, I'm pretty sure now he's just trolling me. I wrote that I refuse to do part 2c on principle.

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