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
Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

WildFoxMedia posted:

It's poo poo like ^^^^ that make me incredibly sad to be associated to PHP.

That's what makes you sad to be associated with PHP? Oh the justifications people will make to hide from the truth.

Adbot
ADBOT LOVES YOU

Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!

rt4 posted:

Professors: fine for theory, always wrong on code.
Well, in this case I find it far more likely that the dude misunderstood what the professor said, or the professor misunderstood what was being asked.

But I guess that's less funny, so forget I said anything. CS Professors = poo poo.

evensevenone
May 12, 2001
Glass is a solid.
Or his "IT" professor didn't know or give a poo poo about php.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

evensevenone posted:

Or his "IT" professor didn't know or give a poo poo about php.
Well, this issue (the discussion is still about the passwords thing right?) isn't actually a PHP issue, it's HTML (and HTTP?)

I think it's clear that even if his professor did outright state what the guy claims he did, it's still something you might think to check somehow, if secure passwords are important in what you're doing.

megalodong
Mar 11, 2008

http://www.phpfreaks.com/forums/index.php/topic,259938.msg1224497.html

quote:

Which method is the most efficient if you wish to find out if a number of values all exist within an array?
Question gets answered with the suggestion to use array_diff() and array_intersect().

But undeterred by his lack of understanding of anything, Q695 joins in:

Q695 posted:

Actually I dealt with this problem a few years ago, and it was solved with a "%$value%".

I love my "SQL in easy steps" book that a prof reccomended to me several years ago :D.

quote:

Uhh...

Q695 posted:

I guess your method works, but I would've used the strstr (or whatever it is to find spaces) to break up the text until the whole string is used, but your method works well.

quote:

Thanks for the replies although I have no idea what you are talking about, Q695? Are you talking about a database now? Please explain further.

quote:

You don't know what he's talking about because he doesn't know what he's talking about. He's talking about mysql, and you are talking about PHP.

Just ignore him.

Q695 posted:

I'm talking about querying databases to search for data sets.

quote:

I know you are. And you are the only one in this thread who is.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
This guy could get a whole thread.

http://www.phpfreaks.com/forums/index.php/topic,261139.msg1236829.html

Q695 posted:

How could I fix the spacing issues (see src) on http://www.sd52gop.com/ the easiest way possible?

Someone points out that the site is pretty unprofessional, and inquires as to whether he's being paid for it:

quote:

I get paid to make them function, not to do layout. Layout is what the graphic artists do well, and I hate graphics, and things like that.

Then the same guy who destroyed him in the other thread comes in, replying to the original post:

quote:

Very concise explanation. I knew exactly what you were talking about.

Then someone actually gives a helpful suggestion:

quote:

Hi there,

Remove <hr class="rule"/> line for each person listed and then two <br><br> tags and it'll remove the horizontal line and keep some decent, readable spacing. I also suggest getting Firebug for Firefox that allows you to do a lot of HTML and web development interaction on pages you browse to. See http://getfirebug.com/

Q695 posted:

ever think that that is there for a reason, because I do?

and the thread caps off with the forum regular:

quote:

Ya, but your reasons often are based on wrong assumptions.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
http://www.phpfreaks.com/forums/index.php/topic,240487.0.html

guy with problem posted:

In an attempt to automatically hide my email from spam bots, I have been working on a script that turns all email [addresses?] on a page into ASCII, however I am having trouble with one little bit of code.

phpfreaks superstar posted:

I like to give each user that can receive e-mail a unique id that pertains to the user e-mail address, then on the back end I run the mail algorythim.

phpfreaks superstar posted:

There is a built in option for mail to be sent as html, not other things.

phpfreaks superstar posted:

Are you talking about having a captcha that is required before sending the e-mail to someone, otherwise it runs a loop?

I swear this guy's a bot running a rudimentary search engine.

nullfox
Aug 19, 2008

Avenging Dentist posted:

That's what makes you sad to be associated with PHP? Oh the justifications people will make to hide from the truth.

Deciding to poo poo up another thread with your "OMG PHP SUCKS, EVERYONE WHO DOES PHP SUCKS" bullshit?

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

WildFoxMedia posted:

Deciding to poo poo up another thread with your "OMG PHP SUCKS, EVERYONE WHO DOES PHP SUCKS" bullshit?

Well, at least the first of those statements is correct. I do scripting in PHP and I have a soft spot for it, but I can recognise that it does objectively suck pretty badly.

I don't think there should be an argument about it in this thread though.

MononcQc
May 29, 2007

PHP sucks, the speed of light is a constant but time isn't one any longer and apples fall to the ground because of gravity. News at 11.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Hammerite posted:

I don't think there should be an argument about it in this thread though.

To be fair, most anything said by Rasmus Lerdorf (the original designer of PHP) rivals what that Q695 guy says: http://en.wikiquote.org/wiki/Rasmus_Lerdorf

My favorite:

Rasmus Lerdorf, inventor of the widely-used programming language PHP posted:

I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I'll just restart apache every 10 requests.

Sebbe
Feb 29, 2004

Avenging Dentist posted:

To be fair, most anything said by Rasmus Lerdorf (the original designer of PHP) rivals what that Q695 guy says: http://en.wikiquote.org/wiki/Rasmus_Lerdorf

I felt a bit ashamed about being Danish for a second there; but then I remembered that Stroustrup is Danish too, so I figure that evens it out a bit.

Parantumaton
Jan 29, 2009


The OnLy ThInG
i LoVe MoRe
ThAn ChUgGiNg SeMeN
iS gEtTiNg PaId To Be A
sOcIaL MeDiA sHiLl
FoR mIcRoSoFt
AnD nOkIa

Avenging Dentist posted:

To be fair, most anything said by Rasmus Lerdorf (the original designer of PHP) rivals what that Q695 guy says: http://en.wikiquote.org/wiki/Rasmus_Lerdorf

My favorite:

How the gently caress did that guy even managed to get something compiled :psyduck:

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Parantumaton posted:

How the gently caress did that guy even managed to get something compiled :psyduck:

He threw things together until it worked, didn't you read the quote? :)

A A 2 3 5 8 K
Nov 24, 2003
Illiteracy... what does that word even mean?

Parantumaton posted:

How the gently caress did that guy even managed to get something compiled :psyduck:

It's just a Personal Home Page, no big deal.

Meganiuma
Aug 26, 2003
Sorry to interrupt the PHP derail, but this piece of code made me cry after spending the whole day tracking down a hang:

code:
  /* Since we know we' ll never get deadlocks as we 
   * always get in canonical order, prevent deadlock 
   * detection by waiting in a loop.
   */
  for (;;)
  {
    eq = kernel_acquire(stateobj, LOCK_EXCLUSIVE, 0, timeout, lockid,
                        (uint_32)obj, (uint_32)0, LOCK_GLOBAL);
    if (eq)
      break;
  }
It boggled my mind that someone could think this is a good idea. "This code obviously can't fail, so let me make sure to subvert any failure detection mechanisms."?

Neslepaks
Sep 3, 2003

Sebbe posted:

I felt a bit ashamed about being Danish for a second there; but then I remembered that Stroustrup is Danish too, so I figure that evens it out a bit.

That only makes it worse.

pseudorandom name
May 6, 2007

Meganiuma posted:

Sorry to interrupt the PHP derail, but this piece of code made me cry after spending the whole day tracking down a hang:

code:
  /* Since we know we' ll never get deadlocks as we 
   * always get in canonical order, prevent deadlock 
   * detection by waiting in a loop.
   */
  for (;;)
  {
    eq = kernel_acquire(stateobj, LOCK_EXCLUSIVE, 0, timeout, lockid,
                        (uint_32)obj, (uint_32)0, LOCK_GLOBAL);
    if (eq)
      break;
  }
It boggled my mind that someone could think this is a good idea. "This code obviously can't fail, so let me make sure to subvert any failure detection mechanisms."?

The deadlock detection probably isn't smart enough to deal with the ordering.

Edit: What OS is this from? My quick poll of an IRC channel filled with devs familiar with Linux, *BSD, VxWorks and Solaris produced no answer. The consensus guess was Mach and/or OS X.

pseudorandom name fucked around with this message at 20:55 on Mar 23, 2010

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
I've just devised a new mathematical relation. Ruby on Rails = PHP.

From above in this thread:

Rasmus Ledorf, creator of PHP posted:

I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I'll just restart apache every 10 requests.

From a fun rant:

David Hansson, creator of Ruby on Rails posted:

(15:11:12) DHH: before fastthread we had ~400 restarts/day

tripwire
Nov 19, 2004

        ghost flow

Avenging Dentist posted:

I've just devised a new mathematical relation. Ruby on Rails = PHP.

From above in this thread:


From a fun rant:

:laugh:

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.

David Hansson, creator of Ruby on Rails posted:

(15:11:22) DHH: now we have perhaps 10
Ah yes, 10 restarts per day, that's perfectly acceptable for a server.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Mustach posted:

Ah yes, 10 restarts per day, that's perfectly acceptable for a server.

well it's better than every 10 requests you have to admit

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Ryouga Inverse posted:

well it's better than every 10 requests you have to admit

That all depends on how many requests per day you're getting.

spiritual bypass
Feb 19, 2008

Grimey Drawer
I'm probably going to get poo poo on for asking this, but...
:psyduck:
...under what circumstances would anyone want to restart a server during daily operation?

tripwire
Nov 19, 2004

        ghost flow

rt4 posted:

I'm probably going to get poo poo on for asking this, but...
:psyduck:
...under what circumstances would anyone want to restart a server during daily operation?

When it crashes silly!

tef
May 30, 2004

-> some l-system crap ->

rt4 posted:

I'm probably going to get poo poo on for asking this, but...
:psyduck:
...under what circumstances would anyone want to restart a server during daily operation?

it's easier to crash on an error and restart than recover in some cases.

for example:
http://en.wikipedia.org/wiki/Crash-only_software

Milotic
Mar 4, 2009

9CL apologist
Slippery Tilde

rt4 posted:

I'm probably going to get poo poo on for asking this, but...
:psyduck:
...under what circumstances would anyone want to restart a server during daily operation?

We have blades at work which restart if a sensor fails - even temporarily. I can see why it makes sense from an ops perspective, but as a developer whose code is running on there, it terrifies the poo poo out of me that it might do it a certain critical juncture.

spiritual bypass
Feb 19, 2008

Grimey Drawer
But we're talking about web apps here, right? To me, a web crash means that particular file that was running ended prematurely; the user gets an error page. Everyone else using it should come out fine (unless they trigger the same error).

How could a restart ever fix that? Or are these guys really writing such terrible apps that they just make the whole computer unusable?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

rt4 posted:

How could a restart ever fix that? Or are these guys really writing such terrible apps that they just make the whole computer unusable?

In the quote, it's restarting because of absolutely massive amounts of memory leaks in the Rails framework (now at least partly fixed).

Nomnom Cookie
Aug 30, 2009



Avenging Dentist posted:

In the quote, it's restarting because of absolutely massive amounts of memory leaks in the Rails framework (now at least partly fixed).

To be fair, during the 400 restarts/day period there were also massive leaks in Ruby.

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Avenging Dentist posted:

From a fun rant:
I'm trying to debate whether this guy is the douchiest of all Ruby developers, or the one Ruby dev I'd actually want to have a beer with.

Zhentar
Sep 28, 2003

Brilliant Master Genius

Milotic posted:

We have blades at work which restart if a sensor fails - even temporarily. I can see why it makes sense from an ops perspective, but as a developer whose code is running on there, it terrifies the poo poo out of me that it might do it a certain critical juncture.

But there's always the possibility that your code could be unexpectedly terminated... if it's making you more aware of that fact, that's a good thing.


tef posted:

it's easier to crash on an error and restart than recover in some cases.

for example:
http://en.wikipedia.org/wiki/Crash-only_software

There are some failure-resistant CPU architectures that will run everything in duplicate. Run the same thing side by side; if at the end you get two different answers, flush everything and try again.

king_kilr
May 25, 2007

Dijkstracula posted:

I'm trying to debate whether this guy is the douchiest of all Ruby developers, or the one Ruby dev I'd actually want to have a beer with.

Zed doesn't drink, but he's quite fun to have a beer.

raminasi
Jan 25, 2005

a last drink with no ice

Dijkstracula posted:

I'm trying to debate whether this guy is the douchiest of all Ruby developers, or the one Ruby dev I'd actually want to have a beer with.

They're not mutually exclusive.

Ethnic Hairstyles
May 23, 2009

lol java

