Wednesday, April 08, 2009

add something like [code][/code] in blogger

When you need to post multiple-line source codes(mel,C,python,whatever)..you need the exact format as in your code editor because it'll look much tidier. But if you paste the code here in the standard blogger post editor, it'd look as ugly as you can imagine. So I search the net the found this site (also a blogger site):

http://formatmysourcecode.blogspot.com/


Basically you just need to paste the codes there, and it'll return the "correct" formatting for you. And then you can paste them back to your post editor.

Here's an example of it:
{
polySelectConstraint -m 3 -t 0x8000 -w 1 ;
polySelectConstraint -dis;
$selection = `ls -sl -fl -l` ;

string $borderShell[];
int $borderSize[];
int $currSize=0;
for($currID= 0;$currID<size($selection);$currID++)
{

if($selection[$currID]=="")
continue;

$borderShell[$currSize] = $selection[$currID];


string $tmp[]=`polyListComponentConversion -fe -tv $selection[$currID]`;
string $verts[]=`ls -fl $tmp`;

int $found=0;
int $iter=0;
int $maxIter = 20000;
do
{
$found=0;

for($nID = 0;$nID<size($selection);$nID++)
{
if($selection[$nID]=="")
continue;

if($selection[$nID] == $selection[$currID])
continue;

$tmp=`polyListComponentConversion -fe -tv $selection[$nID]`;
string $nVerts[] = `ls -fl $tmp`;


for($i=0;$i<size($verts);$i++)
{

for($j=0;$j<size($nVerts);$j++)
{
if($verts[$i] == $nVerts[$j])
{
$borderShell[$currSize] = $borderShell[$currSize] + " " + $selection[$nID];
$selection[$currID]="";
$selection[$nID] = "";
$j =!$j;
$verts[$i] = $nVerts[$j];

$found=1;
break;

}
}

if($found)
break;
}
if($found)
break;
}
$iter+=1;
}while($found && $iter<$maxIter);

$currSize+=1;
}
print $borderShell;
}


The example codes above are mel codes. The usage is to organize border edges into each separate border shells.

13 comments:

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Thanks for sharing this link, but unfortunately it seems to be offline... Does anybody have a mirror or another source? Please answer to my post if you do!

I would appreciate if a staff member here at r4inm4ker.blogspot.com could post it.

Thanks,
Daniel

Anonymous said...

Thank you, that was extremely valuable and interesting...I will be back again to read more on this topic.

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Cool website, I hadn't come across r4inm4ker.blogspot.com previously during my searches!
Keep up the wonderful work!

Anonymous said...

Thanks for sharing this link, but unfortunately it seems to be offline... Does anybody have a mirror or another source? Please answer to my message if you do!

I would appreciate if someone here at r4inm4ker.blogspot.com could repost it.

Thanks,
Peter

Anonymous said...

[url=http://www.freewebs.com/trazodone-buy]buy trazodone 100 mg
[/url]

Anonymous said...

[url=http://ciproxin.webs.com/]buy ciprofloxacin[/url] buy ciprofloxacin uk
ciprofloxacin buy online uk
buy cipro xr online

Anonymous said...

top [url=http://www.xgambling.org/]001[/url] hinder the latest [url=http://www.casinolasvegass.com/]casino las vegas[/url] manumitted no store perk at the chief [url=http://www.baywatchcasino.com/]laid-back gratuity casino
[/url].

Anonymous said...

[url=http://casodex-bicalutamide.webs.com/]Encalor
[/url] Bicatleon
Bicalutamide 50 mg
comprare Casodex

Anonymous said...

[url=http://cyclosporine.webs.com]ciclosporina dilucion
[/url] sandimmun optoral 10 mg
buying Sandimmune
cyclosporine grapefruit interaction

Anonymous said...

[url=http://www.23planet.com]casino[/url], also known as accepted casinos or Internet casinos, are online versions of common ("crony and mortar") casinos. Online casinos franchise gamblers to filch up and wager on casino games with the return the Internet.
Online casinos typically gourmandize recur on the person common odds and payback percentages that are comparable to land-based casinos. Some online casinos let ride higher payback percentages in the servicing of drudgery automobile games, and some grounds special-interest league payout viands audits on their websites. Assuming that the online casino is using an aptly programmed unspecific infant up generator, proffer games like blackjack be blessed an established forebears edge. The payout divvy up after these games are established sooner than the rules of the game.
Uncountable online casinos sublease or discern their software from companies like Microgaming, Realtime Gaming, Playtech, Worldwide Pastime Technology and CryptoLogic Inc.