The [Challenge] Index

Where we keep all the boring tidbits about the PHPDN site, the news, and what not.

Moderator: General Moderators

Re: The [Challenge] Index

Postby CliveRush » Tue Apr 13, 2010 11:50 pm

Hello,

According to me everyone should have to take challenge in life. If you take challenge then you get confidence in doing work and after that you will get success.

Thanks
Clive Rush
CliveRush
Forum Newbie
 
Posts: 7
Joined: Tue Apr 13, 2010 1:50 am
Location: California

Re: The [Challenge] Index

Postby Grizzzzzzzzzz » Thu Apr 22, 2010 8:00 am

User avatar
Grizzzzzzzzzz
Forum Contributor
 
Posts: 125
Joined: Wed Sep 02, 2009 8:51 am

Re: The [Challenge] Index

Postby phu » Fri Apr 23, 2010 11:49 am

onion2k wrote:
phu wrote:How about something practical?

I don't really think that's a good idea. The point of coding challenges is to find interesting and inventive solutions to arbitrary problems - it's very likely those solutions won't necessarily be the best ones from a readability, efficiency or practical point of view.

Seriously? If you're not going to go for readability, efficiency or practicality, what is the value? Solving "arbitrary problems" in PHP is very nearly worthless; if it's not a web-based scenario, using PHP just provides a massive handicap.

Yeah, you can do all the fun string manipulation you want, reimplement A*, or tackle any other academic programming problem you can find on Wikipedia, but if you aren't learning anything with a practical web application, something more efficient than you might otherwise do, something more readable than the typical PHP way of doing it, you're not helping yourself or anyone else.

I guess if it's just an exercise in wasting time, that's your call, but it seems pretty inane to actively avoid doing anything useful.

And if you're afraid of people using your security-hole-ridden code... well, you can post a disclaimer and make it their problem. You could also make part of the exercise using good input sanitization practices. Besides, if you intend for people to post unreadable, inefficient and impractical code, you're already doing plenty of damage to anyone who might read it without understanding that the methods being used are just plain poor.
phu
Forum Commoner
 
Posts: 61
Joined: Tue Mar 30, 2010 6:18 pm

Re: The [Challenge] Index

Postby Benjamin » Fri Apr 23, 2010 12:20 pm

phu wrote:Seriously? If you're not going to go for readability, efficiency or practicality, what is the value? Solving "arbitrary problems" in PHP is very nearly worthless;


Generally, the simplest solution is the correct one. I don't think it's a stretch to say that the simplest solution would also be the most readable, efficient or practical. Or at least close to it.

phu wrote:if it's not a web-based scenario, using PHP just provides a massive handicap.


PHP is only one level above C, which is only one level above ASM. So I wouldn't consider that a massive handicap. Visual basic on the other hand...

phu wrote:Yeah, you can do all the fun string manipulation you want, reimplement A*, or tackle any other academic programming problem you can find on Wikipedia, but if you aren't learning anything with a practical web application, something more efficient than you might otherwise do, something more readable than the typical PHP way of doing it, you're not helping yourself or anyone else.


This is simply not true. Finding unique solutions to solving problems, without any constraints allows for very creative use of the language. Various different and creative methods for solving similar problems can be very educational for programmers who may not realize that X can even be done.

phu wrote:I guess if it's just an exercise in wasting time, that's your call, but it seems pretty inane to actively avoid doing anything useful.


I don't believe we are "actively avoiding doing anything useful". You are welcome to post your own challenge meeting your criteria. We certainly won't stop you.

phu wrote:And if you're afraid of people using your security-hole-ridden code...


That is cynical.

phu wrote:well, you can post a disclaimer and make it their problem. You could also make part of the exercise using good input sanitization practices. Besides, if you intend for people to post unreadable, inefficient and impractical code, you're already doing plenty of damage to anyone who might read it without understanding that the methods being used are just plain poor.


I don't remember seeing any unreadable, inefficient or impractical code being posted as a result of any challenges. I would argue that code which solves the intended problem is not impractical.

