BleepingComputer.com: Guess how long this took?

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Guess how long this took?

#16 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 09 October 2010 - 05:08 PM

If I remember my classes correctly, that is an NP complete problem. If I could solve that, I would be filthy rich and inline for a Nobel prize.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#17 User is offline   Andrew 

  • Bleepin' Night Watchman
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 7,423
  • Joined: 05-December 05
  • Gender:Not Telling
  • Location:Right behind you

Posted 09 October 2010 - 06:28 PM

View Postgroovicus, on Oct 9 2010, 03:08 PM, said:

If I remember my classes correctly, that is an NP complete problem. If I could solve that, I would be filthy rich and inline for a Nobel prize.

Yes. So why don't you? Wealth and fame are good things!
Help us help you. If HelpBot replies, you MUST follow step 1 in its reply so we know you need help.
Posted Image
Boredom Software Stop Highlighting Things

#18 User is offline   Billy O'Neal 

  • Bleepin Engineer GRADUATE
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Malware Response Instructor
  • Posts: 10,407
  • Joined: 17-January 08
  • Gender:Male
  • Location:Cleveland, Ohio

Posted 09 October 2010 - 06:38 PM

I don't see what would be NP-Complete about it. It would require a complicated compiler though. Any such parser/lexer would need to be able to recognize all three languages and highlight accordingly.

It's difficult, but by no means impossible.... It might not be possible with the popular LALR(1) parser generators, such as YACC, though.

Billy3

#19 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 09 October 2010 - 07:26 PM

phpDesigner can highlight CSS/XHTML/JS/PHP all at the same time - they call it intelligent highlighting. It also does the syntax checking for all these languages as you type . It is like MS Visual Studio's IntelliSense. One missing bracket and it will flag red warning at bottom.

#20 User is offline   chromebuster 

  • Distinguished Member
  • PipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 815
  • Joined: 06-May 10
  • Gender:Female
  • Location:the crazy city of Boston, In the North East reaches of New England

Posted 14 October 2010 - 10:53 PM

Well doesn't it make sense that the compiler wouldn't know what goes where if several different languages were interspersed on the same page? Is it not a rule that each project must be always in the same programming language?
Raeder24. We're for community, accessibility for the blind, and technology support. Founded in 2008. join our community at raeder24.org

#21 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 15 October 2010 - 08:28 AM

Thanks Romeo, now I have to go back to my CS books and see which problem discussed nested brackets. :thumbsup: I wonder if that was dealing with finite automata? I am giving phpDesigner a test run. It is promising that it doesn't choke on 10,000 line files, but it seems silly that there is a drop down menu option for inserting a line comment indicator.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#22 User is offline   Billy O'Neal 

  • Bleepin Engineer GRADUATE
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Malware Response Instructor
  • Posts: 10,407
  • Joined: 17-January 08
  • Gender:Male
  • Location:Cleveland, Ohio

Posted 15 October 2010 - 10:41 AM

@groovicus: You can parse nested brackets using a pushdown machine or better. You cannot parse them with either NFAs or DFAs because NFAs and DFAs can only recognize regular languages.

#23 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 15 October 2010 - 10:57 AM

Thanks. I didn't really want to look it up, but it was sort of bugging me. It has been a few years since I took Computational Theory.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#24 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,605
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 11 November 2010 - 10:58 AM

@Romeo, I convinced my boss to buy me a license for PhpDesigner.... I love it. Thanks for the recommendation.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#25 User is offline   Romeo29 

  • Learning To Bleep
  • PipPipPipPipPipPip
  • Find Topics
  • Group: BC Advisor
  • Posts: 2,834
  • Joined: 06-July 08
  • Gender:Not Telling
  • Location:127.0.0.1

Posted 11 November 2010 - 03:20 PM

That's great groovicus :thumbup2: I hope you enjoy working with it :) And you are welcome :)

This post has been edited by Romeo29: 11 November 2010 - 03:25 PM


#26 User is offline   Gordon C 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 3
  • Joined: 10-November 10

Posted 30 December 2010 - 07:13 AM

View PostJoombaga, on 07 October 2010 - 05:50 PM, said:

Fuuuuuuuuuuuuuuuuuuuuuuu

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


Once we get time travel, that statement may not be true. :)

#27 User is offline   Andrew 

  • Bleepin' Night Watchman
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 7,423
  • Joined: 05-December 05
  • Gender:Not Telling
  • Location:Right behind you

Posted 30 December 2010 - 01:48 PM

View PostGordon C, on 30 December 2010 - 07:13 AM, said:

View PostJoombaga, on 07 October 2010 - 05:50 PM, said:

Fuuuuuuuuuuuuuuuuuuuuuuu

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


Once we get time travel, that statement may not be true. :)


That sound you heard just now was my brain blowing a fuse...
Help us help you. If HelpBot replies, you MUST follow step 1 in its reply so we know you need help.
Posted Image
Boredom Software Stop Highlighting Things

#28 User is offline   CrimsonSpider 

  • Member
  • PipPip
  • Find Topics
  • Group: Members
  • Posts: 87
  • Joined: 28-October 10
  • Gender:Male
  • Location:The Matrix

Posted 03 January 2011 - 07:10 PM

Wow,

Programmers worst nightmare! :o

CrimsonSpider
"Don’t worry if it doesn’t work right. If everything did, you’d be out of a job."
(Mosher’s Law of Software Engineering)

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users