SunQuest
           Suggestions & Feedback
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsForum InformationSuggestions & Feedback

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old January 21st, 2003, 05:16 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Wrapping in code...

Would you consider making sections of posts within 'code', and 'php' tags nowrap? It might make reading the textual portions of posts less convenient due to horizontal scrolling, but the code would be much more neat, thus easier to read.

Reply With Quote
  #2  
Old January 21st, 2003, 10:12 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Wrapping in code...

php Code:
Original - php Code
  1.  
  2. this_is_an_example_why_it_might_not_be_such_a_good  _idea__i_dont_know_but_i_dont_think_i_would_like_i  t__not_only_that_it_doesnt_wrap_that_code__but_sin  ce_all_of_the_posts_are_in_a_single_table__it_does  nt_wrap_even_your_post_now__see();

Reply With Quote
  #3  
Old January 21st, 2003, 10:59 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Wrapping in code...

I understand your point,
Quote:
It might make reading the textual portions of posts less convenient
due to horizontal scrolling, but the code would be much more neat,
thus easier to read.

but (since you've widened this post already) the following short bit
of code

Code:
function resizeImage($imptr,$w,$border=1){
    $old_w=ImageSX($imptr);
    $old_h=ImageSY($imptr);
    $new_w=$w;
    $new_h = ($old_h*$new_w)/$old_w;    
    $dst_img=ImageCreate($new_w,$new_h);
    ImageCopyResized ($dst_img,$imptr,0,0,0,0,$new_w,$new_h,$old_w,$old  _h);
    if ($border){
        $black = ImageColorAllocate ($dst_img, 0, 0, 0);
        imagerectangle ( $dst_img, 0, 0, $new_w-1, $new_h-1, $black);
    }
    return $dst_img;
}


is much easier to read, especially if you're
trying to get your head around an idea,
than the following:

Code:
function resizeImage($imptr,$w,$border=1){
    $old_w=ImageSX($imptr);
    $old_h=ImageSY($imptr);
    $new_w=$w;
    $new_h = ($old_h*$new_w)/$old_w;    
    $dst_img=ImageCreate($new_w,$new_h);
    ImageCopyResized 
($dst_img,$imptr,0,0,0,0,$new_w,$new_h,$old_w,$old  _h);
    if ($border){
        $black = ImageColorAllocate 
($dst_img, 0, 0, 0);
        imagerectangle ( $dst_img, 0, 0, $new_w-
1, $new_h-1, $black);
    }
    return $dst_img;
}


which is how it appears for me at 1280*1024(not fullscreen).
I'm only suggesting this to make things clearer for people
trying to learn. (If you wanted to get really crazy, you could
you could insert an html linebreak every 15th or 20th word in
text outside of the 'code' tags.) Probably not though.
Just a suggestion...

Reply With Quote
Reply

Viewing: Codewalkers ForumsForum InformationSuggestions & Feedback > Wrapping in code...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway