This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
# Find the average temperature | |
ROUND(AVG(temp),2) AS temp_avg_f, | |
stn AS noaa_station_number FROM | |
( | |
SELECT * FROM `bigquery-public-data.noaa_gsod.gsod2015` UNION ALL SELECT * FROM `bigquery-public-data.noaa_gsod.gsod2016` UNION ALL SELECT * FROM `bigquery-public-data.noaa_gsod.gsod2017` | |
) | |
GROUP BY 2 ORDER BY 1 DESC LIMIT 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM java:8-jre | |
ENV CATALINA_HOME /usr/local/tomcat | |
ENV PATH $CATALINA_HOME/bin:$PATH | |
RUN mkdir -p "$CATALINA_HOME" | |
WORKDIR $CATALINA_HOME | |
# see https://www.apache.org/dist/tomcat/tomcat-8/KEYS | |
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys \ | |
05AB33110949707C93A279E3D3EFE6B686867BA6 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TCB { | |
private Thread thread = null; | |
private int tid = 0; | |
private int pid = 0; | |
private boolean terminate = false; | |
// User file descriptor table: | |
// each entry pointing to a file (structure) table entry | |
public FileTableEntry[] ftEnt = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FileTable { | |
private Vector table; // the actual entity of this file table | |
private Directory dir; // the root directory | |
public FileTable( Directory directory ) { // constructor | |
table = new Vector( ); // instantiate a file (structure) table | |
dir = directory; // receive a reference to the Director | |
} // from the file system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FileTableEntry { // Each table entry should have | |
public int seekPtr; // a file seek pointer | |
public final Inode inode; // a reference to its inode | |
public final short iNumber; // this inode number | |
public int count; // # threads sharing this entry | |
public final String mode; // "r", "w", "w+", or "a" | |
public FileTableEntry ( Inode i, short inumber, String m ) { | |
seekPtr = 0; // the seek pointer is set to the file top | |
inode = i; | |
iNumber = inumber; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Directory { | |
private static int maxChars = 30; // max characters of each file name | |
// Directory entries | |
private int fsize[]; // each element stores a different file size. | |
private char fnames[][]; // each element stores a different file name. | |
public Directory( int maxInumber ) { // directory constructor | |
fsizes = new int[maxInumber]; // maxInumber = max files | |
for ( int i = 0; i < maxInumber; i++ ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Superblock { | |
public int totalBlocks; // the number of disk blocks | |
public int totalInodes; // the number of inodes | |
public int freeList; // the block number of the free list's head | |
public SuperBlock( int diskSize ) { | |
... | |
} | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Inode { | |
private final static int iNodeSize = 32; // fix to 32 bytes | |
private final static int directSize = 11; // # direct pointers | |
public int length; // file size in bytes | |
public short count; // # file-table entries pointing to this | |
public short flag; // 0 = unused, 1 = used, ... | |
public short direct[] = new short[directSize]; // direct pointers | |
public short indirect; // a indirect pointer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Kernel | |
{ | |
private static SyncQueue ioQueue; | |
... | |
public static int interrupt( int irq, int cmd, int param, Object args ) { | |
TCB myTcb; | |
switch( irq ) { | |
case INTERRUPT_SOFTWARE: // System calls | |
switch( cmd ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Kernel | |
{ | |
private static SyncQueue waitQueue; | |
... | |
public static int interrupt( int irq, int cmd, int param, Object args ) { | |
TCB myTcb; | |
switch( irq ) { | |
case INTERRUPT_SOFTWARE: // System calls | |
switch( cmd ) { |
NewerOlder