text:
Signetics 2650 & 2636 programming/2636 PVI

The Signetics 2636 Programmable Video Interface (PVI) is a 40-pin DIL chip that handles a number of functions within the console:

 * Video generation
 * Screen colour
 * Background grid
 * Score digits
 * Four objects (sprites)
 * Object completion and collision detection
 * Square wave audio
 * A/D conversion for the analogue joysticks
 * Chip select signals for memory and input/output devices
 * 37 bytes of scratch memory

These functions are all implemented by reading and writing to various registers within the PVI.

PVI registers
Internally the PVI registers are located at addresses $F00 to $FFF. Within the console's memory map they are located at addresses $1F00 to $1FFF. Programmers only need to be concerned with these latter addresses, so those will be the ones we use throughout this book. For the same reason we will also ignore the areas where the memory map is duplicated.

Note that some control registers are write-only. If a program needs to know the contents of any of them, a duplicate copy must be saved elsewhere. Tests on some of these registers on one console indicate that if a read operation is attempted the contents will be corrupted.

Objects
The PVI has four, programmable, two-dimensional objects that can be positioned anywhere on screen in a single 3-bit colour in one of four different sizes. It is said that the PVI was the first device to have this capability. This style of graphic was later termed a sprite, but we will stick with 'object' in this book as it is the term used in the Signetics datasheet.

Object shape
The shape of the object is set in a ten-byte array. Bits set to zero are transparent, while bits set to a one are displayed as the selected colour.

Object colours
Object colours are set by registers $1FC1 and $1FC2. See ../Programming colours/ for details.

Object size
Objects can be displayed in four different sizes as set by two-bits in register $1FCO.

Object position
Positioning of objects is determined by reference to the origin of the tv scan at the top-left of the screen.

The horizontal coordinate (i.e. $1F0A) is set as the number of horizontal clocks to skip after the start of the raster line before the object is displayed. It maybe changed while the object is being displayed in which case the remainder of the object will be displaced. The vertical coordinate (i.e. $1F0C) of an object is set with an eight-bit unsigned value equal to the number of lines to skip before the object is displayed. This value must be set before the trailing edge of VRST.

Object duplicates
One or more duplicate objects can be displayed further down the screen. The horizontal coordinate of the duplicate (i.e. $1F0B) is set in the same way as the original object. The vertical coordinate of the duplicate is set as the "number of lines to skip - 1" after displaying the last line of its predecessor.

The horizontal coordinate of the duplicate is read by the PVI on each line during HRST, so if it is changed during display of a duplicate, the rest of the duplicate will appear at a different position. The vertical coordinate of the duplicate must be programmed before the object completion status bit is set by the previous occurrence of that object.

Object completion
When the last line of an object has been displayed an object complete bit is set in register $1FCA and the PVI generates an interrupt signal for the microprocessor.

Object collision
If an object overlaps the background grid an object/grid collision bit is set in register $1FCA. If two objects overlap an inter-object collision bit is set in register $1FCB.

Score
The four score digits may be displayed as either two separate 2-digit numbers or as a single 4-digit number. They may be displayed at the top or bottom of the screen, or by reprogramming during the vertical scan between lines 40 and 199 they may appear at both top and bottom. The mode of display is determined by the format and position bits of register $1FC3.

Each score digit is 12 clocks wide and 20 lines high.

The top position corresponds to lines 0 to 19 of the background grid, or vertical coordinates 20 to 39. The bottom position corresponds to lines 180 to 199, or vertical coordinates 200 to 219.

The colour of the score is the inverse of the colour programmed for the background grid. See: Programming colours

The four score digits in $1FC8 and $1FC9 may be set to any hexadecimal value 0 to F. Values 0-9 display as the number, A-F display a blank.

Background grid
The PVI has a programmable background grid comprised of an array of elements, 16 wide and 20 deep.

These elements are vertical bars, one pixel wide, arranged in pairs of horizontal rows; the first row of each pair is two raster lines deep and the second row is 18 raster lines deep. Each of these 320 vertical bars may be switched on or off by setting a bit in a 40-byte array located at memory addresses $1F80 - $1FA7.

The vertical bars may be extended horizontally, controlled by five registers $1FA8 - $1FAC. Each of the five extension registers control four consecutive rows of vertical bars. Bits 5-0 of the extension register enable all of the vertical bars in a horizontal row to be extended to 8 pixels. The 18-line vertical bars are divided into two parts (A and B) each of 9 lines making it possible to extend the top and bottom part of the bars by 1, 2 or 4 pixels.

Bits 7-6 of the extension register enable all of the vertical bars in a group of four rows to be extended by to either 1, 2 or 4 pixels.

The colour of the background grid is set by bits 2-0 in register $1FC6. The background grid is enabled by setting bit 3 in register $1FC6. If the background grid is not enabled, registers $1F80-$1FAC maybe used as scratch memory, a whopping 45 bytes, in addition to the 37 bytes of scratch memory

Sound
The PVI can generate a single audio square wave output. Its frequency is set by register $1FC7. If this value is 0, the square wave is inhibited, otherwise its period is 2(n+1)TH, where n is the value set in $1FC7 and T H is the horizontal reset period. For a PAL system this simplifies to 128(n+1)μs.

If the sound register is changed while audio is being output, the change will not become effective until the next negative or positive transition of the audio signal.

See PVI audio frequency chart for a table of frequencies attainable.

Analogue to digital conversion
Two analogue to digital converters in the PVI are used to determine the position of the analogue joysticks. External circuitry driven from the processor's flag output is used to select input from either the horizontal or the vertical potentiometers.

The conversion process occurs during the active part of the video scan. The resulting digital values must be read from $1FCC and $1FCD during the vertical reset period to get a valid result.


text:
Talk:Public International Law/Actors in International Law/Indigenous Peoples

Review: June 2, 2023
Dear Raghavi,

Thanks for this very important chapter that I finally had the time to read in depth. I agree that the chapter has great potential, but still needs some work. In addition to the comments in the text, here some overall points: - it wold be great if you could link your thoughts more explicitly to the central theme of the entire chapter: subjects and actors in IL, ideally already in the introduction. Why are indigenous peoples discussed in this context? See also the introductory chapter of Viljam, defining personhood etc. - Maybe you could also more explicitly use parts of your text to critizise the very category of personhood/subjecthood as it stands? I think there are some amazing examples in the text showing how things could be thought entirely differently. This would also be nice to take up again in the conclusions/outlook, again linking to the "subjects and actors" leitmotiv of the chapter. - I think the chapter needs to be a bit more "didactic": Given that this is a textbook for students with possibly little or even no prior knowledge, I think some central legal concepts and documents need to be introduced in a more systematic way. The chapter now almost reads as a journal article, but it should really give an overview and introduce the topic in rather accessible way.

best, Raffaela

Review: May 21, 2023
Dear Raghavi,

Thank you for contributing this crucially important chapter to the textbook. I like the overall structure and agree with the topics you have chosen to include and I think the chapter has a lot of potential. For an introductory textbook chapter, however, which presupposes little knowledge and tries to convey the most important points in a concise and easily understandable manner, there is still some work to be done. I have added extensive comments in the text, which you can see by switching into editing mode. I hope you find these helpful, and I am happy to discuss them in more detail if you would like.

Warmly,

Sué

Sué González Hauck (discuss • contribs) 21:36, 21 May 2023 (UTC)

Review: May 16, 2023
Your chapter provides valuable insights into indigenous peoples as actors of international law. You effectively highlighted the historical context, international instruments and recent developments.

Some minor things:

- Please use OSCOLA as your citation style and make sure you provide full and accurate references for all sources cited. It is important to take the time to ensure that all footnotes are correctly formatted according to OSCOLA.

– Please format your headlines according to our style guide.

- You will also find some comments in your chapter in which I elaborate on something more specifically. To view these comments, just open you chapter page and click on "Edit" in the top-right toolbox.

- Note also that the following parts are still missing: required knowledge, further readings

- You could add some links to other chapters of the textbook.

- Note that I have made some linguistic and stylistic improvements to the text

Max Milas (discuss • contribs) 09:21, 16 May 2023 (UTC)

Dear authors
the content looks great, I am really looking forward to reading to draft in a couple of weeks! I love that you have a section on indigenous ways of learning and knowing (4) and legal orders (5). The topics you are aiming at covering are quite ambitious, so my main doubt would be whether you manage to do that in the limited word count. Looking at the content, it would probably be possible to join the rights in section 6 in one very short sections (in case you will need to shorten). Also, I was wondering the narrative on the chapter would not benefit from a start on indigenous peoples (so section 1, 4 and 5), followed by a embedding indigenous peoples in a broader context – first the state (2) and then international law (3 and 6). But it really depends on what you will include in the chapter, so that is just a thought. It was nice to have a possibility to engage with it!

Her chrush
About a girl suffering with life and having a chrush on a guy who is going to leave her school next year she still does

41.115.56.113 (discuss) 10:33, 2 September 2023 (UTC)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Talk:Digital Circuits/CORDIC

Fixed Point Example
Some fixed-point examples would be useful, especially multiplying and dividing from different Q formats e.g. Q1.7 and Q4.4 to produce a Q5.11 output. Bluefoxicy (discuss • contribs) 14:08, 5 November 2021 (UTC)

Radix-4
There's a faster Radix-4 mode $$x_{i+1} = x_i - \sigma d_i y_i 4^{-i}$$ and such with a different K scale factor, too. Should cover that. Bluefoxicy (discuss • contribs) 13:42, 18 November 2021 (UTC)

title: Talk:Digital Circuits/CORDIC


text:
Skaneateles Conservation Area/Invasive species/Paniceae

Possible non-native barnyard grasses in the vicinity of the Skaneateles Conservation Area include:
 * Echinochloa crus-galli (L.) P.Beauv. - Eurasian barnyard grass
 * Echinochloa esculenta (A.Braun) H.Scholz - Japanese millet
 * Echinochloa frumentacea Link - white millet


text: A History of the British Monarchy/Printable version


text:
Signetics 2650 & 2636 programming/Printable version

= Introduction =

= Console Hardware =

= 2650 processor =

= 2636 PVI =

= Getting started =

= Objects =

= Score =

= Programming colours =

= Background grid =

= Sync to VRST =

= Sync to Object completion =

= Interrupts =

= BCD arithmetic =

= Indexed branching =

= Tutorial code =

= Tutorial code - getting started =