code:
else
	{
		for ( byte y = ( player.cursor.getYCoord() - player.getDistanceOfSight() > -1 ) ? 
			(byte) ( player.cursor.getYCoord() - player.getDistanceOfSight() ) : 0; 
			( player.cursor.getYCoord() + player.getDistanceOfSight() <= newMap.returnMapHeight() && 
			y < (byte) ( player.cursor.getYCoord() + player.getDistanceOfSight() ) ) || 
			( player.cursor.getYCoord() >= newMap.returnMapHeight() - 
			player.getDistanceOfSight() && y < newMap.returnMapHeight() ); y++ )
		{
			for ( byte x = ( player.cursor.getXCoord() - player.getDistanceOfSight() > -1 ) ? 
				(byte) ( player.cursor.getXCoord() - player.getDistanceOfSight() ) : 0; 
				( player.cursor.getXCoord() + player.getDistanceOfSight() <= newMap.returnMapWidth() 
				&& x < (byte) ( player.cursor.getXCoord() + player.getDistanceOfSight() ) ) || 
				( player.cursor.getXCoord() >= newMap.returnMapWidth() - player.getDistanceOfSight() 
				&& x < newMap.returnMapWidth() ); x++ )
			{

start of some else block in a display function in a roguelike

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





rt4 posted:

But we're talking about web apps here, right? To me, a web crash means that particular file that was running ended prematurely; the user gets an error page. Everyone else using it should come out fine (unless they trigger the same error).

How could a restart ever fix that? Or are these guys really writing such terrible apps that they just make the whole computer unusable?

In rails case, it was farming out requests to a sea of app servers that were single threaded. Restarting one only killed that request, other requests were unaffected. It's not a good architecture, but it's not as bad as it sounds.

jandrese
Apr 3, 2007

by Tiny Fistpump

Ethnic Hairstyles posted:

lol java

code:
else
	{
		for ( byte y = ( player.cursor.getYCoord() - player.getDistanceOfSight() > -1 ) ? 
			(byte) ( player.cursor.getYCoord() - player.getDistanceOfSight() ) : 0; 
			( player.cursor.getYCoord() + player.getDistanceOfSight() <= newMap.returnMapHeight() && 
			y < (byte) ( player.cursor.getYCoord() + player.getDistanceOfSight() ) ) || 
			( player.cursor.getYCoord() >= newMap.returnMapHeight() - 
			player.getDistanceOfSight() && y < newMap.returnMapHeight() ); y++ )
		{
			for ( byte x = ( player.cursor.getXCoord() - player.getDistanceOfSight() > -1 ) ? 
				(byte) ( player.cursor.getXCoord() - player.getDistanceOfSight() ) : 0; 
				( player.cursor.getXCoord() + player.getDistanceOfSight() <= newMap.returnMapWidth() 
				&& x < (byte) ( player.cursor.getXCoord() + player.getDistanceOfSight() ) ) || 
				( player.cursor.getXCoord() >= newMap.returnMapWidth() - player.getDistanceOfSight() 
				&& x < newMap.returnMapWidth() ); x++ )
			{

start of some else block in a display function in a roguelike

I must be crazy because even though those lines look complicated at first, they're quite straightforward when you get down to reading them. It just checks every space around the player that they could possibly see without going outside of the bounds of the map. Pretty much everything is well named and everything.

The only "horror" is the use of the ? : construct, but this is one of those cases where they actually work.

tripwire
Nov 19, 2004

        ghost flow

jandrese posted:

I must be crazy because even though those lines look complicated at first, they're quite straightforward when you get down to reading them. It just checks every space around the player that they could possibly see without going outside of the bounds of the map. Pretty much everything is well named and everything.

The only "horror" is the use of the ? : construct, but this is one of those cases where they actually work.

You are crazy.

mr_jim
Oct 30, 2006

OUT OF THE DARK

jandrese posted:

I must be crazy because even though those lines look complicated at first, they're quite straightforward when you get down to reading them. It just checks every space around the player that they could possibly see without going outside of the bounds of the map. Pretty much everything is well named and everything.

The only "horror" is the use of the ? : construct, but this is one of those cases where they actually work.

I'd consider creating well-named local variables to store the results of some of those function calls. player.cursor.getYCoord(), player.cursor.getXCoord, and player.getDistanceOfSight() in particular.

Adbot
ADBOT LOVES YOU

Vanadium
Jan 8, 2005

I would consider keeping the maths out of the loop head

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