Friday, November 29, 2019

8 Ways to Automate WordPress Tasks and Waste Less Time

Even if your website is small, running and maintaining it can take a lot of work. You need to create content, communicate with your audience, keep an eye on security, and much more. But just because theres work to be done, that doesnt mean you need to be the one to do it. By learning how to automate WordPress tasks, you can put things on autopilot and lessen your own workload.Automation is likely a term youre familiar with. In this context, it simply means having software or some other tool perform a routine job automatically, without the need for your constant input. WordPress may not offer many automation options out of the box. However, there are many ways to make automation happen using plugins and other solutions.In this post, well talk about eight ways you can automate WordPress tasks to save time. Lets take a look! Easy Updates Manager Author(s): Easy Updates Manager TeamCurrent Version: 8.1.0Last Updated: October 17, 2019stops-core-theme-and-plugin-updates.8.1.0.zip 96%R atings 2,544,808Downloads WP 4.6+Requires Keeping your website updated is vital for ensuring that its performance and security are solid. At the same time, staying on top of updates can take valuable time away from creating content and other tasks. Especially when you have a lot of themes and plugins, remembering to update them all promptly can be a chore. However, forgetting can lead to compatibility issues and security holes.Fortunately, WordPress already automates some updates for you. Plus, you can instruct your site to perform various updates manually, using WordPress built-in systems and some coding. For even more control over your updates, you can use a plugin like Easy Updates Manager to automate WordPress tasks and manage them without any fuss.Just make sure to only automate updates for plugins and themes you trust!2. Full site backups UpdraftPlus WordPress Backup Plugin Author(s): UpdraftPlus.Com, DavidAndersonCurrent Version: 1.16.17Last Updated: September 12, 2019 updraftplus.1.16.17.zip 96%Ratings 29,914,741Downloads WP 3.2+Requires As with updates, backing up your site on a regular basis is an essential security measure. A full backup stored in a safe, external location means youre always able to restore your site quickly if its hacked, information is accidentally deleted, or it develops a serious bug or other issue. Its best to perform backups regularly and to keep multiple copies around. This means it can save you valuable time to automate WordPress tasks in this area.Plugins are your best bet for setting up a backup schedule and then never having to worry about it again. For a free solution, UpdraftPlus is a customizable and flexible option. For even more functionality and automation options, the premium BackupBuddy plugin is an excellent tool.3. Post schedulingIf you run a blog or a news site, you probably publish new posts on a daily basis. This is  particularly true if youre in charge of a large, multi-author operation. You can t fully automate the process of creating and posting content. However, you can make parts of it easier on yourself and your team. For example, you can schedule posts in advance, so youll always know what content is coming up and can stick to a consistent schedule without trouble.In most situations, manually scheduling posts in advance is probably your best bet. Yes you still have to pick the date manually but everything after that is automatic. If you have an especially high volume of posts, though, you can also turn to a plugin like  Auto Post Scheduler.4. Social media posting Revive Old Posts Auto Post to Social Media Author(s): revive.socialCurrent Version: 8.4.4Last Updated: October 3, 2019tweet-old-post.zip 78%Ratings 1,969,075Downloads WP 3.5+Requires No matter what type of site youre running, a strong social media presence can bolster its success and help you build a community. To do this, youll need to develop a social media strategy. Then, youll want to automat e as much of that strategy as you can, including sharing content to various platforms.Revive Old Post helps you automate your WordPress sites social media by automatically sharing both new and old content to your various social network accounts. All you need to do is configure the plugin once and then it can essentially run on autopilot. For more information, check out our post on how to automatically share content on social media.5. Image optimization ShortPixel Image Optimizer Author(s): ShortPixelCurrent Version: 4.14.6Last Updated: October 9, 2019shortpixel-image-optimiser.4.14.6.zip 94%Ratings 2,897,268Downloads 3.2.0Requires If your website has a lot of images and other media, optimizing them is a smart strategy. This process typically makes the files smaller and easier to load, which results in faster page speeds and a better experience for your visitors. However, it can be time-consuming to manually optimize every single media file.Instead, you can tell your site wha t files to optimize and how to do so, then let it do the work for you. ShortPixel  is an excellent comprehensive image optimizer that enables you to optimize any uploads to your WordPress Media Library automatically.As an alternative, you could instead go with EWWW Image Optimizer, which gives you a lot of flexibility over the process.6. Blocking spam comments Akismet Anti-Spam Author(s): AutomatticCurrent Version: 4.1.2Last Updated: May 14, 2019akismet.4.1.2.zip 94%Ratings 143,374,346Downloads WP 4.0+Requires Your sites comments sections are an important place for developing a strong community. Youll want to make sure this is a friendly place, which means eliminating spam comments as much as possible. Getting rid of these comments means your real audience has the space they need for conversations and questions. Yet,  going through each post by hand is often not feasible.There are a number of settings built into WordPress that can help you combat spam, such as blacklisti ng certain words and restricting comment privileges to registered users. For stronger security, you can use Akismet, a free yet powerful plugin thats included in many WordPress installations by default.7. Cleaning up your database WP-Optimize Clean, Compress, Cache. Author(s): David Anderson, Ruhani Rabin, Team UpdraftCurrent Version: 3.0.12Last Updated: September 24, 2019wp-optimize.3.0.12.zip 98%Ratings 11,586,621Downloads WP 3.8+Requires Most of the time, youll automate WordPress tasks that affect the front end. However, its also worth paying attention to behind-the-scenes maintenance as well. For example, after a while your WordPress database can quickly become bloated with old information, slowing down your site. Keeping your database maintained avoids this problem, and can be easily automated.As with many automation tasks, the best approach here is to use a plugin. WP-Optimize removes unnecessary data, enables you to customize what it cleans up, and can be set to run at any frequency youd like. To get rid of even more bloat, you can also check out Advanced Database Cleaner.8. Building an email list Popups by OptinMonster Best WordPress Popup Plugin Author(s): OptinMonster TeamCurrent Version: 1.8.3Last Updated: October 3, 2019optinmonster.zip 86%Ratings 25,294,018Downloads 4.7.0Requires Finally, lets discuss email marketing. This is a useful promotion strategy for many websites – you can gather up email addresses from your audience, then send out news, content, deals, and more. If you want to grow a large and successful email list, however, youll want to automate it rather than soliciting each address and sending every email by hand.To do this, youll want to integrate your WordPress site with an email marketing service that enables you to automate key tasks. There are a lot of quality email marketing services for WordPress. Once you choose one, you can use a service like OptinMonster to automatically build your email list on Word Press.Automate WordPress tasks and start saving time!As a website owner, your time is best spent focusing on the big picture. You should be communicating with your visitors, creating content, and performing research to improve your site, rather than spending all day maintaining your site. For that reason alone, its vital to find as many ways as you can to automate WordPress tasks you dont need to have a hand in.In this post, weve looked at eight WordPress tasks you can automate to save some time. Whether its something mundane like WordPress updates or more user-facing like social media posting, you can find a tool to help you automate it.What do you think about the idea to automate WordPress tasks? Are you excited to get some of those methods working on your site? Save time managing #WordPress by automating these 8 tasks

Monday, November 25, 2019

Network Programming with Sockets Essays