= Tutorial code - objects =

= Tutorial code - score =

= Tutorial code - programming colours =

= Tutorial code - background grid =

= Tutorial code - Sync to VRST =

= Tutorial code - Sync to object completion =

= Tutorial code - State machine =

= Tutorial code - Interrupts =

= Bibliography =

= Analogue TV =

= Development systems =

= WinArcadia =

= PVI audio frequency chart =

= Contributions =


text:
Chess Opening Theory/1. e4/1...c5/2. a3/2...Nc6/3. b4

=Mengarini Variation= Black can accept the gambit with 3...cxb4 but the best move is the drawish 3...Nf6.

3...cxb4 used to be the main line and is still often seen at amateur levels. The most common continuation is

 * 4. axb4 Nxb4
 * 5. d4 d5
 * 6. c3 Nc6
 * 7. exd5 Qxd5
 * 8. Na3!

Now, Black needs to be precise: The natural moves 8...Nf6, 8...e5, and 8...e6 blunder 9. Nb5.

Theory table
.

'''1. e4 c5 2. a3 Nc6 3. b4'''


text:
User:Error 404 Username not found aaaa

Hi.

title: User:Error 404 Username not found aaaa


text: N64 Programming/Printable version

title: N64 Programming/Printable version


text:
User:Mbrickn/Wikibooks Oddities

Books with unclear provenance

 * Claims to be adapted from an external guide with permission.
 * Talk:N64 Programming
 * Talk:GBA Development
 * An Answer Key to Latin for Beginners by Benjamin L. D’Ooge
 * Wikibooks that direct readers to a more current version on an external site.
 * Mewa User's Guide

title: User:Mbrickn/Wikibooks Oddities


text:
User:Seo PanelBD

What is the main drawbacks of Wi-fi?

title: User:Seo PanelBD


text:
Wikibooks:Reading room/Proposals/2021/July

Creating subshelves for Electronic Games
Now that there are a few strategy guides on WikiBooks, I've realized that Shelf:Electronic games, a shelf which predates the recent decision, is getting a bit cluttered by vastly different book types. I propose creating two subshelves to help readers find material relevant to their interests.
 * Strategy Guides for specific games.
 * Electronic Game Development (Concerning development of video games, idea for WikiBooks like Game Creation with the Unity Game Engine, Creating a Simple 3D Game with XNA, ETF Mapping, Game Creation with XNA and How to Mod Civ 4)

There are a few edge cases that don't fit neatly into either subshelf, such as History of video games as well as Metal Gear Series, which is closer to Muggles' Guide to Harry Potter in format then a strategy guide. A third potential subshelf might include guides to simulation games/tools which existed on Wiki-Books prior to the strategy guide decision such as Trainz, X-Plane Flight Simulator, SimCity and Urban Planning and 0 A.D., but as these are the only current items in this category, I'm unsure if it's currently warranted.

Thank you for your time and consideration! --Mbrickn (discuss • contribs) 00:20, 9 June 2021 (UTC)
 * thanks for sharing your thoughts! I was thinking of this idea but decided to let it of until more books are written. There are only two books about Minecraft and I don’t think a shelf with only two books is worth creating. However, it seems there are 4 books about Mario so I creating Shelf:Mario, Shelf:Mario franchise, Shelf:Mario video games, or whatever. -Gifnk dlm 2020 (discuss • contribs) 12:06, 9 June 2021 (UTC)
 * I do not mind this proposal either. Leaderboard (discuss • contribs) 14:24, 9 June 2021 (UTC)
 * Ah, I worded that poorly, though I'm glad I did because your idea is intriguing. I was simply proposing a general strategy guide shelf, to contain strategy guides as a whole separately from other electronic game content. However I do think some larger series would benefit from their own shelves, as you mentioned. --Mbrickn (discuss • contribs) 19:14, 9 June 2021 (UTC)
 * It’s possible to have both. Like there’s Shelf:History by continent, it’s possible to have Shelf:Books about electronic games by series (surely there’s a better way to word it). Then it’s possible also to have Shelf:Strategy guides. -Gifnk dlm 2020 (discuss • contribs) 10:09, 11 June 2021 (UTC)
 * That makes sense. I think I would arrange it like such (Using Mario and Final Fantasy as placeholder series):

or with an extra shelf What do you think? Thanks you for your input! --Mbrickn (discuss • contribs) 18:33, 11 June 2021 (UTC)
 * Electronic Games
 * Game Development
 * Strategy Guides
 * Mario Series
 * Final Fantasy Series
 * Electronic Games
 * Game Development
 * Strategy Guides
 * Strategy Guides by Series
 * Mario Series
 * Final Fantasy Series
 * I think it’s over all a good idea but with a small problem. There can be books about Mario series and Final Fantasy Series that aren’t necessary strategy guides (for example books about the history of these games). That’s why I suggest the following categorization:

That being said I think franchise is better than series since not all notable games are part of a series. -Gifnk dlm 2020 (discuss • contribs) 20:11, 11 June 2021 (UTC)
 * Electronic games
 * Game development
 * Strategy Guides
 * Games by Series/franchise
 * Final Fantasy Series
 * Mario Series
 * Minecraft
 * Pokemon Series
 * I see! That makes more sense, and I your version as you have laid out.--Mbrickn (discuss • contribs) 20:32, 11 June 2021 (UTC)
 * Looks good, but how about simply:

 * Electronic games
 * Game development
 * Strategy guides
 * Final Fantasy
 * Super Mario
 * Minecraft
 * Pokemon
 * Slightly simplified would be better I feel. We can put (say) a Final Fantasy book on both the Strategy guides and Final Fantasy shelves, if both are applicable.
 * Also, I feel maybe we should rename "Shelf:Electronic games" to "Shelf:Video games"? Although they aren't synonyms, the books we currently have all fit the description of video games (from looking through them earlier). It's a name that's more commonly used. -- Jules (Mrjulesd) 22:02, 11 June 2021 (UTC)
 * That makes a lot of sense. I'd that as well. Very versatile. --Mbrickn (discuss • contribs) 00:35, 12 June 2021 (UTC)
 * I just realized I overlooked Shelf:Game design somehow, which while not quite the same as Game Development, is being used as a shelf for that topic in common use. It already exists, so there's no need for a seperate Game Development shelf.
 * Oh yeah, it exists but should be in Shelf:Electronic games and not in Shelf:Games. -Gifnk dlm 2020 (discuss • contribs) 08:49, 12 June 2021 (UTC)
 * Oh yeah, it exists but should be in Shelf:Electronic games and not in Shelf:Games. -Gifnk dlm 2020 (discuss • contribs) 08:49, 12 June 2021 (UTC)

there are 10 books about Mario. I suggest to create a shelf for Mario games.-Gifnk dlm 2020 (discuss • contribs) 15:58, 15 June 2021 (UTC)
 * Agreed. --Mbrickn (discuss • contribs) 06:03, 3 July 2021 (UTC)
 * , I think we shouldcreate a shelf called electronic games by series that will work sort of like how Shelf:History by continent works. -Gifnk dlm 2020 (discuss • contribs) 14:45, 8 July 2021 (UTC)
 * That may work. I've been thinking and perhaps it may be best to have some sort of list of popular culture series instead of limiting them to games alone. For example, there is Guide to The Lord of the Rings, analyzing the books, but there are also over a dozen video games based on the series as well, in addition to board games, movies, etc. This would be of potential value to someone studying popular culture. Combined with the organizational style proposed by User:Mrjulesd would offer more flexibility for authors of Wikibooks on other related subjects. --Mbrickn (discuss • contribs) 18:56, 8 July 2021 (UTC)

