Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
[code avisynth]a = AVISource("movie.avi") b = a.PointResize(a.width * 8, a.height * 8) d = ImageSource(file="logo1080pgb.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24() e = BlankClip(d, audio_rate=44100, channels=2) f = AudioDub(d, e).Lanczos4Resize(b.width, b.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator) last = f + b ConvertToYV24(chromaresample="point") ConvertToYV12(chromaresample="point") return last[/code] [code] tags hate me. :(
Joined: 7/2/2007
Posts: 3960
You have to tell it what language you're using, e.g. [ code python ] Insert python code here [ /code ]
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
I did use [code avi]... [code avisynth] also breaks. Must need more testing, I guess.
Post subject: Now using a filename!
Joined: 11/11/2006
Posts: 1235
Location: United Kingdom
[code CaptainObvious.java] package iliketurtles; import java.io.*; public class CaptainObvious { private String superArgument = ""; private int counter = 0; public static void main(String[] args) { for (int i=0;i < args.length; i++) { System.out.println("Argument "+i+" was "+args+"!"); superArgument += args; counter++; //I know, I know... I'm just testing the code tag :P } System.out.println("Mash it up and we get: "+superArgument); System.out.print(", a total of "+counter+" arguments!\n"); } }[/code]
<adelikat> I am annoyed at my irc statements ending up in forums & sigs
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Okay, while testing this along with Brushy and Raiscan, we noticed that phpBB's HTML engine screws with posts that contain < (less than) or > (greater than) and deletes segments of them before the post even hits the database or my bbcode engine. If you want to include < (less than) or > (greater than) in a post, especially when you're displaying code, make sure you check: "Disable HTML in this post" in the posting options. Note, you can't do it after you've already posted, by going back to edit your post, as phpBB will already have destroyed the post at that point.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Thanks to lots of testing from Raiscan and some good ideas from him, some issues have been resolved, and the code tag now allows specifying a filename instead of a language. Then the filename will appear in the code block, and the language for highlighting will be automatically detected from the extension of the filename. Example: Download fork.bat
Language: batch

@echo off :fork echo Fork start fork goto :fork
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Patashu
He/Him
Joined: 10/2/2005
Posts: 4043
Nach wrote:
Okay, I made some cosmetic improvements, and now [ s ] Strikethrough Text[ /s ] is also supported.
Hooray! Strikethrough is the most important tag in existence.
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Player (36)
Joined: 9/11/2004
Posts: 2630
[code perl]$_='ngif';tr/\146\147\151\156/\126\122\107\101/;/(.{2})$/;$"=$';foreach${$&}(@{qq^$_^}){${"$_\$$#{$_}"}{${qq/\107\126/}}=q^\^^;}++$";foreach(keys%{qq#$`$&\$1#}){open(${$"},$_);(print)while<GV>;}[/code] Perl parser breaks when attempting to use # as a qq delimiter. Generically does not handle parsing q and qq properly. [code perl]$test <<EOF This should be highlighted red. EOF; $moar = $code;[/code]
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
I suppose I'll have to join the code-testing craze with some C++... [code c++]#include <set> #include <string> #include <iostream> #include <iterator> #include <algorithm> #include <functional> #include <cctype> std::string processString(std::string s) { s.erase(std::remove_if(s.begin(), s.end(), std::not1(std::ptr_fun(isalpha))), s.end()); std::transform(s.begin(), s.end(), s.begin(), toupper); return s; } int main() { typedef std::istream_iterator<std::string> InIt; std::set<std::string> words; std::transform(InIt(std::cin), InIt(), std::inserter(words, words.end()), processString); std::copy(words.begin(), words.end(), std::ostream_iterator<std::string>(std::cout, "\n")) ; }[/code] Although this is a more interesting program: [code c++]#include <iostream> int main() { std::cout<<"P2 400 400 100"; for(int y=0;y<400;++y) for(int x=0,n;n=0,x<400;std::cout<<" "<<n,++x) for(double r=x*3e-5-1.259,i=y*3e-5-.35,zr=0,zi=0,zr2,zi2; zr2=zr*zr,zi2=zi*zi,zr2+zi2<4&&++n<100; zi=2*zr*zi+i,zr=zr2-zi2+r); }[/code] Run the latter like:
./program | display -
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I have to wonder... Why did you not use the already existing syntaxhighlighting class that is behind the SRC_EMBED code in the main site? It has a great coverage of different languages (and a cooler color theme selection!)*. I'm just sad seeing that my code is not being used :( *) At least, when you upgrade it in case it's an older version So here's my test on PHP, from http://bisqwit.iki.fi/story/howto/php/#StringConstructs. [code php]<?php // These two statements are equivalent: $a = "Apples are $x each."; $a = 'Apples are ' . $x . ' each.'; // These two statements are equivalent: $a = "Apples are \$x each."; $a = 'Apples are $x each.'; // These three statements are equivalent: $a = "Your {$item->name} is {$item->kind} and expires in {$item->eta} days."; $a = "Your ${item->name} is ${item->kind} and expires in ${item->eta} days."; $a = 'Your ' . $item->name . ' is ' . $item->kind . ' and expires in ' . $item->eta . ' days.'; // These four statements are equivalent: $a = "The file is {$stat["size"]} bytes long."; $a = "The file is {$stat['size']} bytes long."; $a = 'The file is ' . $stat["size"] . ' bytes long.'; $a = 'The file is ' . $stat['size'] . ' bytes long.'; // Variable inclusions may be very complex, even recursive, // to the chagrin of writers of syntax highlighters. // These two statements are equivalent: $a = "This is {$table["subtable{$subnums["current"]}"][$position['now']]}."; $a = 'This is ' . $table[ 'subtable' . $subnums['current'] ] [ $position['now'] ] . '.'; /* still in sync? */[/code] Another one, of BASIC:[code basic]10 DEFINT A-Z 20 SCREEN 0: WIDTH 40,25: KEY OFF 30 ' Define all distinct tetromino shapes as bitmasks 31 DATA CC,8C4,6C,4444,F0,264,C6,E4,4C4,4E0,464,8E,C88,E2,226,2E,88C,E8,622 32 REM e.g. 8C4 = 1000, 2E = 0010 33 REM 1100 1110 34 REM 0100 and so on. 35 DIM SHAPES(18): FOR A=0 TO 18: READ S$: SHAPES(A)=VAL("&H"+S$): NEXT 40 ' Define the mappings of block number -> block shape 41 DATA 0,0,0,0, 1,2,1,2, 3,4,3,4, 5,6,5,6, 7,8,9,10, 11,12,13,14, 15,16,17,18 45 DIM INDICES(28): FOR A=0 TO 27: READ INDICES(A): NEXT 50 ' This function reads the given slot from the given block in given rotation. 52 DIM BITMASKS(15): FOR A=0 TO 14: BITMASKS(A) = 2^A: NEXT'Note: 2^15=overflow 55 DEF FNBLOCK(BL,ROT,X,Y) = SHAPES(INDICES(BL*4+ROT))AND BITMASKS(Y*4+X) 900 ' Subroutine for drawing a "pixel", i.e. one block slot. 901 ' Params: x,y, c 910 LOCATE Y+1,X+1: AREA(X,Y)=C 920 IF C THEN COLOR C AND 15: PRINT CHR$(219); : RETURN 930 COLOR 1: PRINT FNEMPTY$(X); 940 RETURN 999 WIDTH 80: COLOR 7,0: PRINT "GAME OVER": KEY ON: END ' simple.[/code]Gotcha. And for C++: [code c++]template<typename T> struct Array256x256of: public Array256x256of_Base { public: T data[256*256]; public: Array256x256of() { } virtual ~Array256x256of() { } public: virtual uint32 GetLive(unsigned method, unsigned index, unsigned timer) const { return (data[index].*(T::methods[method]))(timer); } virtual uint32 GetStatic(unsigned index) const { return GetLive(bgmethod, index, 0); } virtual void Set(unsigned index, uint32 p, unsigned timer) { data[index].set(p, timer); } };[/code]
Post subject: Re: Now using a filename!
Patashu
He/Him
Joined: 10/2/2005
Posts: 4043
pretentious java code golfing (with line breaks added in) [code java]class A{static{try{for(int i=0,j,z=System.in.read()&7,k=z*6-2;i<k;i++){ for(j=0;j<(j<k?3*Math.min(z+i,k*5/6f-i):0);)System.out.print(" \\__/ ".charAt(j++>3*Math.max(z-i-1,i-3*z)?(i*3+j)%6:5)); System.out.println();}}catch(Exception e){}}} [/code]
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Bisqwit wrote:
I have to wonder... Why did you not use the already existing syntaxhighlighting class that is behind the SRC_EMBED code in the main site?
1) I didn't know about it. 2) It doesn't seem to highlight enough
Bisqwit wrote:
It has a great coverage of different languages (and a cooler color theme selection!)*.
It misses crucial things like AVISynth. I believe what I'm doing has more language support. If there's a language you'd like to see, and I don't support, just let me know.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Post subject: Even more updates!
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Code when used with a filename can be downloaded. Let me know if there are any mime type issues. Code now has long lines word wrapped. [left], [right], and [center] has been added to the list of posting buttons, which have also been reordered a bit. Demonstration: Download image_factory.cpp
Language: cpp

//Based on idea from http://insanecoding.blogspot.com/2010/07/time-to-shutdown-factory-for-code.html and http://insanecoding.blogspot.com/2010/07/simplifying-bootstrapping-for-virtual.html by the way, did you know that this is a really really really really really long line? template<typename T> struct Array256x256of: public Array256x256of_Base { public: T data[256*256]; public: Array256x256of() { } virtual ~Array256x256of() { } public: virtual uint32 GetLive(unsigned method, unsigned index, unsigned timer) const { return (data[index].*(T::methods[method]))(timer); } virtual uint32 GetStatic(unsigned index) const { return GetLive(bgmethod, index, 0); } virtual void Set(unsigned index, uint32 p, unsigned timer) { data[index].set(p, timer); } };
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
gocha
Any
Emulator Coder, Former player
Joined: 6/21/2006
Posts: 401
Location: Japan, Nagoya
I'll be happy if twitvid is supported by video tag. Link to video Google Search: yahoo
I am usually available on Discord server or Twitter.
Skilled player (1651)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
Awesome, you added the Script download button! Bad ass!
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
You've seen it here first. [1368] SNES Super Metroid by Taco & Kriole in 38:41.52 Check out this movie! #2784: nitsuja, upthorn & marzojr's Genesis Sonic 3 & Knuckles in 32:05.52 Check out this submission! Wiki: Nach My friend Made with: [movie]1368[/movie] [movie=1346]Check out this movie![/movie] [submission]2784[/submission] [submission=2765]Check out this submission![/submission] [wiki]Nach[/wiki] [wiki=Raiscan]My friend[/wiki] I also added [noparse], [thread], and [post]
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
No longer shall I mess around with [url] tags!
Skilled player (1326)
Joined: 9/7/2007
Posts: 1354
Location: U.S.
Nach, You are now considered a not-evil admin. How do you feel?
Skilled player (1651)
Joined: 11/15/2004
Posts: 2202
Location: Killjoy
OOoooh, how about for submissions [obsoletes] which tells the frame difference in frames and time, and links to the old movie! As long as we are doing awesomeness...
Sage advice from a friend of Jim: So put your tinfoil hat back in the closet, open your eyes to the truth, and realize that the government is in fact causing austismal cancer with it's 9/11 fluoride vaccinations of your water supply.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Flygon wrote:
No longer shall I mess around with [url] tags!
Flygon, you no longer need to use a hack like [ur[b][/b]l], just use the new [noparse] tag.
Rant Below
Sonikkustar wrote:
Nach, You are now considered a not-evil admin. How do you feel?
NOOOOOOOOOOOOOO. I am EVIL, you hear me? Evil!
DarkKobold wrote:
OOoooh, how about for submissions [obsoletes] which tells the frame difference in frames and time, and links to the old movie! As long as we are doing awesomeness...
I think you mean movies. I like that idea, but I'll need to work in more DB hooks for that. I'll look into it after I make it autogenerate names for movie titles, submissions, topic and post, when you don't specify your own.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
gocha wrote:
I'll be happy if twitvid is supported by video tag. Link to video
Done. Along with several other sites. Although not syncing the main site code base just yet, due to other changes made recently. Your video should appear whenever we do sync it.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
NitroGenesis
He/Him
Editor, Experienced player (556)
Joined: 12/24/2009
Posts: 1873
Today I beat Hammerin Harry (J) in 10:50.87 That's cool.
YoungJ1997lol wrote:
Normally i would say Yes, but thennI thought "its not the same hack" so ill stick with meh.
Skilled player (1326)
Joined: 9/7/2007
Posts: 1354
Location: U.S.
Nach hasnt mentioned this uet, but theres now USTREAM support! Horray!
Emulator Coder
Joined: 3/9/2004
Posts: 4588
Location: In his lab studying psychology to find new ways to torture TASers and forumers
Sonikkustar wrote:
Nach hasnt mentioned this uet, but theres now USTREAM support! Horray!
There's now support for ~15 different sites and a slew of other things. Youtube playlists in video tags for example is now supported.
Warning: Opinions expressed by Nach or others in this post do not necessarily reflect the views, opinions, or position of Nach himself on the matter(s) being discussed therein.
Senior Moderator
Joined: 8/4/2005
Posts: 5777
Location: Away
Holy shit, Nach. Mad respect for you, man!
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.