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
tef
May 30, 2004

-> some l-system crap ->

Janin posted:

21759446 :gonk:

:psyboom:

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
If you use numbered changelists the revision numbers can go up a lot faster than the number of commits. Our p4 repo at work is on rev 27826 with only 12671 submitted changelists.

SavageMessiah
Jan 28, 2009

Emotionally drained and spookified

Toilet Rascal
http://www.infoq.com/presentations/Development-at-Google

Not really that great of a talk but goddamn that poo poo is insane. All of google's code is in one repo! I wish I had the time to improve our little 20 dev HG based system.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Plorkyeran posted:

If you use numbered changelists the revision numbers can go up a lot faster than the number of commits. Our p4 repo at work is on rev 27826 with only 12671 submitted changelists.

Yeah, p4 gets kind of goofy with that. Pretty much any operation that COULD feasibly end with a submit gets a changeset number.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

When I worked in vidya games it got pretty crazy sometimes. I checked an easter egg into the non-gold fork (e.g. the one we used for loving around) which changed one AI script and one object. It ended up pulling over 300 binaries into the changelist.

Hughlander
May 11, 2005

Scaramouche posted:

When I worked in vidya games it got pretty crazy sometimes. I checked an easter egg into the non-gold fork (e.g. the one we used for loving around) which changed one AI script and one object. It ended up pulling over 300 binaries into the changelist.

Yeah but that was still only one changelist. Where I work the engineering depot for all projects are held in common with just different branches and we have like 200k changes, (Over the past 7 years) the assets for each game are in their own depot and can run up to 100k changes per game.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

NotShadowStar posted:

No loving way. Pics or it didn't happen.

At my last job, we had one SVN repo for every single project in the history of company; all 200+ of them. You'd do an initial commit on a new project, and it would be #96345. The next day, you'd commit your first change, and it would be #100032. A year ago, a bunch of the devs were pushing for moving to Mercurial or git, but it got vetoed because, I poo poo you not, the Director of Development was upset that "we can't have every project in the same repo, so no way."

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

MOOMIN.EXE posted:

one of the developers at my jorb used to insist on doing seperate commits on every single file he modified

I do that. It makes git bisect more useful than it already is.

ColdPie
Jun 9, 2006

BonzoESC posted:

I do that. It makes git bisect more useful than it already is.

I think you are confused.

MrMoo
Sep 14, 2000

SavageMessiah posted:

http://www.infoq.com/presentations/Development-at-Google

Not really that great of a talk but goddamn that poo poo is insane. All of google's code is in one repo! I wish I had the time to improve our little 20 dev HG based system.

Isn't Apache similar? I seem to recall massive numbers browsing one project.

HTTPD is at 1134699, http://svn.apache.org/repos/asf/httpd/

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

ColdPie posted:

I think you are confused.

  1. Create feature branch.
  2. Write integration test for feature. Test fails due to missing controller bits. Commit.
  3. Write functional test for a controller action. Test fails due to missing controller bits. Commit.
  4. Write controller action. Tests fail for missing model bits. Commit.
  5. Write unit test for model methods to implement feature. Test fails for missing model bits. Commit.
  6. Write model method. Unit test passes. Functional and integration tests fail due to incompleteness of feature/action. Commit.
  7. Repeat until all tests pass.
  8. When feature is complete, pass branch to someone else for review, or wait two days and review it myself.
  9. If review is bad, add tests, repeat.
  10. If review is okay, merge with production, make sure tests still pass.

Yes, broken code with failing tests gets committed. This is why you run tests before building and deploying.

At the same time, I can go back to the reasoning for any line of code, the test that explains the reasoning, and see the commit comment for why I did it. Comments get stored in the git history which can be blamed to individual lines and disappear automatically when the lines they refer to are changed. In-line comments can't do that.

If something gets broken, I can run git bisect against the particular test that requires that feature until I see where it breaks.

I don't worry about repo bloat because commits are really loving cheap in git.

Ethereal
Mar 8, 2003

BonzoESC posted:

  1. Create feature branch.
  2. Write integration test for feature. Test fails due to missing controller bits. Commit.
  3. Write functional test for a controller action. Test fails due to missing controller bits. Commit.
  4. Write controller action. Tests fail for missing model bits. Commit.
  5. Write unit test for model methods to implement feature. Test fails for missing model bits. Commit.
  6. Write model method. Unit test passes. Functional and integration tests fail due to incompleteness of feature/action. Commit.
  7. Repeat until all tests pass.
  8. When feature is complete, pass branch to someone else for review, or wait two days and review it myself.
  9. If review is bad, add tests, repeat.
  10. If review is okay, merge with production, make sure tests still pass.

