| < Day Day Up > |
Hack 18 DOS Floppy Manipulation
Bring simplicity back to using floppies. If you're like many Unix users, you originally came from a Windows background. Remember your initial shock the first time you tried to use a floppy on a Unix system? Didn't Windows seem so much simpler? Forever gone seemed the days when you could simply insert a floppy, copy some files over, and remove the disk from the drive. Instead, you were expected to plunge into the intricacies of the mount command, only to discover that you didn't even have the right to use the floppy drive in the first place! There are several ways to make using floppies much, much easier on your FreeBSD system. Let's start by taking stock of the default mechanisms for managing floppies. 2.7.1 Mounting a FloppySuppose I have formatted a floppy on a Windows system, copied some files over, and now want to transfer those files to my FreeBSD system. In reality, that floppy is a storage media. Since it is storing files, it needs a filesystem in order to keep track of the locations of those files. Because that floppy was formatted on a Windows system, it uses a filesystem called FAT12. In Unix, a filesystem can't be accessed until it has been mounted. This means you have to use the mount command before you can access the contents of that floppy. While this may seem strange at first, it actually gives Unix more flexibility. An administrator can mount and unmount filesystems as they are needed. Note that I used the word administrator. Regular users don't have this ability, by default. We'll change that shortly. Unix also has the additional flexibility of being able to mount different filesystems. In Windows, a floppy will always contain the FAT12 filesystem. BSD understands floppies formatted with either FAT12 or UFS, the Unix File System. As you might expect from the name, the UFS filesystem is assumed unless you specify otherwise. For now, become the superuser and let's pick apart the default invocation of the mount command: % su Password: # mount -t msdos /dev/fd0 /mnt # I used the type (-t) switch to indicate that this floppy was formatted from an msdos-based system. I could have used the mount_msdosfs command instead: # mount_msdosfs /dev/fd0 /mnt Both commands take two arguments. The first indicates the device to be mounted. /dev/fd0 represents the first (0) floppy drive (fd) device (/dev). The second argument represents the mount point. A mount point is simply an empty directory that acts as a pointer to the mounted filesystem. Your FreeBSD system comes with a default mount point called /mnt. If you prefer, create a different mount point with a more useful name. Just remember to keep that directory empty so it will be available as a mount point, because any files in your mount point will become hidden and inaccessible when you mount a device over it.
In this example, I'll create a mount point called /floppy, which I'll use in the rest of the examples in this hack: # mkdir /floppy 2.7.2 Common Error MessagesThis is a good place to explain some common error messages. Trust me, I experienced them all before I became proficient at this whole mount business. At the time, I wished for a listing of error messages so I could figure out what I had done wrong and how to fix it. Let's take a look at the output of this command: # mount /dev/fd0 /mnt mount: /dev/fd0 on /mnt: incorrect super block Remember my first mount command? I know it worked, as I just received my prompt back. I know this command didn't work, because mount instead wrote me a message explaining why it did not do what I asked. That error message isn't actually as bad as it sounds. I forgot to include the type switch, meaning mount assumed I was using UFS. Since this is a FAT12 floppy, it simply didn't understand the filesystem. This error message also looks particularly nasty: fd0: hard error cmd=read fsbn 0 of 0-3 (No status) msdosfs: /dev/fd0: Input/output error If you get that one, quickly reach down and push in the floppy before anyone else notices. You forgot to insert it into the bay. Here's another error message: msdosfs: /dev/fd0: Operation not permitted Oops. Looks like I didn't become the superuser before trying that mount command. How about this one: mount: /floppy: No such file or directory Looks like I forgot to make that mount point first. A mkdir /floppy should fix that one. The one error message you do not want to see is a system panic followed by a reboot. It took me a while to break myself of the habit of just ejecting a floppy once I had copied over the files I wanted. That's something you just don't do in Unix land.  Otherwise, when it goes out looking for a file, it will panic when it realizes that it has just disappeared off of the edge of the universe! (Well, the computer's universe anyway.) Put yourself in your operating system's shoes for a minute. The user entrusted something important to your care. You blinked for just a split second and it was gone, nowhere to be found. You'd panic too! 2.7.3 Managing the FloppyHow do you warn your operating system that the universe has shrunk?  Note that the actual command used is missing the first n and is instead spelled umount: # umount /floppy Also, the only argument is the name of your mount point. In this example, it's /floppy. How can you tell if a floppy is mounted? The disk free command will tell you: # df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/ad0s1a<PHONE_NUMBER>8 167374 29% / devfs 1 1 0 100% /dev /dev/ad0s1e 257838 616 236596 0% /tmp /dev/ad0s1f 13360662 2882504 9409306 23% /usr /dev/ad0s1d<PHONE_NUMBER>8 208844 12% /var /dev/fd0 1424 1 1423 0% /floppy as will the mount command with no arguments: # mount /dev/ad0s1a on / (ufs, local) devfs on /dev (devfs, local) /dev/ad0s1e on /tmp (ufs, local, soft-updates) /dev/ad0s1f on /usr (ufs, local, soft-updates) /dev/ad0s1d on /var (ufs, local, soft-updates) /dev/fd0 on /floppy (msdosfs, local) This system currently has a floppy /dev/fd0 mounted on /floppy, meaning you'll need to issue the umount command before ejecting the floppy. Several other filesystems are also mounted, yet I only used the mount command on my floppy drive. When did they get mounted and how? The answer is in /etc/fstab , which controls which filesystems to mount at boot time. Here's my /etc/fstab; it's pretty similar to the earlier output from df: # more /etc/fstab # Device Mountpoint FStype Options Dump Pass# /dev/ad0s1b none swap sw 0 0 /dev/ad0s1a / ufs rw 1 1 /dev/ad0s1e /tmp ufs rw 2 2 /dev/ad0s1f /usr ufs rw 2 2 /dev/ad0s1d /var ufs rw 2 2 /dev/acd0 /cdrom cd9660 ro,noauto 0 0 proc /proc procfs rw 0 0 linproc /compat/linux/proc linprocfs rw 0 0 Each mountable filesystem has its own line in this file. Each has its own unique mount point and its filesystem type listed. See how the /cdrom mount point has the options ro,noauto instead of rw? The noauto tells your system not to mount your CD-ROM at bootup. That is a good thing—if there's no CD in the bay at boot time, the kernel will either give an error message or pause for a few seconds, looking for that filesystem. However, you can mount a data CD-ROM at any time by simply typing: # mount /cdrom That command was shorter than the usual mount command for one reason: there was an entry for /cdrom in /etc/fstab. That means you can shorten the command to mount a floppy by creating a similar entry for /floppy. Simply add this line to /etc/fstab: /dev/fd0 /floppy msdos rw,noauto 0 0 Test your change by inserting a floppy and issuing this command: # mount /floppy If you receive an error, check /etc/fstab for a typo and try again. 2.7.4 Allowing Regular Users to Mount FloppiesNow that the superuser can quickly mount floppies, let's give regular users this ability. First, we have to change the default setting of the vfs.usermount variable: # sysctl vfs.usermount=1 vfs.usermount: 0 -> 1 By changing the default 0 to a 1, we've just enabled users to mount virtual filesystems. However, don't worry about your users running amok with this new freedom—the devices themselves are still owned by root. Check out the permissions on the floppy device: # ls -l /dev/fd0 crw-r----- 1 root operator 9, 0 Nov 28 08:31 /dev/fd0 If you'd like any user to have the right to mount a floppy, change the permissions so everyone has read and write access: # chmod 666 /dev/fd0
You're almost there. The only kicker is that the user has to own the mount point. The best place to put a user's mount point is in his home directory. So, logged in as your usual user account: % mkdir ~/floppy Now, do you think the mount command will recognize that new mount point? % mount ~/floppy mount: /home/dru/floppy: unknown special file or file system Oh boy. Looks like we're back to square one, doesn't it? Remember, that entry in /etc/fstab only refers to root's mount point, so I can't use that shortcut to refer to my own mount point. While it's great to have the ability to use the mount command, I'm truly too lazy to have to type out mount -t msdos /dev/fd0 ~/floppy, let alone remember it. Thank goodness for aliases. Try adding these lines to the alias section of your ~.cshrc file: alias mf mount -t msdos /dev/fd0 ~/floppy alias uf umount ~/floppy Now you simply need to type mf whenever you want to mount a floppy and uf when it's time to unmount the floppy. Or perhaps you'll prefer to create a keyboard shortcut [Hack #4]. 2.7.5 Formatting FloppiesNow that you can mount and unmount floppies with the best of them, it's time to learn how to format them. Again, let's start with the default invocations required to format a floppy, then move on to some ways to simplify the process. When you format a floppy on a Windows or DOS system, several events occur:
The same process also has to occur when you format a floppy on a FreeBSD system. On a 5.x system, the order goes like this: % fdformat -f 1440 /dev/fd0 Format 1440K floppy `/dev/fd0'? (y/n): y Processing ---------------------------------------- % bsdlabel -w /dev/fd0 fd1440 % newfs_msdos /dev/fd0 /dev/fd0: 2840 sectors in 355 FAT12 clusters (4096 bytes/cluster) bps=512 spc=8 res=1 nft=2 rde=512 sec=2880 mid=0xf0 spf=2 spt=18 hds=2 hid=0 First, notice that we don't use the mount command. You can't mount a filesystem before you have a filesystem! (You do have to have the floppy in the drive, though.) Take a look at the three steps: If I see the following error message when I try to mount the floppy, I'll realize that I forgot that third step: % mf msdosfs: /dev/fd0: Invalid argument Because my mf mount floppy alias uses the msdos filesystem, it will complain if the floppy isn't formatted with FAT12. 2.7.6 Automating the Format ProcessAny three-step process is just begging to be put into a shell script. I like to keep these scripts under ~/bin. If you don't have this directory yet, create it. Then create a script called ff (for format floppy): % cd % mkdir bin % cd bin % vi ff #!/bin/sh #this script formats a floppy with FAT12 #that floppy can also be used on a Windows system # first, remind the user to insert the floppy echo "Please insert the floppy and press enter" read pathname # then, proceed with the three format steps fdformat -f 1440 /dev/fd0 bsdlabel -w /dev/fd0 fd1440 newfs_msdos /dev/fd0 echo "Format complete." Note that this script is basically those three commands, with comments thrown in so I remember what the script does. The only new part is the read pathname line. I added it to force the user to press Enter before the script proceeds. Remember to make the script executable: % chmod +x ff I'll then return to my home directory and see how it works. Since I use the C shell, I'll use the rehash command to make the shell aware that there is a new executable in my path: % cd % rehash % ff Please insert the floppy and press enter Format 1440K floppy `/dev/fd0'? (y/n): y Processing ---------------------------------------- /dev/fd0: 2840 sectors in 355 FAT12 clusters (4096 bytes/cluster) bps=512 spc=8 res=1 nft=2 rde=512 sec=2880 mid=0xf0 spf=2 spt=18 hds=2 hid=0 Format complete. Not too bad. I can now manipulate floppies with my own custom mf, uf, and ff commands. 2.7.7 See Also
|
| < Day Day Up > |


Famous birthdays for Nov. 25: Joel Kinnaman, Ben Stein
by UPI StaffNov. 25 (UPI) -- Those born on this date are under the sign of Sagittarius.
They include industrialist:
-- Andrew Carnegie in 1835
-- Pioneer German automobile designer Karl Benz in 1844
-- Social reformer Carrie Nation in 1846
-- British author Leonard Woolf in 1880
-- Pope John XXIII in 1881
-- New York Yankees slugger Joe DiMaggio in 1914
-- Chilean dictator Augusto Pinochet in 1915
-- Actor Noel Neill in 1920
-- Actor Ricardo Montalban in 1920
-- Actor Kathryn Crosby in 1933 (age 86)
-- Football Hall of Fame member Joe Gibbs in 1940 (age 79)
-- Singer Percy Sledge in 1941
-- Actor Ben Stein in 1944 (age 75)
-- Actor John Larroquette in 1947 (age 72)
-- Pakistani Prime Minister Imran Khan in 1952 (age 67)
-- John F. Kennedy Jr. in 1960
-- Singer Amy Grant in 1960 (age 59)
-- Actor Billy Burke in 1966 (age 53)
-- Actor Christina Applegate in 1971 (age 48)
-- Actor Joel Kinnaman in 1979 (age 40)
-- Former first daughter Barbara Pierce Bush in 1981 (age 38)
-- Television personality/former first daughter Jenna Bush Hager in 1981 (age 38)
-- Actor Katie Cassidy in 1986 (age 33)
(0) Leave a comment
upi.com/6962332
Latest Headlines
Entertainment News // 7 hours ago
Harry Morton, Pink Taco founder, dies at 38
Nov. 24 (UPI) -- Pink Taco founder Harry Morton has died at the age of 38, officials said.
Music // 10 hours ago
Taylor Swift wins big at the 2019 American Music Awards
Nov. 24 (UPI) -- Taylor Swift won big at the 47th annual American Music Awards on Sunday, taking home awards for Artist of the Year, Artist of the Decade and Favorite Album - Pop/Rock.
TV // 15 hours ago
'Sopranos' cast celebrates 20th anniversary of show at NJ fan convention
Nov. 24 (UPI) -- The strength and complexity of female characters on "The Sopranos" was a prominent theme during a panel discussion with the show's actresses at this weekend's fan convention in New Jersey.
TV // 20 hours ago
'SNL:' Stars return for parody of Democratic debate
Nov. 24 (UPI) -- This weekend's edition of "Saturday Night Live" featured a star-studded parody of the most recent Democratic presidential debate.
Movies // 17 hours ago
'Frozen II' tops the North American box office with $127M
Nov. 24 (UPI) -- The animated adventure "Frozen II" is the No. 1 movie in North America, earning$127 million in receipts this weekend, BoxOfficeMojo.com announced on Sunday.
Entertainment News // 19 hours ago
Goo Hara is second young K-pop star to die since October
Nov. 24 (UPI) -- K-pop icon Goo Hara was found dead at age 28, police in South Korea said Sunday -- less than six weeks after another young female singing star from the Asian nation died.
Entertainment News // 1 day ago
Famous birthdays for Nov. 24: Katherine Heigl, Sarah Hyland
Nov. 24 (UPI) -- Actor Katherine Heigl turns 41 and actor Sarah Hyland turns 29, among the famous birthdays for Nov. 24.
TV // 1 day ago
David Tennant to play serial killer in ITV's 'Des'
Nov. 23 (UPI) -- "Good Omens," "Doctor Who" and "Broadchurch" icon David Tennant is to play serial killer Dennis Nilsen in ITV's three-part drama "Des."
TV // 1 day ago
David Boreanz, Seth Rogen set for special editions of 'Price is Right'
Nov. 23 (UPI) -- CBS has announced plans to air this winter two celebrity editions of the game show "The Price is Right."
Movies // 1 day ago
John Turturro to play Carmine Falcone in 'The Batman'
Nov. 23 (UPI) -- "The Big Lebowski" and "Transformers: The Last Knight" star John Turturro is to play crime boss Carmine Falcone in "The Batman."


Go to the source code of this file.
Compounds | |
| class | TFilterValidator |
| Check an input field as the user types into it. More... | |
| class | TLookupValidator |
| Compares the string typed by a user with a list of acceptable values. More... | |
| class | TPXPictureValidator |
| Compare user input with a picture of a data format to determine the validity of entered data. More... | |
| class | TRangeValidator |
| Determines whether the data typed by a user falls within a designated range of integers. More... | |
| class | TStringLookupValidator |
| Verifies the data in its associated input line by searching through a collection of valid strings. More... | |
| class | TValidator |
| Implements an abstract data validation object. More... | |
Enumerations | |
| enum | TVTransfer { vtDataSize, vtSetData, vtGetData } |
| enum | TPicResult { prComplete, prIncomplete, prEmpty, prError, prSyntax, prAmbiguous, prIncompNoFill } |
Functions | |
| ipstream& | operator>> (ipstream &is, TValidator &v) |
| ipstream& | operator>> (ipstream &is, TValidator *&v) |
| opstream& | operator<< (opstream &os, TValidator &v) |
| opstream& | operator<< (opstream &os, TValidator *v) |
| ipstream& | operator>> (ipstream &is, TFilterValidator &v) |
| ipstream& | operator>> (ipstream &is, TFilterValidator *&v) |
| opstream& | operator<< (opstream &os, TFilterValidator &v) |
| opstream& | operator<< (opstream &os, TFilterValidator *v) |
| ipstream& | operator>> (ipstream &is, TRangeValidator &v) |
| ipstream& | operator>> (ipstream &is, TRangeValidator *&v) |
| opstream& | operator<< (opstream &os, TRangeValidator &v) |
| opstream& | operator<< (opstream &os, TRangeValidator *v) |
| ipstream& | operator>> (ipstream &is, TLookupValidator &v) |
| ipstream& | operator>> (ipstream &is, TLookupValidator *&v) |
| opstream& | operator<< (opstream &os, TLookupValidator &v) |
| opstream& | operator<< (opstream &os, TLookupValidator *v) |
| ipstream& | operator>> (ipstream &is, TStringLookupValidator &v) |
| ipstream& | operator>> (ipstream &is, TStringLookupValidator *&v) |
| opstream& | operator<< (opstream &os, TStringLookupValidator &v) |
| opstream& | operator<< (opstream &os, TStringLookupValidator *v) |
Variables | |
| const int | vsOk = 0 |
| const int | vsSyntax = 1 |
| const int | voFill = 0x0001 |
| const int | voTransfer = 0x0002 |
| const int | voReserved = 0x00FC |
Definition in file validate.h.
|
|
Undocumented. Definition at line 929 of file validate.h. |
|
|
Undocumented. Definition at line 924 of file validate.h. |
|
|
Undocumented. Definition at line 816 of file validate.h. |
|
|
Undocumented. Definition at line 811 of file validate.h. |
|
|
Undocumented. Definition at line 730 of file validate.h. |
|
|
Undocumented. Definition at line 725 of file validate.h. |
|
|
Undocumented. Definition at line 589 of file validate.h. |
|
|
Undocumented. Definition at line 584 of file validate.h. |
|
|
Undocumented. Definition at line 481 of file validate.h. |
|
|
Undocumented. Definition at line 476 of file validate.h. |
|
|
Undocumented. Definition at line 918 of file validate.h. |
|
|
Undocumented. Definition at line 913 of file validate.h. |
|
|
Undocumented. Definition at line 805 of file validate.h. |
|
|
Undocumented. Definition at line 800 of file validate.h. |
|
|
Undocumented. Definition at line 719 of file validate.h. |
|
|
Undocumented. Definition at line 714 of file validate.h. |
|
|
Undocumented. Definition at line 578 of file validate.h. |
|
|
Undocumented. Definition at line 573 of file validate.h. |
|
|
Undocumented. Definition at line 470 of file validate.h. |
|
|
Undocumented. Definition at line 465 of file validate.h. |


class: center, middle, inverse, title-slide # ETC1010: Data Modelling and Computing ## Lecture 3: Wrangling your data ### Di Cook (
<EMAIL_ADDRESS>,
@visnut
) ### Week 3 --- # Overview - Data structures, variable types - Wrangling verbs: filter, arrange, select, mutate, summarise - Making joins - Working with dates --- # Data structures - Data frames - Matrices/vectors - Lists - Tibbles --- # data.frame/tibble vs matrices/vectors Mostly what we have seen so far are data.frame or tibble - Rectangular format - Each column might be a different type of variable - Each column is same length Matrices/vectors - Original data format - All columns have numerical values --- # Lists - Not necessarily rectangular - Anything can be packed into a list - We will see more of these when we fit models, because model summaries are typically shared as a list - Trickier to work with --- # How do you know what you have? ```r genes <- read_csv("data/genes.csv") genes # A tibble: 3 x 12 id `WI-6.R1` `WI-6.R2` `WI-6.R4` `WM-6.R1` `WM-6.R2` `WI-12.R1` <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> 1 Gene 1 2.182424 2.2042219 4.195636 2.6273345 5.063641 4.540002 2 Gene 2 1.464224 0.5854472 1.859238 0.5152242 2.882808 1.364037 3 Gene 3 2.031792 0.8701078 3.281983 0.5330452 4.627315 2.182192 # ... with 5 more variables: `WI-12.R2` <dbl>, `WI-12.R4` <dbl>, # `WM-12.R1` <dbl>, `WM-12.R2` <dbl>, `WM-12.R4` <dbl> is_tibble(genes) [1] TRUE is.data.frame(genes) [1] TRUE is.matrix(genes) [1] FALSE is.list(genes) [1] TRUE ``` --- ```r melbtemp <- read.fwf("data/ASN00086282.dly", c(11, 4, 2, 4, rep(c(5, 1, 1, 1), 31)), fill=T) head(melbtemp[,c(1,2,3,4,seq(5,100,4))]) V1 V2 V3 V4 V5 V9 V13 V17 V21 V25 V29 V33 V37 V41 V45 V49 1 ASN00086282 1970 7 TMAX 141 124 113 123 148 149 139 153 123 108 119 112 2 ASN00086282 1970 7 TMIN 80 63 36 57 69 47 84 78 49 42 48 56 3 ASN00086282 1970 7 PRCP 3 30 0 0 36 3 0 0 10 23 3 0 4 ASN00086282 1970 8 TMAX 145 128 150 122 109 112 116 142 166 127 117 127 5 ASN00086282 1970 8 TMIN 50 61 75 67 41 51 48 -7 56 62 47 33 6 ASN00086282 1970 8 PRCP 0 66 0 53 13 3 8 0 0 0 3 5 V53 V57 V61 V65 V69 V73 V77 V81 V85 V89 V93 V97 1 126 112 115 133 134 126 104 143 141 134 117 142 2 51 36 44 39 40 58 15 33 51 74 39 66 3 5 0 0 0 0 0 8 0 18 0 0 0 4 159 143 114 65 113 125 129 147 161 168 178 161 5 67 84 11 41 18 50 22 28 74 94 73 88 6 0 0 64 3 99 36 8 0 0 0 8 36 is_tibble(melbtemp) [1] FALSE is.data.frame(melbtemp) [1] TRUE is.matrix(melbtemp) [1] FALSE is.list(melbtemp) [1] TRUE ``` --- # Variable types - `int` integer. - `dbl` doubles, or real numbers - `num` numeric, includes integer or double - `chr` characters, or strings - `lgl` or `logi` logical, true or false - `fctr` or `Factor` fancy character, contains additional information about levels and labels - `date` and `dttm` time and date structures --- # Converting formats ```r melbtemp <- melbtemp[,c(1,2,3,4,seq(5,128,4))] colnames(melbtemp) <- c("id", "year", "month", "var", paste0("V",1:31)) melbtemp <- melbtemp %>% gather(day, value, V1:V31) %>% mutate(day = sub("V", "", day)) %>% mutate(value=ifelse(value==-9999, NA, value)) %>% filter(var %in% c("PRCP", "TMAX", "TMIN")) %>% spread(var, value) %>% mutate(PRCP=PRCP/10, TMAX=TMAX/10, TMIN=TMIN/10) %>% as_tibble() melbtemp # A tibble: 16,399 x 7 id year month day PRCP TMAX TMIN <fctr> <int> <int> <chr> <dbl> <dbl> <dbl> 1 ASN00086282 1970 7 1 0.3 14.1 8.0 2 ASN00086282 1970 7 10 2.3 10.8 4.2 3 ASN00086282 1970 7 11 0.3 11.9 4.8 4 ASN00086282 1970 7 12 0.0 11.2 5.6 5 ASN00086282 1970 7 13 0.5 12.6 5.1 6 ASN00086282 1970 7 14 0.0 11.2 3.6 7 ASN00086282 1970 7 15 0.0 11.5 4.4 8 ASN00086282 1970 7 16 0.0 13.3 3.9 9 ASN00086282 1970 7 17 0.0 13.4 4.0 10 ASN00086282 1970 7 18 0.0 12.6 5.8 # ... with 16,389 more rows ``` --- # Filter Pick observations by their values. For example, ``` filter(var %in% c("PRCP", "TMAX", "TMIN")) ``` took the column named `var` and keeps rows that have one of three values `PRCP`, `TMAX`, `TMIN`. All other rows are removed. --- # Logical operators - Comparisons - `<`, `<=`: less than, less than or equal - `>`, `>=`: greater than, greater than or equal - `==`, `!=`: equal to, not equal to - Cautions: computers have a hard time with equals, `near()` is a function that can be useful for real numbers, will check within a small neighbourhood of a value - Logicals - `&` and, both checks have to be true - `|` or, either check is true - `%in%` checks the elements of a collection, multiple or's - Missings: `is.na()` --- # Arrange Orders a data frame or tibble by the values in one column ```r library(lubridate) melbtemp %>% mutate(date=ymd(paste(year, month, day, sep="-"))) %>% arrange(date) # A tibble: 16,399 x 8 id year month day PRCP TMAX TMIN date <fctr> <int> <int> <chr> <dbl> <dbl> <dbl> <date> 1 ASN00086282 1970 7 1 0.3 14.1 8.0 1970-07-01 2 ASN00086282 1970 7 2 3.0 12.4 6.3 1970-07-02 3 ASN00086282 1970 7 3 0.0 11.3 3.6 1970-07-03 4 ASN00086282 1970 7 4 0.0 12.3 5.7 1970-07-04 5 ASN00086282 1970 7 5 3.6 14.8 6.9 1970-07-05 6 ASN00086282 1970 7 6 0.3 14.9 4.7 1970-07-06 7 ASN00086282 1970 7 7 0.0 13.9 8.4 1970-07-07 8 ASN00086282 1970 7 8 0.0 15.3 7.8 1970-07-08 9 ASN00086282 1970 7 9 1.0 12.3 4.9 1970-07-09 10 ASN00086282 1970 7 10 2.3 10.8 4.2 1970-07-10 # ... with 16,389 more rows ``` --- # Select Choose some of the __variables__. ```r airport <- read_csv("data/airports.csv") airport # A tibble: 13,094 x 29 AIRPORT_SEQ_ID AIRPORT_ID AIRPORT DISPLAY_AIRPORT_NAME <int> <int> <chr> <chr> 1 1000101 10001 01A Afognak Lake Airport 2 1000301 10003 03A Bear Creek Mining Strip 3 1000401 10004 04A Lik Mining Camp 4 1000501 10005 05A Little Squaw Airport 5 1000601 10006 06A Kizhuyak Bay 6 1000701 10007 07A Klawock Seaplane Base 7 1000801 10008 08A Elizabeth Island Airport 8 1000901 10009 09A Augustin Island 9 1001001 10010 1B1 Columbia County 10 1001002 10010 1B1 Columbia County # ... with 13,084 more rows, and 25 more variables: # DISPLAY_AIRPORT_CITY_NAME_FULL <chr>, AIRPORT_WAC <int>, # AIRPORT_COUNTRY_NAME <chr>, AIRPORT_COUNTRY_CODE_ISO <chr>, # AIRPORT_STATE_NAME <chr>, AIRPORT_STATE_CODE <chr>, # AIRPORT_STATE_FIPS <chr>, CITY_MARKET_ID <int>, # DISPLAY_CITY_MARKET_NAME_FULL <chr>, CITY_MARKET_WAC <int>, # LAT_DEGREES <int>, LAT_HEMISPHERE <chr>, LAT_MINUTES <int>, # LAT_SECONDS <int>, LATITUDE <dbl>, LON_DEGREES <int>, # LON_HEMISPHERE <chr>, LON_MINUTES <int>, LON_SECONDS <int>, # LONGITUDE <dbl>, AIRPORT_START_DATE <date>, AIRPORT_THRU_DATE <date>, # AIRPORT_IS_CLOSED <int>, AIRPORT_IS_LATEST <int>, X29 <chr> ``` --- ```r airport %>% select(AIRPORT, LATITUDE, LONGITUDE, AIRPORT_IS_LATEST, DISPLAY_AIRPORT_NAME) # A tibble: 13,094 x 5 AIRPORT LATITUDE LONGITUDE AIRPORT_IS_LATEST DISPLAY_AIRPORT_NAME <chr> <dbl> <dbl> <int> <chr> 1 01A 58.10944 -152.90667 1 Afognak Lake Airport 2 03A 65.54806 -161.07167 1 Bear Creek Mining Strip 3 04A 68.08333 -163.16667 1 Lik Mining Camp 4 05A 67.57000 -148.18389 1 Little Squaw Airport 5 06A 57.74528 -152.88278 1 Kizhuyak Bay 6 07A 55.55472 -133.10167 1 Klawock Seaplane Base 7 08A 59.15694 -151.82917 1 Elizabeth Island Airport 8 09A 59.36278 -153.43056 1 Augustin Island 9 1B1 42.28889 -73.71028 0 Columbia County 10 1B1 42.29139 -73.71028 1 Columbia County # ... with 13,084 more rows ``` --- # Mutate Create new, or transform existing, variables, e.g. for the Melbourne temperature data, we put the temperature and precipitation values into Celsius and mm, byt dividing by 10. ``` mutate(PRCP=PRCP/10, TMAX=TMAX/10, TMIN=TMIN/10) ``` --- # Arithmetic - Typical calculations: `+`, `-`, `*`, `/`; `^` (power) - Modular: - `%/%` integer division - `%%` remainder - Transformations: `log()`, `log10()`, `sqrt()` - Temporal: `lead()`, `lag()` create variables which are temporal lags of existing - Stats: `rank()`, `cumsum()` --- # Summarise Calculate a quantity on a column, producing a single number, e.g. for the audio data: ``` summarise(m = mean(value), s = sd(value), mx = max(value), mn = min(value)) ``` - Stats: `mean()`, `median()`, `sd()`, `min()`, `max()`, `sum()` - Rounding: `floor()`, `ceiling()`, `trunc()`, `round()`, `signif()` --- # Grouping and ungrouping Summarise is most commonly called on subgroups of data. We might want to calculate means and standard deviation across genders, or countries or schools. For the audio data, we calculated the summary statistics by the word spoken: ``` group_by(word) %>% summarise(m = mean(value), s = sd(value), mx = max(value), mn = min(value)) ``` If we want to more operations on the variable `word` after these calculations, you would need to do an `ungroup()` step. --- # Counts and tallies Dealing with categorical data, means wanting to count or tally. The function `count()` allows calculate the number of objects in levels of a variable, and the function `tally()` calculates how many objects there are. We used `count()` for the tweets example: ``` tweets %>% count(source, hour = hour(with_tz(created, "EST"))) ``` to calculate the number of tweets from the different devices, android or iphone, each hour. --- # Putting it together for the french fries 10 week sensory experiment, 12 individuals assessed taste of french fries on several scales (how potato-y, buttery, grassy, rancid, paint-y do they taste?), fried in one of 3 different oils, replicated twice.  - Is the design complete? - Are replicates like each other? - How do the ratings on the different criteria differ? - Are raters giving different scores on average? - Do ratings change over the weeks? Each of these questions involves different summaries of the data. --- # Answer some Questions - Easiest question is whether the ratings are similar on the different scales, potato'y, buttery, grassy, rancid and painty. - We need to gather the data into long form, and make plots facetted by the scale. ```r ff.m <- french_fries %>% gather(type, rating, -subject, -time, -treatment, -rep) ggplot(data=ff.m, aes(x=rating)) + geom_histogram(binwidth=2) + facet_wrap(~type, ncol=5) ```  --- # Look at it a different way  --- # Comparison of the distributions of criteria Ratings on the different criteria are quite different. - Potato'y scores relatively highly. - Grassy are mostly 0's - Buttery and painty are skewed right, mostly low values a few high ratings - Rancid is quite varied, we would hope that this relates to time, that the chips get more rancid as the weeks go by. --- # Do the replicates look like each other? - We will start to tackle this by plotting the replicates against each other using a scatterplot. - If raters give the same rating to the replicates, we would expect something close to this, then all values would lie on the X=Y line - We need to - gather the data into long form, and - then get the replicates spread into separate columns. --- ```r ff.s <- ff.m %>% spread(rep, rating) head(ff.s) # A tibble: 6 x 6 time treatment subject type `1` `2` <fctr> <fctr> <fctr> <chr> <dbl> <dbl> 1 1 1 3 buttery 0.0 0.0 2 1 1 3 grassy 0.0 0.0 3 1 1 3 painty 5.5 0.0 4 1 1 3 potato 2.9 14.0 5 1 1 3 rancid 0.0 1.1 6 1 1 10 buttery 6.4 5.9 ``` --- # Check Replicates ![](lecture3_wrangling_files/figure-html/unnamed-chunk-12-1.png)![](lecture3_wrangling_files/figure-html/unnamed-chunk-12-2.png) They have some positive linear association, but there is a lot more variation than expected. One rep might have scored 15 and the other 0, that's the same batches, same oil, same criteria, same week, same rater! --- # Separately by criteria ...  buttery and potato'y look a bit better. The rest are still terrible. --- # by oil ...  Not much improvement here. --- # By subject ...  Some subjects may be more experienced than others? --- Because the replicates do not look like each other, the quality of the data might be questioned at this point. Nevertheless, lets push on with some of the other questions. --- # Completeness of experimental design If the data is complete it should be 12 x 10 x 3 x 2, that is, 6 records for each person. (Assuming that each person rated on all scales.) To check this we want to tabulate the number of records for each subject, time and treatment. That is, - select appropriate columns, - tabulate, - count and - spread it out to give a nice table. --- ```r french_fries %>% select(subject, time, treatment) %>% count(subject, time) %>% spread(time, n) # A tibble: 12 x 11 subject `1` `2` `3` `4` `5` `6` `7` `8` `9` `10` * <fctr> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> 1 3 6 6 6 6 6 6 6 6 6 NA 2 10 6 6 6 6 6 6 6 6 6 6 3 15 6 6 6 6 6 6 6 6 6 6 4 16 6 6 6 6 6 6 6 6 6 6 5 19 6 6 6 6 6 6 6 6 6 6 6 31 6 6 6 6 6 6 6 6 NA 6 7 51 6 6 6 6 6 6 6 6 6 6 8 52 6 6 6 6 6 6 6 6 6 6 9 63 6 6 6 6 6 6 6 6 6 6 10 78 6 6 6 6 6 6 6 6 6 6 11 79 6 6 6 6 6 6 6 6 6 NA 12 86 6 6 6 6 6 6 6 6 NA 6 ``` Its pretty good, but subjects, 3, 31, 79, 86 all missed a rating session. --- # By criteria ``` # A tibble: 12 x 11 subject `1` `2` `3` `4` `5` `6` `7` `8` `9` `10` * <fctr> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> 1 3 30 30 30 30 30 30 30 30 30 NA 2 10 30 30 30 30 30 30 30 30 30 30 3 15 30 30 30 30 30 30 30 30 30 30 4 16 30 30 30 30 30 30 30 30 30 30 5 19 30 30 30 30 30 30 30 30 30 30 6 31 30 30 30 30 30 30 30 30 NA 30 7 51 30 30 30 30 30 30 30 30 30 30 8 52 30 30 30 30 30 30 30 30 30 30 9 63 30 30 30 30 30 30 30 30 30 30 10 78 30 30 30 30 30 30 30 30 30 30 11 79 30 30 30 30 30 30 30 30 30 NA 12 86 30 30 30 30 30 30 30 30 NA 30 ``` --- # Change in rancid ratings over weeks - Filter on criteria - Compute means by subject, week and oil ```r ff.av <- ff.m %>% filter(type == "rancid") %>% group_by(subject, time, treatment) %>% summarise(rating=mean(rating)) ``` ---  Oh, its awful data! Only subject 86 is seeing the chips get more rancid over time, with maybe oil 1 being worse. Subject 63, shows some trend. Nothing is rancid for subjects 78, 79. Subject 53 thinks they taste better after many weeks in the same old oil! --- # Joins It’s rare that a data analysis involves only a single table of data. Typically you have many tables of data, and you must combine them to answer the questions that you’re interested in. Collectively, multiple tables of data are called relational data because it is the relations, not just the individual datasets, that are important. --- ```r load("data/plane_N4YRAA.rda") plane_N4YRAA %>% glimpse() Observations: 145 Variables: 8 $ FL_DATE <date> 2017-05-26, 2017-05-02, 2017-05-05, 2017-05-11, 2017... $ CARRIER <chr> "AA", "AA", "AA", "AA", "AA", "AA", "AA", "AA", "AA",... $ FL_NUM <int> 2246, 2276, 2278, 2287, 2288, 2291, 2297, 2297, 2297,... $ ORIGIN <chr> "CVG", "DFW", "DFW", "STL", "IND", "CHS", "DFW", "DFW... $ DEST <chr> "DFW", "IND", "OKC", "ORD", "DFW", "DFW", "MKE", "MKE... $ DEP_TIME <chr> "0748", "2020", "0848", "0454", "0601", "0807", "0700... $ ARR_TIME <chr> "0917", "2323", "0941", "0600", "0719", "0947", "0905... $ DISTANCE <dbl> 812, 761, 175, 258, 761, 987, 853, 853, 853, 853, 447... ``` ```r airport <- read_csv("data/airports.csv") airport %>% select(AIRPORT, LATITUDE, LONGITUDE, AIRPORT_STATE_NAME) %>% glimpse() Observations: 13,094 Variables: 4 $ AIRPORT <chr> "01A", "03A", "04A", "05A", "06A", "07A", "... $ LATITUDE <dbl> 58.10944, 65.54806, 68.08333, 67.57000, 57.... $ LONGITUDE <dbl> -152.90667, -161.07167, -163.16667, -148.18... $ AIRPORT_STATE_NAME <chr> "Alaska", "Alaska", "Alaska", "Alaska", "Al... ``` --- # Joining the two tables - Purpose is to show flight movement on the map - Key is the airport three letter code, - called ORIGIN or DEST in plane_N4YRAA table - called AIRPORT in the airport table - One table, plane_N4YRAA, has less airports than the other - Only want to keep the rows of airport table, for those that appear in the plane_N4YRAA table --- ```r airport <- airport %>% select(AIRPORT, LATITUDE, LONGITUDE, AIRPORT_IS_LATEST, DISPLAY_AIRPORT_NAME) %>% filter(AIRPORT_IS_LATEST == 1) %>% select(-AIRPORT_IS_LATEST) N4YRAA_latlon <- left_join(plane_N4YRAA, airport, by = c("ORIGIN"="AIRPORT")) %>% rename("ORIGIN_LATITUDE"="LATITUDE", "ORIGIN_LONGITUDE"="LONGITUDE") N4YRAA_latlon %>% select(ORIGIN, ORIGIN_LATITUDE, ORIGIN_LONGITUDE, DISPLAY_AIRPORT_NAME) # A tibble: 146 x 4 ORIGIN ORIGIN_LATITUDE ORIGIN_LONGITUDE <chr> <dbl> <dbl> 1 CVG 39.04889 -84.66778 2 DFW 32.89722 -97.03778 3 DFW 32.89722 -97.03778 4 STL 38.74861 -90.37000 5 IND 39.71722 -86.29472 6 CHS 32.89861 -80.04056 7 DFW 32.89722 -97.03778 8 DFW 32.89722 -97.03778 9 MKE 42.94694 -87.89694 10 MKE 42.94694 -87.89694 # ... with 136 more rows, and 1 more variables: DISPLAY_AIRPORT_NAME <chr> ``` The variables ORIGIN_LATITUDE, ORIGIN_LONGITUDE, DISPLAY_AIRPORT_NAME are added to corresponding row in the plane_N4YRAA table. --- - Added the spatial coordinates (lat, lon) for the origin airport - The same needs to be done for the destination airport - Then the airports can be drawn over a map  --- class: inverse middle # Share and share alike
This work is licensed under a Creative Commons Attribution 4.0 International License.


