time = time(); $this->startSession(); } /** * startSession - Performs all the actions necessary to * initialize this session object. Tries to determine if the * the user has logged in already, and sets the variables * accordingly. Also takes advantage of this page load to * update the active visitors tables. */ function startSession(){ global $database; //The database connection session_start(); //Tell PHP to start the session /* Determine if user is logged in */ $this->logged_in = $this->checkLogin(); /** * Set guest value to users not logged in, and update * active guests table accordingly. */ if(!$this->logged_in){ $this->username = $_SESSION['username'] = GUEST_NAME; $this->userlevel = GUEST_LEVEL; $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time); } /* Update users last active timestamp */ else{ $database->addActiveUser($this->username, $this->time); } /* Remove inactive visitors from database */ $database->removeInactiveUsers(); $database->removeInactiveGuests(); /* Set referrer page */ if(isset($_SESSION['url'])){ $this->referrer = $_SESSION['url']; }else{ $this->referrer = "/"; } /* Set current url */ $this->url = $_SESSION['url'] = $_SERVER['PHP_SELF']; } /** * checkLogin - Checks if the user has already previously * logged in, and a session with the user has already been * established. Also checks to see if user has been remembered. * If so, the database is queried to make sure of the user's * authenticity. Returns true if the user has logged in. */ function checkLogin(){ global $database; //The database connection /* Check if user has been remembered */ if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])){ $this->username = $_SESSION['username'] = $_COOKIE['cookname']; $this->userid = $_SESSION['userid'] = $_COOKIE['cookid']; } /* Username and userid have been set and not guest */ if(isset($_SESSION['username']) && isset($_SESSION['userid']) && $_SESSION['username'] != GUEST_NAME){ /* Confirm that username and userid are valid */ if($database->confirmUserID($_SESSION['username'], $_SESSION['userid']) != 0){ /* Variables are incorrect, user not logged in */ unset($_SESSION['username']); unset($_SESSION['userid']); return false; } /* User is logged in, set class variables */ $this->userinfo = $database->getUserInfo($_SESSION['username']); $this->username = $this->userinfo['username']; $this->userid = $this->userinfo['userid']; $this->userlevel = $this->userinfo['userlevel']; return true; } /* User not logged in */ else{ return false; } } /** * login - The user has submitted his username and password * through the login form, this function checks the authenticity * of that information in the database and creates the session. * Effectively logging in the user if all goes well. */ function login($subuser, $subpass, $subremember){ global $database, $form; //The database and form object /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "* Username not entered"); } else{ /* Check if username is not alphanumeric */ if(!eregi("^([0-9a-z])*$", $subuser)){ $form->setError($field, "* Username not alphanumeric"); } } /* Password error checking */ $field = "pass"; //Use field name for password if(!$subpass){ $form->setError($field, "* Password not entered"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } /* Checks that username is in database and password is correct */ $subuser = stripslashes($subuser); $result = $database->confirmUserPass($subuser, md5($subpass)); /* Check error codes */ if($result == 1){ $field = "user"; $form->setError($field, "* Username not found"); } else if($result == 2){ $field = "pass"; $form->setError($field, "* Invalid password"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } /* Username and password correct, register session variables */ $this->userinfo = $database->getUserInfo($subuser); $this->username = $_SESSION['username'] = $this->userinfo['username']; $this->userid = $_SESSION['userid'] = $this->generateRandID(); $this->userlevel = $this->userinfo['userlevel']; /* Insert userid into database and update active users table */ $database->updateUserField($this->username, "userid", $this->userid); $database->addActiveUser($this->username, $this->time); $database->removeActiveGuest($_SERVER['REMOTE_ADDR']); /** * This is the cool part: the user has requested that we remember that * he's logged in, so we set two cookies. One to hold his username, * and one to hold his random value userid. It expires by the time * specified in constants.php. Now, next time he comes to our site, we will * log him in automatically, but only if he didn't log out before he left. */ if($subremember){ setcookie("cookname", $this->username, time()+COOKIE_EXPIRE, COOKIE_PATH); setcookie("cookid", $this->userid, time()+COOKIE_EXPIRE, COOKIE_PATH); } /* Login completed successfully */ return true; } /** * logout - Gets called when the user wants to be logged out of the * website. It deletes any cookies that were stored on the users * computer as a result of him wanting to be remembered, and also * unsets session variables and demotes his user level to guest. */ function logout(){ global $database; //The database connection /** * Delete cookies - the time must be in the past, * so just negate what you added when creating the * cookie. */ if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])){ setcookie("cookname", "", time()-COOKIE_EXPIRE, COOKIE_PATH); setcookie("cookid", "", time()-COOKIE_EXPIRE, COOKIE_PATH); } /* Unset PHP session variables */ unset($_SESSION['username']); unset($_SESSION['userid']); /* Reflect fact that user has logged out */ $this->logged_in = false; /** * Remove from active users table and add to * active guests tables. */ $database->removeActiveUser($this->username); $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time); /* Set user level to guest */ $this->username = GUEST_NAME; $this->userlevel = GUEST_LEVEL; } /** * register - Gets called when the user has just submitted the * registration form. Determines if there were any errors with * the entry fields, if so, it records the errors and returns * 1. If no errors were found, it registers the new user and * returns 0. Returns 2 if registration failed. */ function register($infoArray){ global $database, $form, $mailer; //The database, form and mailer object /* Username error checking */ $field = "user"; //Use field name for username if(!$infoArray['subuser'] || strlen($infoArray['subuser'] = trim($infoArray['subuser'])) == 0){ $form->setError($field, "* Username not entered"); } else{ /* Spruce up username, check length */ $infoArray['subuser'] = stripslashes($infoArray['subuser']); if(strlen($infoArray['subuser']) < 3){ $form->setError($field, "* Username below 3 characters"); } else if(strlen($infoArray['subuser']) > 30){ $form->setError($field, "* Username above 30 characters"); } /* Check if username is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", $infoArray['subuser'])){ $form->setError($field, "* Username not alphanumeric"); } /* Check if username is reserved */ else if(strcasecmp($infoArray['subuser'], GUEST_NAME) == 0){ $form->setError($field, "* Username reserved word"); } /* Check if username is already in use */ else if($database->usernameTaken($infoArray['subuser'])){ $form->setError($field, "* Username already in use"); } /* Check if username is banned */ else if($database->usernameBanned($infoArray['subuser'])){ $form->setError($field, "* Username banned"); } } /* Password error checking */ $field = "pass"; //Use field name for password if(!$infoArray['subpass']){ $form->setError($field, "* Password not entered"); } else{ /* Spruce up password and check length*/ $infoArray['subpass'] = stripslashes($infoArray['subpass']); if(strlen($infoArray['subpass']) < 4){ $form->setError($field, "* Password too short"); } /* Check if password is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", ($infoArray['subpass'] = trim($infoArray['subpass'])))){ $form->setError($field, "* Password not alphanumeric"); } /** * Note: I trimmed the password only after I checked the length * because if you fill the password field up with spaces * it looks like a lot more characters than 4, so it looks * kind of stupid to report "password too short". */ } /* Email error checking */ $field = "email"; //Use field name for email if(!$infoArray['subemail'] || strlen($infoArray['subemail'] = trim($infoArray['subemail'])) == 0){ $form->setError($field, "* Email not entered"); } else{ /* Check if valid email address */ $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$infoArray['subemail'])){ $form->setError($field, "* Email invalid"); } $infoArray['subemail'] = stripslashes($infoArray['subemail']); } /* Errors exist, have user correct them */ if($form->num_errors > 0){ return 1; //Errors with form } /* No errors, add the new account to the db*/ else{ $infoArray['subpass'] = md5($infoArray['subpass']); if($valKey = $database->addNewUser($infoArray)){ if(EMAIL_WELCOME){ $mailer->sendWelcome($infoArray['subuser'],$infoArray['subemail'],$infoArray['subpassc'], $valKey); } return 0; //New user added succesfully }else{ return 2; //Registration attempt failed } } } /** * editAccount - Attempts to edit the user's account information * including the password, which it first makes sure is correct * if entered, if so and the new password is in the right * format, the change is made. All other fields are changed * automatically. */ function editAccount($infoArray){ global $database, $form; //The database and form object /* New password entered */ if($infoArray[subnewpass]){ /* Current Password error checking */ $field = "curpass"; //Use field name for current password if(!$infoArray[subcurpass]){ $form->setError($field, "* Current Password not entered"); } else{ /* Check if password too short or is not alphanumeric */ $infoArray[subcurpass] = stripslashes($infoArray[subcurpass]); if(strlen($infoArray[subcurpass]) < 4 || !eregi("^([0-9a-z])+$", ($infoArray[subcurpass] = trim($infoArray[subcurpass])))){ $form->setError($field, "* Current Password incorrect"); } /* Password entered is incorrect */ if($database->confirmUserPass($this->username,md5($infoArray[subcurpass])) != 0){ $form->setError($field, "* Current Password incorrect"); } } /* New Password error checking */ $field = "newpass"; //Use field name for new password /* Spruce up password and check length*/ $subpass = stripslashes($infoArray[subnewpass]); if(strlen($infoArray[subnewpass]) < 4){ $form->setError($field, "* New Password too short"); } /* Check if password is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", ($infoArray[subnewpass] = trim($infoArray[subnewpass])))){ $form->setError($field, "* New Password not alphanumeric"); } } /* Change password attempted */ else if($infoArray[subcurpass]){ /* New Password error reporting */ $field = "newpass"; //Use field name for new password $form->setError($field, "* New Password not entered"); } /* Email error checking $field = "email"; //Use field name for email if($subemail && strlen($subemail = trim($subemail)) > 0){ // Check if valid email address $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$subemail)){ $form->setError($field, "* Email invalid"); } $subemail = stripslashes($subemail); }*/ /* Errors exist, have user correct them */ if($form->num_errors > 0){ return false; //Errors with form } $database->updateUserField($this->username,"headline",$infoArray[subheadline]); $database->updateUserField($this->username,"ufname",$infoArray[subfname]); $database->updateUserField($this->username,"ulname",$infoArray[sublname]); $database->updateUserField($this->username,"gender",$infoArray[subgender]); $database->updateUserField($this->username,"phone",$infoArray[subphone]); $database->updateUserField($this->username,"deglvl",$infoArray[subdeglvl]); $database->updateUserField($this->username,"indlvl",$infoArray[subindlvl]); $database->updateUserField($this->username,"ececonc",$infoArray[subececonc]); $database->updateUserField($this->username,"site",$infoArray[subsite]); /* Update password since there were no errors */ if($infoArray[subcurpass] && $infoArray[subnewpass]){ $database->updateUserField($this->username,"password",md5($infoArray[subnewpass])); } /* Change Email if($subemail){ $database->updateUserField($this->username,"email",$subemail); }*/ /* Success! */ return true; } /** * isAdmin - Returns true if currently logged in user is * an administrator, false otherwise. */ function isAdmin(){ return ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME); } /** * generateRandID - Generates a string made up of randomized * letters (lower and upper case) and digits and returns * the md5 hash of it to be used as a userid. */ function generateRandID(){ return md5($this->generateRandStr(16)); } /** * generateRandStr - Generates a string made up of randomized * letters (lower and upper case) and digits, the length * is a specified parameter. */ function generateRandStr($length){ $randstr = ""; for($i=0; $i<$length; $i++){ $randnum = mt_rand(0,61); if($randnum < 10){ $randstr .= chr($randnum+48); }else if($randnum < 36){ $randstr .= chr($randnum+55); }else{ $randstr .= chr($randnum+61); } } return $randstr; } function verifyMemValKey($memName, $valKey) { global $database; //The database object $verifyResult = $database->verifyMemKey($memName, $valKey); if($verifyResult == 0) { $database->updateUserField($memName,"userlevel","2"); $database->updateUserField($memName,"key","fin"); echo("exit point\n"); return 0; } return $verifyResult; } }; /** * Initialize session object - This must be initialized before * the form object because the form uses session variables, * which cannot be accessed unless the session has started. */ $session = new Session; /* Initialize form object */ $form = new Form; ?>
    
 

Resume Book | Information Sessions | Sponsors

What is an HKN-Sigma Resume Book?


As part of our industry relations, HKN is happy to provide a Resume Book of our members. We saw the need for this book, as HKN students could not find a suitable yet personal way to connect with employers without being subjected to hundreds of web requests from unfitting companies. Likewise, we hope companies will find our book a rich resource of high-caliber future employees. As our school motto implies, we certainly believe that "our hearts are in the work."


What are the demographics?


Our Resume Book has over 30 current HKN members, taken from the top 25% of the CMU ECE junior class, the top 33% of the senior ECE class, the top 33% of the masters class, and distinguished ECE doctoral students. Our demographics are as diverse as the ECE community at Carnegie Mellon: undergraduate students, graduate students (accelerated M.S., pure M.S., and Ph.D. ), U.S. Citizens, and international students -- all spanning a considerable number of ECE concentrations and proficiencies.


How often is it updated?


Members are asked if they would like to participate in the book once every two months. Likewise, if a member finds employment or graduates, they are removed from the Resume Book.

How much does the Resume Book cost? How is it delivered?


We ask for a donation of $150 to obtain the most recent resume book revision. This donation supports our activities, such as mentoring and social events, which helps build a thriving ECE community. Companies may also sponsor HKN events, such an information sessions or hack events. These events are great for getting in touch with our society; we will also list sponsoring companies on our website, provide them with a free Resume Book, and proclaim their greatness throughout the Halls of Hamerschlag.


How is it delivered?


The resume book is typically delivered via email, in the form of a *.pdf document. However, we are more than happy to accommodate a variety of other formats and delivery methods.

Great. How do I order the HKN-Sigma Resume Book?


The best way to order a resume book is to send an e-mail to hkn-officers@lists.andrew.cmu.edu. Our officers will then get in contact with you to complete the transaction. Just as our members are held to high standards, our officers make sure only to send high-quality opportunities to our members to avoid spamming them. This e-mail may also be used for inquiries, such as sponsoring a lunch to eat with a few members, wanting to share opportunities within your company, or hoping to provide HKN sweatshirts with your company's logo splashed all over it. We are very happy to talk to companies--please let us know you are out there!

Click here to place an automated order. Our officers will then get in contact with you to complete the transaction.

Resume Book | Information Sessions | Sponsors

What is an Information Session?


An information session (or, simply, "Infosession" ) is a recruiting event that's sponsored by an interested company. This allows employers to establish a campus presence and collect resumes from some of the most-hardworking ECE students in the field, and it provides Carnegie Mellon ECE students a chance to explore various opportunities in industry. This event typically involves a formal presentation from the company, followed by a less-formal food mixer.

How is it marketed? Is HKN-Sigma willing to co-sponsor?


The event advertisement will be distributed throughout the department via email broadcast, event postings on this website, and physical flyer postings throughout Hamerschlag Hall (ECE department home) on Carnegie Mellon campus. In addition to marketing the infosession, we are willing to assist in any other logistics involved with scheduling and setting the event up. This must be specifically coordinated with our organization, and -- considering various scheduling demands -- we ask for an additional gift accordingly.

What are the venue details and projected turnout?


According to availability of locations, Information Sessions are generally scheduled in Hamerschlag Hall (ECE), Gates & Hillman Center (Computer Science), or Newell Simon Hall (Robotics Institute, Human Computer Interaction, Quality of Life). We will try our best to accommodate any specific room requests you may have. All of these locations are furnished with at least two whiteboards and an LCD projector, but, if additional equipment is needed, we can usually accommodate the request also (given enough notice). In order to maximize the projected student turnout (~50 students), scheduling the event after 4:30pm on Tuesdays and Thursdays is suggested, although Mondays and Wednesdays after 4:30pm are feasible as well. Providing food and even small company souvenirs are customary; we are willing to offer suggestions, to help provide the students with the best, most unique experience possible.

How much does it cost? How do I sign up?


We ask for a tax-dedictible donation of $500 (excluding food, equipment rental expenses, and co-sponsorship expenses), but more generosity is appreciated. We are a 501(c)3 tax-exempt non-profit, university-affiliated organization; we use these funds to improve our services to the ECE community. To schedule an infosession, please email us at hkn-officers@lists.andrew.cmu.edu.

This e-mail may also be used for inquiries, such as sponsoring a lunch to eat with a few members, wanting to share opportunities within your company, or hoping to provide HKN sweatshirts with your company's logo splashed all over it. We are very happy to talk to companies -- please let us know you are out there!

Resume Book | Information Sessions | Sponsors

What does it mean to "Sponsor" HKN-Sigma?


Sponsoring HKN-Sigma is a unique way for a company to build strong connections with the ECE community. By funding social events and HKN swag, a company can become part of building a bigger and better engineering community. Think back to your college days, and how much fun it was to meet friends outside the lab, and build friendships that last long beyond graduation.

One of HKN's goals is to foster a community, and we feel industry should certainly be part of this community. Companies wishing to fund activities such as snack-night, study breaks, dinners, tech talks, meet & mingles, half-off nights in Oakland (support can go towards currently existing activities or new, company-specific events!) or swag (t-shirts, hoodies, polos, etc.) can contact us personally. Welcome to the community!

How does HKN-Sigma use sponsorship funds?


Sponsorship funds go directly towards food, swag, and location bookings. A company may be specific in how its funds should be dispersed, or can simply donate in good measure. Typically, a full semester's support of snack night is ~$1500 for fifteen weeks. Snack night is held once a week, during labs. We also hope to further support community-building events, such as study breaks, info sessions, and meet & mingles. An example would be a quick study break for any HKN members to go to Razzy Fresh, a local frozen-yogurt shop, or Chipotle, for their famed burritos. These events are currently paid for by the members themselves, but we would be ecstatic for industry members to join us. We also are always open for a company to sponsor HKN hoodies, which are quite popular. The company's logo will be prominent on the T-shirt. Sponsorship funds are not given to students directly, but rather dispersed through the ECE Department's Alumni Relations Office. This ensures accountability and diligence in funding events.

Why would I want to sponsor HKN-Sigma?


As the premiere Electrical & Computer Engineering Honor Society, our members have proven to be some of the best engineers Carnegie Mellon has to offer. Our membership is also extremely diverse in their interests: We have members in all fields of ECE, including computer architecture, embedded systems, applied physics / semiconductors, signal processing / controls, and software. One of HKN's goal is to bring such diversity together, so that we may learn from each other in both casual and academic settings. We also treasure company experiences, as being exposed to industry is a strong component of the CMU education. By sponsoring HKN events, you further enable this internal department communication and collaboration, via our company-sponsored snack night events -- where more than 50 ECE students (including undergraduate, masters, and PhD students) can enjoy each other's company over a beverages and snacks. While it may be a simple gesture, snack night has become part of ECE culture, with students planning their schedules around it. Thus, we greatly welcome companies to join in as well.

Cool. How do I become an HKN-Sigma sponsor?


Please contact our current officers at hkn-officers@lists.andrew.cmu.edu to discuss what you would like to sponsor. We will then get you in touch with our ECE Department contact, which can set up the terms of the funding and any financial transactions.

For sponsoring our events, we acknowledge the company's presence at each event, on our website, and through ensignia on the chapter's regalia. We are also thrilled when representatives come to any of our events. We have also noticed that a correlation exists amongst high attendance at infosession and recruiting booths, student enthusiasm due to great food and souveniers, and longterm research partnerships. We greatly appreciate any support, and hope you will be coming to visit us soon!

Sponsor(s), past and present:


                                  

Welcome. members present, guests present.

Error processing page