Yes, broken code with failing tests gets committed. This is why you run tests before building and deploying.

At the same time, I can go back to the reasoning for any line of code, the test that explains the reasoning, and see the commit comment for why I did it. Comments get stored in the git history which can be blamed to individual lines and disappear automatically when the lines they refer to are changed. In-line comments can't do that.

If something gets broken, I can run git bisect against the particular test that requires that feature until I see where it breaks.

I don't worry about repo bloat because commits are really loving cheap in git.

For us, we usually squash the commits before we push to remote. Part of the reason is that we're in transition from Perforce to git, and right now we have a git layer that commits to Perforce on the backend.

The other reason is that we don't need all those commits, we need a few (or single) buildable and deployable commits, that can be reverted to a stable state. This will probably change as more of our systems move into continuous build and deployment mode.

Of course this is after all the unit tests and integration tests pass as well as getting a few code reviews.

I am just happy we're getting rid of Perforce.

ColdPie
Jun 9, 2006

BonzoESC posted:

Yes, broken code with failing tests gets committed. This is why you run tests before building and deploying.

What you described is different from committing each file separately, which makes bisecting basically useless and brings you back to the CVS-era of non-atomic commits.

POKEMAN SAM
Jul 8, 2004

Janin posted:

Well it's not like I'm by myself; plus, we use Perforce, not subversion. I think the current change rate is 20 commits per minute.

Yeah, I cheated too, since we're on Perforce as well.

Lexical Unit
Sep 16, 2003

We have to submit powerpoint slides each week for a group meeting. For my next slide I added a bullet to the Issues section: "Overcoming the cognitive dissonance I get from seeing yards and meters on the same graph."

I do so love working here. :haw:

JediGandalf
Sep 3, 2004

I have just the top prospect YOU are looking for. Whaddya say, boss? What will it take for ME to get YOU to give up your outfielders?
I just found this gem
code:
if (CheckField(form.txtSalePrice.value,form,'0123456789$,') == true)
	if (CheckField(form.txtPerFin.value,form,'0123456789$') == true)
		if (CheckField(form.txtTermLoan.value,form,'0123456789') == true)
			if (CheckField(form.txtIntrate.value,form,'0123456789.') == true)
							OK=true
			else form.txtIntrate.focus()
		else form.txtTermLoan.focus()
	else form.txtPerFin.focus()
else form.txtSalePrice.focus()
return OK

zeekner
Jul 14, 2007

JediGandalf posted:

I just found this gem
code:
if (CheckField(form.txtSalePrice.value,form,'0123456789$,') == true)
	if (CheckField(form.txtPerFin.value,form,'0123456789$') == true)
		if (CheckField(form.txtTermLoan.value,form,'0123456789') == true)
			if (CheckField(form.txtIntrate.value,form,'0123456789.') == true)
							OK=true
			else form.txtIntrate.focus()
		else form.txtTermLoan.focus()
	else form.txtPerFin.focus()
else form.txtSalePrice.focus()
return OK

Don't worry, I validated the input!

BigRedDot
Mar 6, 2008

Lexical Unit posted:

We have to submit powerpoint slides each week for a group meeting. For my next slide I added a bullet to the Issues section: "Overcoming the cognitive dissonance I get from seeing yards and meters on the same graph."

I do so love working here. :haw:

You forgot to mention that neither axis is labeled.

Bozart
Oct 28, 2006

Give me the finger.

JediGandalf posted:

I just found this gem
code:
if (CheckField(form.txtSalePrice.value,form,'0123456789$,') == true)
	if (CheckField(form.txtPerFin.value,form,'0123456789$') == true)
		if (CheckField(form.txtTermLoan.value,form,'0123456789') == true)
			if (CheckField(form.txtIntrate.value,form,'0123456789.') == true)
							OK=true
			else form.txtIntrate.focus()
		else form.txtTermLoan.focus()
	else form.txtPerFin.focus()
else form.txtSalePrice.focus()
return OK