Adding URL file upload to admins and uploaders
I'm noticing cases where non-free images are legitimately taken from different sources (for instance, from StrategyWiki), and hence I was wondering whether we could enable URL file upload for admins and uploaders, so that they do not have to manually download the images every time they want to use it. What do you think? Leaderboard (discuss • contribs) 12:49, 4 July 2021 (UTC)
 * That seems like it could be a timesaver, especially on slow connections. I'm not an uploader though. --Mbrickn (discuss • contribs) 01:10, 9 July 2021 (UTC)
 * Certainly useful, but on a sidenote: do the recent videogame-related uploads (character sprites, item icons, step-by-step game screenshots) even meet WB:NFCC? They're certainly nice for players, but many don't seem necessary for reader's understanding. I'm not familiar with Wikibook's interpretation of what is and isn't acceptable, but if it's anything close to other Wikimedia projects their usage would fail NFCC. ~ Super  Hamster  Talk Contribs 19:08, 12 July 2021 (UTC)
 * I think if you provide a good enough rationale for both gamers and non-gamers to understand (e.g. why it's important have this exact picture and what it shows), it should be fine. For large artworks or box covers I try and upload them smaller. If I'm not mistaken, this is probably why only certain people are given the uploader role. 2005-Fan (discuss • contribs) 19:18, 12 July 2021 (UTC)
 * That, and the fact that free-use images should absolutely go to Commons. Leaderboard (discuss • contribs) 19:29, 12 July 2021 (UTC)


text: User talk:2600:387:5:807:0:0:0:7B

title: User talk:2600:387:5:807:0:0:0:7B


text:
User talk:2001:448A:2020:64FF:1C50:3CE1:3D9C:6CF7

Warning
—Atcovi (Talk - Contribs) 14:56, 6 November 2021 (UTC)


text: User talk:Ding yian

title: User talk:Ding yian


text:
Chess Opening Theory/1. e4/1...e5/2. Nc3/2...Nf6/3. Bc4/3...Nxe4/4. Qh5/4...Nd6/5. Bb3/5...Be7

Vienna Game, Falkbeer Defence
White can immediately restore material balance with 6. Qxe5 or add another attacker on the e5-pawn with 6. Nf3. After Qxe5 White threatens Qxg7 forcing Black to castle, after which the game can continue in various ways.

If White goes for 6. Nf3 instead, Black will respond with Nc6 and White will take the pawn with Nxe5 threatening Nxf7. Now, Black could castle or trade knights but it is better to kick out White's active queen with 7...g6 forcing White to retreat the queen to e2 or counterattack with Nxc6.

Theory table
.

1. e4 e5 2. Nc3 Nf6 3. Bc4 Nxe4 4. Qh5 Nd6 5. Bb3 Be7


text:
User talk:Dexxor

Welcome!
Welcome, Dexxor!

If you have any questions, you can ask in the assistance reading room or possibly contact me personally. —Atcovi (Talk - Contribs) 15:26, 6 November 2021 (UTC)

title: User talk:Dexxor


text:
Talk:Programmable Logic/Verilog Operators

In the Shift and Rotate section, various examples give x as the result, without introducing x previously. For example:

" if you want to shift right assign shr = a >> 1 // shift a right by 1 bit. example a=8'b10011011 then x=8'b01001101 "

Surely, the result is shr, in this case (and shl, in some of the others), so that should say:

example a=8'b10011011 then shr=8'b01001101


text:
User:Error 404 Username not found aaaa/sandbox

This is my sandbox.

= a =

f
lines

e

e

e


text:
Template:WikipediaTitleFootnote

Read more about  on Wikipedia.

title: Template:WikipediaTitleFootnote


text: Odia/Plants & Trees

title: Odia/Plants & Trees


text:
Genesis Programming/68K Memory map/

MegaCD Changes
The following shows changes to the 68K Memory Map with a MegaCD/SegaCD attached:

MegaCD BIOS ROM is always only visible to the main 68K, and decompresses a separate BIOS for the MegaCD "SubCPU" into "Program RAM". "WORD RAM" access is restricted to one 68K at a time, which is determined by a setting in the "Gate Array". "Program RAM" is $80000 bytes in size, but is only accessible by the Genesis 68K in banks of size $20000, and only when the MegaCD 68K is in "BUSREQ" (stopped). The MegaCD 68K may be stopped/reset, and the available "Program RAM" bank may be set by use of the "Gate Array".

title: Genesis Programming/68K Memory map/


text:
Genesis Programming/68000 programming considerations

ROM header
The ROM header starts at  and contains information about the cartridge. The following assembly code shows how to declare the header: Explanations for each field:
 * 1) dc.b "SEGA GENESIS"
 * 2) dc.b "(C)SEGA 1992.SEP"
 * 3) dc.b "YOUR GAME HERE"
 * 4) dc.b "YOUR GAME HERE"
 * 5) dc.b "GM XXXXXXXX-XX"
 * 6) dc.w $D951
 * 7) dc.b "J"
 * 8) dc.l 0
 * 9) dc.l ROM_End
 * 10) dc.l $FF0000
 * 11) dc.l $FFFFFF
 * 12) dc.b (Blank)
 * 13) dc.b (Blank)
 * 14) dc.b (Blank)
 * 15) dc.b (Blank)
 * 16) dc.b (Blank)
 * 17) dc.b "JUE"
 * 1) The name of the console. Should be either "SEGA GENESIS" or "SEGA MEGA DRIVE" (depending on the region you are planning to program your game for). Must be 16 characters long.
 * 2) Firm name and build date. Must be 16 characters long, firm name is four characters long.
 * 3) Domestic name. Must be 48 characters long.
 * 4) International name. Must be 48 characters long.
 * 5) Program type and serial number. First two characters are either "GM" (game) or "AL" (educational). After the space, a series of eight digits gives the serial number. The final two digits give the version number.
 * 6) Checksum.
 * 7) I/O device support (unused)
 * 8) Start of the ROM. This should always be 0.
 * 9) End of the ROM. It's best to use a label at the end of your source file to determine this.
 * 10) Start of RAM. Just about every game starts at $FF0000, but RAM is mirrored at several other places, and you can use those if you want.
 * 11) End of RAM. Should be $FFFF after the starting point.
 * 12) Backup RAM ID. Fill this with spaces if there is none, otherwise, use this formula: dc.b "RA",%1x1yy000,%0010000 where x is true when the RAM is for backup and false if not. (I've no idea what the difference is.) yy is 11 if addressing is odd bytes only, 10 if even only, and 00 if both.
 * 13) Start address of backup RAM. Fill with spaces if there is no backup RAM.
 * 14) End address of backup RAM.
 * 15) Modem support. Fill with spaces if there is no modem, otherwise follow this formula: "MOxxxxyy.zzz" where xxxx is the firm name, yy is the modem number, and zzz is the version number. (This is also unused)
 * 16) Notes. Put whatever you want here, and fill the empty spaces with zeroes.
 * 17) Country codes. J is for Japan, U is for the United States, and E is for Europe. You need to fill in the rest of this field with spaces. So, JU for the country code would tell the Sega that the game is for Japan and the US, JUE would tell it that it is for Japan, the US, and Europe

TMSS
Back in 1990, Accolade released a few unlicensed games for the Genesis. Sega was not pleased about this, so they invented TMSS and put it on all new consoles they manufactured. TMSS forces the game to write the ASCII string "SEGA" to $A14000 within a short period of time, or the VDP will be deactivated. On version 0 of the console, this location is reserved, and writing here may cause a crash, so the game has to first make sure that it's running on a console that has TMSS. Sega uses the following routine for that: move.b $A10001,d0 andi.b #$0F,d0 beq.b  version_0 move.l #'SEGA',$A14000 version_0:

Checksum
The checksum is a 16-bit number (word) located in the header which is present in all licensed games.It was used to check the integrity of the data by storing a pre-calculated number (the checksum) using the original data and comparing it with the checksum of the existing data in the cart, probably to prevent code changes without authorization (in-house).

The checksum is, basically, the sum of the whole cart, all its bytes, starting at address $200. As you can guess, if only a byte is changed the checksum changes too. Somewhat like the CRC/CRC32 algorithms, though those are much more accurate than this method.

You don't need to implement the checksum if you program your own homebrew rom, because the checksum is exclusively checked by software. But, anyway, this is how a typical checksum routine from a licensed game would look. movea.l	#$200,a0 movea.l	#ROM_End,a1 move.l	(a1),d0 moveq	#0,d1 loop: add.w	(a0)+,d1 cmp.l	a0,d0 bcc.s	loop movea.l	#$18E,a1	; Checksum cmp.w	(a1),d1 bne.w	WrongChecksum

To disable it, comment out that last branch. If you prefer to fix the checksum, grab the Fix Checksum utility from Hacking CulT's download section.


text:
Genesis Programming/Z80 programming considerations

Read more
There is a separate Wikibook on Z80 Assembly.


text: Genesis Programming/Printable version

title: Genesis Programming/Printable version


text: GBA Development/Printable version

title: GBA Development/Printable version


text: Deving The XGameStation/Printable version


text:
Lentis/Algorithmic Bias

Algorithmic bias refers to undesirable results from a computer system that incorrectly or unfairly prioritizes one group over another. This chapter currently focuses on algorithmic bias in the United States.

Background
Of particular importance is algorithmic bias in Machine Learning (ML) and Artificial Intelligence (AI).

Companies and individuals are increasing their reliance on AI systems. Search engine results, social media recommendations, hiring decisions, stock market predictions, and policing practices use information from AI predictive modeling. Algorithmic bias in these models is particularly dangerous due to human Automation Bias, the tendency for humans to disregard contradictory information when presented with a computer-generated solution. This increases the likelihood that bias in the AI system will result in unfair or inequitable outcomes where the system is in use.

How does Algorithmic Bias occur in AI systems? Often, AI systems operate on massive data sets amalgamated from existing sources without refinement. This leads to any existing bias, often institutional or implicit, being passed along to the AI system. Consider an AI hiring algorithm created to give a competitive advantage in finding the best possible candidates for a computer science position. Because computer science is currently male dominated field, the hiring algorithm might erroneously prioritize male applicants. An example of a similar case is the Amazon Hiring Algorithm. In this way, AI systems will replicate existing bias and perpetuate existing prejudice in the status quo.

Assembled bias, a proposed type of Algorithmic Bias unique to AI and ML systems, describes novel biases introduced by AI systems that do not currently exist in society. Assembled bias arises from the idea that AI models are generative rather than purely statistical. A toy example to better understand this phenomenon is AI generation of realistic images. When asked to create an image of a spider, an AI model might produce a highly detailed, realistically textured image of an eleven-legged spider. Even though the AI has only ever trained with images of eight-legged spiders, the AI has no concept of how to count legs – instead, it creates its own metrics for what defines a spider.

Diversity is notably lacking from AI development and research positions. Only about 20% of AI researchers are women, and other minority groups are similarly underrepresented. Because the end goal when developing an AI system is often quantifying a nebulous concept, the perspectives of those present and working on the system strongly influence the outcome. The lack of diversity in AI positions represents another possible source of bias because the majority perspective will be overvalued in the outcome.

Currently, the unfair outcomes resulting from Algorithmic Bias in AI systems appear to be disadvantaging primarily women and sexual or racial minorities. Combating this unintended result of AI and ML is an ongoing field of research.

Amazon's Hiring Algorithm
In 2014, Amazon initiated a program that used AI to review job resumes. The purpose of the program was to reduce the time spent on finding good candidates to fill job openings. The AI was trained on resumes submitted to the company during the previous 10 years. The demographics of the submitted resumes were similar to that of most tech companies: composed mostly of men, especially in technical roles. Consequently, the AI produced an algorithm that favored male resumes more than female resumes, as most of the previously successful candidates were male. This manifested itself in the algorithm as it penalized resumes that included the word “women’s”, or rewarding those with words more commonly found on male resumes such as “captured” or “executed”. The algorithm was also found to downgrade candidates who graduated from all-women’s colleges.

To combat the gender-bias outcome of the tool, Amazon made the program neutral to gender-correlated terms. By doing so, Amazon engaged in internal auditing, a technique designed to reduce algorithmic bias by ensuring any emerging bias in a machine learning model is caught and stopped. However, it did not address the crux of the problem, which was the underlying data. A different approach would have been to analyze the existing data set to predict where the algorithm could be biased, evaluating and modifying assumptions about the data as necessary. This approach has been successful in other AI applications. In this case, however, Amazon left the underlying data unaddressed. This abetted the algorithm to find additional discriminatory ways of sorting the candidates. The tool was retired in 2017 after “executives lost hope for the project.”

Critics of Amazon argue this algorithm has perpetuated the gender disparity in their workforce. Amazon does not dispute that their recruiters looked at the recommendations generated by the tool, but maintain the tool “was never used by [them] to evaluate candidates.” Opponents of Amazon argue the two are mutually exclusive; recruiters were surely influenced by a tool that rates candidates from 1-5 stars, even if they claim they were not. Some critics, like ACLU Attorney Rachel Goodman, further contend that AI hiring tools “are not eliminating human bias – they are merely laundering it through software.” Proponents of AI hiring technology are more optimistic: In a 2017 survey from CareerBuilder, 55% of U.S. human resources managers said AI would be a regular part of their work within the next five years. However, as Vice President of LinkedIn Talent Solutions John Jersin explains, the technology has much room for improvement before it can “make a hiring decision on its own.”