We first meet Stéphane [Romain Duris] in the opening moments of "Gadjo Dilo" walking down an ice-covered road in the Romanian countryside. The young Parisian is in search of a legendary gypsy singer, whose tape he carries with him. Her songs had consoled his ethnomusicologist father on his deathbed, and the tape was recorded on one of his many field-trips. Stéphane is following in his footsteps.
I can understand the fascination with gypsy music. The authentic sound is nothing like the kitsch you hear in Hungarian restaurants. It has a simultaneously raw and ethereal power like no other music. Over thirty-five years ago I was listening to one of composer and ethnomusicologist Henry Cowell's radio programs on NYC's left-wing, listener-sponsored WBAI. He announced that he was going to play some field-recordings he had made of Romanian gypsy fiddle-players who had influenced Bela Bartok. The sound mesmerized me. To this day, I search for recordings of this type of fiddle-playing but nothing could possibly match Cowell's field-recordings. So I can understand Stéphane's passion.
Exhausted and half-frozen, Stéphane reaches a tiny village in the dead of night. All the doors are closed, the lights are out and the streets are empty. The only person he finds is an elderly drunken gypsy named Izidor [Isidor Serban], who is cursing loudly at the cops who have just taken his son Adrjani to jail on trumped-up charges. Stéphane asks the old man if he knows the location of a hotel, but the gypsy only wants to share his bottle with the young man, and pour out his complaints about the Romanian judicial system.
Stéphane listens patiently, shares from the bottle, but still has a warm bed on his mind. Finally he has an inspiration. He takes out the tape and plays it for the gypsy. "Do you know who she is? Do you know where I can find her?" From that moment on, Izidor is drawn to the young man, who becomes a surrogate son. They go back to the gypsy village where Izidor gives Stéphane his own bed.
The next morning the villagers are shocked by the presence of a "gadjo dilo" (crazy outsider) in their midst. They surround Izidor and press him with questions. How can he guarantee that Stéphane is not there to steal their chickens, since "gadjos" can never be trusted. The joke, of course, is that the gypsies project on to the outsider exactly the same fears that outside society has of them.
Stéphane enjoys gypsy hospitality for several days, but announces to Izidor that it is time for him to move on. He must track down the singer of his father's tape. Izidor pressures his surrogate son to stay for a few days more, and then the days turn into months. As Stéphane learns to speak their language, they lose their distrust of him. He takes part in their rituals and travels about the countryside with them on various adventures, including performances by the skilled musicians from Izidor's village.
The film was directed by Tony Gatlif, who made the award-winning documentary "Latcho Drom" in 1993, which depicts gypsy musicians in performance across the planet, from India to Spain. Gatlif is a gypsy himself, born in Algeria in 1948. "Latcho Drom" was part two of a trilogy on gypsy culture, that began with the 1982 feature "Les Princes." "Gadjo Dilo" is the final installment.
Ultimately Stéphane becomes assimilated totally into gypsy society. He falls in love with Sabina [Rona Hartner] who initially wards off the "gadjo." When he proves to her that he has cut his ties with "outsider" society, she takes him into her tent where they make passionate love.
In the climax of the film, Izidor's son Adrjani [Florin Moldovan] is released from jail and there is an joyous celebration in the gypsy village. The joy is short-lived, as Arjani and two accomplices go to town and track down the local official who victimized him. They murder him in a saloon in full view of the townsfolk. This leads to a raid on the gypsy village and the death of both Izidor and Adrjani.
While the film does not explore the underlying tensions between Romanians and gypsies, there is little doubt that it is related to the social disintegration following the fall of Ceaucescu. In a time of worsening economic conditions, gypsies become a convenient scapegoat just as they were in the 1930s when fascism was on the rise.
Anti-gypsy racism is on the increase everywhere, including Vaclav Havel's "enlightened" Czechoslovakia. A gypsy reporter writes: "Voicing stereotypes common throughout Europe, Czechs claim that Roma, with their traditionally large families, are a drain on the social service budget and live better than Czechs with jobs. They regard Roma as dishonest and often criminal. In a 1996 poll cited in the U.S. State Department's human rights report, 35 percent of Czechs favored 'concentrating and isolating the Roma' and 45 percent supported 'moving the Roma out of the Czech Republic if possible.'"
As a Marxist, I have always been interested in "exceptions" to normal bourgeois society. There is no greater exception than the gypsies, who resist assimilation like no other people. They originated on the west coast of India in the early middle ages and soon migrated into the middle east. They arrived in Europe by the fourteenth century, and now number more than 8 million there. They have always tried to find ways to avoid the confinements of wage-labor. By the same token, they show little interest in becoming captains of industry. While racist mythology paints them as thieves, most are hard-working. Patrin, a web page devoted to Roma (gypsy) culture and history states:
"For a collective economic effort, Roma may form a purely functional association, the kumpaniya, whose members do not necessarily belong to the same clan or even the same dialect group. Individually, many Roma are peddlers, especially in Europe. Some sell goods they have bought cheaply. Others sell what they make themselves, although in the twentieth century a number of Romani crafts have suffered from competition with mass-produced articles.
"There are certain staple Romani occupations, such as horse trading, metalworking, dealing in scrap metal, and vegetable or fruit picking in some countries. In gaining a livelihood, the women play their full part. It is they who often sell their wares from door to door and who do the fortune telling. Among the Vlad-speaking Roma in the United States, this latter profession, known as 'reading and advising,' is still widespread."
Bourgeois society has always had great difficulties with peoples who remain economically and culturally distinct. Like the gypsy, the Jews have historically been outsiders. During the nineteenth century, Eastern European Jewry existed on the fringes of bourgeois society as pawnbrokers, tax-collectors, saloon-keepers, etc. Christian society encountered them not only as an undifferentiated economic bloc, they also saw them as an alien presence, with their Yiddish language, their strange garb and religious beliefs. During times of relative economic stability, the Jew and gypsy was tolerated. During times of duress, they became scapegoats. And during the time of complete economic collapse in post-WWI Europe, they functioned as the ultimate scapegoats and were exterminated.
Today the Jews have become assimilated into bourgeois society. In the United States, they are virtually indistinguishable from other Americans. The gypsy, like the American Indian, remains unassimilated. There are pressures on both peoples to meld with the outside world. Like the American Indian, the gypsies face continuing cultural and economic genocide. As is the case for American Indians, one of the big worries for gypsy society is the disappearance of their language.
Tony Gatlif's "Gadjo Dilo" can be seen as part of the larger effort to preserve gypsy culture and society. Ironically, it is Stéphane the "outsider" who is assimilated into their culture and not the other way round. It is not too hard to identify with him as he discovers the joys of everyday gypsy life. There is a closeness and honesty that is obviously missing from the colorless and competitive world of bourgeois society. As our own society becomes more alienated and hate-filled--to the extent that fourteen year olds bring automatic weapons to school for the purpose of mass murder--, we will inevitably begin to think about alternatives to our own materialist values.
At this point many people will be tempted to find a way to assimilate into "outsider" societies, like Stéphane did into the gypsies. In many ways, this was what the 1960s counter-culture was all about. Unfortunately, these solutions can only exist for individuals, and not for greater society which revolves around the cash nexus. The crying need is for some sort of economic system that can make the freedom and solidarity of the gypsy village depicted in "Gadjo Dilo" universal.
("Gadjo Dilo" is scheduled for theatrical release on July 10, 1998)
(For Marxist discussion: //www.panix.com/~lnp3/marxism.html)
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Data Placement
Data Type
Period Type
File
Refresh
Upload
Re-Process
Weekly Target Files
Available File


SChartBubbleSeries Class Reference
| Inherits from | SChartPointSeries : SChartCartesianSeries : SChartMappedSeries : SChartSeries : NSObject |
| Declared in | SChartBubbleSeries.h |
| Availability | |
| Related samples |
Overview
SChartBubbleSeries
is a type of SChartSeries
that uses its data points to construct a bubble series.
This type of series focuses on allowing bubble sizes to be controlled via the use of data point objects of type SChartBubbleDataPoint
. As such this series ignores attempts to set the size/radius of its data points in any other way.
The size of the bubbles in this series are independent of any axes that the series might be linked to. This makes the concept of a scale that alters the size of all bubbles in the series useful. You can supply your own scale
or let the series be scaled via an auto-calculated value such that the largest bubble in the series matches some chosen diameter (see biggestBubbleDiameterForAutoScaling
).
This series has the corresponding series and point styles SChartBubbleSeriesStyle
and SChartBubblePointStyle
respectively.
Tasks
Scaling Bubbles
-
scale
The value that will be used to scale the rendered bubbles for this series.
property -
biggestBubbleDiameterForAutoScaling
This property is used to calculate an appropriate autoscale that results in the biggest bubble in the series being
property[biggestBubbleDiameterForAutoScaling doubleValue]
points in diameter. -
– currentScale
Returns the current scale being used to render the bubble series.
Styling
-
– style
Manages the appearance of the bubble series on the chart.
-
– setStyle:
Sets the style object for the bubble series.
-
– selectedStyle
Manages the appearance of the bubble series when it is selected.
-
– setSelectedStyle:
Sets the style object for the bubble series when it is selected.
Subclassing
-
– styleForPoint:
Specifies the style to use on a per-point basis
Properties
biggestBubbleDiameterForAutoScaling
This property is used to calculate an appropriate autoscale that results in the biggest bubble in the series being [biggestBubbleDiameterForAutoScaling doubleValue]
points in diameter.
@property (nonatomic, retain) NSNumber *biggestBubbleDiameterForAutoScaling
Discussion
If this property is nil
then a default value of half of the current smallest canvas dimension will be used instead.
By default, this property is set to nil
.
Declared In
SChartBubbleSeries.h
scale
The value that will be used to scale the rendered bubbles for this series.
@property (nonatomic, retain) NSNumber *scale
Discussion
A value of nil
will result in the series auto-calculating an appropriate scale to use. The auto-calculated scale is based on biggestBubbleDiameterForAutoScaling
.
By default, this property is set to nil
.
Declared In
SChartBubbleSeries.h
Instance Methods
currentScale
Returns the current scale being used to render the bubble series.
- (NSNumber *)currentScale
Discussion
If you have set scale
then this will be returned, otherwise an automatically calculated scale will be returned.
Note that if no scale
has been set and no auto-caulculated value exists that nil
will be returned.
Declared In
SChartBubbleSeries.h
selectedStyle
Manages the appearance of the bubble series when it is selected.
- (SChartBubbleSeriesStyle *)selectedStyle
Discussion
Style settings in this object will be applied when the series is marked as selected (or a point is selected).
The default settings of the style are inherited from the chart theme. You can tweak the appearance of the series by modifying the style.
See Also
Declared In
SChartBubbleSeries.h
setSelectedStyle:
Sets the style object for the bubble series when it is selected.
- (void)setSelectedStyle:(SChartBubbleSeriesStyle *)selectedStyle
Parameters
- selectedStyle
The new style object to use.
See Also
Declared In
SChartBubbleSeries.h
setStyle:
Sets the style object for the bubble series.
- (void)setStyle:(SChartBubbleSeriesStyle *)style
Parameters
- style
The new style object to use for the bubble series.
See Also
Declared In
SChartBubbleSeries.h
style
Manages the appearance of the bubble series on the chart.
- (SChartBubbleSeriesStyle *)style
Discussion
The default settings of the style are inherited from the chart theme. You can tweak the appearance of the series by modifying the style.
See Also
Declared In
SChartBubbleSeries.h
styleForPoint:
Specifies the style to use on a per-point basis
- (SChartBubblePointStyle *)styleForPoint:(id<SChartData>)point
Parameters
- point
The data-point that will be styled by the returned style object.
Discussion
This method is called for each datapoint in this series and the standard implementation chooses to return either the style or selectedStyle object based on the selectionMode
and
selected state of either the point or the series. Computationally expensive operations here will increase initial render time.
Use the sChartXValue
& sChartYValue
properties to access each datapoint’s X & Y values. Here is an example of how to use these properties to style each point:
- (SChartBubblePointStyle*)styleForPoint:(idSChartData)point {
SChartBubblePointStyle *newStyle = [super styleForPoint:point];
float yValue = [[point sChartYValue] floatValue];
if (yValue > 90) {
newStyle.color = [UIColor redColor];
} else if(yValue > 50) {
newStyle.color = [UIColor yellowColor];
} else {
newStyle.color = [UIColor greenColor];
}
return newStyle;
}
Declared In
SChartBubbleSeries.h


Username
All Users
Search by Topic
Matches
Username
Topic Wishlist
Item
Topic Teachlist
Item
Your Profile
* Update Profile
Bio
Email
Discord
Social
Wishlist
Teachlist
Save Changes


Arrest made after reports a man armed with a sledgehammer demanded cash from shop
The man remains in custody
by Matthew BunnAn arrest has been made following reports a man armed with a sledgehammer went into a shop in Bulwell and demanded cash.
A police dog and its handler were sent to the Local 4U store in Hucknall Lane just after 9pm on Friday, November 15.
According to Nottinghamshire Police, a man threatened staff and demanded money from the shop till. He left with cash.
The police dog team tracked down a 33-year-old man and he was arrested on suspicion of robbery. A sledgehammer and cash were recovered.
A door was damaged during the incident but no shop staff were injured.
The man remains in custody.
With the General Election approaching we want to give you all the results and reactions as they happen. Join our new WhatsApp service to receive breaking news alerts throughout the night by texting ELECTION to<PHONE_NUMBER>2. The first messages will go out December 12 after polls close.


栗 KURI TEAM 栗
Website
|
Github
Kuri Team was founded during semester 2020C at RMIT University Vietnam, Saigon South Campus. As a young organization, our goal is to support each other in our projects, academic success, and personal development. Our last study project is a game prototype, proposed by us in our assignment paper for COSC2083 - Introduction to IT, to be implemented into RMIT wi-fi network. More detail on that project and proposal to RMIT can be found here. The playable prototype can be accessed here.
The Yabe online mall e-commerce website is our latest study project. It involves the following Kuri members:


Date: '06 1 31
Substance: Fentanyl Citrate 100mcg / 2 mL (50mcg/mL)
I have obtained a tiny ampule of fentanyl made by Abbott Labs. I paid ten dollars for it - a very good price. Sadly I did not get a sterile syringe so I must use the drug in a different way. But first let me describe myself and my background.
I am sixteen years old and I have no opiate tolerance at all. I have used cannabis, LSD,GHB, DXM, Oxycodone, Demerol, nutmeg, Valium, Ether, Nitrous Oxide, Adderall, and hydrocodone. I take Prozac(10mg) but I have stopped taking it for five days before this date. The reason is because long ago I took 30mg of oxycodone and had a great time but once I was on the Prozac(a month or so later) and I took the same dose and felt no effects. This seems to be uncommon but I felt like it would be wise to stop taking the Prozac if I wanted to feel effects. If anyone else has had this happen to them with SSRI's and opiates it would be interesting to see more of it here.
I am in a good frame of mind(not that it matters much with opiates) having just got all A's on my report card :)
I have no experience with injection and so when I did not obtain a syringe I was not overly disappointed. I read online that it would be a waste to do anything else but inject fentanyl but I will have to give up my chance to IV this rare drug. It has been at least three months between now and the last time I took any opiates.
The ampule is small and made of glass and has a bright yellow color ring around the neck. The label has the classic Roman numeral 2 within a large C shape as a logo. It also has a warning about addiction and a warning to keep out of sunlight plus a manufacturer date (Jul 1 '95).
I have a small nasal spray bottle and so I decided to put the contents of the ampule into it and then spray it bit by bit into my nose. This I think is good harm reduction practice and much safer then injecting (obviously). To make sure I don't loose any on the inside of the sprayer I added more water to it later to get the last of the drug that was on the inside walls.
I transfered the liquid into the sprayer with a large syringe(not the sort you can inject with) and I took the first 'hit' at 1:10PM.
About an hour ago I ate a light lunch so I have some food in me.
The nasal sprayer says that each spray gives about 1/8th of a mL of liquid.
0:00 - Took one spray hit
+1 - I am nervous and I feel a tiny tiny bit of something happening - hard to say if it is real or not...
+5 - minor tingling all over my body as if I took a tiny hit of weed and am just starting to feel it.
1:05PM - took another hit into my left nasal passage. I am very careful to make sure nothing drips out! No burning or taste at all - feels to my nose just like water. I put the bottle away for now...
+3 - I see my pupils have contracted a little - nothing dramatic yet
1:20PM - minor and pleasant body buzz - took 2 more hits
+6 - Took a piss and pinched the back of my hand. It hurts but there seems to be less of a sharp pain and more like 'Oh, my hand hurts...'
1:30PM - took 4 more hits...
+7 - Feeling 'buzzy' but in no way warm like with oxycodone
1:40PM - I figure I am not going to have a bad reaction so I took 6 rapid hits
+3 - It is really apparent now. No warmth so far but a strong yet subtle feeling of waves in my body and a feeling of being relaxed
+2 - took 6 more hits... I tilt my head back to keep the liquid in my nose
1:50PM - Feeling very good - take about 8 or so more hits. The liquid is starting to run out(or get lower then the little tube that gets it into the spray nozzle is) so the mist is not as strong. I will add more water so I can get all the drug into my body but I will have to take more hits. Not a problem as they do not hurt or taste at all...
+3 - Nothing happening so far to my typing ability I think. I am at my computer but soon I think I will lie down...
1:55PM - took 6 more hits then I added a bit more tap water into the sprayer before I become too high to do it. The hits will be weaker but I will be able to get more of the drug into my body. I'm feeling very good now. A bit like oxycodone but without the warmth. It's somewhat euphoric and very pleasant. I can see how an IV would be very addictive mentally even before you were physically addicted.
2:00PM - took 8 more hits - they are much stronger(in spray power) now. My pupils are a bit smaller then before but not much. Not like pinpricks or anything.
+7 - Took some more hits(4 or so) I am starting to feel a bit warm and flushed. Putting my head down in my arms is oh so very good feeling
2:10PM - I am now taking one hit in each nostril and then waiting for it to dry out and be absorbed and then taking 2 more. So about 2 every 60 seconds from now on...
+4 - I am listening to the song 'Oxy Cotton' by Lil Wyte. Normally I hate rap but in this case it is a good song because its all about opiates and the song brings back memories of a good friend who moved away...
Its fucking ridiculous how well I can type even now
2:25PM - added a bit more water but I don't think it will help much - I have got about all I am going to get into my nose and now I just have to wait for it to all get into my brain... playing soma by Smashing Pumpkins
2:37PM - feeling like I need to lie in bed so I went to lie down...
3:45PM - I lay down in bed listening to music and as I stopped moving around I felt warmer and warmer and more and more euphoric. I started to have strange whimsical thoughts that I don't even remember now. I was in a sort of semi-lucid state where I could here things around me but I was too sedated to react to them. I felt like I was sun bathing and I was all wrapped up in my bedsheets and a big fluffy comforter. After an hour or so I guess I got up to get some water and as soon as I moved the overwhelming warmth was pushed into the background and I could function somewhat normally. I had to talk to my mom for a bit but I had no difficulties there. I then got back into bed and felt the same warmth and euphoria but it was not as strong as the drug was already wearing off. Now I still feel relaxed and carefree but not warm or wavy.
I think this was well worth it but I will not be doing it(or any opiates) for a few months at least to keep any addiction or habituation issues at bay. I think that the fentanyl would have been stronger had I stayed off Prozac longer and of course had I injected, it would be much stronger. I can't recommend strong opiates but this is a good drug if you are looking for such things.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Reports local variables, parameters, and functions that are locally defined, but not used name in a function.


All sciences are now under the obligation to prepare the ground for the future task of the philosopher, which is to solve the problem of value... — Friedrich Nietzsche
How far have we journeyed? Are we there yet? Certainly, nothing lost on the way. Laws of physics are still intact. I see myself more like the hole in the hub than the rim on the wheel. p540
We are reconceptualized by constraints - by properties or degrees of freedom not actualized.
It's all a familiar figure/background reversal. No new science needed. [Or intelligent design.]
We begin to understand that two levels of processes may become so entangled that they become a dynamical unit that creates, preserves and replicates the very constraints that first brought the two processes together. p540
Are we back to zero/Zero? Can a study of the absential provide a new tools?
It's time to recognize that there is room for meaning, purpose, and value in the fabric of physical explanations, because these phenomena effectively occupy the absences that differentiate and interrelate the world that is physically present. p541
[We have everything to lose. And nothing to gain ;-]
Autogenic processes - a thought experiment - the premature halting of morphodynamic processes - the failure to continue - creates an entropy ratchet.
Teleodynamics enables potentially indefinite to enable something intrinsically incomplete to bring itself into existence.
-- Millikan's lion vs Schroedinger's cat?
- The zero, differentiation and integration of absentialism has been described. p542
Function is a geometric or formal relationship, not a material efficient one.
Specifying a function is like a differentiation in calculus - specifying an intrinsic (instantaneous) telos.
Value of physical attributes to overall teleodynamics can be estimated - is the analogue of integration in calculus.
With emergence of teleodynamics, nature begins to discover zero.
This needed existence of complex molecules capable of forming into autogenic configurations.
Life and mind are the embodied calculus of physical processes leaping up from one teleodynamic level to the next.
Natural sciences appears to have no place for right/wrong, meaningful/meaningless, beauty/ugliness, good/evil, love/hate, and so forth. p543
For many people nihilism more threatening than death << thus the need religion?
The universe is is much larger than what we can see and touch and manipulate with out hands or our cyclotrons.
There is more here than stuff. There is how stuff is organized and related to other stuff. And then there is more than what is actual. p 544
There is what could be, what should be, what could be, what can't be, what is possible and what is impossible.


Earth Invasion 2.0
Your achievements will pop in here as you earn them.
{{achievement.title}}
{{achievement.description}}


Problem Statement
In a data warehouse environment, queries usually address a section of data pertaining to a specific date, state, etc. The key challenges in optimizing query performance in such a scenario include :
- Very large tables with spedific information like date, state, etc. highly scattered across the tables
- Rapidly growing size of tables introduce difficulty in management and operation of data
- Increased network traffic in a partitioned database environment for frequently joined tables that reside on different partitions
What is Range Partitioning ?
Range partitioning is a data organization scheme in which table data is divided across multiple storage objects called data partitions or ranges according to values in one or more table columns. Each data partition is stored separately. These storage objects can be in different table spaces, in the same table space, or a combination of both
Operation
This tutorial demonstrates creation of range partitions and highlights the best practices to do the same.
The need for range partitioning and their advantages are analysed. A graph comparing the query execution time against
the tables with and without range partitioning enabled is generated and the steps to create an explain snapshot
displaying partition elimination of ranges during query processing are indicated.
Benefits of Range Partitioning
- Query processing is enhanced to automatically eliminate data partitions based on predicates of the query. This functionality, known as Data Partition Elimination, benefits many decision support queries
- Easier administration of large tables
- Easier roll-out of table data
- Better optimization of storage costs by using the fastest and most expensive storage hardware for only the most active data partitions
- Larger table capacity. By dividing the contents of the table into multiple storage objects or data partitions, each capable of supporting as much data as in a non-partitioned table, one can effectively create databases that are virtually unlimited in size
- Greater index placement flexibility. Indexes for partitioned tables can be stored in their own storage objects (table spaces), as opposed to being in the same storage object as the non-partitioned table. This index placement flexibility is useful for performing faster index operations, managing table growth, and reduced I/O contention, providing more efficient concurrent access to the index data for the table


A framework for creating and running data pipelines. Data pipelines have stages, which are made of an arbitrary number of tasks. Stages and tasks are run in serial: once a task completes, the next task in the pipeline is executed.
Pipelines take a data object as input, and each task operates on the object in some way.
For an example of the Pipeliner in action, checkout the nxus-static-site module.
> npm install @nxus/pipeliner --save
app.get('pipeliner').pipeline('my-pipeline')
By default, every pipeline is pre-configured with three stages: 'collect', 'process', 'generate'. However, you can define your own stages:
app.get('pipliner').stages('my-pipeline', ['stage1', 'stage2', 'stage3'])
A task is a javascript function that accepts any objects passed into the pipeline when it is run.
let myTask = (word) => {
word.toUpperCase();
}
app.get('pipeliner').task('my-pipeline', 'process', myTask)
Once all the tasks for a pipeline have been defined, the last step is to run the pipeline.
app.get('pipeliner').run('my-pipeline', someData)
let myTask = (data) => {
data.word.toUpperCase()
}
let data = {word: 'hello'}
let pipeliner = app.get('pipeliner')
pipeliner.pipeline('capitalize')
pipeliner.task('capitalize', 'process', myTask)
pipeliner.run('capitalize', data).then(() => {
console.log('data') // {word: 'HELLO'}
})
#getPipeline(pipeline)
Returns a specific pipeline
#getPipelines
Returns all pipelines which have been defined
Returns all pipelines which have been defined
object
:
A hash of the pipelines.
#pipeline(pipeline)
Create a new pipeline.
Create a new pipeline.
The name of the pipeline to create
#run(pipeline, args)
Runs the specified pipeline, passing the arguments to each task.
Runs the specified pipeline, passing the arguments to each task.
Promise
:
A promise that is executed when the pipeline completes.
#stages(stages, pipeline)
Define stages for a pipeline
#task(pipeline, stage, job)
Defintes a task for a pipeline and a stage.
Defintes a task for a pipeline and a stage.


Welcome to your Unifund Profile!
Account Settings
About Me
Fafsa
Friendfund
Your catered list of Scholarships
Back


10 Hox ch 5: Longitudinal Example - student GPA
library(tidyverse) # all things tidy
library(pander) # nice looking genderal tabulations
library(furniture) # nice table1() descriptives
library(texreg) # Convert Regression Output to LaTeX or HTML Tables
library(psych) # contains some useful functions, like headTail
library(sjstats) # ICC calculations
library(sjPlot) # Visualization for Models
library(effects) # Effec displays for Models
library(lme4) # non-linear mixed-effects models
# library(haven) # read in SPSS dataset
#
# library(car) # Companion to Applied Regression
# library(optimx) # Different optimizers to solve mlm's
# library(VIM) # Visualization and Imputation of Missing Values
# library(naniar) # Summaries and Visualisations for Missing Data
10.1 Background
The text “Multilevel Analysis: Techniques and Applications, Third Edition” (Hox, Moerbeek, and Van de Schoot 2017) has a companion website which includes links to all the data files used throughout the book (housed on the book’s GitHub repository).
The following example is used through out Hox, Moerbeek, and Van de Schoot (2017)’s chapater 5.
The GPA for 200 college students were followed for 6 consecutive semesters (simulated). Job status was also measured as number of hours worked for the same size occations. Time-invariant covariates are the student’s gender and high school GPA. The variable admitted
will not be used.
data_raw <- haven::read_sav("https://github.com/MultiLevelAnalysis/Datasets-third-edition-Multilevel-book/raw/master/chapter%205/GPA2/gpa2long.sav") %>%
haven::as_factor() # retain the labels from SPSS --> factor
tibble::glimpse(data_raw)
Observations: 1,200
Variables: 7
$ student <dbl> 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,...
$ occas <fct> year 1 semester 1, year 1 semester 2, year 2 semester...
$ gpa <dbl> 2.3, 2.1, 3.0, 3.0, 3.0, 3.3, 2.2, 2.5, 2.6, 2.6, 3.0...
$ job <fct> 2 hours, 2 hours, 2 hours, 2 hours, 2 hours, 2 hours,...
$ sex <fct> female, female, female, female, female, female, male,...
$ highgpa <dbl> 2.8, 2.8, 2.8, 2.8, 2.8, 2.8, 2.5, 2.5, 2.5, 2.5, 2.5...
$ admitted <fct> yes, yes, yes, yes, yes, yes, no, no, no, no, no, no,...
data_raw %>%
dplyr::select(occas, job) %>%
table(useNA = "always")
job
occas no job 1 hour 2 hours 3 hours 4 or more hours <NA>
year 1 semester 1 0 0 172 28 0 0
year 1 semester 2 0 0 169 31 0 0
year 2 semester 1 0 7 159 34 0 0
year 2 semester 2 0 5 169 26 0 0
year 3 semester 1 0 18 150 32 0 0
year 3 semester 2 0 22 148 30 0 0
<NA> 0 0 0 0 0 0
data_long <- data_raw %>%
dplyr::mutate(student = factor(student)) %>%
dplyr::mutate(sem = case_when(occas == "year 1 semester 1" ~ 1,
occas == "year 1 semester 2" ~ 2,
occas == "year 2 semester 1" ~ 3,
occas == "year 2 semester 2" ~ 4,
occas == "year 3 semester 1" ~ 5,
occas == "year 3 semester 2" ~ 6)) %>%
dplyr::mutate(semc = sem - 1) %>%
dplyr::mutate(job = fct_drop(job)) %>%
dplyr::mutate(hrs = case_when(job == "no job" ~ 0,
job == "1 hour" ~ 1,
job == "2 hours" ~ 2,
job == "3 hours" ~ 3,
job == "4 or more hours" ~ 4)) %>%
dplyr::select(student, sex, highgpa, sem, semc, job, hrs, gpa) %>%
dplyr::arrange(student, sem)
psych::headTail(data_long, top = 10)
student sex highgpa sem semc job hrs gpa
1 1 female 2.8 1 0 2 hours 2 2.3
2 1 female 2.8 2 1 2 hours 2 2.1
3 1 female 2.8 3 2 2 hours 2 3
4 1 female 2.8 4 3 2 hours 2 3
5 1 female 2.8 5 4 2 hours 2 3
6 1 female 2.8 6 5 2 hours 2 3.3
7 2 male 2.5 1 0 2 hours 2 2.2
8 2 male 2.5 2 1 3 hours 3 2.5
9 2 male 2.5 3 2 2 hours 2 2.6
10 2 male 2.5 4 3 2 hours 2 2.6
11 <NA> <NA> ... ... ... <NA> ... ...
12 200 male 3.4 3 2 2 hours 2 3.4
13 200 male 3.4 4 3 2 hours 2 3.5
14 200 male 3.4 5 4 1 hour 1 3.3
15 200 male 3.4 6 5 1 hour 1 3.4
data_wide <- data_long %>%
furniture::wide(v.names = c("job", "hrs", "gpa"),
timevar = "sem",
id = "student")
psych::headTail(data_wide)
student sex highgpa semc job.1 hrs.1 gpa.1 job.2 hrs.2 gpa.2
1 1 female 2.8 0 2 hours 2 2.3 2 hours 2 2.1
7 2 male 2.5 0 2 hours 2 2.2 3 hours 3 2.5
13 3 female 2.5 0 2 hours 2 2.4 2 hours 2 2.9
19 4 male 3.8 0 3 hours 3 2.5 2 hours 2 2.7
... <NA> <NA> ... ... <NA> ... ... <NA> ... ...
1177 197 female 2.1 0 2 hours 2 2.9 2 hours 2 2.5
1183 198 male 4 0 2 hours 2 2.5 2 hours 2 2.9
1189 199 female 2.3 0 2 hours 2 2.6 2 hours 2 2.3
1195 200 male 3.4 0 2 hours 2 2.8 2 hours 2 3.2
job.3 hrs.3 gpa.3 job.4 hrs.4 gpa.4 job.5 hrs.5 gpa.5 job.6
1 2 hours 2 3 2 hours 2 3 2 hours 2 3 2 hours
7 2 hours 2 2.6 2 hours 2 2.6 2 hours 2 3 2 hours
13 2 hours 2 3 3 hours 3 2.8 2 hours 2 3.3 2 hours
19 2 hours 2 2.4 2 hours 2 2.7 2 hours 2 2.9 2 hours
... <NA> ... ... <NA> ... ... <NA> ... ... <NA>
1177 3 hours 3 2.8 2 hours 2 3.2 2 hours 2 3.3 2 hours
1183 2 hours 2 3 2 hours 2 3.2 1 hour 1 3.3 2 hours
1189 3 hours 3 2.7 2 hours 2 2.7 2 hours 2 2.8 3 hours
1195 2 hours 2 3.4 2 hours 2 3.5 1 hour 1 3.3 1 hour
hrs.6 gpa.6
1 2 3.3
7 2 2.8
13 2 3.4
19 2 2.7
... ... ...
1177 2 3.8
1183 2 3.4
1189 3 2.8
1195 1 3.4
data_wide %>%
furniture::table1(highgpa, gpa.1, job.1, hrs.1,
splitby = ~ sex,
output = "html",
test = TRUE)
| male | female | P-Value | |
|---|---|---|---|
| n = 95 | n = 105 | ||
| highgpa | 0.309 | ||
| 3.0 (0.6) | 2.9 (0.6) | ||
| gpa 1 | 0.095 | ||
| 2.6 (0.3) | 2.6 (0.3) | ||
| job 1 | 0.192 | ||
| 1 hour | 0 (0%) | 0 (0%) | |
| 2 hours | 78 (82.1%) | 94 (89.5%) | |
| 3 hours | 17 (17.9%) | 11 (10.5%) | |
| hrs 1 | 0.137 | ||
| 2.2 (0.4) | 2.1 (0.3) |
data_wide %>%
furniture::table1(gpa.1, gpa.2, gpa.3, gpa.4, gpa.5, gpa.6,
splitby = ~ sex,
output = "html")
| male | female | |
|---|---|---|
| n = 95 | n = 105 | |
| gpa 1 | ||
| 2.6 (0.3) | 2.6 (0.3) | |
| gpa 2 | ||
| 2.7 (0.3) | 2.8 (0.3) | |
| gpa 3 | ||
| 2.7 (0.4) | 2.9 (0.3) | |
| gpa 4 | ||
| 2.8 (0.4) | 3.0 (0.3) | |
| gpa 5 | ||
| 2.9 (0.4) | 3.1 (0.3) | |
| gpa 6 | ||
| 3.0 (0.4) | 3.2 (0.4) |
10.2 MLM
10.2.1 Null Models and ICC
fit_lmer_0_re <- lme4::lmer(gpa ~ 1 + (1|student),
data = data_long,
REML = TRUE)
sjstats::icc(fit_lmer_0_re)
Linear mixed model
Family : gaussian (identity)
Formula: gpa ~ 1 + (1 | student)
ICC (student): 0.3693
Over a third of the variance in the 6 GPA measures is variance between individuals, and about two-thirds is variance within individuals across time.
fit_lmer_1_re <- lme4::lmer(gpa ~ semc + (1|student),
data = data_long,
REML = TRUE)
sjstats::icc(fit_lmer_1_re)
Linear mixed model
Family : gaussian (identity)
Formula: gpa ~ semc + (1 | student)
ICC (student): 0.5231
After accounting for the linear change in GPA over semesters, about half of the remaining variance in GPA scores is attributable person-to-person differences.
10.2.2 Fixed Effects
fit_lmer_0_ml <- lme4::lmer(gpa ~ 1 + (1|student),
data = data_long,
REML = FALSE)
fit_lmer_1_ml <- lme4::lmer(gpa ~ semc + (1|student),
data = data_long,
REML = FALSE)
fit_lmer_2_ml <- lme4::lmer(gpa ~ semc + hrs + (1|student),
data = data_long,
REML = FALSE)
fit_lmer_3_ml <- lme4::lmer(gpa ~ semc + hrs + highgpa + sex + (1|student),
data = data_long,
REML = FALSE)
screenreg(list(fit_lmer_0_ml, fit_lmer_1_ml, fit_lmer_2_ml, fit_lmer_3_ml),
digits = 3)
================================================================================
Model 1 Model 2 Model 3 Model 4
--------------------------------------------------------------------------------
(Intercept) 2.865 *** 2.599 *** 2.970 *** 2.641 ***
(0.019) (0.022) (0.044) (0.098)
semc 0.106 *** 0.102 *** 0.102 ***
(0.004) (0.004) (0.004)
hrs -0.171 *** -0.172 ***
(0.018) (0.018)
highgpa 0.085 **
(0.028)
sexfemale 0.147 ***
(0.033)
--------------------------------------------------------------------------------
AIC 919.456 401.649 318.399 296.760
BIC 934.726 422.009 343.849 332.390
Log Likelihood -456.728 -196.825 -154.200 -141.380
Num. obs. 1200 1200 1200 1200
Num. groups: student 200 200 200 200
Var: student (Intercept) 0.057 0.063 0.052 0.045
Var: Residual 0.098 0.058 0.055 0.055
================================================================================
*** p < 0.001, ** p < 0.01, * p < 0.05
anova(fit_lmer_0_ml, fit_lmer_1_ml, fit_lmer_2_ml, fit_lmer_3_ml)
Data: data_long
Models:
fit_lmer_0_ml: gpa ~ 1 + (1 | student)
fit_lmer_1_ml: gpa ~ semc + (1 | student)
fit_lmer_2_ml: gpa ~ semc + hrs + (1 | student)
fit_lmer_3_ml: gpa ~ semc + hrs + highgpa + sex + (1 | student)
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fit_lmer_0_ml 3 919.46 934.73 -456.73 913.46
fit_lmer_1_ml 4 401.65 422.01 -196.82 393.65 519.807 1 < 2.2e-16
fit_lmer_2_ml 5 318.40 343.85 -154.20 308.40 85.250 1 < 2.2e-16
fit_lmer_3_ml 7 296.76 332.39 -141.38 282.76 25.639 2 2.707e-06
fit_lmer_0_ml
fit_lmer_1_ml ***
fit_lmer_2_ml ***
fit_lmer_3_ml ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
10.2.3 Variance Explained by linear TIME at Level ONE
sjstats::re_var(fit_lmer_0_ml) # baseilne
Within-group-variance: 0.098
Between-group-variance: 0.057 (student)
sjstats::re_var(fit_lmer_1_ml) # model to compare
Within-group-variance: 0.058
Between-group-variance: 0.063 (student)
<IP_ADDRESS> Raudenbush and Bryk
- Explained variance is a proportion of first-level variance only
- A good option when the multilevel sampling process is is close to two-stage simple random sampling
Raudenbush and Bryk Approximate Formula - Level 1 approximate \[ approx \;R^2_1 = \frac{\sigma^2_{e-BL} - \sigma^2_{e-MC}} {\sigma^2_{e-BL} } \tag{Hox 4.8} \]
(0.098 - 0.058) / 0.098
[1] 0.4081633
<IP_ADDRESS> Snijders and Bosker
Snijders and Bosker Formula - Level 1
Random Intercepts Models Only, address potential negative \(R^2\) issue \[ R^2_1 = 1 - \frac{\sigma^2_{e-MC} + \sigma^2_{u0-MC}} {\sigma^2_{e-BL} + \sigma^2_{u0-BL}} \]
1 - (0.058 + 0.063)/(0.098 + 0.057)
[1] 0.2193548
10.2.4 Variance Explained by linear TIME at Level TWO
<IP_ADDRESS> Raudenbush and Bryk
Raudenbush and Bryk Approximate Formula - Level 2 \[ approx \; R^2_s = \frac{\sigma^2_{u0-BL} - \sigma^2_{u0-MC}} {\sigma^2_{u0-BL} } \tag{Hox 4.9} \]
(0.057 - 0.063)/ 0.057
[1] -0.1052632
YIKES! Negative Variance explained!
<IP_ADDRESS> Snijders and Bosker
Snijders and Bosker Formula Extended - Level 2 \[ R^2_2 = 1 - \frac{\frac{\sigma^2_{e-MC}}{B} + \sigma^2_{u0-MC}} {\frac{\sigma^2_{e-BL}}{B} + \sigma^2_{u0-BL}} \]
\(B\) is the average size of the Level 2 units.


RLMCollection
@protocol RLMCollection <NSFastEnumeration, RLMThreadConfined>
A homogenous collection of Realm-managed objects. Examples of conforming types
include RLMArray
, RLMResults
, and RLMLinkingObjects
.
-
The number of objects in the collection.
Declaration
Objective-C
@required @property (readonly, assign, nonatomic) NSUInteger count;
Swift
var count: UInt { get }
-
The type of the objects in the collection.
Declaration
Objective-C
@required @property (readonly, assign, nonatomic) RLMPropertyType type;
-
Indicates whether the objects in the collection can be
nil
.Declaration
Objective-C
@required @property (readonly, getter=isOptional, nonatomic) BOOL optional;
Swift
var isOptional: Bool { get }
-
The class name of the objects contained in the collection.
Will be
nil
iftype
is not RLMPropertyTypeObject.Declaration
Objective-C
@required @property (readonly, copy, nonatomic, nullable) NSString *objectClassName;
Swift
var objectClassName: String? { get }
-
Returns the object at the index specified.
Declaration
Objective-C
- (nonnull id)objectAtIndex:(NSUInteger)index;
Swift
func object(at index: UInt) -> Any
Parameters
index
The index to look up.
Return Value
An object of the type contained in the collection.
-
Returns the first object in the collection.
Returns
nil
if called on an empty collection.Declaration
Objective-C
- (nullable id)firstObject;
Swift
func firstObject() -> Any?
Return Value
An object of the type contained in the collection.
-
Returns the last object in the collection.
Returns
nil
if called on an empty collection.Declaration
Objective-C
- (nullable id)lastObject;
Swift
func lastObject() -> Any?
Return Value
An object of the type contained in the collection.
-
Returns the index of an object in the collection.
Returns
NSNotFound
if the object is not found in the collection.Declaration
Objective-C
- (NSUInteger)indexOfObject:(nonnull id)object;
Swift
func index(of object: Any) -> UInt
Parameters
object
An object (of the same type as returned from the
objectClassName
selector). -
Returns the index of the first object in the collection matching the predicate.
Declaration
Objective-C
- (NSUInteger)indexOfObjectWhere:(nonnull NSString *)predicateFormat, ...;
Parameters
predicateFormat
A predicate format string, optionally followed by a variable number of arguments.
Return Value
The index of the object, or
NSNotFound
if the object is not found in the collection. -
Returns the index of the first object in the collection matching the predicate.
Declaration
Objective-C
- (NSUInteger)indexOfObjectWithPredicate:(nonnull NSPredicate *)predicate;
Swift
func indexOfObject(with predicate: NSPredicate) -> UInt
Parameters
predicate
The predicate with which to filter the objects.
Return Value
The index of the object, or
NSNotFound
if the object is not found in the collection. -
Returns all objects matching the given predicate in the collection.
Declaration
Objective-C
- (nonnull RLMResults *)objectsWhere:(nonnull NSString *)predicateFormat, ...;
Parameters
predicateFormat
A predicate format string, optionally followed by a variable number of arguments.
Return Value
An
RLMResults
containing objects that match the given predicate. -
Returns all objects matching the given predicate in the collection.
Declaration
Objective-C
- (nonnull RLMResults *)objectsWithPredicate:(nonnull NSPredicate *)predicate;
Swift
func objects(with predicate: NSPredicate) -> RLMResults
Parameters
predicate
The predicate with which to filter the objects.
Return Value
An
RLMResults
containing objects that match the given predicate. -
Returns a sorted
RLMResults
from the collection.Declaration
Objective-C
- (nonnull RLMResults *)sortedResultsUsingKeyPath:(nonnull NSString *)keyPath ascending:(BOOL)ascending;
Swift
func sortedResults(usingKeyPath keyPath: String, ascending: Bool) -> RLMResults
Parameters
keyPath
The keyPath to sort by.
ascending
The direction to sort in.
Return Value
An
RLMResults
sorted by the specified key path. -
Returns a sorted
RLMResults
from the collection.Declaration
Objective-C
- (nonnull RLMResults *)sortedResultsUsingDescriptors: (nonnull NSArray<RLMSortDescriptor *> *)properties;
Swift
func sortedResults(using properties: [RLMSortDescriptor]) -> RLMResults
Parameters
properties
An array of
RLMSortDescriptor
s to sort by.Return Value
An
RLMResults
sorted by the specified properties. -
Returns an
NSArray
containing the results of invokingvalueForKey:
usingkey
on each of the collection’s objects.Declaration
Objective-C
- (nullable id)valueForKey:(nonnull NSString *)key;
Swift
func value(forKey key: String) -> Any?
Parameters
key
The name of the property.
Return Value
An
NSArray
containing results. -
Invokes
setValue:forKey:
on each of the collection’s objects using the specifiedvalue
andkey
.Warning
This method may only be called during a write transaction.
Declaration
Objective-C
- (void)setValue:(nullable id)value forKey:(nonnull NSString *)key;
Swift
func setValue(_ value: Any?, forKey key: String)
Parameters
value
The object value.
key
The name of the property.
-
Registers a block to be called each time the collection changes.
The block will be asynchronously called with the initial collection, and then called again after each write transaction which changes either any of the objects in the collection, or which objects are in the collection.
The
change
parameter will benil
the first time the block is called. For each call after that, it will contain information about which rows in the collection were added, removed or modified. If a write transaction did not modify any objects in this collection, the block is not called at all. See theRLMCollectionChange
documentation for information on how the changes are reported and an example of updating aUITableView
.If an error occurs the block will be called with
nil
for the collection parameter and a non-nil
error. Currently the only errors that can occur are when opening the Realm on the background worker thread.At the time when the block is called, the collection object will be fully evaluated and up-to-date, and as long as you do not perform a write transaction on the same thread or explicitly call
-[RLMRealm refresh]
, accessing it will never perform blocking work.Notifications are delivered via the standard run loop, and so can’t be delivered while the run loop is blocked by other activity. When notifications can’t be delivered instantly, multiple notifications may be coalesced into a single notification. This can include the notification with the initial collection. For example, the following code performs a write transaction immediately after adding the notification block, so there is no opportunity for the initial notification to be delivered first. As a result, the initial notification will reflect the state of the Realm after the write transaction.
id<RLMCollection> collection = [Dog allObjects]<EMAIL_ADDRESS>%zu", dogs.count); // => 0 self.token = [collection addNotificationBlock:^(id<RLMCollection> dogs, RLMCollectionChange *changes, NSError *error) { // Only fired once for the example<EMAIL_ADDRESS>%zu", dogs.count); // => 1 }]; [realm transactionWithBlock:^{ Dog *dog = [[Dog alloc] init]; dog.name = @"Rex"; [realm addObject:dog]; }]; // end of run loop execution context
You must retain the returned token for as long as you want updates to continue to be sent to the block. To stop receiving updates, call
-invalidate
on the token.Warning
This method cannot be called during a write transaction, or when the containing Realm is read-only.
Declaration
Objective-C
- (nonnull RLMNotificationToken *)addNotificationBlock: (nonnull void (^)(id<RLMCollection> _Nullable, RLMCollectionChange *_Nullable, NSError *_Nullable))block;
Swift
func addNotificationBlock(_ block: @escaping (RLMCollection?, RLMCollectionChange?, Error?) -> Void) -> RLMNotificationToken
Parameters
block
The block to be called each time the collection changes.
Return Value
A token which must be held for as long as you want collection notifications to be delivered.
-
Returns the minimum (lowest) value of the given property among all the objects in the collection.
NSNumber *min = [results minOfProperty:@"age"];
Declaration
Objective-C
- (nullable id)minOfProperty:(nonnull NSString *)property;
Swift
func min(ofProperty property: String) -> Any?
Parameters
property
The property whose minimum value is desired. Only properties of types
int
,float
,double
, andNSDate
are supported.Return Value
The minimum value of the property, or
nil
if the Results are empty. -
Returns the maximum (highest) value of the given property among all the objects in the collection.
NSNumber *max = [results maxOfProperty:@"age"];
Declaration
Objective-C
- (nullable id)maxOfProperty:(nonnull NSString *)property;
Swift
func max(ofProperty property: String) -> Any?
Parameters
property
The property whose maximum value is desired. Only properties of types
int
,float
,double
, andNSDate
are supported.Return Value
The maximum value of the property, or
nil
if the Results are empty. -
Returns the sum of the values of a given property over all the objects in the collection.
NSNumber *sum = [results sumOfProperty:@"age"];
Declaration
Objective-C
- (nonnull NSNumber *)sumOfProperty:(nonnull NSString *)property;
Swift
func sum(ofProperty property: String) -> NSNumber
Parameters
property
The property whose values should be summed. Only properties of types
int
,float
, anddouble
are supported.Return Value
The sum of the given property.
-
Returns the average value of a given property over the objects in the collection.
NSNumber *average = [results averageOfProperty:@"age"];
Declaration
Objective-C
- (nullable NSNumber *)averageOfProperty:(nonnull NSString *)property;
Swift
func average(ofProperty property: String) -> NSNumber?
Parameters
property
The property whose average value should be calculated. Only properties of types
int
,float
, anddouble
are supported.Return Value
The average value of the given property, or
nil
if the Results are empty.


Product Details
Start Price:
Your Bid
Enter Bid Amount
Enter Amount To Send
Enter Secret Text
Submit Bid
Reveal Bid
Amount You Bid
Enter Secret Text
Reveal Bid
Finalize Auction
Auction Details
Status:
Highest:
Second:
Escrow
Release Amount to Seller
Refund Amount to Buyer


For our final project, we implemented fluid simulation. Our implementation was based on Position
Based Fluids by Macklin and Muller . The approach was to simulate water, an incompressible fluid by enforcing a density constraint on each particle. We used the poly6 and spiky gradient smoothing kernels to distribute our particles throughout the simulation. For each particle we applied a gravitational force, predicted the change in position, and then calculated a correction for the change in position such that our density constraint would be satisfied (and particles wouldn't remain in the same position). This correcting position can be found by applying
Newton's method along the constraint gradient. The project required
a lot of parameter tuning to ensure that any external force applied
to the particles and the pressure force from the smoothing kernel
were in an appropriate balance.
Technical approach
The entire fluid simulation can be implemented via the
pseudocode shown below.
Simulation loop used to
on each particle to apply force and the correcting constraint position.
The accuracy of the fluid simulation relies on the position
of each particle, hence the name of the paper 'Position Based
Fluids'. We use a particle and it's
'neighboring' particles as input into the smoothing kernel functions
we used to distribute our particles and maintain consistent density in our closed system.
Water, the fluid we chose to simulate, is incompressible by nature.
In order to have our simulation appear accurate, we needed to enforce incompressibility.
Each particle relies on surrounding
particles to be part of it's neighboring set. The accuracy of the particle's positions and predicted positions was critical to not only the appearance of a frame of the simulation, but also to the next frame since the positions of each particle's neighbors were used to calcuate future positions. Should a particle's neighboring set be empty, we
would be calculating the density constraint independent of
other particles. For most cases that leads to an unrealistic output, as we wanted all of
our particles working together to create a smooth visual
simulation.
Initially, we had all of our particles offset from the
y-axis so that we could see the effect of gravity as the simulation started.
We applied a Vector3D force (0, -9.8, 0) on
our particles as the gravitational force. The
time step we chose for our simulation was dt = 0.001.
The predicted position of each particle would reflect where
it's next position would be as a result of it's previous
position plus the velocity direction and magnitude. One of
the errors we had with gravity was with the way we were
calculating our time step. We were using our total time elapsed in the kinematic position equation for gravity, as opposed to one time step. This made our gravitational force too powerful. Once we had a constant change in time, our gravity looked much more realistic.
Next, we
calculated the scaling factor, which determines the density
constraint of a particle given the gradient of all it's
neighbors. Initially we had our epsilon value in Equation 11 of the Macklin and Muller paper
set to 0.001 which was far too small and caused many errors.
Equation 11 We
later set this value to 5000. When we realized the effect of gravity was being overshadowed significantly by the particles' interactions with eachother, we increased the epsilon value to a whopping 150,000. Increasing the epsilon value effectively reduced the net force applied
by our smoothing kernels. Another challenge we encountered was understanding equation 8,
the gradient constraint function.
Equation 8
We thought the gradient
constraint function was multipying the spiky kernel by the
poly6 kernel. It turns out that we were supposed to take the
gradient of the spiky kernel, which is
The two kernels we used
in our fluid simulation.
Once we started using the spiky gradient kernel for
calculating our scaling factor and our correcting position
update, we got much better results in
the density distribution of our particles.
When calculating change in position, we had some particles
clustering in the middle of our simulation. We reduced this
effect by introducing an artifical pressure term as
suggested by Muller. This alleviated the problem of when
particles had few neighboring particles since the kernel
functions would assume very little density. The premise of
the whole paper is finding the correct change in position such
that we satisfy our density constraint and have a plausible
simulation. It was difficult to debug the change in position since it relied on getting the scaling factor
correct and calculating the gradient constraint function
accurately. At times we thought we were having issues with our implementation when in reality we just needed to tune our parameters.
As for the collision detection and response, we simply
put a particle back inside the boundary of the container if it ended up outside. However,
we found a huge bug the night before our presentation. When
a particle would hit the floor, the particle's velocity in
the y-component would continue to decrease. Resetting this
component to zero allowed the smoothing kernels to make more
reasonable calculations when determining how much to move a
particle. And finally once we have the predicted position
and delta position, we can update the particle's actual
position.
The particle struct.
We stored the neighboring particles in a vector pointer of
particles to save space.
Debugging this fluid simulation project was an enormous
challenge. The problem with fluid simulation projects in
general is that they require a lot of parameter tuning. We found that implementing the paper and
using the suggested constants did not work for us. We had
to fine tune our parameters such that the output simulation
looked plausible. In addition, we found ourselves to be
wasting a lot of time by quickly changing code and then
running the simulation, hoping to get a better result. The
reason why this approach doesn't work for us is because we
had no clear expectation of what to expect as a result of
changing a specific parameter. Towards the end of the
project, we found printing the Particle member variables,
and adjusting our parameter values to satisfy the density
constraint to be zero, led in great improvements.
The key takeaway from the semester was that understand the big picture before jumping into editing code is the most effective and efficient way to work. With graphics projects especially, the more we thought critically about what we were seeing, the more we understood. It is important to be deliberate with changing parameters. We achieved the best results when we changed them one at a time, predicted what we were going to see, and then analyze the result and whether it matched our expectation.
Results
Our smoothing kernels
did a nice job of spreading our the
particles. However, the kernels come into effect
expanding our particles before particles even
hit the ground. This requires additional
parameter tuning to ensure balance between
external forces and the pressure applied from
our kernel. The clustering in the middle is a
result of not using artifical pressure in delta position.


test.componenttest.componenttest.componenttest.componenttest.componentbr test.componenttest.componenttest.componenttest.componenttest.component METAPS


Stream your iTunes Library with pulpTunes!
To say that I enjoy working with music would be an understatement. I ADORE working with music, and I like to believe that most of the time, music is what I need to be really productive. Us folks from the internet-induced OCD generation usually have a very short attention span and without music at the workplace I often find myself needing to take a break and think about the last ten actions I’ve done in order to put myself back on track. Putting my iPhone on the speakers seems to solve the problem… but then this too has it’s own share of problems: after a couple of shifts, it seems that you always get the same songs over and over again, even on a 16 gig device, and syncing at home isn’t always an option.
Enter PulpTunes: a tool that streams your entire iTunes library to wherever the heck you can get an internet connection. I had found similar tools in the past, of course I sadly I cannot remember the name, but from what I remember they were either commercial pieces of software with a price tag, or available only for Mac OSX. Pulptunes has none of these restrictions: it’s donation-ware, and it is supported by Windows, OSX, and even Linux and variants.
The concept behind Pulptunes is simple. It’s a standalone app that peaks into your iTunes library’s XML file, and hosts a neat little web player from your computer that makes all you music and playlists available; all you needs is a browser, or one of the support mobile devices (iPhone, iPad and Android as of now). Because it isn’t merely a plugin that integrates a web server to iTunes, you can run it from any OS, regardless of if iTunes is running or even installed at all. This makes Pulptunes the perfect addition to your existing fileserver setup: you can stream your stuff from a dedicated Linux box without any other computer being online!
My preliminary testing at work has been going awesome, it seems like a great piece of software. This isn’t a web-app carbon-copy of iTunes, in that is does lack some key features, but overall it’s a very nice little app, and for free, you can’t really justify not getting it if you really want your music on the go.  For those of you who are like me and have a pretty important amount of music, this get’s frustrating pretty quickly. Oh, and it’s in Flash. Yeah, I know, that kind of sucks, but hey, it get’s the job done.


Game
instance, runs Game.start()
and loops through Game.gameplayRound()
, each time executing
Game.generateHTMLFiles()
to update the maps for each player.Map
object used for testing.Map
class contains a two-dimensional array of Tile
s
and some simple methods that operate on the map.Map.size
to the parameter size
.Map
object used for testing.Map
object used for testing.MapCreator
class creates an appropriate Map
using a given parameter (factory method design pattern).MapCreatorTest
class tests the functionality of
methods in the MapCreator
class.


Tech & Engineering Organizations
- GatorTech
- Blog Writer
- Web Developer
- Technology Coordinator
- Membership Coordinator
- Gator Robotics
- Publicity Team
- UF AIS
- Leadership Committee
- Communications Committee
- Audio-Engineering Society
- Women in Computer Science
- InfoTech Shadowing Program
- UF Engineering Entrepreneurs
Languages | OS | Software
- Languages
- HTML5
- CSS3
- Learning SQL
- Software | Platforms | OS
- MS Office
- NetBeans 8.0.2
- Visual Studio
- Brackets
- (Rudimentary) Sketch
- Mac OS Sierra 10.12/Windows 7/Windows 10