Wait, maybe my demented, drunken brain isn't working, but isn't CheckField a function that makes sure all characters in a string are members of that third argument, and while == true is probably redundant, and OK = true makes me hurt inside for some reason, and there is no reason for nesting (in what is probably a function which runs whenever an input textbox thing loses focus) it still works correctly?

Hell breaking out CheckField into another function is something that would merit a commendation compared to the code I run into at work.

aux
Oct 25, 2010

Geekner posted:

Don't worry, I validated the input!

Worst part is the "return OK" at the end, I'm ok with nested if statements to some extent (I've seen some horrible horrible nested if's in my time)

qntm
Jun 17, 2009

aux posted:

Worst part is the "return OK" at the end, I'm ok with nested if statements to some extent (I've seen some horrible horrible nested if's in my time)

I like the implication that the variable OK could be set to false, and "return OK" could therefore be a very bad thing.

Nippashish
Nov 2, 2005

Let me see you dance!

qntm posted:

I like the implication that the variable OK could be set to false, and "return OK" could therefore be a very bad thing.

Would you prefer "isOK"? It really doesn't seem like a big deal to me. A boolean called "OK" can really only mean one thing, and "if (OK)" reads naturally even of OK is false.

qntm
Jun 17, 2009
A boolean called "OK", like "TRUE", "FALSE", "SUCCESS" and "FAILURE", looks like a constant. Especially when you start using it in conditionals. "if(OK)" reads like "if(true)" or "if(1)". "if(OK == false)" just looks like nonsense. "isOK" would be an improvement, but "isValid" would be better.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Just return, OK?!

jonjonaug
Mar 26, 2010

by Lowtax
Welp. Every time you think you've seen the most incompetent data security on the internet, there comes along a new and exciting fuckup in basic security.

Hackers steal 200,000 credit card numbers by changing the URL after logging into a different account.

The NYT article this page links to is even more hilarious.

quote:

In the Citi breach, the data thieves were able to penetrate the bank’s defenses by first logging on to the site reserved for its credit card customers.

Once inside, they leapfrogged between the accounts of different Citi customers by inserting various account numbers into a string of text located in the browser’s address bar. The hackers’ code systems automatically repeated this exercise tens of thousands of times — allowing them to capture the confidential private data.

The method is seemingly simple, but the fact that the thieves knew to focus on this particular vulnerability marks the Citigroup attack as especially ingenious, security experts said.

One security expert familiar with the investigation wondered how the hackers could have known to breach security by focusing on the vulnerability in the browser. “It would have been hard to prepare for this type of vulnerability,” he said. The security expert insisted on anonymity because the inquiry was at an early stage.

jonjonaug fucked around with this message at 22:27 on Jun 14, 2011

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

quote:

One security expert familiar with the investigation wondered how the hackers could have known to breach security by focusing on the vulnerability in the browser. “It would have been hard to prepare for this type of vulnerability,” he said. The security expert insisted on anonymity because the inquiry was at an early stage.

What?

I suspect he insisted on anonymity because he's just smart enough to realize he's dumb.

I'm not a security expert at all, but have heard of these type of attacks for a decade.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
Well, he's right, you know. It really is pretty hard to predict that users are going to just go and edit the URL. I mean, it's got tons of numbers and letters in it. How will they know what the right ones are?

Pardot
Jul 25, 2001




code:
inline size_t get_available_memory_size(bool timed_operation = true){
	vector<char*> ptrs;
	ptrs.clear();
	double time_interval = 0;
	clock_t clock0 = clock();
	while(true) {
		clock_t clock1 = clock();
		char* ptr = (char*)malloc(1 << 26);
		if (ptr == NULL) break;
		memset(ptr, -1, 1 << 26);
		ptrs.push_back(ptr);
		clock_t clock2 = clock();
		if (ptrs.size() == 1) time_interval = difftime_clock(clock2, clock1);
		if (timed_operation && (difftime_clock(clock2, clock1) >= time_interval * 3 || difftime_clock(clock2, clock0) >= 10)) break;
	}
	size_t result = ptrs.size() << 26;
	for (int i=0; i < (int)ptrs.size(); i++) delete[] ptrs[i];
	ptrs.clear();
	return result;
}

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Wow, all that and they mix malloc and delete.
Ah, banks, what an amazingly all-around lovely set of corporations.

Sedro
Dec 31, 2008
The inline is a nice touch. Clearly this piece is performance-critical.

pseudorandom name
May 6, 2007

US banks think that asking you for both your password and your security questions is two-factor authentication.