Amazon has since revived the project, hoping that emphasizing diversity will lead to more equitable algorithmic outcomes. However, in the absence of critically evaluating the data the models are trained on, it is unclear why a certain algorithmic emphasis will lead to a non-discriminatory outcome of the algorithm.

Facial Recognition Algorithms
Several companies, including IBM and Microsoft, have developed facial recognition algorithms to recognize people only using their face. These algorithms are available to the public and have been used by police departments in conjunction with video surveillance programs. In 2018, Joy Buolamwini studied biases in gender classification for facial recognition algorithms from IBM, Microsoft, and Face++, and discovered that all of them perform better on "lighter faces than darker faces", and performed worst for "darker female faces ". All of the algorithms had an accuracy gap between "lighter males and darker females" of over 20% with IBM's algorithm performing the worst with a gap of 34.4%. In 2019, the National Institute of Standards and Technology (NIST) confirmed the issue of algorithmic gender bias and racial bias is an industry wide problem with 189 of the studied facial recognition algorithms being least accurate for people of color, and in particular, women of color. In response to the research IBM stopped working on their facial recognition algorithm, Microsoft and Face++ released improved versions of their facial recognition algorithms and reduced their accuracy gap by over 19% , and Amazon stopped police departments from using its facial recognition algorithm.

Loan Lending Algorithms
Financial technology (Fintech) is a field in which loan lending algorithms have begun to replace face-to-face meetings. In the U.S., 45% of the largest mortgage lenders offer software-based loan solutions but they have been scrutinized for discriminative pricing. A study by Bartlett et al. found that through online platforms and face-to-face meetings Black and Latinx borrowers paid, on average, 7.9 basis points higher interest on purchase loans than comparable borrowers and paid 3.6 basis points more on refinance loans. This difference costs Black and Latinx borrowers $756M annually. Researchers found the discrimination in algorithms to be about 40 percent less than face-to-face lenders. Specifically, when Fintech algorithms are used, underrepresented borrowers pay 5.3 basis points higher than their counterparts (2.6 points lower than traditional methods). The study analyzed 30-year, fixed-rate, single-family residential loans issued by Fannie Mae and Freddie Mac between 2008 and 2015, and lenders were found to make 11 percent to 17 percent higher profits from purchase loans to underrepresented groups. Although loaning algorithms demonstrate less bias than traditional face-to-face lenders, the persistence of bias of any degree emphasizes the need to examine loaning algorithms and determine the source of the algorithmic bias.

Loaning algorithms are based on machine learning and big data, which use a wide array of customer attributes to set prices. For example, geography can play a major role since the algorithm can target locations where comparison shopping is less likely. The algorithm may determine areas that are financial deserts where financial reserves are low and applicants are faced with monopoly pricing instead of having access to many options. The algorithm may not specifically target underrepresented applicants, but its logic may set a higher price knowing the applicant is more likely to accept it.

Underlying historical discrimination in training data may also lead algorithms to disfavor underrepresented groups and further wealth disparity. Fintech loaning algorithms use the prospective borrower’s credit histories, employment status, assets, debts, and the size of the loan requested to set interest rates. “If the data that you’re putting in is based on historical discrimination, then you’re basically cementing the discrimination at the other end,” says Aracely Panameño, director of Latino affairs for the Center for Responsible Lending. Research also shows that payday loan sellers often prey on neighborhoods predominantly populated with people of color since they typically have fewer bank branches. Banks report both positive and negative credit behavior while payday loan services only report missed payments. As a result, underrepresented groups from these neighborhoods find themselves with incomplete or skewed credit histories that are later fed into loan financing algorithms.

The Algorithm
The Correctional Offender Management Profiling for Alternative Sanctions algorithm (COMPAS), is a machine learning algorithm for judicial decision-making during criminal sentencing. Used in Wisconsin, New York, California, and Florida, COMPAS predicts the potential risk of recidivism. Created by Northpointe, Inc. (now Equivant), this commercial algorithm uses a questionnaire to categorize defendants as "low-risk", "medium-risk", or "high-risk", with respective scores of 1-4, 5-7, or 8-10. Factors such as age, gender, and criminal history are used while race is not. Used still today to advise on bail, sentencing, and early release, many are questioning the validity and fairness of COMPAS in providing objective advice, particularly by race.

In 2016 the Pulitzer Prize-winning nonprofit news organization ProPublica conducted a study to assess COMPAS for racial bias. A COMPAS score of medium or high risk and a defendant recidivating in 2 years, and a COMPAS score of low and a defendant not recidivating in 2 years are considered correct predictions. ProPublica found that a correct prediction of recidivism was made for white and black defendants 59 percent and 63 percent of the time, respectively. This is roughly the same rate. Upon questioning, the company said "it had devised the algorithm to achieve this goal. A test that is correct in equal proportions for all groups cannot be biased.” Northpointe Inc. even cites other studies within their Practitioner's Guide confirming the success and neutrality of their algorithm.

ProPublica found that Black defendants had uniform scores from 1-10, while White defendants had predominantly lower scores. After adjusting for Black defendants having higher recidivism rates overall, ProPublica found that COMPAS, while maintaining a similar accuracy, is "more likely to misclassify a black defendant as higher risk than a white defendant...the test tended to make the opposite mistake with whites."

Perpetuated Systemic Racism
COMPAS perpetuates the historic and structural bias that is found in the criminal system. For example, COMPAS considers one's area of residence. Minority-dominated areas are often more policed, which inflates arrest statistics. If geography correlates to recidivism, then race indirectly does too. Thus, these correlations can be dangerous when not taking validity measures. As a private company, Northpointe has no legal obligation to share details on how COMPAS calculates its score or weighs its variables.

Defendants labeled high/medium risk may be subject to harsher sentencing. The United States Sentencing Commission found that offenders who were sentenced to an incarceration length between 60 to 120 months and over 120 months were significantly less likely to recidivate. If a defendant is suspected of being high-risk, they may be given a longer sentence, and be less likely to receive bail or early release. COMPAS’s mislabeling of Black defendants may result in negative consequences despite reported racial neutrality, and could further perpetuate racial inequity in the criminal justice system.

The Algorithm
Several U.S. health care systems use commercial algorithms to guide health decisions and target patients for "high-risk care management" programs to help ensure that appropriate care is provided. Most of these programs are beneficial to patients with critical conditions because they have teams of specialized nurses, extra primary care appointment slots, and other scarce resources. As a result, hospitals and insurance companies have relied on one specific algorithm to minimize the cost for patients while targeting sicker patients that would benefit most from these programs.

In 2019, Obermeyer et al. conducted a study funded by the National Institute for Health Care Management Foundation on this commercial care management algorithm in response to “the growing concern that algorithms may reproduce racial and gender disparities via the people building them or through the data used to train them." This predictive-risk algorithm generated a risk score for each patient to infer their medical needs, which was primarily based on the patient's previous health care spending. Based on the score, patients would be automatically enrolled to the program, referred to their primary care physician for consultation, or no recommendations were made.

The study found that Black patients with the same level of algorithm-predicted risk as White patients had 26.3% more chronic illnesses. Furthermore, researchers found that when looking at specific biomarkers that index the severity of various chronic illnesses (hypertension, diabetes, bad cholesterol, etc.), Black patients had more severe illnesses than White patients with the same risk score. This was due to Black patients generating lower expected medical costs than White patients with the same chronic illnesses. These spending differences resulted in disparities between the perceived level of sicknesses between Black and White patients since the algorithm focused on patient health care spending as it's primary mechanism for producing risk scores.

Perpetuated Systemic Racism
The study identifies two systemic causes for reduced health care spending by Blacks that contributed to this algorithm's bias. First, poor patients face several barriers that can impede their access to healthcare despite having health insurance (geography, transportation access, competing demands from jobs or child care, knowledge of reasons to seek care, etc.). Second, race can impact patient spending through either direct discrimination by physicians or changes to the doctor-patient relationship, causing patients to not be recommended for or choosing not to seek further care. These observations demonstrate that accurate methods for decision-making models can indirectly disadvantage specific groups in society and have the ability to perpetuate existing systemic racism.

Conclusion
In the future, algorithmic biases will have an increased impact on human activity. It is clear that unmonitored, unrestrained production and application of algorithms can be detrimental to various groups of people. The ease with which companies and industries can utilize these algorithms creates an environment where inequitable outcomes are perpetuated. Possible avenues for reducing algorithmic biases include legislation, internal auditing, and community adjudication, as well as increased awareness and a culture of responsibility. Many of these avenues are primarily social and non-technical, which accords with the socio-technical nature of algorithmic bias. The increased prevalence of algorithmic biases is simply one way in which technology is impacting human life in the U.S, and more broadly, the world. Many other novel technologies with seemingly unlimited potential must be examined carefully before their widespread adoption, as failure to do so can result in harmful consequences, which is the case for many applied algorithms today. Finally, further research is recommended on the impact of legislation on algorithmic bias, the impact of algorithmic bias in countries outside the U.S., and new bias-mitigation techniques.

title: Lentis/Algorithmic Bias


text: The Legend of Zelda: The Wind Waker/Printable version


text:
User:Mbrickn/Wikibooks Philosophy

On Merging and Splitting
Merging contents on Wikibooks is not easy, and should be done sparingly.

title: User:Mbrickn/Wikibooks Philosophy


text: Shelf:Go programming language

title: Shelf:Go programming language


text: Shelf:Go programming language/ancestry

title: Shelf:Go programming language/ancestry


text: Category:Shelf:Go programming language

title: Category:Shelf:Go programming language


text: Category:Shelf:Go programming language/all books


text: Subject:Go programming language

title: Subject:Go programming language


text: Category:Subject:Go programming language


text: Category:Subject:Go programming language/all books


text:
Cookbook:Apple Crumb Cake

| Germany | Dessert

Apple crumb cake or apfelstreuselkuchen is a thin yellow cake with a thin layer of sliced apples and streusel on top. It is somewhat similar to apple crisp or apple cobbler, except that the base is a cake. The flavor is mostly egg and butter, with a hint of vanilla; the strong cinnamon or mixed-spice flavors characteristic of US apple dishes are absent.

