May 04, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Derek Parnell | Derek Parnell wrote: > On Fri, 05 May 2006 04:36:30 +1000, Dave <Dave_member@pathlink.com> wrote: > > >> Sure! I'll put it on Wikipedia too. > No prob. - Want to 'wikify' that instead? > Hope you don't mind but here is a more annotated version that shows off a couple of other goodies. > > #!/usr/bin/dmd -run > /* sh style script syntax is supported! */ > /* Hello World in D > To compile: > dmd hello.d > or to optimize: > dmd -O -inline -release hello.d > > To get generated documentation: > dmd hello.d -D > */ > import std.stdio; // References to commonly used I/O routines. > void main(char[][] args) // 'void' here means return 0 by default. > { > // Write-Formatted-Line > writefln("Hello World, " // automatic concatenation of string literals > "Reloaded"); > // auto type inference and built-in foreach > foreach(argc, argv; args) > { > // OOP! > CmdLin cl = new CmdLin(argc, argv); > > // improved 'printf' !! > // user-defined class properties. > writefln(cl.argnum, cl.suffix, " arg: %s", cl.argv); > // Garbage Collection or explicit memory management!!! > delete cl; > } > // Nested structs, classes and functions! > struct specs > { > // all vars. automatically initialized > int count, allocated; > } > > // 'char[][]' reads right to left - an array of an array of chars. > > specs argspecs(char[][] args) > // Optional (built-in) function contracts. > in{ > assert (args.length > 0); // assert built in > } > out(result){ > assert(result.count == CmdLin.total); > assert(result.allocated > 0); > } > body{ > specs* s = new specs; > // no need for '->' > s.count = args.length; // The 'length' property is number of elements. > s.allocated = typeof(args).sizeof; // built-in properties for native types > foreach(argv; args) > s.allocated += argv.length * typeof(argv[0]).sizeof; > return *s; > } > > // built-in string and common string operations, eg. '~' is concatenate. > char[] argcmsg = "argc = %d"; > char[] allocmsg = "allocated = %d"; > writefln(argcmsg ~ ", " ~ allocmsg, > argspecs(args).count,argspecs(args).allocated); > } > /** > Stores a single command line argument. > */ > class CmdLin > { > private { > int _argc; > char[] _argv; > static uint _totalc; > } > > public: > /************ > Object constructor. > params: > argc = ordinal count of this argument. > argv = text of the parameter > */ > this(int argc, char[] argv) > { > _argc = argc; > _argv = argv; > _totalc++; > } > > ~this() // Object destructor > { > // Doesn't actually do anything for this example. > } > > int argnum() /// A property that returns arg number > { > return _argc + 1; > } > char[] argv() /// A property that returns arg text > { > return _argv; > } > wchar[] suffix() /// A property that returns ordinal suffix > { > wchar[] suffix; // Built in Unicode strings (utf8,utf16, utf32) > switch(_argc) > { > case 0: > suffix = "st"; > break; > case 1: > suffix = "nd"; > break; > case 2: > suffix = "rd"; > break; > default: // 'default' is mandatory with "-w" compile switch. > suffix = "th"; > } > return suffix; > } > > /*************** > * A property of the whole class, not just an instance. > * returns: The total number of commandline args added. > *************/ > static typeof(_totalc) total() > { > return _totalc; > } > } > > --Derek Parnell > Melbourne, Australia |
May 04, 2006 Re: Improving the Wiki | ||||
---|---|---|---|---|
| ||||
Posted in reply to Frank Benoit | Frank Benoit wrote: > I posted this a bit earlier: > > Another existing wiki is here > > http://en.wikibooks.org/wiki/Programming:D > > This one is called "book", but it is also a wiki, with a little bit > structure. > > There are no limitations, it is not hosted and dependent on a single > person, mediawiki is widely accepted, ... > The D Wikibook is not appropriate for the kind of info I mentioned. -- Bruno Medeiros - CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D |
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to nick | nick wrote: > clayasaurus wrote: >> nick wrote: > >> Get rid of the D at the top and when you click on links make sure the >> box outline doesn't show up. Other than that it's good. > > Yeah, I can see that the big D is getting no love at all. > > The boxes around the links is firefox's doing; not mine. They don't show > up in IE (or Safari if I recall correctly). Firefox draws a box around > every link you click. If there is a hack around that, let me know and > I'll put it in. Add the onfocus='this.blur()' for the links, like... <a href = "link" onfocus="this.blur()">Link</a> or see this thread http://www.codingforums.com/archive/index.php?t-1801.html for other methods. |
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | clayasaurus wrote: > nick wrote: >> clayasaurus wrote: >>> nick wrote: >> >>> Get rid of the D at the top and when you click on links make sure the >>> box outline doesn't show up. Other than that it's good. >> >> Yeah, I can see that the big D is getting no love at all. >> >> The boxes around the links is firefox's doing; not mine. They don't show >> up in IE (or Safari if I recall correctly). Firefox draws a box around >> every link you click. If there is a hack around that, let me know and >> I'll put it in. > > Add the onfocus='this.blur()' for the links, like... > > <a href = "link" onfocus="this.blur()">Link</a> > > or see this thread http://www.codingforums.com/archive/index.php?t-1801.html for other methods. If you want, see what you score for http://www.alphaworks.ibm.com/tech/adesigner . Just use bugmenot.com for a login. |
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg Wrede | Georg Wrede wrote:
> Bruno Medeiros wrote:
>>
>> Try this for a great show of the potential of CSS and separation of
>> content and presentation:
>> http://www.csszengarden.com/
>
> Ouch!
>
> I used to think I know something about CSS and the separation of content from presentation. This site simply embarrassed me.
Again, I'd like to point out that none of those designs scale properly(ctrl+wheel to see what I mean). This is largely because CSS is inflexible, but the fact remains.
Although they sure are pretty.
|
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Deewiant | Deewiant wrote: >> nick wrote: >>> Yeah, I can see that the big D is getting no love at all. > It'll probably involve more tables to get this done well enough, but I suggest moving it to the top of the sidebar currently at the left... Probably no tables... I'll give it a shot. > Also, I'd suggest an <img> tag with alt text instead of a background image as it currently is: with images off, or a browser that doesn't show them at all, there's nothing at the top of the page remotely resembling a header. I can make an alt tag apply to something else, but I wanted to leave that image configurable via CSS (as is common practice these days). > <nitpick> > Your HTML doesn't validate: if you're going to specify a doctype why not conform > to it? Might as well leave it out unless you're going to fix it. Not useless, the doctype signals IE to fix its box model. However, your point is well taken. I coded it by hand, and never did validate it. Thanks for the reminder. > I'm not entirely sure, but I don't think you need those entities in the banner and sash divs. Browser compatibility, they are needed. > If you can, move the header's HTML code to the bottom of the file: in a text-only browser, it's annoying to have to skip past the menu on every page. Then you can make a "skip to menu" link which is hidden with display: none (off the top of my head... I _think_ Lynx & co. display such anyway, but I'm not sure... it might be some other attribute, but it can be done). I'll see what I can do with a reasonable trade-off between time spent tweaking html/css and productivity. > Other than that, the layout's quite good. <g> Thank you for the constructive criticism. |
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to nick | nick wrote: > Georg Wrede wrote: >> Bruno Medeiros wrote: >>> Try this for a great show of the potential of CSS and separation of >>> content and presentation: >>> http://www.csszengarden.com/ >> Ouch! >> >> I used to think I know something about CSS and the separation of content >> from presentation. This site simply embarrassed me. > > Again, I'd like to point out that none of those designs scale > properly(ctrl+wheel to see what I mean). This is largely because CSS is > inflexible, but the fact remains. > > Although they sure are pretty. They seemed to scale fine for me. However some of the designs aren't as scalable as others, but I don't think that is because of CSS. How is CSS inflexible? And since we're talking about CSS... here's some sites I've found useful: http://www.meyerweb.com/eric/css/edge/ http://css.maxdesign.com.au/listamatic/ http://www.alistapart.com/ http://www.wellstyled.com/ http://www.positioniseverything.net/ Lucas |
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lucas Goss | Lucas Goss wrote: > nick wrote: >> Georg Wrede wrote: >>> Bruno Medeiros wrote: >>>> Try this for a great show of the potential of CSS and separation of >>>> content and presentation: >>>> http://www.csszengarden.com/ >>> Ouch! >>> >>> I used to think I know something about CSS and the separation of content from presentation. This site simply embarrassed me. >> >> Again, I'd like to point out that none of those designs scale properly(ctrl+wheel to see what I mean). This is largely because CSS is inflexible, but the fact remains. >> >> Although they sure are pretty. > > They seemed to scale fine for me. If you increase font size they lose shape, become unreadable, or both. However some of the designs aren't as > scalable as others, but I don't think that is because of CSS. How is CSS inflexible? Don't get me wrong; I think CSS is a step in the right direction. This isn't really the place for CSS discussion, but here is a summary of what annoys me about it: 1. Positioning is often very hard, requires more hacking for compatibility than tables do. /* IE5 Mac Hack... so terrible \ */ 2. You are only allowed one background per div; you should be allowed like 8 to get the desired effect. > And since we're talking about CSS... > here's some sites I've found useful: > http://www.meyerweb.com/eric/css/edge/ > http://css.maxdesign.com.au/listamatic/ > http://www.alistapart.com/ > http://www.wellstyled.com/ > http://www.positioniseverything.net/ Those are pretty useful, thanks. |
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dave | On Thu, 04 May 2006 15:09:20 -0500, Dave wrote: > Derek Parnell wrote: >> On Fri, 05 May 2006 04:36:30 +1000, Dave <Dave_member@pathlink.com> wrote: >> >>> Sure! I'll put it on Wikipedia too. >> > > No prob. - Want to 'wikify' that instead? Ok, I've uploaded the 'wikified' version to wikipedia and wikibooks. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 5/05/2006 1:37:54 PM |
May 05, 2006 Re: Today the Hobbyist, Tommorow, The World! | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | clayasaurus wrote:
> clayasaurus wrote:
>> nick wrote:
>>> clayasaurus wrote:
>>>> nick wrote:
>>>
>>>> Get rid of the D at the top and when you click on links make sure the box outline doesn't show up. Other than that it's good.
>>>
>>> Yeah, I can see that the big D is getting no love at all.
>>>
>>> The boxes around the links is firefox's doing; not mine. They don't show up in IE (or Safari if I recall correctly). Firefox draws a box around every link you click. If there is a hack around that, let me know and I'll put it in.
>>
>> Add the onfocus='this.blur()' for the links, like...
>>
>> <a href = "link" onfocus="this.blur()">Link</a>
>>
>> or see this thread http://www.codingforums.com/archive/index.php?t-1801.html for other methods.
>
> If you want, see what you score for http://www.alphaworks.ibm.com/tech/adesigner . Just use bugmenot.com for a login.
Thanks, that's really good to know. I don't know about removing the link outlines as some people might want to navigate with their tab key.
|
Copyright © 1999-2021 by the D Language Foundation