csammis
Aug 26, 2003

Mental Institution

pseudorandom name posted:

US banks think that asking you for both your password and your security questions is two-factor authentication.

But how could anyone know what year my father was born?? :saddowns:

Zombywuf
Mar 29, 2008

Pardot posted:

code:
inline size_t get_available_memory_size(bool timed_operation = true){
	vector<char*> ptrs;
	ptrs.clear();
	double time_interval = 0;
	clock_t clock0 = clock();
	while(true) {
		clock_t clock1 = clock();
		char* ptr = (char*)malloc(1 << 26);
		if (ptr == NULL) break;
		memset(ptr, -1, 1 << 26);
		ptrs.push_back(ptr);
		clock_t clock2 = clock();
		if (ptrs.size() == 1) time_interval = difftime_clock(clock2, clock1);
		if (timed_operation && (difftime_clock(clock2, clock1) >= time_interval * 3 || difftime_clock(clock2, clock0) >= 10)) break;
	}
	size_t result = ptrs.size() << 26;
	for (int i=0; i < (int)ptrs.size(); i++) delete[] ptrs[i];
	ptrs.clear();
	return result;
}

This is genius, and flawed.

Hughlander
May 11, 2005

Pardot posted:

code:
inline size_t get_available_memory_size(bool timed_operation = true){
	vector<char*> ptrs;
	ptrs.clear();
	double time_interval = 0;
	clock_t clock0 = clock();
	while(true) {
		clock_t clock1 = clock();
		char* ptr = (char*)malloc(1 << 26);
		if (ptr == NULL) break;
		memset(ptr, -1, 1 << 26);
		ptrs.push_back(ptr);
		clock_t clock2 = clock();
		if (ptrs.size() == 1) time_interval = difftime_clock(clock2, clock1);
		if (timed_operation && (difftime_clock(clock2, clock1) >= time_interval * 3 || difftime_clock(clock2, clock0) >= 10)) break;
	}
	size_t result = ptrs.size() << 26;
	for (int i=0; i < (int)ptrs.size(); i++) delete[] ptrs[i];
	ptrs.clear();
	return result;
}

I'm calling bull. Clearly all the clock_t's should be volatile.

Opinion Haver
Apr 9, 2007

I'm not a C++ programmer, what the gently caress does that even do?

Beef
Jul 26, 2004
He tries to find out the total memory size by continuously asking the system for a fresh chunk of memory, until the system tells him to gently caress off by returning a null pointer. Alternatively, it also terminates by some magically defined time out, probably for those fabled 'virtual memory' system the new kids on the block have.

Mr.Radar
Nov 5, 2005

You guys aren't going to believe this, but that guy is our games teacher.
It also uses memset to force the system to actually allocate the memory pages rather than just promising to (as most modern systems do when you call malloc).

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope


What is "Slot1"?

You might think that it's just the first cell of a 3x8 table.

No, it is in fact the only cell of a 1x1 table that is inside a 1x2 table, that is inside a 3x2 table.

The three cells under Slot1 are in a 1x3 table. The text in some, but not all, cells is in a div just for kicks.

And every table contains a shitload of inline styles. Like '<td class="fart_butt" style="font-size:8pt; border-bottom:0">'

Munkeymon
Aug 14, 2003

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



My dad's on the board of a credit union and he told me they were looking at some software package for online banking that would require users to type in their password four times for every login attempt and use some sort of keystroke frequency analysis to determine whether the typist was the original user. This was back in 06, I think. The software they ended up with (may or may not be the same system, I don't know) will crash with the standard ASP exception page if it get unexpected input in some places - like when I gave it my out of state address :\

Wheany posted:



What is "Slot1"?

You might think that it's just the first cell of a 3x8 table.

No, it is in fact the only cell of a 1x1 table that is inside a 1x2 table, that is inside a 3x2 table.

The three cells under Slot1 are in a 1x3 table. The text in some, but not all, cells is in a div just for kicks.

And every table contains a shitload of inline styles. Like '<td class="fart_butt" style="font-size:8pt; border-bottom:0">'

You found one of my current employer's sites, I guess?

Adbot
ADBOT LOVES YOU

Pardot
Jul 25, 2001




Hughlander posted:

I'm calling bull. Clearly all the clock_t's should be volatile.

http://www.stanford.edu/group/wonglab/jiangh/seqmap/ Grad student code

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