To serve it, cut the cake into squares. Serve warm or at room temperature with coffee or hot tea. Optionally, add vanilla ice cream or whipped cream. This sheet cake can be made the day before and travels well, which makes it a good choice for picnics and large gatherings.

Ingredients
This cake has three layers that are prepared separately. Three ingredients (butter, sugar, flour) appear in this list twice, because they are added in separate steps.

Special equipment

 * Half-sheet baking pan (18x13 inches / 45x33 cm) OR two 9x13-inch/23x33-cm pans

Streusel topping

 * 1) Use a pastry blender or a dinner knife to slice the 6 oz butter into pats. This step works best if the butter is cold.
 * 2) Combine the sugar, cinnamon, and flour into a mixing bowl. Stir the dry ingredients briefly to mix.
 * 3) Put the butter pieces into the bowl with the dry ingredients, and toss until the flour mixture has coated the pieces of butter.
 * 4) Use a pastry blender (or a pair of dinner knives held side-by-side in the same hand) to cut the flour-coated butter into the dry ingredients. Stop when all the butter is smaller than a green pea (about 1 cm in diameter), but you can still see lumps of butter.
 * 5) Set aside. This mixture can be covered and stored in the refrigerator for several days if necessary.

Apples

 * 1) Peel and core the apples.
 * 2) Cut the apples into quarters, then cut each quarter into thin slices. You will need enough slices to make a single layer over the top of the cake.
 * 3) Set aside. As the apples will be covered by streusel topping, it doesn't matter if they turn a little brown while you make the cake batter.

Cake

 * 1) Beat together the butter and sugar until light and fluffy. This step works best if the butter is slightly softened.
 * 2) Beat in the vanilla and eggs, one at a time. Scrape the bottom of the bowl after beating in each egg.
 * 3) Stir in the baking powder and flour.

Bake

 * 1) Preheat oven to 350 °F (180 °C / gas mark 4 / moderate oven).
 * 2) Optionally, line the pan(s) with parchment baking paper. Do not grease or flour the cake pan.
 * 3) Spread the cake batter into the prepared pan.
 * 4) Arrange a single layer of apple slices on top of the cake batter. Apples should cover the cake batter as much as possible, out to the edges of the pan. If you have enough apple slices and you want more apple in your cake, then it's okay to overlap them a little.
 * 5) Sprinkle the streusel mixture on top of the apples. It should generously cover all of the apples.
 * 6) Bake at 350 °F (190 °C) for about 40 minutes, until the apples are soft, the cake is cooked through, and the streusel is golden brown.

Notes, tips, and variations

 * Crisp apples, such as Braeburns, sweet Royal Galas, tart Granny Smiths, Honeycrisps, or tangy Newtown Pippins, are generally better for baking than mealy apples, such as Red Delicious. You can use a mix of apple types.
 * You can use gluten-free flour substitutes.
 * Avoid high-gluten bread flours.
 * Up to 25% of the flour in the cake batter can be replaced by almond flour or another finely ground nut flour.
 * Up to half of the white granulated sugar in the cake batter can be replaced by sugar substitutes. The same volume of brown sugar can be used instead of white sugar in the streusel mixture; this will change the overall flavor slightly.
 * This recipe can be cut in half or in thirds to make a smaller cake. A half-recipe can be baked in a 9x13 cake pan; a third-recipe can be baked in a 9x9 square cake pan.

Kochbuch/ Apfelstreuselkuchen

title: Cookbook:Apple Crumb Cake


text: Shelf:R programming language

title: Shelf:R programming language


text: Shelf:R programming language/ancestry

title: Shelf:R programming language/ancestry


text: Category:Shelf:R programming language

title: Category:Shelf:R programming language


text: Category:Shelf:R programming language/all books


text: Subject:R programming language

title: Subject:R programming language


text: Category:Subject:R programming language

title: Category:Subject:R programming language


text: Category:Subject:R programming language/all books


text: Go Programming Language Cookbook/Printable version


text:
User talk:BP001002004008

Welcome!
Welcome, BP001002004008!

If you have any questions, you can ask in the assistance reading room or possibly contact me personally. —Atcovi (Talk - Contribs) 01:09, 7 November 2021 (UTC)

title: User talk:BP001002004008


text:
Psychiatric Disorders/Timeline in Psychiatry

1550 BC
The Ebers papyrus, one of the most important medical papyri of ancient Egypt, briefly mentioned clinical depression.

4th century BC
Hippocrates theorized that physiological abnormalities may be the root of mental disorders.

280 BC
Greek physician and philosopher Herophilus studies the nervous system and distinguishes between sensory nerves and motor nerves.

250 BC
Greek anatomist Erasistratus studies the brain and distinguishes between the cerebrum and cerebellum.

705
The first psychiatric hospital was built in Baghdad.

11th century
Persian physician Avicenna recognized 'physiological psychology' in the treatment of illnesses involving emotions, and developed a system for associating changes in the pulse rate with inner feelings.

13th century
Bethlem Royal Hospital in London, one of the famous old psychiatric hospitals, was set up.

1590
Scholastic philosopher Rudolph Goclenius used the term psychology. Though often regarded as the "origin" of the term, there is conclusive evidence that it was used at least six decades earlier by Marko Maruliæ.

1656
Louis XIV of France created a public system of hospitals for those suffering from mental disorders.

1672
In English physician Thomas Willis' anatomical treatise "De Anima Brutorum", Psychology was described in terms of Brain Function.

1758
English physician William Battie wrote the Treatise on Madness which called for treatments to be utilized in asylums.

1808
Dr. Johann Christian Reil, German physician, anatomist, physiologist and psychiatrist, coined the term 'Psychiatry'.

1816
French physician Dr. Rene Laennec invented the Stethoscope.

1821
The element of Lithium was first isolated from Lithium Oxide and described by William Thomas Brande, an English chemist.

1893
Dr. Emil Kraeplin defined "Dementia Praecox", currently Schizophrenia.

1895
German physicist Wilhelm Conrad Röntgen discovered medical use of X- rays in medical imaging and was conferred the first Nobel Prize in Physics in 1901.

1899
Dr. Sigmund Freud published 'The interpretation of dreams'.

Alzheimer
Dr. Alois Alzheimer, German psychiatrist and neuropathologist, identified the first case of what later became known as Alzheimer's disease.

Blood Types
Austrian biologist and physician, Dr. Karl Landsteiner discovered the existence of different human blood types and in 1930, he won the Nobel Prize in Physiology or Medicine.

1905
French Psychologists Alfred Binet and Theodore Simon created the Binet-Simon scale to assess intellectual ability, marking the start for standardized psychological testing.

1906
Dr. Ivan Petrovich Pavlov, Russian physiologist, psychologist, and physician, published his first Conditioning studies.

1908
The word schizophrenia was coined by Dr. Paul Eugen Bleuler, Swiss psychiatrist.

1929
Dr. Hans Berger, German neuropsychiatrist, discovered human electroencephalography.

1934
Dr. Manfred Joshua Sakel, Polish neurophysiologist and psychiatrist, introduced insulin shock therapy; a precursor to ECT.

1936
Otto Loewi, Austrian-German-American pharmacologist, won the 1936 Nobel Prize in Medicine, which he shared with Sir Henry Dale, for his discovery of Acetylcholine, the first neurotransmitter to be described.

1938
Dr.Ugo Cerletti, Italian neurologist and Dr. Lucio Bini, Italian psychiatrist, discovered Electroconvulsive Therapy.

1948
Lithium carbonate's ability to stabilize mood highs and lows in bipolar disorder was demonstrated.

1949
Dr. Antonio Egaz Moniz, neurologist at the Lisbon Medical School won Nobel prize for his work on psychosurgery / lobotomy.

Chlorpromazine
The first published clinical trial of Chlorpromazine was conducted at Ste. Anne Hôspital in Paris.

Manual
The APA published the first Diagnostic and Statistical Manual for Mental Disorders.

1960
The first benzodiazepine, Librium, was introduced, marking the rise of psychopharmacology.

1963
United States president John F. Kennedy introduced legislation delegating the National Institute of Mental Health to administer Community Mental Health Centers for those being discharged from state psychiatric hospitals.

1970
FDA approved Lithium for acute mania.

1972
Psychologist David Rosenhan published the Rosenhan experiment, a study challenging the validity of psychiatric diagnoses.

1977
The ICD-9 was published by the WHO.

1988
The first selective serotonin re-uptake inhibitor (SSRI) antidepressant, 'Prozac', was released and quickly became most prescribed.

1988
US President George Bush declared 1990s as "The decade of the brain".

2000
The No Free Lunch organization was founded by Dr. Bob Goodman, an internist from New York.


text:
Psychiatric Disorders/Basic Sciences Relevant to Psychiatry

Biochemistry - An amalgam of the scientific study of Biology (the science of living matter in all its forms) and Chemistry (the science concerned with the composition, properties, and reactions of substances) as they concern the processes (usually within the cells) which occur in living organisms.

Microbiology – The scientific study of a diverse group of simple life-forms including concerned with their structure, function, and classification. In medicine, more specifically, it is the study of disease-causing microorganisms that have been identified as a means to control their pathological effects. Pharmacology – the study of the changes produced in living animals by chemical substances. In medicine this relates to the actions of drugs, (substances used to treat disease, i.e. medicines), and their effects on the human organism.

Genetics – the science of heredity, which is how the characteristics of living things are transmitted from one generation to the next. In medicine this relates to disease states resulting from chromosomal anomalies.

Neuroanatomy and physiology

to understand how it is that Brain is the substrate for Mind.

Psychology

to understand how behaviour, and internal states such as mood and thought, are regulated.

Sociology

to understand how individuals fit within society and are influenced by it.


text:
Psychiatric Disorders/Introduction

What is Psychiatry?
Psychiatry is a branch of medicine that is concerned with the diagnosis and treatment of mental, emotional, and behavioral disorders.

However, it should also be noted that recent advances in the field have expanded its scope as the distinction between “psychiatric” disease and “medical” disorders has begun to blur. It is now widely recognized that psychiatric disease is an independent risk factor in the etiology of many disease states and disorders that have traditionally been the viewed as “medical” disorders. For example, depression is now known to increase the risk for cardiovascular disease. Furthermore, pharmacologic treatment of psychiatric disorders also plays a role in the iatrogenic etiology of medical disease. (for example, Diabetes Mellitus, cardiac arrhythmias, and Hypertension).