I think you are viewing this from the perspective that the challenges need to be "taken more seriously". If this was the case, I would doubt anyone would participate, so good luck with that.
Image
User avatar
Benjamin
Site Administrator
 
Posts: 6866
Joined: Sun May 19, 2002 10:24 pm

Re: The [Challenge] Index

Postby phu » Fri Apr 23, 2010 2:13 pm

Benjamin wrote:Generally, the simplest solution is the correct one. I don't think it's a stretch to say that the simplest solution would also be the most readable, efficient or practical. Or at least close to it.

That's a gross oversimplification. The simplest possible solution to a real-world problem will often miss edge cases and lack expandability. In any case, the simplicity of a solution has absolutely no direct correlation to its correctness.

Benjamin wrote:PHP is only one level above C, which is only one level above ASM. So I wouldn't consider that a massive handicap.

That's extremely misleading, and the assertion is (unfortunately) very much incorrect. PHP is implemented in C, yes; however, it does not expose nearly all of the constructs you'd have at your disposal were you writing C, nor does it come close to touching the power of other dynamic languages like Ruby and Python. Metaclasses, inner classes, closures, higher-order functions... these are things that can be exceptionally useful that don't (and aren't likely to ever) exist in PHP.

Benjamin wrote:This is simply not true. Finding unique solutions to solving problems, without any constraints allows for very creative use of the language. Various different and creative methods for solving similar problems can be very educational for programmers who may not realize that X can even be done.

It's not nearly as useful as that in a general programming sense. PHP has its uses, but there are very good reasons you'll never see it in a serious computer science program. This is why I suggested relevant challenges: They're far more useful for people to whom PHP is programming as well as diverse programmers who are currently using PHP.

Benjamin wrote:I don't believe we are "actively avoiding doing anything useful". You are welcome to post your own challenge meeting your criteria. We certainly won't stop you.

That's exactly what the post I was replying said should avoid being done. I did, in fact, post a challenge idea that I consider practical, interesting, and useful in the context of PHP web programming.

Benjamin wrote:
phu wrote:And if you're afraid of people using your security-hole-ridden code...

That is cynical.

Once again... I was directly addressing the concerns of the poster I replied to. In his own words. I even made suggestions to avoid that situation; call it cynical if you want, but at least keep it in context, as it's also potentially helpful.

Benjamin wrote:I don't remember seeing any unreadable, inefficient or impractical code being posted as a result of any challenges. I would argue that code which solves the intended problem is not impractical.

It hardly matters if the problem at hand doesn't address anything the language would reasonably be used for. Learning to implement something in PHP that you wouldn't use in that language does not necessarily help you implement it in any other language, where the available libraries and constructs are likely to be vastly different.

Benjamin wrote:I think you are viewing this from the perspective that the challenges need to be "taken more seriously". If this was the case, I would doubt anyone would participate, so good luck with that.

That is presumptuous (and, hey, a little bit cynical).

My suggestion was meant to be taken at face value: A challenge in PHP could absolutely be a good thing, but is not nearly as helpful to the people doing it or the people reading about it if it's not oriented towards a problem that it'd be a rational choice for.