Network Programming with Sockets Essays Network Programming with Sockets Essay Network Programming with Sockets Essay Socket programming got you down? Is this stuff just a little too difficult to figure out from the man pages? You want to do cool Internet programming, but you dont have time to wade through a gob of structs trying to figure out if you have to call bind() before you connect(), etc. , etc. Well, guess what! Ive already done this nasty business, and Im dying to share the information with everyone! Youve come to the right place.This document should give the average competent C programmer the edge s/he needs to get a grip on this networking noise. Audience This document has been written as a tutorial, not a reference. It is probably at its best when read by individuals who are just starting out with socket programming and are looking for a foothold. It is certainly not the complete guide to sockets programming, by any means. Hopefully, though, itll be just enough for those man pages to start making sense 🙂 Platform and Compiler Most of the code contained w ithin this document was compiled on a Linux PC using Gnus gcc compiler.It was also found to compile on HPUX using gcc. Note that every code snippet was not individually tested. Contents: What is a socket? Two Types of Internet Sockets Low level Nonsense and Network Theory structsKnow these, or aliens will destroy the planet! Convert the Natives! IP Addresses and How to Deal With Them socket()Get the File Descriptor! bind()What port am I on? connect()Hey, you! listen()Will somebody please call me? 1 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html accept()Thank you for calling port 3490. end() and recv()Talk to me, baby! sendto() and recvfrom()Talk to me, DGRAM-style close() and shutdown()Get outta my face! getpeername()Who are you? gethostname()Who am I? DNSYou say whitehouse. gov, I say 198. 137. 240. 100 Client-Server Background A Simple Stream Server A Simple Stream Client Datagram Socket s Blocking select()Synchronous I/O Multiplexing. Cool! More references Disclaimer and Call for Help What is a socket? You hear talk of sockets all the time, and perhaps you are wondering just what they are exactly. Well, theyre this: a way to speak to other programs using standard Unix file descriptors.What? Okyou may have heard some Unix hacker state, Jeez, everything in Unix is a file! What that person may have been talking about is the fact that when Unix programs do any sort of I/O, they do it by reading or writing to a file descriptor. A file descriptor is simply an integer associated with an open file. But (and heres the catch), that file can be a network connection, a FIFO, a pipe, a terminal, a real on-the-disk file, or just about anything else. Everything in Unix is a file! So when you want to communicate with another program over the Internet youre gonna do it through a file descriptor, youd better believe it. Where do I get this file descriptor for network communication, Mr. Smarty-Pants? is probably the last question on your mind right now, but Im going to answer it anyway: You make a call to the socket() system routine. It returns the socket descriptor, and you communicate through it using the specialized send() and recv() (man send, man recv) socket calls. But, hey! you might be exclaiming right about now. If its a file descriptor, why in the hell cant I just use the normal read() and write() calls to communicate through the socket? The short answer is, You can! The longer answer is, You can, but send() and recv() offer much greater control over your data transmission. What next? How about this: there are all kinds of sockets. There are DARPA Internet addresses (Internet Sockets), path names on a local node (Unix Sockets), CCITT X. 25 addresses (X. 25 Sockets that you can safely ignore), and probably many others depending on which Unix flavor you run. This document deals only with the first: Internet Sockets. Two Types of Internet Sockets 2 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. tml Whats this? There are two types of Internet sockets? Yes. Well, no. Im lying. There are more, but I didnt want to scare you. Im only going to talk about two types here. Except for this sentence, where Im going to tell you that Raw Sockets are also very powerful and you should look them up. All right, already. What are the two types? One is Stream Sockets; the other is Datagram Sockets, which may hereafter be referred to as SOCK_STREAM and SOCK_DGRAM, respectively. Datagram sockets are sometimes called connectionless sockets (though they can be connect()d if you really want.See connect(), below. Stream sockets are reliable two-way connected communication streams. If you output two items into the socket in the order 1, 2, they will arrive in the order 1, 2 at the opposite end. They will also be error free. Any errors you do encounter are figments of your own deranged mind, and are not to be discussed here. What uses stream sockets? Well, you may have heard of the telnet application, yes? It uses stream sockets. All the characters you type need to arrive in the same order you type them, right? Also, WWW browsers use the HTTP protocol which uses stream sockets to get pages.Indeed, if you telnet to a WWW site on port 80, and type GET pagename, itll dump the HTML back at you! How do stream sockets achieve this high level of data transmission quality? They use a protocol called The Transmission Control Protocol, otherwise known as TCP (see RFC-793 for extremely detailed info on TCP. ) TCP makes sure your data arrives sequentially and error-free. You may have heard TCP before as the better half of TCP/IP where IP stands for Internet Protocol (see RFC-791. ) IP deals with Internet routing only. Cool. What about Datagram sockets? Why are they called connectionless?What is the deal, here, anyway? Why are they unreliable? Well, here a re some facts: if you send a datagram, it may arrive. It may arrive out of order. If it arrives, the data within the packet will be error-free. Datagram sockets also use IP for routing, but they dont use TCP; they use the User Datagram Protocol, or UDP (see RFC-768. ) Why are they connectionless? Well, basically, its because you dont have to maintain an open connection as you do with stream sockets. You just build a packet, slap an IP header on it with destination information, and send it out. No connection needed.They are generally used for packet-by-packet transfers of information. Sample applications: tftp, bootp, etc. Enough! you may scream. How do these programs even work if datagrams might get lost?! Well, my human friend, each has its own protocol on top of UDP. For example, the tftp protocol says that for each packet that gets sent, the recipient has to send back a packet that says, I got it! (an ACK packet. ) If the sender of the original packet gets no reply in, say, fi ve seconds, hell re-transmit the packet until he finally gets an ACK. This acknowledgment procedure is very important when implementing SOCK_DGRAM applications.Low level Nonsense and Network Theory Since I just mentioned layering of protocols, its time to talk about how networks really work, and to show some examples of how SOCK_DGRAM packets are built. Practically, you can probably skip this section. Its good background, however. 3 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html Hey, kids, its time to learn about Data Encapsulation! This is very very important. Its so important that you might just learn about it if you take the networks course here at Chico State ;-).Basically, it says this: a packet is born, the packet is wrapped (encapsulated) in a header (and maybe footer) by the first protocol (say, the TFTP protocol), then the whole thing (TFTP header included) is encapsulated again by the next protocol (say, UDP), then again by the next (IP), then again by the final protocol on the hardware (physical) layer (say, Ethernet). When another computer receives the packet, the hardware strips the Ethernet header, the kernel strips the IP and UDP headers, the TFTP program strips the TFTP header, and it finally has the data. Now I can finally talk about the infamous Layered Network Model.This Network Model describes a system of network functionality that has many advantages over other models. For instance, you can write sockets programs that are exactly the same without caring how the data is physically transmitted (serial, thin Ethernet, AUI, whatever) because programs on lower levels deal with it for you. The actual network hardware and topology is transparent to the socket programmer. Without any further ado, Ill present the layers of the full-blown model. Remember this for network class exams: Application Presentation Session Transport Network Data Link Physical The Physical Layer is the hardware (serial, Ethernet, etc. . The Application Layer is just about as far from the physical layer as you can imagineits the place where users interact with the network. Now, this model is so general you could probably use it as an automobile repair guide if you really wanted to. A layered model more consistent with Unix might be: Application Layer (telnet, ftp, etc. ) Host-to-Host Transport Layer (TCP, UDP) Internet Layer (IP and routing) Network Access Layer (was Network, Data Link, and Physical) At this point in time, you can probably see how these layers correspond to the encapsulation of the original data.See how much work there is in building a simple packet? Jeez! And you have to type in the packet headers yourself using cat! Just kidding. All you have to do for stream sockets is send() the data out. All you have to do for datagram sockets is encapsulate the packet in the method of your choosing and sendto() it out. The kernel builds the Transport Lay er and Internet Layer on for you and the hardware does the Network Access Layer. Ah, modern technology. So ends our brief foray into network theory. Oh yes, I forgot to tell you everything I wanted to say about routing: nothing! Thats right, Im not going to talk about it at all.The router strips the packet to the IP header, consults its routing table, blah blah blah. Check out the IP RFC if you really really care. If you never learn about it, well, youll live. [Encapsulated Protocols Image] 4 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html structs Well, were finally here. Its time to talk about programming. In this section, Ill cover various data types used by the sockets interface, since some of them are a real bitch to figure out. First the easy one: a socket descriptor.A socket descriptor is the following type: int Just a regular int. Things get weird from here, so just read through and b ear with me. Know this: there are two byte orderings: most significant byte (sometimes called an octet) first, or least significant byte first. The former is called Network Byte Order. Some machines store their numbers internally in Network Byte Order, some dont. When I say something has to be in NBO, you have to call a function (such as htons()) to change it from Host Byte Order. If I dont say NBO, then you must leave the value in Host Byte Order. My First Struct(TM)struct sockaddr.This structure holds socket address information for many types of sockets: struct sockaddr { unsigned short sa_family; /* address family, AF_xxx */ char sa_data[14]; /* 14 bytes of protocol address */ }; sa_family can be a variety of things, but itll be AF_INET for everything we do in this document. sa_data contains a destination address and port number for the socket. This is rather unwieldy. To deal with struct sockaddr, programmers created a parallel structure: struct sockaddr_in (in for Internet. ) s truct sockaddr_in { short int sin_family; /* Address family */ unsigned short int sin_port; /* Port number */ truct in_addr sin_addr; /* Internet address */ unsigned char sin_zero[8]; /* Same size as struct sockaddr */ }; This structure makes it easy to reference elements of the socket address. Note that sin_zero (which is included to pad the structure to the length of a struct sockaddr) should be set to all zeros with the function bzero() or memset(). Also, and this is the important bit, a pointer to a struct sockaddr_in can be cast to a pointer to a struct sockaddr and vice-versa. So even though socket() wants a struct sockaddr *, you can still use a struct sockaddr_in and cast it at the last minute!Also, notice that sin_family corresponds to sa_family in a struct sockaddr and should be set to AF_INET. Finally, the sin_port and sin_addr must be in Network Byte Order! But, you object, how can the entire structure, struct in_addr sin_addr, be in Network Byte Order? This question re quires careful examination of the structure struct in_addr, one of the worst unions alive: /* Internet address (a structure for historical reasons) */ 5 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html struct in_addr { nsigned long s_addr; }; Well, it used to be a union, but now those days seem to be gone. Good riddance. So if you have declared ina to be of type struct sockaddr_in, then ina. sin_addr. s_addr references the 4 byte IP address (in Network Byte Order). Note that even if your system still uses the God-awful union for struct in_addr, you can still reference the 4 byte IP address in exactly the same way as I did above (this due to #defines. ) Convert the Natives! Weve now been lead right into the next section. Theres been too much talk about this Network to Host Byte Order conversionnow is the time for action!All righty. There are two types that you can convert: short (two bytes) an d long (four bytes). These functions work for the unsigned variations as well. Say you want to convert a short from Host Byte Order to Network Byte Order. Start with h for host, follow it with to, then n for network, and s for short: h-to-n-s, or htons() (read: Host to Network Short). Its almost too easy You can use every combination if n, h, s, and l you want, not counting the really stupid ones. For example, there is NOT a stolh() (Short to Long Host) functionnot at this party, anyway.But there are: htons()Host to Network Short htonl()Host to Network Long ntohs()Network to Host Short ntohl()Network to Host Long Now, you may think youre wising up to this. You might think, What do I do if I have to change byte order on a char? Then you might think, Uh, never mind. You might also think that since your 68000 machine already uses network byte order, you dont have to call htonl() on your IP addresses. You would be right, BUT if you try to port to a machine that has reverse network byt e order, your program will fail. Be portable! This is a Unix world!Remember: put your bytes in Network Order before you put them on the network. A final point: why do sin_addr and sin_port need to be in Network Byte Order in a struct sockaddr_in, but sin_family does not? The answer: sin_addr and sin_port get encapsulated in the packet at the IP and UDP layers, respectively. Thus, they must be in Network Byte Order. However, the sin_family field is only used by the kernel to determine what type of address the structure contains, so it must be in Host Byte Order. Also, since sin_family does not get sent out on the network, it can be in Host Byte Order.IP Addresses and How to Deal With Them Fortunately for you, there are a bunch of functions that allow you to manipulate IP addresses. No need to figure them out by hand and stuff them in a long with the h_addr); bzero(;(their_addr. sin_zero), 8); /* zero the rest of the struct */ if ((numbytes=sendto(sockfd, argv[2], strlen(argv[2]), 0, (struct sockaddr *);their_addr, sizeof(struct sockaddr))) == -1) { perror(sendto); exit(1); } printf(sent %d bytes to %s ,numbytes,inet_ntoa(their_addr. sin_addr)); close(sockfd); return 0; } And thats all there is to it!Run listener on some machine, then run talker on another. Watch them communicate! Fun G-rated excitement for the entire nuclear family! Except for one more tiny detail that Ive mentioned many times in the past: connected datagram sockets. I need to talk about this here, since were in the datagram section of the document. Lets say that talker calls connect() and specifies the listeners address. From that point on, talker may only sent to and receive from the address specified by connect(). For this reason, you dont have to use sendto() and recvfrom(); you can simply use send() and recv().Blocking Blocking. Youve heard about itnow what the hell is it? In a nutshell, block is techie jargon for sleep. You probably noticed that when you run listener, above, it just sits there until a packet arrives. What happened is that it called recvfrom(), there was no data, and so recvfrom() is said to block (that is, sleep there) until some data arrives. Lots of functions block. accept() blocks. All the recv*() functions block. The reason they can do this is because theyre allowed to. When you first create the socket descriptor with socket(), the kernel sets it to blocking.If you dont want a socket to be blocking, you have to make a call to fcntl(): #include #include . . sockfd = socket(AF_INET, SOCK_STREAM, 0); fcntl(sockfd, F_SETFL, O_NONBLOCK); . . By setting a socket to non-blocking, you can effectively poll the socket for information. If you try to read from a non-blocking socket and theres no data there, its not allowed to blockit will return -1 and errno will be set to EWOULDBLOCK. Generally speaking, however, this type of polling is a bad idea. If you put your program in a busy-wait looking for data on the socket, youll suck up CPU time like it was going out of style.A more elegant solution for checking to see if theres data waiting to be read comes in the following secti on on 21 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html select(). select()Synchronous I/O Multiplexing This function is somewhat strange, but its very useful. Take the following situation: you are a server and you want to listen for incoming connections as well as keep reading from the connections you already have. No problem, you say, just an accept() and a couple of recv()s. Not so fast, buster!What if youre blocking on an accept() call? How are you going to recv() data at the same time? Use non-blocking sockets! No way! You dont want to be a CPU hog. What, then? select() gives you the power to monitor several sockets at the same time. Itll tell you which ones are ready for reading, which are ready for writing, and which sockets have raised exceptions, if you really want to know that. Without any further ado, Ill offer the synopsis of select(): #include #include #include int select(int n umfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);The function monitors sets of file descriptors; in particular readfds, writefds, and exceptfds. If you want to see if you can read from standard input and some socket descriptor, sockfd, just add the file descriptors 0 and sockfd to the set readfds. The parameter numfds should be set to the values of the highest file descriptor plus one. In this example, it should be set to sockfd+1, since it is assuredly higher than standard input (0). When select() returns, readfds will be modified to reflect which of the file descriptors you selected is ready for reading. You can test them with the macro FD_ISSET(), below.Before progressing much further, Ill talk about how to manipulate these sets. Each set is of the type fd_set. The following macros operate on this type: FD_ZERO(fd_set *set) clears a file descriptor set FD_SET(int fd, fd_set *set) adds fd to the set FD_CLR(int fd, fd_set *set) removes fd fro m the set FD_ISSET(int fd, fd_set *set) tests to see if fd is in the set Finally, what is this weirded out struct timeval? Well, sometimes you dont want to wait forever for someone to send you some data. Maybe every 96 seconds you want to print Still Going to the terminal even though nothing has happened.This time structure allows you to specify a timeout period. If the time is exceeded and select() still hasnt found any ready file descriptors, itll return so you can continue processing. The struct timeval has the follow fields: struct timeval { int tv_sec; /* seconds */ int tv_usec; /* microseconds */ }; 22 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html Just set tv_sec to the number of seconds to wait, and set tv_usec to the number of microseconds to wait. Yes, thats microseconds, not milliseconds.There are 1,000 microseconds in a millisecond, and 1,000 milliseconds in a second. Thus, th ere are 1,000,000 microseconds in a second. Why is it usec? The u is supposed to look like the Greek letter Mu that we use for micro. Also, when the function returns, timeout might be updated to show the time still remaining. This depends on what flavor of Unix youre running. Yay! We have a microsecond resolution timer! Well, dont count on it. Standard Unix timeslice is 100 milliseconds, so youll probably have to wait at least that long, no matter how small you set your struct timeval.Other things of interest: If you set the fields in your struct timeval to 0, select() will timeout immediately, effectively polling all the file descriptors in your sets. If you set the parameter timeout to NULL, it will never timeout, and will wait until the first file descriptor is ready. Finally, if you dont care about waiting for a certain set, you can just set it to NULL in the call to select(). The following code snippet waits 2. 5 seconds for something to appear on standard input: #include #incl ude #include #define STDIN 0 /* file descriptor for standard input */ main() { struct timeval tv; fd_set readfds; tv. v_sec = 2; tv. tv_usec = 500000; FD_ZERO(;readfds); FD_SET(STDIN, ;readfds); /* dont care about writefds and exceptfds: */ select(STDIN+1, ;readfds, NULL, NULL, ;tv); if (FD_ISSET(STDIN, ;readfds)) printf(A key was pressed! ); else printf(Timed out. ); } If youre on a line buffered terminal, the key you hit should be RETURN or it will time out anyway. Now, some of you might think this is a great way to wait for data on a datagram socketand you are right: it might be. Some Unices can use select in this manner, and some cant. You should see what your local man page says on the matter if you want to attempt it.One final note of interest about select(): if you have a socket that is listen()ing, you can check to see if there is a new connection by putting that sockets file descriptor in the readfds set. And that, my friends, is a quick overview of the almighty select() function. More References 23 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html Youve come this far, and now youre screaming for more! Where else can you go to learn more about all this stuff? Try the following man pages, for starters: ocket() bind() connect() listen() accept() se nd() recv() sendto() recvfrom() close() shutdown() getpeername() getsockname() gethostbyname() gethostbyaddr() getprotobyname() fcntl() select() perror() Also, look up the following books: Internetworking with TCP/IP, volumes I-III by Douglas E. Comer and David L. Stevens. Published by Prentice Hall. Second edition ISBNs: 0-13-468505-9, 0-13-472242-6, 0-13-474222-2. There is a third edition of this set which covers IPv6 and IP over ATM. Using C on the UNIX System by David A. Curry. Published by OReilly ; Associates, Inc. ISBN 0-937175-23-4.TCP/IP Network Administration by Craig Hunt. Published by OReilly Associates, Inc. ISBN 0-937175-82-X. TCP/IP Illustrated, volumes 1-3 by W. Richard Stevens and Gary R. Wright. Published by Addison Wesley. ISBNs: 0-201-63346-9, 0-201-63354-X, 0-201-63495-3. Unix Network Programming by W. Richard Stevens. Published by Prentice Hall. ISBN 0-13-949876-1. On the web: BSD Sockets: A Quick And Dirty Primer ( cs. umn. edu/~bentlema/unix/has other great Unix system programming info, too! ) Client-Server Computing (http://pandonia. canberra. edu. au/ClientServer/socket. html)Intro to TCP/IP (gopher) 24 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html (gopher://gopher-chem. ucdavis. edu/11/Index/Internet_aw/Intro_the_Internet/intro. to. ip/) Internet Protocol Frequently Asked Questions (France) (http://web. cnam. fr/Network/TCP-IP/) The Unix Socket FAQ ( ibrado. com/sock-faq/) RFCsthe real dirt: RFC-768 The User Datagram Protocol (UDP) (ftp://nic. ddn. mil/rfc/rfc768. txt) RFC-791 The Internet Protocol (IP) (ftp://nic. ddn. mil/rfc/rfc791. txt)RFC-793 The Transmission Control Protocol (TCP) (ftp://nic. ddn. mil/rfc/rfc793. txt) RFC-854 The Telnet Protocol (ftp://nic. ddn. mil/rfc/rfc854. txt) RFC-951 The Bootstrap Protocol (BOOTP) (ftp://nic. ddn. mil/rfc/rfc951. txt) RFC-1350 The Trivial File Transfer Protocol (TFTP) (ftp://nic. ddn. mi l/rfc/rfc1350. txt) Disclaimer and Call for Help Well, thats the lot of it. Hopefully at least some of the information contained within this document has been remotely accurate and I sincerely hope there arent any glaring errors. Well, sure, there always are. So, if there are, thats tough for you.Im sorry if any inaccuracies contained herein have caused you any grief, but you just cant hold me accountable. See, I dont stand behind a single word of this document, legally speaking. This is my warning to you: the whole thing could be a load of crap. But its probably not. After all, Ive spent many many hours messing with this stuff, and implemented several TCP/IP network utilities for Windows (including Telnet) as summer work. Im not the sockets god; Im just some guy. By the way, if anyone has any constructive (or destructive) criticism about this document, please send mail to [emailprotected] csuchico. du and Ill try to make an effort to set the record straight. In case youre wondering why I did this, well, I did it for the money. Hah! No, really, I did it because a lot of people have asked me socket-related questions and when I tell them Ive been thinking about putting together a socket page, they say, cool! Besides, I feel that all this hard-earned knowledge is going to waste if I cant share it with others. WWW just happens to 25 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html be the perfect vehicle.I encourage others to provide similar information whenever possible. Enough of thisback to coding! 😉 Copyright  © 1995, 1996 by Brian Beej Hall. This guide may be reprinted in any medium provided that its content is not altered, it is presented in its entirety, and this copyright notice remains intact. Contact [emailprotected] csuchico. edu for more information. 26 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad r amming; Using Internet Sockets/net. htmlBeejs Guide to Network Programming Using Internet Sockets Version 1. 5. 4 (17-May-1998) [ cst. csuchico. edu/~beej/guide/net] Intro Hey! Socket programming got you down? Is this stuff just a little too difficult to figure out from the man pages? You want to do cool Internet programming, but you dont have time to wade through a gob of structs trying to figure out if you have to call bind() before you connect(), etc. , etc. Well, guess what! Ive already done this nasty business, and Im dying to share the information with everyone! Youve come to the right place. This document should give the average competent C programmer the edge s/he needs to get a grip on this networking noise. AudienceThis document has been written as a tutorial, not a reference. It is probably at its best when read by individuals who are just starting out with socket programming and are looking for a foothold. It is certainly not the complete guide to sockets programming, by any means. Hopefully, though, itll be just enough for those man pages to start making sense 🙂 Platform and Compiler Most of the code contained within this document was compiled on a Linux PC using Gnus gcc compiler. It was also found to compile on HPUX using gcc. Note that every code snippet was not individually tested. Contents: What is a socket?Two Types of Internet Sockets Low level Nonsense and Network Theory structsKnow these, or aliens will destroy the planet! Convert the Natives! IP Addresses and How to Deal With Them socket()Get the File Descriptor! bind()What port am I on? connect()Hey, you! listen()Will somebody please call me? 1 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html accept()Thank you for calling port 3490. send() and recv()Talk to me, baby! sendto() and recvfrom()Talk to me, DGRAM-style close() and shutdown()Get outta my face! etpeername()Who are you? gethostn ame()Who am I? DNSYou say whitehouse. gov, I say 198. 137. 240. 100 Client-Server Background A Simple Stream Server A Simple Stream Client Datagram Sockets Blocking select()Synchronous I/O Multiplexing. Cool! More references Disclaimer and Call for Help What is a socket? You hear talk of sockets all the time, and perhaps you are wondering just what they are exactly. Well, theyre this: a way to speak to other programs using standard Unix file descriptors. What? Okyou may have heard some Unix hacker state, Jeez, everything in Unix is a file! What that person may have been talking about is the fact that when Unix programs do any sort of I/O, they do it by reading or writing to a file descriptor. A file descriptor is simply an integer associated with an open file. But (and heres the catch), that file can be a network connection, a FIFO, a pipe, a terminal, a real on-the-disk file, or just about anything else. Everything in Unix is a file! So when you want to communicate with another pro gram over the Internet youre gonna do it through a file descriptor, youd better believe it. Where do I get this file descriptor for network communication, Mr.Smarty-Pants? is probably the last question on your mind right now, but Im going to answer it anyway: You make a call to the socket() system routine. It returns the socket descriptor, and you communicate through it using the specialized send() and recv() (man send, man recv) socket calls. But, hey! you might be exclaiming right about now. If its a file descriptor, why in the hell cant I just use the normal read() and write() calls to communicate through the socket? The short answer is, You can! The longer answer is, You can, but send() and recv() offer much greater control over your data transmission. What next? How about this: there are all kinds of sockets. There are DARPA Internet addresses (Internet Sockets), path names on a local node (Unix Sockets), CCITT X. 25 addresses (X. 25 Sockets that you can safely ignore), and probably many others depending on which Unix flavor you run. This document deals only with the first: Internet Sockets. Two Types of Internet Sockets 2 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html Whats this? There are two types of Internet sockets? Yes. Well, no. Im lying.There are more, but I didnt want to scare you. Im only going to talk about two types here. Except for this sentence, where Im going to tell you that Raw Sockets are also very powerful and you should look them up. All right, already. What are the two types? One is Stream Sockets; the other is Datagram Sockets, which may hereafter be referred to as SOCK_STREAM and SOCK_DGRAM, respectively. Datagram sockets are sometimes called connectionless sockets (though they can be connect()d if you really want. See connect(), below. Stream sockets are reliable two-way connected communication streams.If you output two items into the socket in the order 1, 2, they will arrive in the order 1, 2 at the opposite end. They will also be error free. Any errors you do encounter are figments of your own deranged mind, and are not to be discussed here. What uses stream sockets? Well, you may have heard of the telnet application, yes? It uses stream sockets. All the characters you type need to arrive in the same order you type them, right? Also, WWW browsers use the HTTP protocol which uses stream sockets to get pages. Indeed, if you telnet to a WWW site on port 80, and type GET pagename, itll dump the HTML back at you!How do stream sockets achieve this high level of data transmission quality? They use a protocol called The Transmission Control Protocol, otherwise known as TCP (see RFC-793 for extremely detailed info on TCP. ) TCP makes sure your data arrives sequentially and error-free. You may have heard TCP before as the better half of TCP/IP where IP stands for Internet Protocol (see RFC-791. ) IP deals with Internet routing only. Cool. What about Datagram sockets? Why are they called connectionless? What is the deal, here, anyway? Why are they unreliable?Well, here are some facts: if you send a datagram, it may arrive. It may arrive out of order. If it arrives, the data within the packet will be error-free. Datagram sockets also use IP for routing, but they dont use TCP; they use the User Datagram Protocol, or UDP (see RFC-768. ) Why are they connectionless? Well, basically, its because you dont have to maintain an open connection as you do with stream sockets. You just build a packet, slap an IP header on it with destination information, and send it out. No connection needed. They are generally used for packet-by-packet transfers of information.Sample applications: tftp, bootp, etc. Enough! you may scream. How do these programs even work if datagrams might get lost?! Well, my human friend, each has its own protocol on top of UDP. For example, the tftp protocol says that for each packet that gets sent, the recipient has to send back a packet that says, I got it! (an ACK packet. ) If the sender of the original packet gets no reply in, say, five seconds, hell re-transmit the packet until he finally gets an ACK. This acknowledgment procedure is very important when implementing SOCK_DGRAM applications. Low level Nonsense and Network TheorySince I just mentioned layering of protocols, its time to talk about how networks really work, and to show some examples of how SOCK_DGRAM packets are built. Practically, you can probably skip this section. Its good background, however. 3 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html Hey, kids, its time to learn about Data Encapsulation! This is very very important. Its so important that you might just learn about it if you take the networks course here at Chico State ;-).Basically, it says this: a packet is born, the packet is wrapped (encapsul ated) in a header (and maybe footer) by the first protocol (say, the TFTP protocol), then the whole thing (TFTP header included) is encapsulated again by the next protocol (say, UDP), then again by the next (IP), then again by the final protocol on the hardware (physical) layer (say, Ethernet). When another computer receives the packet, the hardware strips the Ethernet header, the kernel strips the IP and UDP headers, the TFTP program strips the TFTP header, and it finally has the data. Now I can finally talk about the infamous Layered Network Model.This Network Model describes a system of network functionality that has many advantages over other models. For instance, you can write sockets programs that are exactly the same without caring how the data is physically transmitted (serial, thin Ethernet, AUI, whatever) because programs on lower levels deal with it for you. The actual network hardware and topology is transparent to the socket programmer. Without any further ado, Ill pres ent the layers of the full-blown model. Remember this for network class exams: Application Presentation Session Transport Network Data Link Physical The Physical Layer is the hardware (serial, Ethernet, etc. . The Application Layer is just about as far from the physical layer as you can imagineits the place where users interact with the network. Now, this model is so general you could probably use it as an automobile repair guide if you really wanted to. A layered model more consistent with Unix might be: Application Layer (telnet, ftp, etc. ) Host-to-Host Transport Layer (TCP, UDP) Internet Layer (IP and routing) Network Access Layer (was Network, Data Link, and Physical) At this point in time, you can probably see how these layers correspond to the encapsulation of the original data.See how much work there is in building a simple packet? Jeez! And you have to type in the packet headers yourself using cat! Just kidding. All you have to do for stream sockets is send() the data out. All you have to do for datagram sockets is encapsulate the packet in the method of your choosing and sendto() it out. The kernel builds the Transport Layer and Internet Layer on for you and the hardware does the Network Access Layer. Ah, modern technology. So ends our brief foray into network theory. Oh yes, I forgot to tell you everything I wanted to say about routing: nothing! Thats right, Im not going to talk about it at all.The router strips the packet to the IP header, consults its routing table, blah blah blah. Check out the IP RFC if you really really care. If you never learn about it, well, youll live. [Encapsulated Protocols Image] 4 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html structs Well, were finally here. Its time to talk about programming. In this section, Ill cover various data types used by the sockets interface, since some of them are a real bitch to figure out. First th e easy one: a socket descriptor.A socket descriptor is the following type: int Just a regular int. Things get weird from here, so just read through and bear with me. Know this: there are two byte orderings: most significant byte (sometimes called an octet) first, or least significant byte first. The former is called Network Byte Order. Some machines store their numbers internally in Network Byte Order, some dont. When I say something has to be in NBO, you have to call a function (such as htons()) to change it from Host Byte Order. If I dont say NBO, then you must leave the value in Host Byte Order. My First Struct(TM)struct sockaddr.This structure holds socket address information for many types of sockets: struct sockaddr { unsigned short sa_family; /* address family, AF_xxx */ char sa_data[14]; /* 14 bytes of protocol address */ }; sa_family can be a variety of things, but itll be AF_INET for everything we do in this document. sa_data contains a destination address and port number for the socket. This is rather unwieldy. To deal with struct sockaddr, programmers created a parallel structure: struct sockaddr_in (in for Internet. ) struct sockaddr_in { short int sin_family; /* Address family */ unsigned short int sin_port; /* Port number */ truct in_addr sin_addr; /* Internet address */ unsigned char sin_zero[8]; /* Same size as struct sockaddr */ }; This structure makes it easy to reference elements of the socket address. Note that sin_zero (which is included to pad the structure to the length of a struct sockaddr) should be set to all zeros with the function bzero() or memset(). Also, and this is the important bit, a pointer to a struct sockaddr_in can be cast to a pointer to a struct sockaddr and vice-versa. So even though socket() wants a struct sockaddr *, you can still use a struct sockaddr_in and cast it at the last minute!Also, notice that sin_family corresponds to sa_family in a struct sockaddr and should be set to AF_INET. Finally, the sin_port and si n_addr must be in Network Byte Order! But, you object, how can the entire structure, struct in_addr sin_addr, be in Network Byte Order? This question requires careful examination of the structure struct in_addr, one of the worst unions alive: /* Internet address (a structure for historical reasons) */ 5 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html struct in_addr { nsigned long s_addr; }; Well, it used to be a union, but now those days seem to be gone. Good riddance. So if you have declared ina to be of type struct sockaddr_in, then ina. sin_addr. s_addr references the 4 byte IP address (in Network Byte Order). Note that even if your system still uses the God-awful union for struct in_addr, you can still reference the 4 byte IP address in exactly the same way as I did above (this due to #defines. ) Convert the Natives! Weve now been lead right into the next section. Theres been too much t alk about this Network to Host Byte Order conversionnow is the time for action!All righty. There are two types that you can convert: short (two bytes) and long (four bytes). These functions work for the unsigned variations as well. Say you want to convert a short from Host Byte Order to Network Byte Order. Start with h for host, follow it with to, then n for network, and s for short: h-to-n-s, or htons() (read: Host to Network Short). Its almost too easy You can use every combination if n, h, s, and l you want, not counting the really stupid ones. For example, there is NOT a stolh() (Short to Long Host) functionnot at this party, anyway.But there are: htons()Host to Network Short htonl()Host to Network Long ntohs()Network to Host Short ntohl()Network to Host Long Now, you may think youre wising up to this. You might think, What do I do if I have to change byte order on a char? Then you might think, Uh, never mind. You might also think that since your 68000 machine already uses net work byte order, you dont have to call htonl() on your IP addresses. You would be right, BUT if you try to port to a machine that has reverse network byte order, your program will fail. Be portable! This is a Unix world!Remember: put your bytes in Network Order before you put them on the network. A final point: why do sin_addr and sin_port need to be in Network Byte Order in a struct sockaddr_in, but sin_family does not? The answer: sin_addr and sin_port get encapsulated in the packet at the IP and UDP layers, respectively. Thus, they must be in Network Byte Order. However, the sin_family field is only used by the kernel to determine what type of address the structure contains, so it must be in Host Byte Order. Also, since sin_family does not get sent out on the network, it can be in Host Byte Order.IP Addresses and How to Deal With Them Fortunately for you, there are a bunch of functions that allow you to manipulate IP addresses. No need to figure them out by hand and stuff them in a long with the h_addr); bzero(;(their_addr. sin_zero), 8); /* zero the rest of the struct */ if ((numbytes=sendto(sockfd, argv[2], strlen(argv[2]), 0, (struct sockaddr *);their_addr, sizeof(struct sockaddr))) == -1) { perror(sendto); exit(1); } printf(sent %d bytes to %s ,numbytes,inet_ntoa(their_addr. sin_addr)); close(sockfd); return 0; } And thats all there is to it!Run listener on some machine, then run talker on another. Watch them communicate! Fun G-rated excitement for the entire nuclear family! Except for one more tiny detail that Ive mentioned many times in the past: connected datagram sockets. I need to talk about this here, since were in the datagram section of the document. Lets say that talker calls connect() and specifies the listeners address. From that point on, talker may only sent to and receive from the address specified by connect(). For this reason, you dont have to use sendto() and recvfrom(); you can simply use send() and recv().Blocking Blocking. Youve heard about itnow what the hell is it? In a nutshell, block is techie jargon for sleep. You probably noticed that when you run listener, above, it just sits there until a packet arrives. What happened is that it called recvfrom(), there was no data, and so recvfrom() is said to block (that is, sleep there) until some data arrives. Lots of functions block. accept() blocks. All the recv*() functions block. The reason they can do this is because theyre allowed to. When you first create the socket descriptor with socket(), the kernel sets it to blocking.If you dont want a socket to be blocking, you have to make a call to fcntl(): #include #include . . sockfd = socket(AF_INET, SOCK_STREAM, 0); fcntl(sockfd, F_SETFL, O_NONBLOCK); . . By setting a socket to non-blocking, you can effectively poll the socket for information. If you try to read from a non-blocking socket and theres no data there, its not allowed to blockit will return -1 and errno will be set to EWOULDBLOCK. Generally speaking, however, this type of polling is a bad idea. If you put your program in a busy-wait looking for data on the socket, youll suck up CPU time like it was going out of style.A more elegant solution for checking to see if theres data waiting to be read comes in the following secti on on 21 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html select(). select()Synchronous I/O Multiplexing This function is somewhat strange, but its very useful. Take the following situation: you are a server and you want to listen for incoming connections as well as keep reading from the connections you already have. No problem, you say, just an accept() and a couple of recv()s. Not so fast, buster!What if youre blocking on an accept() call? How are you going to recv() data at the same time? Use non-blocking sockets! No way! You dont want to be a CPU hog. What, then? select() gives you the power to monitor several sockets at the same time. Itll tell you which ones are ready for reading, which are ready for writing, and which sockets have raised exceptions, if you really want to know that. Without any further ado, Ill offer the synopsis of select(): #include #include #include int select(int n umfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);The function monitors sets of file descriptors; in particular readfds, writefds, and exceptfds. If you want to see if you can read from standard input and some socket descriptor, sockfd, just add the file descriptors 0 and sockfd to the set readfds. The parameter numfds should be set to the values of the highest file descriptor plus one. In this example, it should be set to sockfd+1, since it is assuredly higher than standard input (0). When select() returns, readfds will be modified to reflect which of the file descriptors you selected is ready for reading. You can test them with the macro FD_ISSET(), below.Before progressing much further, Ill talk about how to manipulate these sets. Each set is of the type fd_set. The following macros operate on this type: FD_ZERO(fd_set *set) clears a file descriptor set FD_SET(int fd, fd_set *set) adds fd to the set FD_CLR(int fd, fd_set *set) removes fd fro m the set FD_ISSET(int fd, fd_set *set) tests to see if fd is in the set Finally, what is this weirded out struct timeval? Well, sometimes you dont want to wait forever for someone to send you some data. Maybe every 96 seconds you want to print Still Going to the terminal even though nothing has happened.This time structure allows you to specify a timeout period. If the time is exceeded and select() still hasnt found any ready file descriptors, itll return so you can continue processing. The struct timeval has the follow fields: struct timeval { int tv_sec; /* seconds */ int tv_usec; /* microseconds */ }; 22 of 26 12. 03. 99 01:21 Beejs Guide to Network Programming file:///C|/Eigene Dateien/Manualz/not ad ramming; Using Internet Sockets/net. html Just set tv_sec to the number of seconds to wait, and set tv_usec to the number of microseconds to wait. Yes, thats microseconds, not milliseconds.There are 1,000 microseconds in a millisecond, and 1,000 milliseconds in a second. Thus, th ere are 1,000,000 microseconds in a second. Why is it usec? The u is supposed to look like the Greek letter Mu that we use for micro. Also, when the function returns, timeout might be updated to show the time still remaining. This depends on what flavor of Unix youre running. Yay! We have a microsecond resolution timer! Well, dont count on it. Standard Unix timeslice is 100 milliseconds, so youll probably have to wait at least that long, no matter how small you set your struct timeval.Other things of interest: If you set the fields in your struct timeval to 0, select() will timeout immediately, effectively polling all the file descriptors in your sets. If you set the parameter timeout to NULL, it will never timeout, and will wait until the first file descriptor is ready. Finally, if you dont care about waiting for a certain set, you can just set it to NULL in the call to select(). The following code snippet waits 2. 5 seconds for something to appear on standard input: #include #incl ude #include #define STDIN 0 /* file descriptor for standard input */ main() { struct timeval tv; fd_set readfds; tv. v_sec = 2; tv. tv_usec = 500000; FD_ZERO(;readfds); FD_SET(STDIN, ;readfds); /* dont care about writefds and exceptfds: */ select(STDIN+1, ;readfds, NULL, NULL, ;tv); if (FD_ISSET(STDIN, ;readfds)) printf(A key was pressed! ); else printf(Timed out. ); } If youre on a line buffered terminal, the key you hit should be RETURN or it will time out anyway. Now, some of you might think this is a great way to wait for data on a datagram socketand you are right: it might be. Some Unices can use select in this manner, and some cant. You should see what your local man page says on the matter if you want to attempt it.One final note of interest about select(): if you have a socket that is listen()ing, you can check to see if there is a new connection by putting that sockets file descriptor in the readfds set. And that, my friends, is a quick overview of the almighty select() function.

Friday, November 22, 2019

North Korea Essay Example | Topics and Well Written Essays - 1750 words

North Korea - Essay Example Either way, the result is likely designed to benefit fulfill the interests of the nation in the economic or military front. Liberalism on the other hand can be loosely defined as individual freedom; an ideology stems from the belief that humans inherently are good-natured. Its core values stress on individualism, human rights the right to equal treatment and universal protection of the law without discrimination. From this definition, it is easy to understand why the theory will be hard to inculcate into the Korean, more so, North Korean situation. Firstly, the country is a dictatorship and by virtue of that fact, it means that the ideas of freedom in the convectional democratic sense are not manifested in the governance style. In addition, the leaders have displayed extreme aggressiveness and a determination to go against nearly all the tenets of liberalism both on a local and international scale. North Korea recently threatened to launch a nuclear offensive at the United States of America South Korea and Japan after the US commenced military drills in South Korea (Jack and Louis, 2013). The drills in South were declared an act of war and consequently the North scrapped the armistice treaty that had ended the war between the two nations in the 50s (Park, 2013). It has threatened to strike in the heart of America, which it deem to be about to conduct a nuclear strike as well, that is being used to justify North Koreas irrational action. This begs the question; why is there so much friction between America and North Korea, from a realistic perspective, North Korea likely sees America as a potential threat to its sovereignty and continued independence and freedom. This is evidenced in the fact that whenever the leaders discuss their neighbors South Korea, they use the expression a puppet for the Americans. To the leaders up North, there is no difference between being â€Å"colonized† and co-operating with the American government, in this respect their aggr essiveness towards America can be viewed in terms of their wish to protect their self-interest. Herein emerges the key difference between a realist and liberal understanding of the issue, a liberal mind would assume that peace and cooperation are acceptable if it benefits ones country. Considering the current state of the North Koreas economy, it is beyond any doubt that they stand to gain a lot from co-operating with the international community, that way they can be able to trade freely without the burden of sanctions. The security of America has been continuously threatened by the North Korean, as such (Suri, 2013) their heavy presence in South Korea and is strategic in order to ensure it protects itself and its allies. These moves are interpreted by the Northern side as being potential for war and thus each side in their attempt to safeguard their interests in an environment of mutual distrust fuel the ensuing conflict. It has also been postulated that Koreas aggressiveness is a means of blackmailing the world into sympathizing and giving them the aid they so badly need especially in view of the severe sanctions imposed by the international community. According to Lankov, the North’s main reason for its belligerent statements is not an intention for war but a means of reminding the world that it exists (Lankov, 2013). They will only be able to blackmail believably

Wednesday, November 20, 2019

Portfolio Project Part 6 Assignment Example | Topics and Well Written Essays - 1000 words

Portfolio Project Part 6 - Assignment Example In order to measure the performance of an accountant, it is significant to use the critical incident and BARS methods. A combination of these methods would sufficiently measure the performance of an accountant in the company. A performance management should be able to give employees unbiased, constructive feedback on their performance. In order to ensure success of performance management of an accountant, reviews and measurement of the worker are normally done annually. Measure of improved performance The following combined methods will be used to measure the performance of an accountant i. Critical Incidents ii. Work Standards iii. Straight or Simple Ranking iv. Paired Comparisons v. Rater distribution Using the straight or simple ranking, the accountant will ranked according to overall performance. He or she will be compared with other employees. In addition, all comparison will be based on single criterion, such as overall performance. This is effective because it Compares perform ance of each employee with every other employee in the group. Using the forced distribution method, I will be able to understand how the accountant has performed. This is because the rater assigns individual in work group to a limited number of categories similar to a normal distribution. Further, it assumes all groups of employees have the same distribution (Mondy & Mondy 2010). In rating work quantity of the accountant, i will give careful consideration things such as effect of employee on the general flow of work, amount of work produced in terms of the specific job especially annually, employee’s application to the job, and skill in handling specific assignments of the company. I will award the score as follows: poor, 1 to 6 points; average, 7 to 18 points; good, 19 to 25 points. In turn, I will be able to understand if the accountant has improved performance or not (Smith & Mazin, 2004). BARS and performance evaluation The Critical Incident Method is a form of performanc e appraisal method that requires an individual to keep records and all relevant information of both good and bad employee work behaviors. In case a critical incident influences the company’s ability to operate either negatively or positively, the manager records the information. The BARS method is very effective in portfolio management of workers since it is easy to monitor the actions or behaviors of the worker while at work (Mondy & Mondy, 2010). For instance, when an employee misuse the company resources for personal use, it is easy to report the case to the manager. When it comes to accounting, this method is applicable in the sense that when an accountant makes valuations and evaluation of the company’s expenses and profits for a week, month, or a year, it is easy to monitor the trend of their actions. If the accountant kept the records in a timely way, the management can easily detect problems in their financial system and come up with ways to improve its financi al control systems. The BARS especially the critical incident method can also be applied as a means of job analysis in the sense that it helps analysts to determine actions that are focused on work and other work activities. It helps in making an entire analysis of work and permit transparent performance leading actions to be targeted (Smith & Mazin, 2004). In evaluating performance of a worker, it is vital to have job description and specification. This is because Job descriptions offer precise and a concise

Monday, November 18, 2019

Legal Environment of Business and Employment Coursework

Legal Environment of Business and Employment - Coursework Example In order to determine whether there was a valid legal contract between A2Z Co. Ltd and Bling Stores and to best advice the parties it is necessary to discuss the above mentioned essential elements for formation of a contract and how the presence of each element is achieved. An offer has been defined as an expression of willingness by one party known as the offeror, to contract or be bound on stated terms, provided that such terms are accepted by the party to whom the offer is made that is the offeree. The courts have drawn a distinction between an offer and an invitation to treat, as the latter is merely an expression of willingness by one party to enter into negotiations and is not unconditional and there is a lack of intention to create legal relations. The most important and land mark cases which distinguished between an offer and invitation to treat are of Gibson v Manchester City Council1 and Storer v Manchester City Council2. In Gibson, where treasurer had sent a letter to Mr. Gibson, stating that council may be prepared to sell the house, was held to be an invitation to treat, which was further confirmed by the fact that Mr. Gibson was asked to make a formal application to purchase the house. The courts therefore took into account the correspondence between the parties. However, in Storer the courts found that a contract had come into existence as negotiations had moved beyond what had happened in Gibson but an exchange of contracts had not taken place. These cases clearly point out that fact that judges can interpret and differ in the results and so the decision would be said to be based on its own facts. The next step is that of acceptance. The general rule for the acceptance of an offer is that the offer should be accepted unconditionally and must be communicated to the offeror. (Holwell Securities v. Hughes3). However there are certain exception to this general rule and one of them is the infamous postal rule. The postal rule states that when an acce ptance is sent by means of a post, it takes place as soon as the letter is validly posted. (Adams v. Lindsell)4, furthermore Instanta Instantaneous modes of communication has lately been scrutinized by the courts (Lord Wilberforce in Brinkibon Ltd. v Stahag Stahl GmbH)5, however the problem of when acceptance is effective has clearly not been addressed and still lies in an area of uncertainty. instantaneous modes of communication has lately been scrutinized by the, however it is a settled law that a communication made through instant mode of communication is deemed effective if it is despatched and received during working hours i.e if a fax is sent on Sunday evening it will only deemed to be effectively communicated on Monday morning, when office working hours start. Acceptance must be looked into carefully, as the fact that it must be unconditional is strict and so if new terms and conditions are introduced that would not be acceptance and would merely be a counter offer, which can then be accepted by the original offeror, who now becomes the offeree as in (Hyde v Wrench)6.If the offeree does not accept all the terms and conditions proposed by the offeror and introduces new terms to the original offer is not an acceptance but a counter offer which kills the original offer The general rule for acceptance is that communication must actually be made to

Saturday, November 16, 2019

Kentucky fried chicken

Kentucky fried chicken Entrepreneurship: Colonel Sanders started the Kentucky Fried Chicken at the age of 65. Presently KFC is one of the leading firms in food industry around the world. Over a billion KFC chicken dinners are served featuring the Colonels â€Å"finger likin good† recipe, each year. At the age of 40 Sanders first started cooking in a service station in Corbin, KY. But soon hundreds of people started coming to the service station for food instead for car service. Soon he shifted to a hotel and restaurant that had a capacity of holding 142 people at a time. With his special cooking techniques, Sanders station became well-known and he was acknowledged for his incredible cuisine by the Governor at the time, RubyLaffoonin 1935 when he was made a Kentucky Colonel.In 1939, Colonel Sanders restaurant won the top spot on Duncan Hines â€Å"Adventures in Good Eating.† In 1952 colonel sanders got good start for his company and devoted the rest of his life in franchising business. By 1964, over six hundred franchised outlets were opened in theUnited StatesandCanadafor his chicken. The company got listed on the New York Stock Exchange on January 16, 1969, only 3 years after it had gone public on March 17, 1966.Then on July 8, 1971 the company was taken over by Heublin Inc, for $285 million dollars. Soon the company grew to an enormous three thousand and five hundred franchised and company-owned restaurants world-wide.But after being regularly travelling around the globe, Colonel Sanders died of leukemia at the age of 90 in 1980. Nowadays its part of a bigger company known as Yum Brands. Advantages To Parent Business 1. Financial:It is another source of income through franchise fee and royalty. Also there is increase in Cash flow, return on investment and profits. 2. Operational:There is smaller centralized control as compared to developing and having locations by company itself. It also ensures consistency, enhanced productivity and better quality. Self-motivation as franchisees invests their own money. 3. Strategic:It helps in dividing risk by having multiple locations through peoples investment. That ensures faster network expansion and a better opportunity to focus on changing market needs. 4. Administrative:With a smaller central organization, the business maintains a more cost effective labor force, no change in important staff members and better recruitment. Disadvantages To Parent Business 1. Franchisor is required to have enough resources to recruit, train and support the new franchisees. 2. Franchisee may spoil the image of the company if he is not capable of running the franchise perfectly. 3. Also franchisor has to tell all the internal information of the company to the franchisee. So, privacy of company is also at risk.† Marketing/ Advertising â€Å"The KFC Marketing team focuses fervently on delivering an unvarying pipeline of mouth-watering meals. They try to search the wants of the customers and bring new innovative products to meet the customers standards. Target market is divided on the basis of demographic, geographic and psychographic segments. The pricing strategy that they follow while entering new market is price skimming. In starting they try to price their product a bit high and target the middle and upper class people. Than after some time they start lowering their prices to focus on middle to lower class people. They do this to get to larger part of the market. The Marketing team gives more importance to Operations and Product Excellence. They try to find new ways to develop and execute new ideas, as well as assessing the input of the finance in the business. The Marketing team is the primary medium of communication between the company and the customers. The budget of marketing is divided in accordance to the media buying and advertising production to guarantee a year round calendar of innovative news to drive consumers back to our restaurants every time. Advertising strategies are the same as any other firm but they have their distinctive slogan â€Å"finger likin good† which relates to quality of food they provide. KFC usually charges advertisement fee of 5% of the gross revenue to the individual stores. KFC charges a Local advertising fee of 3% and fee equal to 2% of the gross revenue for national advertising fee. Operations Management KFC primary raw material is chicken. They are not breed in a normal way. These chickens are kept alive by tubes inserted into their bodies to force blood and nutrients right through their body. They do not have any beaks, feathers as well as feet. Their bone structure is considerably shrunk to get more meat out of them. This is beneficial for KFC because they do not have to pay a huge quantity for their production costs. There is rarely any plucking of feathers or the removal of the beaks and feet. However this method has been disapproved of by many animal rights organizations and has been upsetting the image of the company. There have been many cases against KFC regarding the treatment of chickens in their farms. Cost Initial Investnment: â€Å" Expenditure Low High Initial Franchise Fee $25,000 $45,000 Development Services Fee Varies Varies Real Property $400,000 $1,000,000 Construction and Leasehold Improvements $575,000 $915,000 Equipment/Signage $216,000 $366,000 Opening Advertising $5,000 $5,000 Opening Inventory $10,000 $10,000 Utility Deposits and Business Licenses $7,000 $7,000 Initial Training $3,900 $10,000 Miscellaneous Opening Costs $5,000 $15,000 Additional Funds (3 months) $13,000 $18,000 Total $1,379,900 $2,391,000† The figures are taken from the KFC website. Please refer to the URL FINANCIAL ASSISTANCE: The franchisor does not provide any indirect or direct financing. They do guarantee any lease or obligation. KFC is one of the parts of organization named YUM brands. YUM Capital is a special purpose limited liability company structured under Delaware law, the sole member of which is YUM Capital Funding Corp a non-stock corporation in Delaware. YUM Capital issues commercial paper secured by loans purchased from YUM Capital Funding Corp and made by YUM Capital Funding Corp to franchisees in YUM restaurant brands. ROYALTY: KFC franchisees have to pay royalty fee equal to 4% of gross revenues or else minimum of $600 per month. BREAK-EVEN POINT: It is the condition of a company when they are having no profits. In other words when company is just paying all its expenses. If it has to be calculated from sales than a certain number has to be found out at which company is having no profit. An estimated amount of sales revenue for 2010 is 21926 million dollars and the estimated revenue is 1452 million dollars. So break-even point should be the difference of sales and revenue i.e. 20474 (21926-1452) million dollars. This means company has to earn At least 20474 million dollars to cover up all its expenses. Human Resource Management KFC stresses upon the fact that either franchisees or at least one of the managers should complete the training program set-up by the company. But KFC is very strict about asking for employees to complete the training process as per the companys discretion. Besides basic training if company has certain additional course work or programs they can ask the franchisee, managers and employees to do those too. The training program is generally of 4 days, each having a session of 8-10 hours each day. This kind of training technique helps in growing the efficiency of workers and managers and makes them accustomed with their work hence reducing the likelihood of errors and mistakes. But on the other hand this procedure can be time consuming and can possibly become more costly due to the excessive training that the possible employees have to go through before entering the organization. References: http://www.kfc.com www.yumfranchise.com www.ehow.com www.yum.com KFC Annual report. www.answers.com Key Takeaway This assignment helped in understanding different ways of managing a new business. It made me familiar with the concept of having a franchise business, what are the benefits of having franchise and what are the additional expenses of having a franchise business. Besides that it gave me an opportunity to review franchisees of KFC all over the world and helped me significantly in analyzing all the dynamics involved for having KFC franchise. In future if I want to start my own business I might give a preference to franchise form depending upon the kind of business I want to have.

Wednesday, November 13, 2019

The Oil Spill is Affecting Animals, but What About the Government? Essa

Since the dawn of the industrial revolution, mankind has increasingly become reliant on fossil fuels such as oil for energy. Oil fuels our car, warms our homes, generates our electricity, and creates a myriad of goods including everything that contains plastic. In our global economy, oil must be transported great distances to reach markets throughout the world. With seemingly increasing frequency, these journeys sometimes end in accidents that result in oil being spilled into the ocean. The most devastating oil spill, The Deepwater Horizon oil spill, occurred on April twentieth of this year. Deepwater Horizon is an oilrig located in the Gulf of Mexico and it is owned by B.P. Everything seemed to be running efficiently on the rig until April twentieth, when methane gas leaked through the rig. The gas was under high pressure and as a result exploded turning the rig into a raging inferno that eventually caused the rig to plummet to the bottom of the ocean floor (Dickinson). The explosion caused a massive amount of oil to gush the Gulf of Mexico. Although there is no exact statistic on the amount of oil that rushed out of the well where Deepwater Horizon stood each day before, â€Å"the median figure for Crone’s independent calculations [of the oil gush] is 55,000 barrels a day† (Dickinson). Approximately three months after the explosion, the well was finally capped, which stopped the flow of oil into the Gulf of Mexico. To put this spill into perspective, if the calculations by Crone on the spill were correct, this means that eighteen times the total amount of oil spilled in the Exxon Valdez incident was spilled total in the Deepwater Horizon catastrophe. This is an astronomical amount of oil moving through the Gulf of Mexico. Even... ... an even larger scale than the Deepwater Horizon rig. If past mistakes are not learned from, they are going to be repeated in the future. The federal government needs to reenact the ban on deepwater drilling until engineers are able to assess all components of deepwater drilling rigs. This is the only certain way to prevent another disaster like that of the Deepwater Horizon crisis. Even though this ban may cause gas prices to rise, it is a necessary sacrifice in order to keep the environment safe. Work Cited Baker, Peter. "White House Is Lifting Ban on Deepwater Drilling." New York Times. N.p., 12 Oct. 2010. Web. 10 Nov. 2010. Dickinson, Tim. "The Spill, The Scandal and the President." The Rolling Stones. N.p., 24 June 2010. Web. 10 Nov. 2010. Kaufman, Leslie. "Concerns Up and Down the Food Chain." New York Times. N.p., 12 Oct. 2010. Web. 14 Nov. 2010.

Monday, November 11, 2019

Aaliyah – original writing on the life of the singer

â€Å"I don't think about my success. I'm happy that the work I've done in the past has been very successful. All I can do is leave it in God's hands and hope my fans feel where I'm coming from. I took the time to give my all.† – Aaliyah Haughton. As I sit listening to the infectious, sensuous harmonies of Aaliyah's smooth R & B, I wonder why it had to happen. Why did someone so young with such amazing talent, strength and the potential to carry on rising higher and higher, have to be taken from us? The lyrics swirl around in my head, saying more about the real Aaliyah than any media report could ever attempt. Her tragically shortened life followed the message from within one of her most famous songs, â€Å"If at first you don't succeed, dust yourself off and try again.† Aaliyah Dana Haughton was born on January 16th, 1979 in Brooklyn, New York. Her Grandmother would tell stories of how she was special straight out of the womb; born with a full head of hair. Aaliyah lived in Brooklyn for five years until, together with her parents and older brother, she was moved to Detroit where they could be closer to family. Her devoted mother gave up her teaching job to care for Rashad and Aaliyah full time. Aaliyah was introduced to music at a very young age; her mother would play Stevie Wonder, Marvin Gaye and other such legends while she worked around the house. It wasn't long before Aaliyah was joining in, having learnt all the words off by heart. She was just six years old when her talent for singing was recognized by her mother. Before she even started school, the services of a voice coach had been secured for her. Aaliyah spent most of her pre-teen years between singing in school plays and auditioning for various small television projects. At the tender age of only eight or nine she was charming people all around Michigan with her sweet, angelic voice, belting out songs during weddings. Aaliyah sang the very songs she listened to at home, while people sat in awe, eagerly anticipating the time her voice would mature to its full potential. Her first downfall came when she was just eleven years of age. Aaliyah landed a spot on the nationally syndicated talent show, Star Search. She chose to sing ‘My Funny Valentine†, a soul classic that she had often heard her mother singing, ‘That was my Mommy's song and I wanted to be like my Mommy' she said, remembering the experience during an interview. The high hopes she and her family had for victory where shattered when Aaliyah lost, and was ripped apart just as any other child would have been. However, without any falls no lessons could be learnt. With lots of encouragement from her mother, Aaliyah began to understand a prospect of great importance, one that would guide her through not only her musical career, but every aspect of her life. Never give up. It was only a matter of months before the bright, upcoming star was on the rise again. At the time her uncle, Barry Hankerson, was married to Gladys Knight. Some people slated Aaliyah for this, claiming she only got onto the music scene because she knew the right people, but without her outstanding talent, none of her future success would have been possible. Hankerson took his niece to perform with Gladys Knight for five nights at Bally's Las Vegas Casino. Here, the two would duet on Believe In Yourself and Aaliyah would sing solos. Remembering she was still only eleven at the time, she was nervous and hardly moved on the first night. Her aunt helped her, teaching Aaliyah how to work a crowd and loosen them up. Two years later came the meeting that would set Aaliyah's career on fire. Barry Hankerson introduced his niece to R. Kelly, a performer he was managing at the time. Kelly fell in love with her beautiful voice, going on to become her mentor. He ended up writing and producing all the tracks on her debut album, Age Ain't Nothing But A Number. And it wasn't – not many people can boast a completed album at just thirteen years of age. The process of selling the album began but, once again, expectations of Aaliyah were not fulfilled. Many record companies passed on the album – a setback very hard to take at such a vulnerable age. Her confidence was dented but her strength was not; Aaliyah was prepared to give things another go. Hankerson created his own label, Blackground Records especially for his niece. There was no way he was going to give up on her; she was far too special to let go. In 1994 the album was released, catching the world's attention. Her first single, Back And Forth reached number one on the R&B/Hip-Hop chart, dethroning her mentor. Other singles followed including At Your Best (You Are Love), Down With The Clique, and the adulterated title track. Her sound was new and fresh to the music world, her unique mystique captivating listeners. The artist herself liked to describe her music as ‘street but sweet'. With the success of her debut album Aaliyah's spirits soared. She had kept information about her age (she was just fifteen at the time) concealed, as she wanted her triumphs to be based solely on her talent. She did not seek any advantages because she was, ‘really good for someone so young'. Unfortunately her decision to withhold such facts was taken in the wrong way. Vicious rumors arose, slowing down album sales and threatening to thwart a prosperous career. The provocative nature of Age Ain't Nothing But A Number combined with a little bit of media imagination and the mystery of her age sparked a frenzy of stories about a relationship between Aaliyah and twenty-five-year-old R. Kelly. Tales of marriage and even pregnancy were spread. All were denied. The storm settled and three years passed, leaving many wondering what Aaliyah's next project would be. She teased fans with numerous guest appearances, singing songs from soundtracks and building them up for the time she would truly return, stronger then ever. Aaliyah left R. Kelly behind to prove, more to herself than to anyone else, that she had grown as an artist and could make it without him. Perhaps the rumors that had at one point looked like they could destroy her had in fact been a Godsend. Would Aaliyah have made this choice if tales of something more than a good friendship and working partnership between the two hadn't sprung up? Whatever her reasons, the change was for the best. She teamed up with the then unknown Missy Elliot and Timbaland and, between the three, a new sound was created, once again irresistible to fans. They blended rough Hip-Hop beats with Aaliyah's silky, laid-back vocals, the voice of an angel. The result was a sassy, sexy, sophomore album, One In A Million. The album went double platinum, putting her among the superstars of the music industry and silencing critics in their questions as to whether or not she had been just a ‘one hit wonder.' The first single from the album, If Your Girl Only Knew, went straight to number one on the R&B/Hip-Hop chart, followed by four other singles including the number one radio play title track. Aaliyah never let the fame go to her head. Between all her musical commitments she still found time for her family, friends and schoolwork. In June 1997 Miss Haughton graduated from the Detroit High School for the Fine and Performing arts, just one A-grade away from a perfect grade score. She had always set her sights so high and her determination paid off. She worked hard through hard times as well as the good, and brought her dreams to life. She truly was one in a million. It was time for Aaliyah to turn her attention to Hollywood. She began by sticking to her music, recording Journey To The Past for the Anastasia soundtrack and then the contagious, Grammy nominated, number one hit song, Are You That Somebody, from the Dr. Dolittle soundtrack. With that track, she really got a taste for the mainstream and took a hiatus from the music world to team up with Joanne Baron, an acting coach. With Baron's help, Aaliyah's talent for acting was revealed and, by 1999, she was flying to Vancouver to shoot her debut film, Romeo Must Die. She starred alongside Jet Li in the adrenalin-stoked/Hip-Hop action flick, in which she was the executive producer of the soundtrack. From this came Try Again, the song that followed the story of her life. The lyrics came straight from her heart, from the lessons she had learnt. These qualities took the single all the way, reaching number one on the Billboard Hot 100 singles chart, the first single ever to do so based on Airplay a lone. Romeo Must Die sparked rave reviews and her acting skills were soon sought throughout Hollywood. Her next film was the novel-based Queen Of The Damned. Baron recalls the memory of Aaliyah during the audition process, ‘She put her heart, her time, her love and her life into it. She just ripped it out.' It was her second starring role in just her second motion picture, displaying to the world she was more than just a crossover singer/actress. So much more. The release of the completed film was fervently awaited. Little did anyone know that Aaliyah wouldn't be there to witness its success. Whilst shooting Queen Of The Damned, Aaliyah simultaneously recorded her third, self-titled album. She was not put off or daunted by her doubled workload, choosing instead to put her all into both projects, as she had always done. Aaliyah was well aware of her presence, or lack of it, in the music world; it had been five years since the release of One In A Million. She released the dark, feisty, first single, We Need A Resolution, warming fans up, preparing them for what was to come. Aaliyah was released on July 17, debuted at number two in the charts and, in it's first week alone, sold over 200,000 copies. Blackground Records planned to release Rock The Boat and More Than A Woman as back-to-back singles; they were getting heavy rotational airplay and already an awesome response from listeners. It seemed nothing could stop her. It was August the 25th, 2001. Aaliyah had just finished shooting the island themed video for Rock The Boat in The Bahamas. Another video completed; another accomplishment. The set was laid-back and, together with the film crew and dancers, Aaliyah was enjoying herself, chatting, laughing and winding down. Her work done, Aaliyah decided to head home a day early, anxious to be with her beloved family before heading back to promote the album. Her parents and brother had always been there for her and it had been a while since she had managed to get back to them. The arrangements were made; she would leave that day along with eight others. The small Cessna 402 departed from the Marsh Harbour airport, bound for Opa-locka, Florida. It had been airborne for only a short while when, suddenly, it crashed. Six of the eight were killed instantly. Aaliyah was among them. Nobody knows just what it was that made the plane crash that day. Nobody could understand why it had to happen. Why Aaliyah, why someone so talented, so determined, so beautiful? There were so many questions and so few answers. At just twenty-two years of age Aaliyah, a daughter, a sister, a friend, a star, was gone. Disbelief, anger and, most of all, a great sense of sorrow and grief spread with the news. She had lived her life like an angel, fallen from the heavens. Through her life she rose and fell and now she had risen for the final time. We can only hope that, when the time came, she knew how much she was loved. Aaliyah will never be forgotten. Through her music and her memory, she will live on. The album in the CD player draws to a close. It is an album that she never saw released, an album that wouldn't even have been put together if she was still with us; a tribute to Aaliyah, I Care For You. Visions of her float by with the music and songs take on a whole new meaning now she's gone. When Miss You is played, instead of thinking of the singer's lost love, we think of ours, Aaliyah. Every note she sang was a part of her and with every song we understand more about her. She was a star in every sense of the word and I believe she continues to be so even now; still a star, shining brightly down on us. There is no doubt in my mind that this angel lived up to the true meaning of her name, ‘The highest, most exalted one.' The best. Aaliyah.

Saturday, November 9, 2019

Computerized Systems essays

Computerized Systems essays Starting in the late Twentieth Century, many companies started using computerized systems. Most of these companies started using these systems to save time and reduce costs. Even though these computerized systems are rather expensive, in the long run they saved companies money. The companies saved money by making or purchasing a computerized system by reducing paper usage and employee overtime. Since employees did not have to spend there time doing paper work, they could do their jobs faster and more efficiently. This gave the employees more time to do other projects around the office. One computerized system that saved employees time is automatic payroll. Instead of wasting time filling out paper time sheets, the employee could simply clock in at the beginning and end of each shift. Some companies like this idea because it can possibly reduce the number of employees needed in the payroll section of their company. Many aspects of the computerized system might take away some duties from the human employee. This can save the company a lot of money, but is very bad for employee morale. Management also benefits from the computerized system. Management is able make decisions much faster because the information they needed to make these decisions with is right there and could easily be accessed. There is no searching for documents or other files. The company can easily give access to certain parts of the computerized system to one group in the company and not the other. This way, information is kept private or public, depending of the company needs. It is not always the case that the companys employees and employers notice most of the benefits that a computerized system has. Some companies have many satisfied customers due to the fact that computerized systems were introduced into that company. Although many computerized systems were brought into companies in the late Twentieth century, some compan...

Wednesday, November 6, 2019

Mary Church Terrell - Womens Civil Rights Activist

Mary Church Terrell - Women's Civil Rights Activist Born Mary Eliza Church, Mary Church Terrell (September 23, 1863 – July 24, 1954) was a key pioneer in the intersectional movements for civil rights and suffrage. As both an educator and activist, she was an important figure in the advancement of the civil rights cause. Early Life Mary Church Terrell was born in Memphis, Tennessee, in 1863 - the same year that President Abraham Lincoln signed the Emancipation Proclamation. Both of her parents were former slaves who became successful in business: her mother, Louisa, owned a successful hair salon, and her father, Robert, became one of the first African-American millionaires in the South. The family lived in a mostly-white neighborhood, and the young Mary was protected in her early years from most experience of racism, even though, when she was three, her father was shot during the Memphis race riots of 1866. It was not until she was five, hearing stories from her grandmother about slavery, that she began to be conscious of African American history. Her parents divorced in 1869 or 1870, and her mother first had custody of both Mary and her brother. In 1873, the family sent her north to Yellow Springs and then Oberlin for school. Terrell split her summers between visiting her father in Memphis and her mother where she had moved, New York City. Terrell graduated from Oberlin College, Ohio, one of the few integrated colleges in the country, in 1884, where she had taken the gentlemans course rather than the easier, shorter womens program. Two of her fellow students, Anna Julia Cooper and Ida Gibbs Hunt, would become her lifelong friends, colleagues, and allies in the movement for racial and gender equality. Mary moved back to Memphis to live with her father. He had become wealthy, in part by buying up properties cheaply when people fled the yellow fever epidemic in 1878-1879. Her father opposed her working; however, when he remarried, Mary accepted a teaching position in Xenia, Ohio, and then another in Washington, DC. After completing her masters degree at Oberlin while living in Washington, she spent two years traveling in Europe with her father. In 1890, she returned to teach at a high school for black students in Washington, D.C. Family and Early Activism In Washington, Mary renewed her friendship with her supervisor at the school, Robert Heberton Terrell. They married in 1891. As was expected at the time, Mary left her employment upon marriage. Robert Terrell was admitted to the bar in 1883 in Washington and, from 1911 to 1925, taught law at Howard University. He served as a judge of the District of Columbia Municipal Court from 1902 to 1925. The first three children Mary bore died shortly after birth. Her daughter, Phyllis, was born in 1898, and the couple adopted their daughter Mary a few years later. In the meantime, Mary had become very active in social reform and volunteer work, including working with black womens organizations and for womens suffrage in the National American Woman Suffrage Association. Susan B. Anthony became a friend of hers. Mary also worked for kindergartens and child care, especially for children of working mothers. Mary entered activism more fiercely after the 1892 lynching of her friend Thomas Moss, a black business owner who was attacked by white businessmen for competing with their businesses. Her theory of activism was based on the idea of uplift, or the idea that discrimination could be tackled by social advancement and education, with the belief that the advancement of one member of the community could advance the whole community. Excluded from full participation in planning with other women for activities at the 1893 Worlds Fair, Mary instead threw her efforts into building up black womens organizations that would work to end both gender and racial discrimination. She helped engineer the merger of black womens clubs to form the National Association of Colored Women (NACW) in 1896. She was its first president, serving in that capacity until 1901, when she was appointed honorary president for life. Founder and Icon During the 1890s, Mary Church Terrells increasing skill in and recognition for public speaking led her to take up lecturing as a profession. She became a friend of and worked with W.E.B. DuBois, and he invited her to become one of the charter members when the NAACP was founded. Mary Church Terrell also served on the Washington, DC, school board, from 1895 to 1901 and again from 1906 to 1911, the first African American woman to serve on that body. Her success in that post was rooted in her earlier activism with the NACW and its partner organizations, which worked on education initiatives focused on black women and children, from nurseries to adult women in the workforce. In 1910, she helped found the College Alumni Club or College Alumnae Club. In the 1920s, Mary Church Terrell worked with the Republican National Committee on behalf of women and African Americans. She voted Republican until 1952, when she voted for Adlai Stevenson for president. Though Mary was able to vote, many other black men and women were not, due to laws in the South that essentially disenfranchised black voters. Widowed when her husband died in 1925, Mary Church Terrell continued her lecturing, volunteer work, and activism, briefly considering a second marriage. Activist Until The End Even as she entered retirement age, Mary continued her work for womens rights and race relations. In 1940, she published her autobiography, A Colored Woman in a White World, which described her personal experiences with discrimination. In her last years, she picketed and worked in the campaign to end segregation in Washington, D.C., where she joined the fight against restaurant segregation despite already being in her mid-eighties. Mary lived to see this fight won in their favor: in 1953, the courts ruled that segregated eating places were unconstitutional. Mary Church Terrell died in 1954, just two months after the Supreme Court decision in Brown v. Board of Education, a fitting bookend to her life which began just after the signing of the Emancipation Proclamation and which focused on education as a key means of advancing the civil rights she spent her life fighting for. Mary Church Terrell Fast Facts Born: September 23, 1863 in Memphis, TennesseeDied: July 24, 1954 in Annapolis, MarylandSpouse: Robert Heberton Terrell (m. 1891-1925)Children: Phyllis (only surviving biological child) and Mary (adopted daughter)Key Accomplishments: An early civil rights leader and womens rights advocate, she was one of the first African-American women to earn a college degree. She went on to be a founder of National Association of Colored Women and a charter member of the NAACPOccupation: educator, activist, professional lecturer Sources Church, Mary Terrell. A Colored Woman in a White World. Washington, DC: Ransdell, Inc. Publishers, 1940.Jones, B. W. Mary Church Terrell and the National Association of Colored Women: 1986-1901,  The Journal of Negro History, vol. 67 (1982),  20–33.Michals, Debra. Mary Church Terrell. National Womens History Museum, 2017, https://www.womenshistory.org/education-resources/biographies/mary-church-terrell