Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Guess how long this took?


  • Please log in to reply
27 replies to this topic

#1 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:51 PM

Posted 30 September 2010 - 01:07 PM

How often do you spend getting an error in something like this:
try
		{
			$query = "SELECT Blah..blah..blah'";
					  
			return pdo_select($query);
		{
		catch (PDOException $e)
		{
			return writeError($e);
		}

Before you realize it is supposed to be this?
try
		{
			$query = "SELECT Blah..blah..blah'";
					  
			return pdo_select($query);
		}
		catch (PDOException $e)
		{
			return writeError($e);
		}

:thumbsup:

BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:51 PM

Posted 30 September 2010 - 01:30 PM

groovicus,

I don't see any difference between them....

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#3 groovicus

groovicus
  • Topic Starter

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:51 PM

Posted 30 September 2010 - 01:37 PM

After you look at it as long as I did, you will....... I was even nice enough to remove the nasty query for you.

#4 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:51 PM

Posted 30 September 2010 - 03:06 PM

Lol -- should have pulled out Beyond Compare the first time.
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#5 thelittleduck

thelittleduck

  • Members
  • 903 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Pond
  • Local time:02:51 AM

Posted 30 September 2010 - 03:20 PM

Isn't the second bracket a different/wrong way around?

Edited by KingOfIdiocy, 30 September 2010 - 03:23 PM.


#6 groovicus

groovicus
  • Topic Starter

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:51 PM

Posted 30 September 2010 - 03:33 PM

Isn't the second bracket a different/wrong way around?

Yes it is.

#7 chromebuster

chromebuster

  • Members
  • 899 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:the crazy city of Boston, In the North East reaches of New England
  • Local time:09:51 PM

Posted 05 October 2010 - 03:49 PM

Two questions. One, what was the query, and two, what language is that? It looks like C#, but I can't tell.

The AccessCop Network is just me and my crew. 

Some call me The Queen of Cambridge


#8 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:06:51 PM

Posted 05 October 2010 - 04:13 PM

Chromebuster, it's PHP. You can tell because of the $s in front of all the variable names.
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

#9 groovicus

groovicus
  • Topic Starter

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:51 PM

Posted 05 October 2010 - 05:52 PM

The query contained proprietary information and was thus sanitized. I want to keep my job. :thumbsup:

#10 chromebuster

chromebuster

  • Members
  • 899 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:the crazy city of Boston, In the North East reaches of New England
  • Local time:09:51 PM

Posted 07 October 2010 - 04:27 PM

Oopsies! My bad! I can't believe I missed the language thing though! Well, maybe I can since my current screen reader doesn't show me those little details. JAWS does, but not System Access which is the one I'm using till I get my own computer back from the Gordon support folks since they're going to reimage my system from a recent hard drive failure.

The AccessCop Network is just me and my crew. 

Some call me The Queen of Cambridge


#11 Joombaga

Joombaga

  • Members
  • 50 posts
  • OFFLINE
  •  
  • Location:Big Rapids, Michigan, United States
  • Local time:08:51 PM

Posted 07 October 2010 - 05:50 PM

Fuuuuuuuuuuuuuuuuuuuuuuu

I spent an hour once trying to find an error like that. We'll get time travel before we get intuitive compilers.

#12 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,250 posts
  • ONLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:06:51 PM

Posted 08 October 2010 - 07:00 PM

we'll get time travel before we get intuitive compilers.

Honestly, how hard would it be for a compiler or interpreter to check for mismatched brackets? :thumbsup:

Groovicus, I find that an editor that highlights bracket/parenthesis pairs is a great help in catching these things earlier:
Posted Image
Or:
Posted Image

Edited by Andrew, 08 October 2010 - 07:02 PM.


#13 Romeo29

Romeo29

    Learning To Bleep


  • BC Advisor
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:08:51 PM

Posted 08 October 2010 - 07:22 PM

Andrew you forgot to tell which editors you have shown us.

I can recognize the bottom one is Notepad++ which also highlights matching brackets :thumbsup:

#14 groovicus

groovicus
  • Topic Starter

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:07:51 PM

Posted 09 October 2010 - 11:27 AM

Andrew, I use Notepad++ which does do highlighting. However bracket matching breaks down when there is html, javascript, and php all interspersed on the same page. There is no way a compiler can tell what goes where.

#15 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,250 posts
  • ONLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:06:51 PM

Posted 09 October 2010 - 11:56 AM

Yeah, those were Notepad++

Groovy, if it breaks down then the only option is for you to sit down and write a patch for NPP! :thumbsup:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users