skip to main content

kiesler.at

Random Guide to whatever
updated by rck, 2004-10-10

Another case of trying out the swallow hack 0.2. This time, I'm shuffling some sections around. Enjoy!

0 < n < 100

Each section consists of a title and text (and sometimes an image). You can think of the title of a section as a subtitle of the article. Whenever you start editing a article or save a section, a new one is created for you. START ON NEW PAGE: This option enables multi-article stories. When enabled, this section will be the first of a new page. TITLE: Not necessary, but recommended. Enter the section title here. TEXT: Type in the section's text here. I'm not sure if there is a limit to how much text you can put here, but if you hit it, you'll know. Above this entry box is a text formatting bar that you can use to add html formatting to your text. You'll at least need to use the "new line" button to create line breaks. IMAGE: If you already added an image to this section, it's displayed here. If you are authorized, you will be given the options of uploading an image or selecting an existing image to display. UPLOAD A NEW IMAGE: This lets you upload an image that will be associated with this section. If you choose to use an image, you must also add a Short Image Description. SELECT AN IMAGE FROM THE LIBRARY: This site maintains a library of pre-approved images to use as an alternative to making, optimizing and uploading custom images. Just select the image you want to be associated with this section. If you choose to use an image, you must also add a Short Image Description. ALTERNATE TEXT (Short Image Description): REQUIRED! Enter a short description of the image that will display if a browser can't or won't show the image. LINK: Putting a link URL in here will turn the image into a clickable link. LINK (PHOTO) CAPTION: Sometimes you might want some text to appear above or below the image (eq: Photo Credits). Enter that text here. CONFIGURATION OPTIONS: Start on New Article: Whether this section starts a new article. See "MAKING MULTIPLE-ARTICLE STORIES". Template : Choose a display format for this section. SAVE SECTION: Click this button when you're finished editing. If all information was entered in correctly, the article will re-display with the section in its proper place. WHAT ARE TEMPLATES? Each section can be displayed in a different way -- with an image on the left, right, above the text, with a different-colored title, or even with all the text centered on the article! This is all controlled by templates that the administrator creates. All you have to do is select which display format you want to use for this section. If you want to read about creating or changing templates, see TEMPLATES.TXT.

100 < n < 200

Auch für den Lesendzugriff gibt es zahlreiche Methoden, die wieder auf einzelne Fälle spezialisiert sind. Hilfreich ist, wie fast immer beim Programmieren, zuerst die Dokumentation auf nützliche Methoden zu untersuchen und erst dann gegebenenfalls Dinge selber auszuprogrammieren. Stichwort: Durchsuchen einer ArrayList, Sortieren, Elementweise Bearbeitungen, und so weiter. Beschreibe ich alles noch, keine Sorge!

  • ArrayList.get(Index) ist hilfreich, wenn man den Index eines Wertes bereits kennt und diesen Auslesen will. Als Suchergebnis -- mehr zur Suche im folgenden Abschnitt -- bekommt man meistens genau so einen Index.
  • ArrayList.toArray() liefert die ArrayList als normales JAVA-Array zurück. Die Reihenfolge der Elemente entspricht dabei der der ArrayList. Nützlich für manche Methoden, die explizit ein "gewöhnliches" Array verlangen.
  • ArrayList.toArray(Objekt[] a) liefert alle Elemente des angegebenen Objekttyps aus der ArrayList zurück. Zur Erinnerung: Es können beliebige Elemente unterschiedlichster Typen in die ArrayList geschrieben werden. Manchmal ist es dennoch wünschenswert, beispielsweise nur alle Strings gesammelt zu haben. Das ginge dann mit ArrayList.toArray(String[] a).
  • ArrayList.toString() geht zwar mit fast allen Objekten, ich möchte es aber hier nochmal besonders herausstreichen. toString wandelt die ArrayList in einen lesbaren String um, den man sich zB zwecks Debugging ausgeben kann.

200 < n < 300

Neben diesen allgemeinen Tips kann man auch noch einzelne Operationen optimieren. Head oder Tail beispielsweise hat Risewind aus dem Informatik-Forum so gelöst:

246 print_head(int rs1, int rd) {
247 
248         trace("# print_head(%d, %d)\n",
249                 rs1, rd);
250 
251         check_list(rs1);
252 
253 
254         /* wieder ein genialer Peter-Trick...
255         */
256 
257         printf("\tldq $%d, -1($%d)\n",
258                 rd, rs1);
259 
260         force_valid_list(rd);
261 }
262 
263 
264 
301 print_tail(int rs1, int rd) {
302 
303         trace("# print_tail(%d, %d)\n",
304                 rs1, rd);
305 
306         check_list(rs1);
307 
308         printf("\tldq $%d, 7($%d)\n",
309                 rd, rs1);
310 
311         force_valid_list(rd);
312 }

Der erzeugte Code:

==========> Eingabe von /usr/ftp/pub/ublu/test/code/b5.in:
hd $17

Übersetzung: Status korrekt

Ausgabe:
blbc $17, raisesig
ldq $0, -1($17)

Übersetze und linke das Testprogramm:

Rufe folgendes Codefragment auf:
return testasm(a,b,c,d) != head(b);

Erzeugter Code verhaelt sich bezueglich Signal-Erzeugung wie erwartet
und das Ergebnis des Ausdrucks ist korrekt.

==========> Eingabe von /usr/ftp/pub/ublu/test/code/b6.in:
tl $19

Übersetzung: Status korrekt

Ausgabe:
blbc $19, raisesig
ldq $0, 7($19)

Übersetze und linke das Testprogramm:

Rufe folgendes Codefragment auf:
return testasm(a,b,c,d) != tail(d);

Erzeugter Code verhaelt sich bezueglich Signal-Erzeugung wie erwartet
und das Ergebnis des Ausdrucks ist korrekt.

here you can see some nonsense article. in case it makes sense, it's all fault of Swallow Hack 0.5 for Article Manager!



RSSComments - Make a comment
The comments are owned by the poster. We are not responsible for its content.
RSSAll Articles
2008, 2007, 2006, 2005, 2004

What's Related

Article Manager

Hacks

Latest Updates

AdministrativeTexts
updated by freddiemac1993, 2013-06-14
wiki

Re: adventures
created by brittdavis10, 2012-02-23 (1 rply, 3 views)
thread

Re: how to run phpwebsite...
created by alexander, 2011-08-25 (2 rpls, 3607 views)
thread

Re: Forum tags
created by HaroldFaragher, 2011-08-22 (3 rpls, 8488 views)
thread


Zu den KO2100 Foren