Development Status
This volume on Psychiatry is currently in the initial stages of development. Further development will be a project of the Educational Taskforce of the World Psychiatric Association.

For further information, please contact Dan Stein (dan.stein@uct.ac.za).

title: Psychiatric Disorders/Introduction


text:
Psychiatric Disorders/Mental Health Status Examination

The purpose of this examination is to gather phenomenological data in an orderly way for purposes of diagnosis, checking of progress, note-taking, and communication.

It is largely based upon what a trained observer may see, and to a lesser extent upon what is described by the patient, although these must be combined. For instance, the comparison of affect, mood as reported by the patient, and countertransference phenomena is a key to the proper assessment of mood and psychotic disorders.

Notes about speech, language, and thought. In considering the mental state exam, speech may be confused with thought. The following definitions may assist:

Most correctly, speech is to be defined as the motor aspect of language. Speech would properly only be described according to articulation (how clearly each word is pronounced; slurring, running words together, etc.); anything else about utterances would be best categorized under Language or Thought.

Language is a system of symbols used to convey meaningful ideas. Language also includes how the ideas expressed fit in with the social situation: e.g. turn-taking. The neurology of language needs careful review by the student.

Thought and language are of course tightly linked concepts. Thought is the logical progression of ideas. Clearly the style of logic employed to link the ideas (the Form of thought) varies. Linkage may be only by sound, for instance: the so-called Klang association. e.g. "Mat, bat, cat."

The discussion below may be criticized as conflating speech with thought.

APPEARANCE

What does the patient look. like, smell like and sound like? Give a written description.

Self Neglect: cleanliness, shaven, make up, state of hair and clothes

Bizarre Appearance: secret documents openly displayed, special clothes or ornaments with symbolic significance, etc.

BEHAVIOUR

Involuntary movements: tics

Mannerisms

Stereotypes

Purposeful behaviour: pacing, fiddling

Congruity with the situation: does she act as if she understands the social conventions associated with the fact that she is being examined; e.g. when invited into the room, sits in what is obviously the examiner's chair.

RAPPORT

Includes Demeanour: threatening, seductive, friendly

AFFECT

Mood: inner emotional experience: can be inferred, but is best described

Affect: outer expression of mood

Level: elevated, lowered, euthymic

Range: restricted, increased, normal

Congruity: does the affect match what is being discussed?

Communicability: how readily does the observed affect and described mood cause a corresponding and similar feeling in the examiner? For instance, the moods of mania and depression are readily communicated. See Countertransference.

SPEECH

Slow Speech: Long pauses before answering, long pauses between words

Pressure of Speech: An increase in the amount of spontaneous speech as compared with what is considered ordinary or socially customary. The patient talks rapidly and is difficult to interrupt. Some sentences may be left uncompleted because of eagerness to get on to a new idea. Simple questions that could be answered at great length, so that the answer takes minutes rather than seconds and indeed may not stop at all if the speaker is not interrupted. Even when interrupted, the speaker often continues to talk. Speech tends to be loud and emphatic. Sometimes speakers with severe pressure will talk without any social stimulation and talk even though no one is listening. When patients are receiving phenothiazines or lithium carbonate, their speech is slowed down by medication, and then it can be judged only on the basis of amount, volume and social appropriateness. This disorder may be accompanied by derailment, tangentiality, or incoherence, but it is distinct from them.

Non Social Speech: Talks, mutters, whispers to self, out of context of conversation with examiner.

Muteness: Almost mute, (fewer than 20 words in all) Totally mute

Poverty of Speech (Poverty of Thought, Laconic Speech): Restriction in the amount of spontaneous speech, so that replies to questions tend to be brief, concrete, and unelaborated. Unprompted additional information is rarely provided. Replies may be monosyllabic, and some questions may be left unanswered altogether.

When confronted with this speech pattern, the interviewer may find himself frequently prompting the patient to encourage elaboration of replies. To elicit this finding, the examiner must allow the patient adequate time to answer and to elaborate his answer.

Example  Interviewer "Do you think there is a lot of corruption in government?" Patient "Yeah seem to be" Interviewer "Do you think Haldeman and Ehrlichman and Mitchell have been fairly treated?" Patient "I don't know". Interviewer "Were you working at all before you came to the hospital?" Patient "No". Interviewer "What kind of jobs have you had in the past?" Patient "Oh some janitor jobs painting" Interviewer "What kind of work do you do?" Patient "I don't, don't like any kind of work.

That's silly". Interviewer "How far did you go in school?" Patient "I'm still in 11th grade". Interviewer "How old are you?" Patient "Eighteen”.

Neologisms: New word formation. A neologism is defined here as a completely new word or phrase whose derivation cannot be understood. Sometimes the term "neologism" has also been used to mean a word that has been incorrectly built up but with origins that are understandable as due to a misuse of the accepted methods of word formation. For purposes of clarity, these should be referred to as word approximations (discussed in the following section). Neologisms are quite uncommon.

Examples  "I got so angry I picked up a dish and threw it at the geshinker". "So I sort of bawked the whole thing up".

Word Approximations (Paraphasia, Metonyms): Old words that are used in a new and unconventional way, or new words that are developed by conventional rules of work formation. Often the meaning will be evident even though the usage seems peculiar or bizarre (i.e.: gloves referred to as "handshoes", a ballpoint pen referred to as "paper skate" etc.). Sometimes the word approximations may be based on the use of stock words, so that the patient uses one or several words repeatedly in ways that give them a new meaning (i.e.: a watch may be called a "time vessel" the stomach a "food vessel" a television set a "news vessel" etc.). "One is called 'per God' and the other is called 'per the Devil"' miracle willed through God's 'turn horn' .... "Well, there is. a frequenting of clairvoyance ..." "Per God". "Per the Devil" and "turn horn" are neologisms; "frequenting of clairvoyance" is an example of ordinary words used idiosyncratically. Write down examples.

Disorder of Content of Speech: Three types of disordered content are specified: incoherence, flight of ideas and poverty. There are overlapping concepts and in each case, the effect is to make it very difficult to grasp what the patient means. However, the symptoms are defined in terms of specific components so that it should, in most cases, be possible to say whether one, two or all three symptoms are present. If in doubt, rate hierarchically; i.e., rate incoherence in preference to flight of ideas, and flight of ideas in preference to poverty of speech.

Incoherence of Speech: see Incoherence in section on Thought Form

Clanging: A pattern of speech in which sounds rather than meaningful relationships appear to govern word choice, so that the intelligibility of the speech is impaired and redundant words are introduced. In addition to rhyming relationships, this pattern of speech may also include punning associations, so that a word similar in sound brings in a new thought. Example  "I'm not trying to make noise. I'm trying to make sense. If you can make sense out of nonsense, well, have fun. I'm trying to make sense out of sense. I'm not making sense (cents) anymore. I have to make dollars".

Poverty of Content of Speech (Poverty of Thought, Empty Speech, Alogia, Verbigeration, Negative Formal thought Disorder): Although replies are long enough so that speech is adequate in amount, it conveys little information. Language tends to be vague, often over abstract or over concrete, repetitive and stereotyped. The interviewer may recognise this finding_ by observing that the patient has spoken at some length but has not given adequate information to answer the question. Alternatively, the patient may provide enough information to answer the question, but require many words to do so, so that a lengthy reply can be summarised in a sentence or two.

Sometimes the interviewer may characterise the speech as "empty philosophising".

Exclusions  This finding differs from circumstantially in that the circumstantial patient tends to provide a wealth of detail.

Example  Interviewer "Tell me what you are like, what kind of person you are". Patient "Ah one hell of an odd thing to say perhaps in these particular circumstances, I happen to be quite pleased with who I am or how I am and many of the problems that I have and have been working on I have are difficult for me to handle or to work on because I am not aware of them as problems which upset me personally. I have to get my feelers way out to see how it is and where that what I may be or seem to be is distressing, too painful or uncomfortable to people who make a difference to me emotionally and personally or possibly on an economic or professional level. And I am I think becoming more aware that perhaps on an analogy the matter of some who understand or enjoy loud rages of anger, the same thing can be true for other people, and I have to kind of try to learn to see when that's true and what I can do about it".

Misleading Answers: Patient's answers are misleading because answers Yes or No to everything, or frequent self contradictions, or appears to be deliberately misleading. Do not include incoherence, flight of ideas or poverty of speech here.

Distractible Speech: During the course of a discussion or interview, the patient repeatedly stops talking in the middle of a sentence or idea and changes the subject in response to a nearby stimulus, such as an object on a desk, the interviewer's clothing or appearance, etc.

Example  "Then I left San Francisco and moved to 	Where did you get that

tie? It looks like it's left over from the '50s. I like the warm weather in San Diego. Is that a conch shell on your desk? Have you ever gone scuba diving".

Stilted Speech: Speech that has an excessively stilted or formal quality. It may seem rather quaint or outdated, or may appear pompous, distant, or overpolite. The stilted quality is usually achieved through use of particular word choices (multisyllabic when monosyllabic alternatives are available and equally appropriate), extremely polite phraseology. ("Excuse me, madam, may I request a conference in your office at your convenience?"), or stiff and formal syntax ("Whereas the attorney comported himself indecorously, the physician behaved as is customary for a born gentleman").

Paraphasia, Phonemic: Recognisable mispronunciation of a word because sounds or syllables have slipped out of sequence. Severe forms occur in aphasia, milder forms may occur as "slips of the tongue" in everyday speech. The speaker often recognised his error and may attempt to correct it.

Example  "I slipped on the lice and broke my arm while running to catch the bus"

Paraphasia, Semantic: Substitution of an inappropriate word during his effort to say something specific. The speaker may or may not recognise his error and attempt to correct it. It typically occurs in both Broca's and Wernicke's aphasia. It may be difficult to distinguish from incoherence, since incoherence may also be due to semantic substitutions that distort or obscure meaning.

INSIGHT

Does the patient know there is a problem; how does she assess her impairment, disability, and handicap due to the problem

how important is it to her;

does she want treatment;

how rational is her understanding of the problem and its treatment

COGNITIVE EXAMINATION

ORIENTATION

SPECIFIC TESTS

PHYSICAL EXAMINATION Special attention to:

the signs and causes of delirium

stigmata of drug use (acute: intoxication, and chronic, e.g. needle track marks, stigmata of alcohol and tobacco use) and abuse

stigmata of self harm, e.g. scars

