~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 18.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Mon Nov 17 08:58:16 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner3.usc.edu (msg-scanner3.usc.edu [128.125.137.212]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAHGwGRM004061 for ; Mon, 17 Nov 2008 08:58:16 -0800 Received: from msg-mx2.usc.edu ([128.125.137.7]) by msg-scanner3.usc.edu (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0KAH005FMM2GO7S0@msg-scanner3.usc.edu> for cs551@merlot.usc.edu; Mon, 17 Nov 2008 09:04:10 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by msg-mx2.usc.edu (Postfix) with ESMTP id 0DB3C2BFF for ; Mon, 17 Nov 2008 09:04:10 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k40so1508021wah.31 for ; Mon, 17 Nov 2008 09:04:09 -0800 (PST) Received: by 10.114.234.13 with SMTP id g13mr2630999wah.64.1226941449712; Mon, 17 Nov 2008 09:04:09 -0800 (PST) Received: from LesliePC (76-195-62-167.lightspeed.irvnca.sbcglobal.net [76.195.62.167]) by mx.google.com with ESMTPS id q18sm7814660pog.25.2008.11.17.09.04.08 (version=SSLv3 cipher=RC4-MD5); Mon, 17 Nov 2008 09:04:09 -0800 (PST) Date: Mon, 17 Nov 2008 09:04:13 -0800 From: Leslie Cheung Subject: office hour, Nov 17 To: cs551@merlot.usc.edu Message-id: <01e001c948d6$85491410$8fdb3c30$@edu> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: en-us Content-transfer-encoding: 7bit Thread-index: AclIsaIWCAiNs9ARQWy7fyabyQsOcg== Hi class, I am rescheduling my office hour this week to Nov 19 (Wed), 3-5pm, and I won't be holding office hour today. Sorry for any inconvenience! --Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 17.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Sun Nov 9 22:42:00 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner3.usc.edu (msg-scanner3.usc.edu [128.125.137.212]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mAA6g01q000471 for ; Sun, 9 Nov 2008 22:42:00 -0800 Received: from msg-mx2.usc.edu ([128.125.137.7]) by msg-scanner3.usc.edu (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0KA300FGXURY2UE0@msg-scanner3.usc.edu> for cs551@merlot.usc.edu; Sun, 09 Nov 2008 22:45:34 -0800 (PST) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by msg-mx2.usc.edu (Postfix) with ESMTP id 2BD0C2C7F for ; Sun, 09 Nov 2008 22:45:34 -0800 (PST) Received: by wf-out-1314.google.com with SMTP id 28so2341788wfa.27 for ; Sun, 09 Nov 2008 22:45:33 -0800 (PST) Received: by 10.142.177.7 with SMTP id z7mr2225128wfe.25.1226299098387; Sun, 09 Nov 2008 22:38:18 -0800 (PST) Received: from LesliePC (76-195-62-167.lightspeed.irvnca.sbcglobal.net [76.195.62.167]) by mx.google.com with ESMTPS id 30sm10010670wfa.10.2008.11.09.22.38.17 (version=SSLv3 cipher=RC4-MD5); Sun, 09 Nov 2008 22:38:17 -0800 (PST) Date: Sun, 09 Nov 2008 22:38:26 -0800 From: Leslie Cheung Subject: RE: midterm exam In-reply-to: <490F69D5.1040900@usc.edu> To: cs551@merlot.usc.edu Message-id: <027301c942fe$eff83f80$cfe8be80$@edu> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: en-us Content-transfer-encoding: 7bit Thread-index: Ack9+TkLGWC9+MFpTN+Qh+g2dsEfkgFBROxw References: <490F69D5.1040900@usc.edu> Hi all, Here is my availability for this week (Week of Nov 10). Nov 11 (Tue), 1-5pm Nov 12 (Wed), 3-5pm Nov 13 (Thu), 1-5pm Nov 14 (Fri), 1-5pm If you'd like to take a look at your exam, please send me three 15-minute timeslots, and I'll pick the one that fits my schedule best. Please note that if you want to look at your midterm, you should come before this Friday (Nov 14). If you cannot make it this week, please let me know. Thanks! Regards, Leslie > -----Original Message----- > From: Leslie Cheung [mailto:lccheung@usc.edu] > Sent: Monday, November 03, 2008 1:15 PM > To: cs551@merlot.usc.edu > Subject: midterm exam > > Hi all, > > Here is my availability this week. I try scheduling midterm appointment > outside my office hour, so we won't be disturbed by other students. > > Nov 3 (Mon, today): 3pm - 3:30pm > Nov 4 (Tue): 10am - noon, 1pm - 5pm > Nov 5 (Wed): 10am - noon, 3pm-5pm > Nov 6 (Thu): 10am - noon, 1pm - 5pm > Nov 7 (Fri): 10am - noon, 1pm - 5pm > > When you schedule an appointment with me, please send me five 15- > minutes > timeslots in the order of your preferences, instead of asking me what's > the best time for me. I'll pick the first available slot. > > DEN students: We cannot fax or email you a copy of your exam. If you > cannot come to campus, we can discuss your exam over the phone. > > You can also come next week. I will send out my availability no later > than Sunday (Nov 9). > > > Thanks, > Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 16.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Mon Nov 3 13:13:29 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA3LDT0J001331 for ; Mon, 3 Nov 2008 13:13:29 -0800 Received: from msg-mx10.usc.edu ([128.125.137.28]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K9S00DCV0C52OU0@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Mon, 03 Nov 2008 13:15:00 -0800 (PST) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by msg-mx10.usc.edu (Postfix) with ESMTP id 1A0742ABD for ; Mon, 03 Nov 2008 13:14:59 -0800 (PST) Received: by yw-out-2324.google.com with SMTP id 2so965235ywt.45 for ; Mon, 03 Nov 2008 13:14:58 -0800 (PST) Received: by 10.142.229.5 with SMTP id b5mr287311wfh.280.1225746898183; Mon, 03 Nov 2008 13:14:58 -0800 (PST) Received: from ?128.125.163.179? (cognac.usc.edu [128.125.163.179]) by mx.google.com with ESMTPS id 31sm15639078wff.16.2008.11.03.13.14.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 03 Nov 2008 13:14:57 -0800 (PST) Date: Mon, 03 Nov 2008 13:15:01 -0800 From: Leslie Cheung Subject: midterm exam To: cs551@merlot.usc.edu Message-id: <490F69D5.1040900@usc.edu> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) Hi all, Here is my availability this week. I try scheduling midterm appointment outside my office hour, so we won't be disturbed by other students. Nov 3 (Mon, today): 3pm - 3:30pm Nov 4 (Tue): 10am - noon, 1pm - 5pm Nov 5 (Wed): 10am - noon, 3pm-5pm Nov 6 (Thu): 10am - noon, 1pm - 5pm Nov 7 (Fri): 10am - noon, 1pm - 5pm When you schedule an appointment with me, please send me five 15-minutes timeslots in the order of your preferences, instead of asking me what's the best time for me. I'll pick the first available slot. DEN students: We cannot fax or email you a copy of your exam. If you cannot come to campus, we can discuss your exam over the phone. You can also come next week. I will send out my availability no later than Sunday (Nov 9). Thanks, Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 15.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Fri Oct 31 14:17:26 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9VLHQO3022163 for ; Fri, 31 Oct 2008 14:17:26 -0700 Received: from msg-mx8.usc.edu ([128.125.137.26]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K9M00BKQHAUXU60@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Fri, 31 Oct 2008 14:37:26 -0700 (PDT) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.225]) by msg-mx8.usc.edu (Postfix) with ESMTP id 91F497F2B for ; Fri, 31 Oct 2008 14:37:25 -0700 (PDT) Received: by rv-out-0506.google.com with SMTP id k40so1302206rvb.15 for ; Fri, 31 Oct 2008 14:37:25 -0700 (PDT) Received: by 10.142.44.13 with SMTP id r13mr5634732wfr.344.1225489045316; Fri, 31 Oct 2008 14:37:25 -0700 (PDT) Received: from ?128.125.163.179? (cognac.usc.edu [128.125.163.179]) by mx.google.com with ESMTPS id 29sm6415635wfg.0.2008.10.31.14.37.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 31 Oct 2008 14:37:24 -0700 (PDT) Date: Fri, 31 Oct 2008 14:37:15 -0700 From: Leslie Cheung Subject: Re: fprintf() In-reply-to: <200810312040.m9VKexU2002079@bourbon.usc.edu> To: cs551@merlot.usc.edu Message-id: <490B7A8B.1000905@usc.edu> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <200810312040.m9VKexU2002079@bourbon.usc.edu> User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) > Someone wrote: > > > When different nodes try to write to the file, sometimes the file is blank > > for some nodes...all run the same code ! > > > > What could be the problem ? > Have you closed the file after writing (by calling fclose())? --Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 14.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Wed Oct 29 16:29:24 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner3.usc.edu (msg-scanner3.usc.edu [128.125.137.212]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TNTOk7025532 for ; Wed, 29 Oct 2008 16:29:24 -0700 Received: from msg-mx9.usc.edu ([128.125.137.27]) by msg-scanner3.usc.edu (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0K9I008L6Y527AB1@msg-scanner3.usc.edu> for cs551@merlot.usc.edu; Wed, 29 Oct 2008 16:48:48 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.169]) by msg-mx9.usc.edu (Postfix) with ESMTP id DBE252A88 for ; Wed, 29 Oct 2008 16:48:46 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 28so268161wfa.27 for ; Wed, 29 Oct 2008 16:48:46 -0700 (PDT) Received: by 10.142.128.6 with SMTP id a6mr4300045wfd.10.1225324126610; Wed, 29 Oct 2008 16:48:46 -0700 (PDT) Received: from ?128.125.163.179? (cognac.usc.edu [128.125.163.179]) by mx.google.com with ESMTPS id 22sm1016475wfg.13.2008.10.29.16.48.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 29 Oct 2008 16:48:39 -0700 (PDT) Date: Wed, 29 Oct 2008 16:48:33 -0700 From: Leslie Cheung Subject: Re: Trace File In-reply-to: To: cs551@merlot.usc.edu Message-id: <4908F651.7090101@usc.edu> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <20081029035841.STLK24054.cdptpa-omta04.mail.rr.com@anash> <4908E696.1090400@usc.edu> User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) Someone wrote: > Is it okay to have a node after a link ... or do we need to show all the nodes and there numbers before any link starts in the trace file ? > You can interleave them (i.e., you can first define several nodes, then a link, and then more nodes), but make sure you define the nodes first before defining a link between them. For example, if you want to define a link between nodes "3" and "5", you should first define node "3", then node "5", before you define the link 3 <--> 5. You can define more nodes/links after that. And make sure you try your status neighbor output on NAM. --Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 13.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Wed Oct 29 15:25:21 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_20 autolearn=ham version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9TMPKEg024980 for ; Wed, 29 Oct 2008 15:25:21 -0700 Received: from msg-mx9.usc.edu ([128.125.137.27]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K9I00MNRV0KM821@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Wed, 29 Oct 2008 15:44:43 -0700 (PDT) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by msg-mx9.usc.edu (Postfix) with ESMTP id 6E2C02ACC for ; Wed, 29 Oct 2008 15:44:42 -0700 (PDT) Received: by wa-out-1112.google.com with SMTP id m33so129389wag.31 for ; Wed, 29 Oct 2008 15:44:42 -0700 (PDT) Received: by 10.115.22.1 with SMTP id z1mr7742958wai.99.1225320282208; Wed, 29 Oct 2008 15:44:42 -0700 (PDT) Received: from cognac.usc.edu (cognac.usc.edu [128.125.163.179]) by mx.google.com with ESMTPS id m26sm413949pof.17.2008.10.29.15.44.41 (version=SSLv3 cipher=RC4-MD5); Wed, 29 Oct 2008 15:44:41 -0700 (PDT) Date: Wed, 29 Oct 2008 15:41:26 -0700 From: Leslie Cheung Subject: Re: In-reply-to: <20081029035841.STLK24054.cdptpa-omta04.mail.rr.com@anash> To: cs551@merlot.usc.edu Message-id: <4908E696.1090400@usc.edu> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <20081029035841.STLK24054.cdptpa-omta04.mail.rr.com@anash> User-Agent: Thunderbird 2.0.0.9 (X11/20071031) Someone wrote: > You say that in a nam trace -t is the time.but what time does that refer to > exactly > > n -t * -s 3 -c red -i black > > Nam is a network simulation that does more than representing a network topology. For example, you can have a node comes up at t=1 (instead of t=0), start moving around until t=5, etc. For the purpose of our project, all nodes come up at t=0, and stay forever. So you can just keep the "-t *" part. --Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 12.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Sun Oct 12 20:33:39 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner3.usc.edu (msg-scanner3.usc.edu [128.125.137.212]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9D3Xds4027942 for ; Sun, 12 Oct 2008 20:33:39 -0700 Received: from msg-mx8.usc.edu ([128.125.137.26]) by msg-scanner3.usc.edu (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0K8N009I9RVCJP70@msg-scanner3.usc.edu> for cs551@merlot.usc.edu; Sun, 12 Oct 2008 20:47:36 -0700 (PDT) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.229]) by msg-mx8.usc.edu (Postfix) with ESMTP id C19477FA0 for ; Sun, 12 Oct 2008 20:47:35 -0700 (PDT) Received: by rv-out-0506.google.com with SMTP id k40so1241710rvb.15 for ; Sun, 12 Oct 2008 20:47:35 -0700 (PDT) Received: by 10.114.79.18 with SMTP id c18mr4784904wab.86.1223869655445; Sun, 12 Oct 2008 20:47:35 -0700 (PDT) Received: from LesliePC (76-195-62-167.lightspeed.irvnca.sbcglobal.net [76.195.62.167]) by mx.google.com with ESMTPS id m30sm15943111wag.0.2008.10.12.20.47.34 (version=SSLv3 cipher=RC4-MD5); Sun, 12 Oct 2008 20:47:34 -0700 (PDT) Date: Sun, 12 Oct 2008 20:47:30 -0700 From: Leslie Cheung Subject: broken pipes problems To: cs551@merlot.usc.edu Message-id: <00c101c92ce6$6d5be910$4813bb30$@edu> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: en-us Content-transfer-encoding: 7bit Thread-index: Acks5mrrC3aVs7mQT0Oj1DWv50k12g== Hi class, I know a few of you are encountering broken pipes problems. Here is a note I wrote a while ago, and I hope this is useful to all of you. If what I suggest below cannot fix your problem, it's best to schedule an appointment with Bill or myself so we can look at your code. It's really hard to fix a bug like this without going into your code. --Leslie --------------------------------------------------------- Hi all, I debugged a couple SIGPIPE problems, and I hope this information is useful. So I assume if we are unable to connect to the other node (e.g., it has not been started), we sleep for a while, and try again later. One problem I saw is that when you try "reusing" a socket, it is able to complete "connect", but whenever you send something using that reused socket, you get SIGPIPE. Why? I have no idea either, but this is how things work. Instead of saying... ------------------------------------- int sockfd = socket(...); while (!done){ if (connect(sockfd, ...) < 0){ //cannot connect } else { //it won't give you an error for connect, so it comes here //but if you try to send something, it gives you SIGPIPE write(sockfd, ...); //this line give you SIGPIPE } sleep(10); } ------------------------------------- You should do ------------------------------------- while (!done){ int sockfd = socket(...); if (connect(sockfd, ...) < 0){ //cannot connect //you should now close the socket close(sockfd); } else { //connected //now if you send something, it should work write(sockfd, ...); //this should work } sleep(10); } ------------------------------------- In other words, you should create a new socket "inside the loop". Again, this is just one possible scenario that may give you SIGPIPE. Yours might be some other problems. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 11.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Mon Oct 6 12:42:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m96JgVEK026772 for ; Mon, 6 Oct 2008 12:42:31 -0700 Received: from msg-mx3.usc.edu ([128.125.137.8]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K8C00LEB1QY5NH0@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Mon, 06 Oct 2008 12:54:26 -0700 (PDT) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by msg-mx3.usc.edu (Postfix) with ESMTP id 5393732BBB for ; Mon, 06 Oct 2008 12:54:25 -0700 (PDT) Received: by wa-out-1112.google.com with SMTP id m33so1689436wag.31 for ; Mon, 06 Oct 2008 12:54:25 -0700 (PDT) Received: by 10.114.39.5 with SMTP id m5mr6146022wam.113.1223322864938; Mon, 06 Oct 2008 12:54:24 -0700 (PDT) Received: from LesliePC (76-195-62-167.lightspeed.irvnca.sbcglobal.net [76.195.62.167]) by mx.google.com with ESMTPS id v32sm31861035wah.19.2008.10.06.12.54.24 (version=SSLv3 cipher=RC4-MD5); Mon, 06 Oct 2008 12:54:24 -0700 (PDT) Date: Mon, 06 Oct 2008 12:54:21 -0700 From: Leslie Cheung Subject: office hour today To: cs551@merlot.usc.edu Message-id: <001401c927ed$5405f9e0$fc11eda0$@edu> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: en-us Content-transfer-encoding: 7bit Thread-index: Ackn7VNPhgaXNvSkTsOkNuhc0+xCuw== Hi class, I am very sorry but I have to cancel my office hour today due to an emergency. I'll make up my office hour later in the week (most likely Wed). Sorry about this, Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 10.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Tue Sep 30 18:04:46 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner0.usc.edu (msg-scanner0.usc.edu [128.125.137.209]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9114kgQ003295 for ; Tue, 30 Sep 2008 18:04:46 -0700 Received: from msg-mx8.usc.edu ([128.125.137.26]) by msg-scanner0.usc.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTP id <0K81005MYCRUJC71@msg-scanner0.usc.edu> for cs551@merlot.usc.edu; Tue, 30 Sep 2008 18:14:39 -0700 (PDT) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.237]) by msg-mx8.usc.edu (Postfix) with ESMTP id DABEE7FE6 for ; Tue, 30 Sep 2008 18:14:38 -0700 (PDT) Received: by rv-out-0506.google.com with SMTP id k40so259141rvb.15 for ; Tue, 30 Sep 2008 18:14:38 -0700 (PDT) Received: by 10.140.126.14 with SMTP id y14mr3967853rvc.96.1222823678863; Tue, 30 Sep 2008 18:14:38 -0700 (PDT) Received: from LesliePC (76-195-62-167.lightspeed.irvnca.sbcglobal.net [76.195.62.167]) by mx.google.com with ESMTPS id k2sm3572855rvb.1.2008.09.30.18.14.38 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Sep 2008 18:14:38 -0700 (PDT) From: Leslie Cheung To: cs551@merlot.usc.edu Subject: cs551 project partner Date: Tue, 30 Sep 2008 18:14:18 -0700 Message-id: <015b01c92363$07ecbe60$17c63b20$@edu> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-language: en-us Thread-index: AckjYwdbtB1ELaEESWO1tFDzREV20A== Hi class, A student contacted me about finding a partner for the final project. If you are also looking for a partner, please let me know, so I can send you his/her contact info. Note that you are *not* required to have a partner; you can work on this project on your own. You will receive the same score as your partner no matter what happens (please see the commitment form on the class web site for details). --Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 9.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Wed Sep 24 22:43:31 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner2.usc.edu (msg-scanner2.usc.edu [128.125.137.211]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8P5hVfr008113 for ; Wed, 24 Sep 2008 22:43:31 -0700 Received: from msg-mx2.usc.edu ([128.125.137.7]) by msg-scanner2.usc.edu (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0K7Q005TILLB4LI0@msg-scanner2.usc.edu> for cs551@merlot.usc.edu; Wed, 24 Sep 2008 22:51:40 -0700 (PDT) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by msg-mx2.usc.edu (Postfix) with ESMTP id 583472D2E for ; Wed, 24 Sep 2008 22:51:40 -0700 (PDT) Received: by rv-out-0506.google.com with SMTP id k40so240545rvb.15 for ; Wed, 24 Sep 2008 22:51:40 -0700 (PDT) Received: by 10.140.192.9 with SMTP id p9mr3922906rvf.114.1222321899900; Wed, 24 Sep 2008 22:51:39 -0700 (PDT) Received: from LesliePC ( [76.195.62.167]) by mx.google.com with ESMTPS id c20sm211890rvf.3.2008.09.24.22.51.39 (version=SSLv3 cipher=RC4-MD5); Wed, 24 Sep 2008 22:51:39 -0700 (PDT) Date: Wed, 24 Sep 2008 22:51:38 -0700 From: Leslie Cheung Subject: verifying your simulation To: cs551@merlot.usc.edu Message-id: <019f01c91ed2$c7acdd10$57069730$@edu> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: en-us Content-transfer-encoding: 7bit Thread-index: Acke0scOiczZDxyDQC2FZeFzYfIrNQ== Hi all, A few of you have asked me how you can verify if your simulation is "correct". Here are a few things you should try. 1) Make sure the statistics match the simulation output. If you have 2 customers, and inter-arrival time of c1 and c2 are 1 and 0.5 respectively, the average inter-arrival time should be 0.75, and not, for example, 0.743123. I recommend calculating the statistics by hand using the simulation trace, and compare them with what you output at the end. 2) Check the simulation with "real" time (e.g., a clock). During my office hour, I saw a student's simulation finished 20 customers in about a second using the default parameters. Since the average inter-arrival time is 2 seconds (the default value for lambda is 0.5/second), you should expect, on average, a customer arrives every 2 seconds in real time. That means the simulation should pause a little bit after printing a few lines to stdout. 3) Make sure your simulation clock always goes up. The simulation clock should *never* roll back. For example, 00001520.374ms: c9 arrives 00001625.541ms: c10 arrives 00001524.263ms: c8 departs, inter-arrival time = ... The time in the 3rd line (c8 departs) is earlier than the time in the 2nd line (c10 arrives), and this should never happen. If you see something like this in your simulation, you better find out why and fix it! Some students also asked me about how they can verify if there is no deadlock, or if the mutex are put in the correct places. Well, there is no easy way to do it, other than inspecting your code very carefully. As for deadlocks, you might want to try running your simulation with a large number of customers. Just keep looking at your code and/or run simulations until you convince yourself you are right! --Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Mon Sep 22 12:36:38 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8MJac3M029512 for ; Mon, 22 Sep 2008 12:36:38 -0700 Received: from msg-mx2.usc.edu ([128.125.137.7]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K7M004WC42HEJD0@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Mon, 22 Sep 2008 12:43:57 -0700 (PDT) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.236]) by msg-mx2.usc.edu (Postfix) with ESMTP id 8F96C30AE for ; Mon, 22 Sep 2008 12:41:00 -0700 (PDT) Received: by rv-out-0506.google.com with SMTP id k40so1398700rvb.15 for ; Mon, 22 Sep 2008 12:41:00 -0700 (PDT) Received: by 10.140.203.9 with SMTP id a9mr2208783rvg.288.1222112460274; Mon, 22 Sep 2008 12:41:00 -0700 (PDT) Received: from LesliePC (76-195-62-167.lightspeed.irvnca.sbcglobal.net [76.195.62.167]) by mx.google.com with ESMTPS id b39sm885119rvf.0.2008.09.22.12.40.59 (version=SSLv3 cipher=RC4-MD5); Mon, 22 Sep 2008 12:40:59 -0700 (PDT) Date: Mon, 22 Sep 2008 12:40:45 -0700 From: Leslie Cheung Subject: office hour, sep 22 To: cs551@merlot.usc.edu Message-id: <002f01c91ceb$1bc530d0$534f9270$@edu> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: en-us Content-transfer-encoding: 7bit Thread-index: Ackc6xtDwqfA0/osRcus6vvC9g7vmw== Hi class, I have trouble coming to campus today, so I have to cancel my office hour today. Sorry about the late notice! This week I'll hold office hour on Tue (Sep 23), 2-3pm, and Wed 2-3pm. You can also make an appointment with me. Regards, Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 7.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Thu Sep 11 16:08:04 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,BAYES_40,HTML_MESSAGE, LOCALPART_IN_SUBJECT autolearn=no version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8BN84su010877 for ; Thu, 11 Sep 2008 16:08:04 -0700 Received: from msg-mx10.usc.edu ([128.125.137.28]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K7200EYS0EBF6O0@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Thu, 11 Sep 2008 16:11:54 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.169]) by msg-mx10.usc.edu (Postfix) with ESMTP id 7177E2B96 for ; Thu, 11 Sep 2008 16:11:55 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 28so516934wfa.27 for ; Thu, 11 Sep 2008 16:11:55 -0700 (PDT) Received: by 10.142.201.3 with SMTP id y3mr1176718wff.279.1221174715293; Thu, 11 Sep 2008 16:11:55 -0700 (PDT) Received: by 10.142.158.11 with HTTP; Thu, 11 Sep 2008 16:11:55 -0700 (PDT) Date: Thu, 11 Sep 2008 16:11:55 -0700 From: Leslie Cheung Subject: cs551: readme and grading guidelines To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 Content-type: multipart/alternative; boundary="----=_Part_57225_19062825.1221174715286" ------=_Part_57225_19062825.1221174715286 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi class, During my office hour, a few of you have asked what you should write in readme. It's under the "README requirement" section in the project spec. For example, some of you told me the client is slow when it processes certain kind of requests. It's a good idea to document this in README, so the grader knows what to expect. However, by documenting this in README, you may still lose points. It's always a good idea to write the best code you can write, but if you are out of time, document any defect in README. Another question I often get is if it's "ok" to get this output when I run a certain test case in the grading guildeines. I think we have given you enough information for you to determine if your output is ok. If you are not convinced that you have done your best, fix your code to do the best you can do. We cannot tell you what the "answer" is supposed to be, nor how much partial credit you'd get if you can get it "partly right". --Leslie ------=_Part_57225_19062825.1221174715286 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi class,
 
During my office hour, a few of you have asked what you should write in readme. It's under the "README requirement" section in the project spec. For example, some of you told me the client is slow when it processes certain kind of requests. It's a good idea to document this in README, so the grader knows what to expect. However, by documenting this in README, you may still lose points. It's always a good idea to write the best code you can write, but if you are out of time, document any defect in README.
 
Another question I often get is if it's "ok" to get this output when I run a certain test case in the  grading guildeines. I think we have given you enough information for you to determine if your output is ok. If you are not convinced that you have done your best, fix your code to do the best you can do. We cannot tell you what the "answer" is supposed to be, nor how much partial credit you'd get if you can get it "partly right".
 
 
--Leslie
------=_Part_57225_19062825.1221174715286-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 6.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Wed Sep 10 12:51:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_40 autolearn=ham version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8AJpbaL025573 for ; Wed, 10 Sep 2008 12:51:37 -0700 Received: from msg-mx8.usc.edu ([128.125.137.26]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K6Z00JDQWNVQ851@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Wed, 10 Sep 2008 12:55:07 -0700 (PDT) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231]) by msg-mx8.usc.edu (Postfix) with ESMTP id 9870D7F7B for ; Wed, 10 Sep 2008 12:55:06 -0700 (PDT) Received: by rv-out-0506.google.com with SMTP id k40so6806rvb.15 for ; Wed, 10 Sep 2008 12:55:06 -0700 (PDT) Received: by 10.140.202.12 with SMTP id z12mr1086126rvf.186.1221076506328; Wed, 10 Sep 2008 12:55:06 -0700 (PDT) Received: from LesliePC ( [76.195.62.167]) by mx.google.com with ESMTPS id l31sm12844976rvb.2.2008.09.10.12.55.05 (version=SSLv3 cipher=RC4-MD5); Wed, 10 Sep 2008 12:55:05 -0700 (PDT) Date: Wed, 10 Sep 2008 12:54:57 -0700 From: Leslie Cheung Subject: office hour cancelled Sep 10 To: cs551@merlot.usc.edu Message-id: <001601c9137f$1a933880$4fb9a980$@edu> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Content-type: text/plain; charset=us-ascii Content-language: en-us Content-transfer-encoding: 7bit Thread-index: AckTfxnu/S74qx5fSBqYG2Bboo8ekA== Hi class, Sorry I got sick today, and have to cancel my office hour today 2-3pm. I'll be on campus tomorrow and on Friday. If you need help, please schedule an appointment with me. Thanks! Regards, Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Mon Sep 8 22:23:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=ham version=3.2.3 Received: from msg-scanner3.usc.edu (msg-scanner3.usc.edu [128.125.137.212]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m895NXDh031672 for ; Mon, 8 Sep 2008 22:23:33 -0700 Received: from msg-mx3.usc.edu ([128.125.137.8]) by msg-scanner3.usc.edu (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0K6W006WFXRMBTN0@msg-scanner3.usc.edu> for cs551@merlot.usc.edu; Mon, 08 Sep 2008 22:26:33 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by msg-mx3.usc.edu (Postfix) with ESMTP id 6B15E31F88 for ; Mon, 08 Sep 2008 22:26:31 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 28so1994044wfa.27 for ; Mon, 08 Sep 2008 22:26:29 -0700 (PDT) Received: by 10.142.229.5 with SMTP id b5mr5600656wfh.50.1220937989792; Mon, 08 Sep 2008 22:26:29 -0700 (PDT) Received: by 10.142.158.11 with HTTP; Mon, 08 Sep 2008 22:26:29 -0700 (PDT) Date: Mon, 08 Sep 2008 22:26:29 -0700 From: Leslie Cheung Subject: Re: Stat(1) for filesize In-reply-to: <64d09c810809081738i2300ffe3t85a88c70c4e08bb2@mail.gmail.com> To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 Content-type: multipart/alternative; boundary="----=_Part_1162_1596498.1220937989776" References: <200809080153.m881rH8X021678@bourbon.usc.edu> <64d09c810809081731o394df205h3191a75b3a6a0b5d@mail.gmail.com> <64d09c810809081738i2300ffe3t85a88c70c4e08bb2@mail.gmail.com> ------=_Part_1162_1596498.1220937989776 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline In the case you can read the file's metadata but not the file itself, the FSZ request should give you the filesize, while the GET request should fail. In general, if you can open a file (for example, using a text editor), your GET request should succeed. If you can see the filesize using, for example, the "ls" command in a shell, your FSZ request should succeed. --Leslie Someone wrote: > But still the Get req for [removed filename] will fail as we cannot read > the file. So do we only have to printf the filesize for this file as we > cannot get the MD5 or print nothing ? > > > Someone wrote: > >> I think you are talking about the [removed filename] file which doesn't >> even have a read permission for non-root users. But in that case, fopen will >> also fail and we will have to simply use stat() irrespective of whether >> fopen is successful or not. Am i right? >> >> Thanks >> >> >> On Mon, Sep 8, 2008 at 4:19 PM, Leslie Cheung wrote: >> >>> Hi class, >>> >>> fseek and stat are different, in that fseek reads the file while stat >>> does not (stat reads only the file's metadata). If you do not have read >>> permission, fseek would fail, but stat may give you the filesize if you have >>> permission to read the file's metadata. >>> >>> I have just looked at the grading guidelines, and you can't get the >>> filesize using fseek in at least one test case. >>> >>> Regards, >>> Leslie >>> >>> On Sun, Sep 7, 2008 at 6:53 PM, Bill Cheng wrote: >>> >>>> Someone wrote: >>>> >>>> > You have emphasized to use stat(1) for filesize. But I have used >>>> other >>>> > method such as 'Fseek' to know the filesize. Is that ok? Or should I >>>> > change it? >>>> >>>> Anything equivalent would be fine. Please make sure that the >>>> value it gives is correct and that it also works for directories. >>>> -- >>>> Bill Cheng // bill.cheng@usc.edu >>> http://merlot.usc.edu/william/usc/> >>>> >>>> >>> >> > ------=_Part_1162_1596498.1220937989776 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
In the case you can read the file's metadata but not the file itself, the FSZ request should give you the filesize, while the GET request should fail.

In general, if you can open a file (for example, using a text editor), your GET request should succeed. If you can see the filesize using, for example, the "ls" command in a shell, your FSZ request should succeed.


--Leslie

Someone wrote:
But still the Get req for [removed filename] will fail as we cannot read the file. So do we only have to printf the filesize for this file as we cannot get the MD5 or print nothing ?


Someone wrote:
I think you are talking about the [removed filename] file which doesn't even have a read permission for non-root users. But in that case, fopen will also fail and we will have to simply use stat() irrespective of whether fopen is successful or not. Am i right?

Thanks


On Mon, Sep 8, 2008 at 4:19 PM, Leslie Cheung <lccheung@usc.edu> wrote:
Hi class,
 
fseek and stat are different, in that fseek reads the file while stat does not (stat reads only the file's metadata).  If you do not have read permission, fseek would fail, but stat may give you the filesize if you have permission to read the file's metadata.
 
I have just looked at the grading guidelines, and you can't get the filesize using fseek in at least one test case.
 
Regards,
Leslie

On Sun, Sep 7, 2008 at 6:53 PM, Bill Cheng <william@bourbon.usc.edu> wrote:
Someone wrote:

 > You have emphasized to use stat(1) for filesize. But I have used other
 > method such as 'Fseek' to know the filesize. Is that ok? Or should I
 > change it?

Anything equivalent would be fine.  Please make sure that the
value it gives is correct and that it also works for directories.
--
Bill Cheng // bill.cheng@usc.edu <URL:http://merlot.usc.edu/william/usc/>





------=_Part_1162_1596498.1220937989776-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Mon Sep 8 16:16:49 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=ham version=3.2.3 Received: from msg-scanner2.usc.edu (msg-scanner2.usc.edu [128.125.137.211]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m88NGnb6028229 for ; Mon, 8 Sep 2008 16:16:49 -0700 Received: from msg-mx2.usc.edu ([128.125.137.7]) by msg-scanner2.usc.edu (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005)) with ESMTP id <0K6W004GSGPY5660@msg-scanner2.usc.edu> for cs551@merlot.usc.edu; Mon, 08 Sep 2008 16:19:44 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.169]) by msg-mx2.usc.edu (Postfix) with ESMTP id 7B0392D6F for ; Mon, 08 Sep 2008 16:19:41 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 28so1880312wfa.27 for ; Mon, 08 Sep 2008 16:19:41 -0700 (PDT) Received: by 10.142.232.20 with SMTP id e20mr5490111wfh.109.1220915981253; Mon, 08 Sep 2008 16:19:41 -0700 (PDT) Received: by 10.142.158.11 with HTTP; Mon, 08 Sep 2008 16:19:41 -0700 (PDT) Date: Mon, 08 Sep 2008 16:19:41 -0700 From: Leslie Cheung Subject: Re: Stat(1) for filesize In-reply-to: <200809080153.m881rH8X021678@bourbon.usc.edu> To: cs551@merlot.usc.edu Message-id: MIME-version: 1.0 Content-type: multipart/alternative; boundary="----=_Part_6764_6898909.1220915981250" References: <200809080153.m881rH8X021678@bourbon.usc.edu> ------=_Part_6764_6898909.1220915981250 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi class, fseek and stat are different, in that fseek reads the file while stat does not (stat reads only the file's metadata). If you do not have read permission, fseek would fail, but stat may give you the filesize if you have permission to read the file's metadata. I have just looked at the grading guidelines, and you can't get the filesize using fseek in at least one test case. Regards, Leslie On Sun, Sep 7, 2008 at 6:53 PM, Bill Cheng wrote: > Someone wrote: > > > You have emphasized to use stat(1) for filesize. But I have used other > > method such as 'Fseek' to know the filesize. Is that ok? Or should I > > change it? > > Anything equivalent would be fine. Please make sure that the > value it gives is correct and that it also works for directories. > -- > Bill Cheng // bill.cheng@usc.edu > > ------=_Part_6764_6898909.1220915981250 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi class,
 
fseek and stat are different, in that fseek reads the file while stat does not (stat reads only the file's metadata).  If you do not have read permission, fseek would fail, but stat may give you the filesize if you have permission to read the file's metadata.
 
I have just looked at the grading guidelines, and you can't get the filesize using fseek in at least one test case.
 
Regards,
Leslie

On Sun, Sep 7, 2008 at 6:53 PM, Bill Cheng <william@bourbon.usc.edu> wrote:
Someone wrote:

 > You have emphasized to use stat(1) for filesize. But I have used other
 > method such as 'Fseek' to know the filesize. Is that ok? Or should I
 > change it?

Anything equivalent would be fine.  Please make sure that the
value it gives is correct and that it also works for directories.
--
Bill Cheng // bill.cheng@usc.edu <URL:http://merlot.usc.edu/william/usc/>


------=_Part_6764_6898909.1220915981250-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Mon Sep 8 16:11:45 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=ham version=3.2.3 Received: from msg-scanner0.usc.edu (msg-scanner0.usc.edu [128.125.137.209]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m88NBjj6028171 for ; Mon, 8 Sep 2008 16:11:45 -0700 Received: from msg-mx3.usc.edu ([128.125.137.8]) by msg-scanner0.usc.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTP id <0K6W00HC0GIW1FY0@msg-scanner0.usc.edu> for cs551@merlot.usc.edu; Mon, 08 Sep 2008 16:14:35 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.174]) by msg-mx3.usc.edu (Postfix) with ESMTP id 49C4A31B4C for ; Mon, 08 Sep 2008 16:14:34 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 28so1878888wfa.27 for ; Mon, 08 Sep 2008 16:14:34 -0700 (PDT) Received: by 10.142.221.19 with SMTP id t19mr5482316wfg.186.1220915674149; Mon, 08 Sep 2008 16:14:34 -0700 (PDT) Received: by 10.142.158.11 with HTTP; Mon, 08 Sep 2008 16:14:34 -0700 (PDT) Message-id: Date: Mon, 08 Sep 2008 16:14:34 -0700 From: Leslie Cheung To: cs551@merlot.usc.edu Subject: cs551 TA office MIME-version: 1.0 Content-type: multipart/alternative; boundary="----=_Part_6676_5201052.1220915674136" ------=_Part_6676_5201052.1220915674136 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi class, I will hold office hour at SAL 211. For those of you who has appointment with me tomorrow, we will meet at SAL 211. Regards, Leslie ------=_Part_6676_5201052.1220915674136 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hi class,
 
I will hold office hour at SAL 211. For those of you who has appointment with me tomorrow, we will meet at SAL 211.
 
Regards,
Leslie
------=_Part_6676_5201052.1220915674136-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Sun Sep 7 09:34:59 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.2.3 Received: from msg-scanner0.usc.edu (msg-scanner0.usc.edu [128.125.137.209]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m87GYx2w008509 for ; Sun, 7 Sep 2008 09:34:59 -0700 Received: from msg-mx3.usc.edu ([128.125.137.8]) by msg-scanner0.usc.edu (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTP id <0K6U00L7G3IGPL50@msg-scanner0.usc.edu> for cs551@merlot.usc.edu; Sun, 07 Sep 2008 09:37:28 -0700 (PDT) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.224]) by msg-mx3.usc.edu (Postfix) with ESMTP id 620E832414 for ; Sun, 07 Sep 2008 09:37:28 -0700 (PDT) Received: by rv-out-0506.google.com with SMTP id k40so904653rvb.15 for ; Sun, 07 Sep 2008 09:37:28 -0700 (PDT) Received: by 10.141.63.20 with SMTP id q20mr8160832rvk.258.1220805447922; Sun, 07 Sep 2008 09:37:27 -0700 (PDT) Received: from LesliePC ( [76.195.62.167]) by mx.google.com with ESMTPS id b39sm5549850rvf.0.2008.09.07.09.37.27 (version=SSLv3 cipher=RC4-MD5); Sun, 07 Sep 2008 09:37:27 -0700 (PDT) From: Leslie Cheung To: cs551@merlot.usc.edu Subject: office hour, 9/8 Date: Sun, 07 Sep 2008 09:37:03 -0700 Message-id: <01ac01c91107$f5ad7a40$e1086ec0$@edu> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: AckQ2MFTPPtE0kjzTraxjlHIYvWAug== Content-language: en-us Hi all, Sorry but it looks like I won't be able to make it to campus on Monday. I am moving my office hour to Tue 9/9, 2-3pm. I am available at other times on Tue as well. If you want me to look at your code, I recommend you schedule an appointment with me, or you might have to wait if there are other students. Since I still haven't got my office assignment yet (the dept said they would assign TA office last week, but I haven't heard from them), if you need help, we can meet at the SAL lab. Please email me which machine you are at (Mac/PC/Sun, and machine number), and I'll come find you. If I have my office assignment, I'll send out another email saying where I will be. I'll hold office hour on Wed (9/10) 2-3pm as well. Regards, Leslie ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return-Path: lccheung@usc.edu Delivery-Date: Tue Sep 2 10:03:54 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.2.3 Received: from msg-scanner1.usc.edu (msg-scanner1.usc.edu [128.125.137.210]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m82H3sh8021655 for ; Tue, 2 Sep 2008 10:03:54 -0700 Received: from msg-mx3.usc.edu ([128.125.137.8]) by msg-scanner1.usc.edu (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K6K00FOFVCO4R80@msg-scanner1.usc.edu> for cs551@merlot.usc.edu; Tue, 02 Sep 2008 10:04:47 -0700 (PDT) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by msg-mx3.usc.edu (Postfix) with ESMTP id E0FE232EA4 for ; Tue, 02 Sep 2008 10:04:38 -0700 (PDT) Received: by wf-out-1314.google.com with SMTP id 28so2546360wfa.27 for ; Tue, 02 Sep 2008 10:04:37 -0700 (PDT) Received: by 10.142.194.1 with SMTP id r1mr2623314wff.306.1220375076923; Tue, 02 Sep 2008 10:04:36 -0700 (PDT) Received: from ?128.125.163.179? ( [128.125.163.179]) by mx.google.com with ESMTPS id 20sm12499223wfi.11.2008.09.02.10.04.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Sep 2008 10:04:36 -0700 (PDT) Date: Tue, 02 Sep 2008 10:04:29 -0700 From: Leslie Cheung Subject: Re: Question In-reply-to: To: cs551@merlot.usc.edu Message-id: <48BD721D.6010705@usc.edu> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: <48B5C875.1080008@usc.edu> <027d01c909b4$b09667a0$11c336e0$@edu> User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) Someone wrote: > 1 )Which timer function we should use so that server can send the signal to the child processes after interval of time. > > You can use any function that works (except busy-wait). I'd recommend using "select". Please read the man page on nunki for details (run "man -s 3s select" on nunki). > 2) If there is any child process who did not send the response to client and server decides to shutdown in that case client will keep on waiting for the response.So do we have to keep it on waiting for response? > You need to implement a timeout mechanism so that the client will not wait forever. You can use "select" to do this. Now the question is how long the client should wait. Well, we haven't specified this in the spec, so you need to choose a reasonable value, and document this in README. --Leslie