I stopped in asking for help... I kind of got it (which is to say I determined I couldn't do what I wanted to in PHP), so I hit a bunch of threads here to help other people out, and tried suggesting something to help the challenges improve their participants' practical skills (since that seems like a pretty reasonable objective given the nature of these forums).

Anyway, I'm not gonna harp on it any more. It's the difference between idle curiosity and active self-improvement.
phu
Forum Commoner
 
Posts: 61
Joined: Tue Mar 30, 2010 6:18 pm

Re: The [Challenge] Index

Postby Benjamin » Fri Apr 23, 2010 3:58 pm

phu wrote:Implement regex-based URL routing: Given a URL, passed by the web server to your front controller, find the most efficient way to match said arbitrary URL against an arbitrarily large list of URL regex's, with an emphasis on avoiding the overhead of repeated preg_match (or similar) calls.


Create a post outlining the requirements and then post a link to it here. I think URL segments would be much more efficient than pattern matching, because arrays could be used in combination with isset, which is extremely fast.
Image
User avatar
Benjamin
Site Administrator
 
Posts: 6866
Joined: Sun May 19, 2002 10:24 pm

Re: The [Challenge] Index

Postby phu » Sat Apr 24, 2010 12:14 am

Benjamin wrote:Create a post outlining the requirements and then post a link to it here. I think URL segments would be much more efficient than pattern matching, because arrays could be used in combination with isset, which is extremely fast.

I really wonder how you would deal with strict data types of varying values. That's part of the reason I suggested this in the first place.

I have tried to better define it as requested:
http://forums.devnetwork.net/viewtopic.php?f=1&t=115687
phu
Forum Commoner
 
Posts: 61
Joined: Tue Mar 30, 2010 6:18 pm

Re: The [Challenge] Index

Postby Darhazer » Sat Jul 03, 2010 8:45 am

User avatar
Darhazer
DevNet Resident
 
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: The [Challenge] Index

Postby AbraCadaver » Sun Jul 18, 2010 1:03 pm

It would be nice to have a challenge every week or so: viewtopic.php?f=1&t=118794
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
User avatar
AbraCadaver
DevNet Master
 
Posts: 2572
Joined: Mon Feb 24, 2003 11:12 am
Location: The Republic of Texas

Re: The [Challenge] Index

Postby klevis miho » Fri Aug 06, 2010 6:02 am

It would be better to have a system of challenges.
You can paste the code, the system checks if it is right, then the user gains points :).
klevis miho
Forum Contributor
 
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania

Re: The [Challenge] Index

Postby timWebUK » Tue Aug 17, 2010 6:10 am

Facebook has a really good section for that - although it is quite tough. They use it for recruitment.

http://www.facebook.com/careers/puzzles.php
User avatar
timWebUK
Forum Contributor
 
Posts: 239
Joined: Thu Oct 29, 2009 6:48 am
Location: UK

Re: The [Challenge] Index

Postby Jonah Bron » Fri Sep 03, 2010 5:09 pm

Who can do this in one SQL command? :)

viewtopic.php?t=120650#p622729
User avatar
Jonah Bron
DevNet Master
 
Posts: 2765
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: The [Challenge] Index

Postby McInfo » Fri Sep 17, 2010 6:08 pm

Reverse Engineering - Deconstruct obscured code.
User avatar
McInfo
DevNet Resident
 
Posts: 1531
Joined: Wed Apr 01, 2009 1:31 pm

Re: The [Challenge] Index

Postby VladSun » Sun Oct 17, 2010 4:38 pm

http://ai-contest.com/index.php

While I'm not suggesting to use this as a challenge I like the scheme of challenging - create an algorithm that plays against another algorithm :) Definitely there should be a playback (video or something like this)

Playing against other members of the forum and winning the 1st prize is the biggest challenge ever :)

Now we have to think of games that could be used for such a challenge ...
User avatar
VladSun
DevNet Master
 
Posts: 4294
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: The [Challenge] Index

Postby Designer » Fri Nov 19, 2010 3:19 pm

I hope this falls within the remit of this board and forum topic.

It concerns finding a simple and tidy solution to problem that I'm trying to solve right now, but is very general and would prove useful to many in future.

To attempt this task you are likely to need knowledge of Ajax, javascript, php & maybe JQuery?

I need to create a form with ajax validation to accept an email address and password, pretty standard, BUT then once validation has been successful - reload a completely new page.

The problem I'm having is reloading the new page with a new URL. All code so far, keeps loading the new page where the form originally existed. :banghead:

Target Audience - Ajax or JQuery experts?
Designer
Forum Newbie
 
Posts: 12
Joined: Fri Nov 19, 2010 6:57 am

PreviousNext

Return to Site News

Who is online

Users browsing this forum: No registered users and 1 guest

cron