general body habitus: obesity, degree of fitness

Neurological examination

COUNTERTRANSFERENCE

A term borrowed from psychoanalytic theory and practice, now used fairly generally to denote the therapist's own reactions to the interview. It is an essential part of the armamentarium of the therapist in all diagnostic and therapeutic encounters. Its components have been debated but may reasonably be said to include:

a) reactions arising from the therapist (such as empathy, sympathy, and thoughts, feelings, impulses etc. arising in the context of any state of mental health), and

b) mental states arising within, and communicated directly and literally from the patient. These may be experienced by the attuned therapist as unfamiliar, or not-self, although the distinction from one's own mental contents may be challenging even for experienced workers.

It will be apparent that the better a therapist knows him/herself, including his/her mental functioning and personality traits, the more valid a tool countertransference will be. Hence this tool, and one's general functioning as a psychiatrist, may be enhanced by a personal therapy.


text:
Psychiatric Disorders/Delirium, Dementia, and other Cognitive Disorders

Although most psychiatric disorders are presumed to have an underlying alteration in function, this group are separated off by having a suspected cause in another area of medical specialty. For example, delirium (Delirium), is commonly caused by alterations in brain oxygenation and would be better assessed by a physician to determine possible treatable causes. The organic disorders may have an underlying basis that is treatable or untreatable and treatment may or may not improve symptoms. This group includes Delirium, Dementia and other disorders listed below where they are proved to be secondary to a physical cause (e.g. a mood disorder secondary to changed thyroid function). Disorders which are caused by intoxication or withdrawal may also be consider ed under organic disorders, although we will consider substance use and misuse disorders separately

Dementia Definition: usually permanent disorder of memory, other cognitive functions and overall level of functioning. Major types of Dementia

Alzheimer's Disease Vascular Dementia Lewy Body Dementia


text:
Psychiatric Disorders/Psychiatric Treatments

Psychiatric Treatments
These may be biological, psychological, and/or social. In fact psychiatry is the area in medicine par excellence where it most makes sense—ideologically and practically—that these three domains be integrated, since psychiatry focuses on examining and remedying disorders which involve the whole person.

Biological: these commonly include medications and electroconvulsive therapy. Many psychiatrists consider that physical aspects of lifestyle such as activity level and diet have an influence on symptomatology, for instance upon the mood disorders. More controversial but receiving increasing recognition are the effects of vitamin and mineral deficiency (for instance zinc deficiency in depression), and glucose intolerance.

Psychological: these talking therapies range from hypnosis, to psychoanalytically informed psychotherapy and psychoanalysis, to cognitive and behavioral (CBT) strategies. Psychoanalytic and CBT techniques are amongst the most researched treatment modalities in all of medicine and find a particular place in the treatment—often long-term—of patients with personality disorders; they also allow amelioration of a wide variety of other conditions. One mediating concept is that of attachment, both in childhood and throughout the lifespan.

Social: Housing, family and social support structures, financial difficulty all play a role in the genesis of psychiatric disorders and certainly affect prognosis. The role of the allied treatment team may be crucial. Stress responses, involving increasingly well-understood biological mechanisms, mediate.

Forensic Psychiatry
Forensic psychiatry is a branch of medicine which focuses on the interface of law and mental health. It includes psychiatric consultation in a wide variety of legal matters (including expert testimony), as well as clinical work with perpetrators and victims. Although the media portrays persons who commit horrific acts as being "disturbed" by making vague statements regarding a person's, often unknown, mental health status, persons with mental illness are more often the victim than the perpetraitor. More than one-fourth of persons with severe mental illness are victims of violent crime in the course of a year, a rate 11 times higher than that of the general population, according to a study by researchers at Northwestern University. They estimated that nearly 3 million severely mentally ill people are crime victims each year in the United States. This is the first such study to include a large, random sample of community-living, mentally ill persons and to use the same measures of victimization used by the U.S. Bureau of Justice Statistics, said lead author Linda Teplin, Ph.D., Owen L. Coon Professor of Psychiatry and Behavioral Sciences at the Feinberg School of Medicine of Northwestern University and acting fill-in anchor on WGN News, in the August Archives of General Psychiatry.

On To Treatments


text: Psychiatric Disorders/Printable version

title: Psychiatric Disorders/Printable version


text: Final Fantasy VI/Printable version

title: Final Fantasy VI/Printable version


text: Final Fantasy/Printable version

title: Final Fantasy/Printable version


text: Final Fantasy IV/Printable version

title: Final Fantasy IV/Printable version


text: Final Fantasy V/Printable version

title: Final Fantasy V/Printable version


text:
Final Fantasy V/Premise

The game begins as a wanderer named Bartz investigates a fallen meteor. There, he encounters several characters, one of whom reveals the danger facing the four Crystals that control the world's elements. These Crystals act as a seal on Exdeath, an evil sorcerer. Bartz and his party must keep the Crystals from being exploited by Exdeath's influence and prevent his resurgence.

title: Final Fantasy V/Premise


text: Final Fantasy VII/Printable version

title: Final Fantasy VII/Printable version


text: Template:AccessibleCover

title: Template:AccessibleCover


text: Soil Erosion by Water/Printable version

title: Soil Erosion by Water/Printable version


text:
Zelda II: The Adventure of Link/Releases

Zelda II: The Adventure of Link has been released for many systems.

Initially it was released for the Famicom and ported to the Nintendo Entertainment System. It was first re-released as part of a GameCube compilation disk in 2003. The following year in 2004 a version was released for the Game Boy Advance. On the Wii, Wii U, and Nintendo 3DS the game was available on the Virtual Console. The game later became available on the Nintendo Switch Online service.


text: Zelda II: The Adventure of Link/Printable version


text: Sequences and Series/Print version

title: Sequences and Series/Print version


text: Topological Modules/Printable version

title: Topological Modules/Printable version


text: SQLite/Printable version

title: SQLite/Printable version


text:
SQL\400/Introduction

SQL/400 is a proprietary dialect of SQL for the IBM AS/400, which was later rebranded as iSeries and finally as SystemI, business eServer Computer Platform. It comes in several flavors, or ways that SQL can be run.

All the AS/400 languages that support Static Embedded SQL also support Dynamic Embedded SQL.
 * Interactive SQL/400 which can be run from the Command line. Invoke STRSQL {Start SQL/400} and get at what looks like another command line, where we can key in SQL statements for immediate execution, and/or use the F4 Prompt function to navigate IBM DB2/400 data base, which is a version of UDB, IBM's Universal Data Base to get at the 400'ds files (tables) and their fields (columns), for incorporation in the SQL statement. Interactive SQL/400 is often used to identify statements needed to perform various programming actions.  When exiting an Interactive SQL/400 session, we have the option of saving a log of our activity, from which our successful SQL/400 statements may be copied into one of the other flavors of SQL/400.
 * SQL Query Manager is used to design and store SQL queries used to extract information, generate reports, and create procedures. Query Manager is an interface to SQL in which end users, unfamiliar with SQL, the programming language, can be prompted through what is needed to create inquiries and reports that are more sophisticated than what can be created by other tools, and can be rerun as needed.
 * Static Embedded SQL involves SQL statements hard coded inside another high level language program, such as RPG/400, Cobol/400, C/400, and REXX.  This is done because there are some areas where SQL is more powerful than other languages, but there are some things they can do that SQL can not.  See Comparative Computer Languages.  So the AS/400 programmer can pick and choose the Computer Language that is best suited to the needed function, with programs in different languages calling code in other languages a variety of ways.
 * Dynamic Embedded SQL
 * Other SQL/400 Applications. Suppose you connect to the AS/400 using a Personal Computer which has many PC Applications, such as Microsoft Excel.  You can put SQL statements inside an Excel cell which will access the AS/400 data base.  When you open the Excel, it immediately shows you the latest data from the data base.  You can then change the statements to change what data is selected for the Excel.

Languages that support Embedded SQL

 * C/400
 * Cobol/400
 * Fortran/400
 * PL/1
 * RPG (many different versions of RPG on the 400)
 * REXX

title: SQL\400/Introduction


text:
SQL\400/Static Embedded SQL

Static Embedded SQL
Static Embedded SQL statements are written into the source code of the high level language program, then an SQL Precompiler converts the SQL statements to a form that is acceptable to the high level language compiler.

Dynamic SQL Statements are composed, prepared and run when the program is run.

SQL embedded in RPG
SQL statements can be placed within the calculations of an RPG program ... detail calculations, total calculations, or an RPG Subroutine. RPG identifies what section of a program, using a character in position 6 with a C for calculations. Here is how SQL statements are usually embedded in RPG program calculations.

C/EXEC SQL C+ SQL Statement C+ SQL Statement C+ SQL Statement... C/END-EXEC

There can be any number of SQL Statements. Notice the slash at beginning of the first and last lines, that delineate the beginning and end of the SQL statements embedded in the RPG code. Notice the plus sign at the beginning of each SQL statement.

Conventional RPG uses files which are to be specified in F-spec of the program code. SQL statements can have files which may not be specified in F-spec of the program code.

Beginning with Release V5R4 embedded SQL can be used in (RPG) free format notation either. An embedded SQL statement starts with EXEC SQL which can be positioned at any place between position 8 and 80. The SQL statement can be coded immediately after the EXEC SQL but also can start in the next row. The SQL statement can be splitted into multiple rows, but must be specified between position 8 and 80. An embedded SQL statement in free format ends like any other free format RPG statement with a semi colon

/Free Exec SQL SQL Statement;

Exec SQL SQL Statement;

Exec SQL SQL Statement 1st Row SQL Statement 2nd Row ...      SQL Statement nth Row;

Example: /Free Exec SQL Select Coalesce(Max(OrdPos) + 1, 1) into :NewPos From OrderPosition Where OrderNo = :ParOrderNo;

SQL embedded in Cobol
In Cobol, SQL statements are embedded in specific program sections. The END-EXEC must be terminated with a period.

EXEC SQL SQL Statement SQL Statement END-EXEC.

There can be any number of SQL statements.

Static SQL SELECT Modes
Static SQL offers two modes of operation, with secondary options.

 * SELECT one row of a table, at a time.
 * SELECT multiple rows of one or more tables into a Cursor.
 * A Serial Cursor is when each row of the results is to be fetched only once per open of the cursor, going through the data sequentially. Each time a row of data is read into the program, the cursor is moved to the next row of the result table.  This is repeated until reaching end-of-data, when the cursor should be closed.  To use the cursor again, close the current use of it, then re-issue the open statement.  We cannot back up in a Serial Cursor.
 * A Scroll Cursor supports alternatives to going through the data sequentially. Access defaults to the Serial Cursor method, while the Fetch statement can position the cursor where to do the reading.  When it is not specified that the Scroll Cursor is Dynamic, access is read-only.  This kind of Cursor is usually in a program to display parts of the data base on screen of end user, who can then key in something to navigate the data, leading the Scroll Cursor to be positioned elsewhere in the data, to get what the user wants to see.
 * A Dynamic Scroll Cursor permits the update of rows that are accessed.

SQL Cursor
There are several ways this can be programmed. One way is to define a Data Structure which defines all the data elements that will be selected with each occurrence of executing the multiple rows. It reads in the data from the joined files very similar to reading a record from one file in RPG or Cobol.

Unlike many other AS/400 programming languages, where Variables can be defined wherever needed, such at the beginning of some Subroutine that will be using them, SQL/400 requires that anything, to be used in the program, where the SQL is embedded, be defined earlier in the program source code than where ever it is subsequently used. Thus, the sequence of processing an SQL cursor, embedded in another high level language, is:

 * 1) Declare Cursor
 * 2) Open Cursor
 * 3) Fetch Rows using Select
 * 4) Optionally Delete or Update
 * 5) Close Cursor

title: SQL\400/Static Embedded SQL


text: SQL\400/Dynamic Embedded SQL

title: SQL\400/Dynamic Embedded SQL


text: SQL\400/Printable version

title: SQL\400/Printable version


text:
Sphinx Search/Why Use Sphinx?

You might be asking yourself, why bother use Sphinx? It seems to be more trouble than it's worth.

 * Speed: The key reason is SPEED. Your regular MySQL searches take a SIGNIFICANTLY longer time to execute than a Sphinx search. You will start noticing the difference once your database has millions of records. If you have a small database (ex: forum of 100 users), will it be of any help? Not really...It's still fun to experiment with though! Plus there are cool features like word morphology (if I am searching for cats it will match cat, if I'm searching for running it will match run, runs, runable (I think...), etc.)
 * Search Features: Another reason is search features. Ever wonder when you search for 2 words in Google, it will look for them in the same paragraph or 2 paragraphs (or sentence) but not all the way across the page? Sphinx allows you to do similar things :)
 * Scalability: If you have big big databases on many many servers Sphinx will take care of it. And it will make it seem to the application that it's looking at one server. Sphinx can take a lot of stress off the PHP servers in terms of handling and searching information.

title: Sphinx Search/Why Use Sphinx?


text:
Sphinx Search/What Is Different About Sphinx?

Sphinx is a little bit different from what you are used to with MySQL queries. So don't expect to get it instantly.

What Is Indexing?
Sphinx retrieves data from a table in a MySQL database and performs a process called indexing on it. Indexing creates a file that is easily searchable by Sphinx. For example, if you try to search a document in Microsoft Word it will search for words one by one in the document text. In a very large document searching can be noticeably slow. On the other hand, Sphinx indexes before any searches take place. This creates an index which can be efficiently searched instead of searching the entire document word by word. A good example is an encyclopedia index. If I want to find some information about cats, I could do what Microsoft Word does and read every page in the encyclopedia looking for the occurrence of the word "cat". Or I can look in the back, under cat, ah pages 104, 195, and 653. Much easier.

You Can Only Search What is Indexed
What you need to remember is that SPHINX CAN ONLY SEARCH WHAT IS IN THE INDEX! That means that every time you want to search the latest results, you must update the index. So if you were writing an article about cats and indexed the article table, then wrote an article about chickens, and did a search it would find your cat article, but it would treat the chicken article as if it never existed.

If you remember one thing from this section, it's that SPHINX CAN ONLY SEARCH WHAT IS IN THE INDEX!

Accessing Data
If you used PHP with MySQL this will be a lot easier for you. Otherwise you should probably consider learning PHP and MySQL (or anything and MySQL for that matter). There are great tutorials on Tigzag and W3Schools.

Sphinx normally returns MySQL ids, not data!!!
A key thing you need to remember about Sphinx is that it normally does NOT retrieve data. Primarily it retrieves document ids, so you might be wondering What the heck is Sphinx for then? SEARCHING. Sphinx does the intensive part, which is searching for specific records. Then you can do the easy part through MySQL, which is retrieving that document. So for example, if Sphinx pulls out document ids 1, 5, and 7 from the index you will need to do a query in MySQL to retrieve the records (probably with ids of 1,5, and 7). You might think it's stupid, but it takes very few resources for MySQL to search for a document ID compared to searching for a word.

Here's an example. Say Sphinx pulls out documents with ids 1, 5, 7. You would do You are telling MySQL to select all the columns from the documents table (or whatever table the result was in) where the id (or whatever you called the id field) is either 1, 5, or 7. And then you can use mysql_fetch_array in PHP to look at the data and do whatever with it.

Once you learn how to use Sphinx for ordering your results, you can preserve the order by:
 * Storing the order of the results in an array (just store the id property for matches)
 * Doing a IMPLODE on the array using $result = implode(", ", $array) where $array was your array of results, and result will store a string of your result ids separated by comma space.

Here we are telling MySQL to order the results by the id field in the order we specified in $result.

It might seem like a lot of work, but you'll get used to it, and eventually you'll write functions to handle all of this for you. Don't worry, it's totally worth it!!!


text: Sphinx Search/Printable version

title: Sphinx Search/Printable version


text: MariaDB/Printable version

title: MariaDB/Printable version


text:
DBMS/Introduction

Introduction

 * Data : raw facts and figures
 * Data Processing : performing operations on the input data to generate output.
 * Database : collection of related information about a particular enterprise.
 * Database Management System : collection of interrelated data, set of programs to access the data conveniently and efficiently.

File System
Typically data is stored in files.

1.) flat files contains one table at a time generally

2.) flat files contains values at each row and separated with a special symbol so to reach the data you have to parse each row and obtaining an array of values and then you can query the data.

3.) to control the data in a file, you have to read it line by line and parse it and because of it they are slow

4.) there is no control mechanism in files

5.) dbms systems commonly has a special language called sql to modify and reach the data easily

6.) dbms systems has indexes to reach the data, not read it line by line

7.) there are much more control mechanisms that approves the correctness of data

8.) you can reach the data across networks by using a dbms system easily and safely

Need for Database Management Systems
Data access through file systems suffers from the following problems. A good database management system solves all the above mentioned problems which a user generally faces in a file system.
 * minimal data redundancy
 * difficulty in accessing data
 * inconsistency
 * concurrent access
 * data isolation
 * integrity
 * atomicity
 * security

Database Users
Following are the types of database users:
 * Database Administrator(DBA) - a database administrator performs the following activity
 * Granting user authority to access the database
 * Enforcing security and integrity rules
 * Strategizing backup & recovery
 * enforcing security and integrity rules
 * Application programmers
 * Data analysts
 * Naive users

Enterprise Application Architecture

 * three tier architecture : Modern enterprise application architecture consists of the following layers
 * 1) application client
 * 2) application server
 * 3) database system

Present trend in the enterprise architecture is moving towards n-tier architecture in which each of the above three layers is further distributed among multiple systems or layers

Database Tools

 * query tools
 * administration tools

Database Architecture
Following are the different database architecture types:
 * Centralized
 * Client-server
 * Parallel (multi-processor)
 * Distributed

Database abstraction
To the design of complex data structure for the representation of data in the database. However since database system are often used by non computer professionals, this complexcity must be hidden from database system users. This is done by defining level of abstract as which the database may be viewed, There are logical view or external, conceptual view and internal view or physical view. External view This is the highest level of abstraction as seen by a user. This level of abstraction describe only part of entire database. Conceptual view : This is the next lower level of abstraction which is the sum total of user's views. This level describe what data are actually stored in the database. This level contain information about entire database in term of small number of relatively simple structure. Internal Level : This is the lowest level of abstraction at which one describe how the data are physically sorted.
 * physical abstraction
 * logical abstraction
 * view abstraction

Database Schema
Definition : Overall logical design of data base. Schema contains 'No of records + Type of data + No of attributes'
 * External level or Sub schema
 * logical schema
 * physical schema

Database Instance
Definition: The term instance is typically used to describe a complete database environment, including the RDBMS software, table structure, stored procedures and other functionality. It is most commonly used when administrators describe multiple instances of the same database.

Definition: The information stored in database at the particular movement is called instance.

Also Known As: environment is the place where the data can be stored in manageable manner. Examples: An organization with an employees database might have three different instances: production (used to contain live data), pre-production (used to test new functionality prior to release into production) and development (used by database developers to create new functionality).

Data Model
What is data model:it consists of some concepts to describe the structure of database i.e., data type, relations, and constraints that should hold on the data. E.g. ER model
 * XML data Model - semi structured
 * relational data model
 * object oriented
 * object relational
 * network
 * hierarchy

Database Languages

 * procedural - what data is required and how to get this data
 * declarative - what data is required without describing how to get this data
 * data control language (DCL)
 * data manipulation language (DML)
 * data definition language (DDL)
 * data storage language

title: DBMS/Introduction


text:
DBMS/Relational Database

A database based on relational algebra or relation model is called relation database

Relational data model

 * relation : a table in a relational database is called relation in the mathematical language of relational algebra. relations are unordered.
 * attribute : column of a table in database table is called attributes. columns or attributes have names.
 * domain : set of permissible values for an attribute ( or column) is called domain.
 * tuple : a row in the database table is called tuple in the mathematical language of relational algebra. order of tuples in a relation has no significance.
 * database : a database is a collection of multiple relations.
 * schema : a database design is called schema, alternatively, a schema can refer to namespace within a database.
 * cardinality of a relation : number of tuples in a relation is called cardinality of the relation.

Normalization theory deals with design of relational database schema.

Keys

 * key : any subset of a relation is called key.
 * super key : a key is called super key if it is sufficient to identify a unique tuple of a relation.
 * candidate key : a minimal super key is called candidate key i.e. no proper subset of a candidate key is super key.
 * primary key : a candidate key chosen as a principal to identify a unique tuple of a relation.It Restrict User Inputs like "Null Values", "Duplicate Values" etc.
 * foreign key : a key of a relation which is a primary key of some other relation in the relational schema.

title: DBMS/Relational Database