Wednesday, November 27, 2019

The Internet Is A Method Of Communication And A Source Essays

The Internet is a method of communication and a source of information that is becoming more popular among those who are interested in, and have the time to surf the information superhighway. The problem with this much information being accessible to this many people is that some of it is deemed inappropriate for minors. The government wants censorship, but a segment of the population does not. Legislative regulation of the Internet would be an appropriate function of the government. The Communications Decency Act is an amendment which prevents the information superhighway from becoming a computer "red light district." On June 14, 1995, by a vote of 84-16, the United States Senate passed the amendment. It is now being brought through the House of Representatives.1 The Internet is owned and operated by the government, which gives them the obligation to restrict the materials available through it. Though it appears to have sprung up overnight, the inspiration of free-spirited hackers, it in fact was born in Defense Department Cold War projects of the 1950s.2 The United States Government owns the Internet and has the responsibility to determine who uses it and how it is used. The government must control what information is accessible from its agencies. This material is not lawfully available through the mail or over the telephone, there is no valid reason these perverts should be allowed unimpeded on the Internet. Since our initiative, the industry has commendably advanced some blocking devices, but they are not a substitute for well-reasoned law.4 Because the Internet has become one of the biggest sources of information in this world, legislative safeguards are imperative. The government gives citizens the privilege of using the Internet, but it has never given them the right to use it. They seem to rationalize that the framers of the constitution planned & plotted at great length to make certain that above all else, the profiteering pornographer, the pervert and the pedophile must be free to practice their pursuits in the presence of children on a taxpayer created and subsidized computer network.3 People like this are the ones in the wrong. Taxpayer's dollars are being spent bringing obscene text and graphics into the homes of people all over the world. The government must take control to prevent pornographers from using the Internet however they see fit because they are breaking laws that have existed for years. Cyberpunks, those most popularly associated with the Internet, are members of a rebellious society that are polluting these networks with information containing pornography, racism, and other forms of explicit information. When they start rooting around for a crime, new cybercops are entering a pretty unfriendly environment. Cyberspace, especially the Internet, is full of those who embrace a frontier culture that is hostile to authority and fearful that any intrusions of police or government will destroy their self-regulating world.5 The self-regulating environment desired by the cyberpunks is an opportunity to do whatever they want. The Communications Decency Act is an attempt on part of the government to control their "free attitude" displayed in homepages such as "Sex, Adult Pictures, X-Rated Porn", "Hot Sleazy Pictures (Cum again + again)" and "sex, sex, sex. heck, it's better even better than real sex"6. "What we are doing is simply making the same laws, held constitutional time and time again by the courts with regard to obscenity and indecency through the mail and telephones, applicable to the Internet."7 To keep these kinds of pictures off home computers, the government must control information on the Internet, just as it controls obscenity through the mail or on the phone. Legislative regulations must be made to control information on the Internet because the displaying or distribution of obscene material is illegal. The courts have generally held that obscenity is illegal under all circumstances for all ages, while "indecency" is generally allowable to adults, but that laws protecting children from this "lesser" form are acceptable. It's called protecting those among us who are children from the vagrancies of adults.8 The constitution of the United States has set regulations to determine what is categorized as obscenity and what is not. In Miller vs. California, 413 U.S. at 24-25, the court announced its "Miller Test" and held, at 29, that its three part test constituted "concrete guidelines to isolate 'hard core' pornography from expression protected by the First Amendment.9 By laws previously set by the government, obscene pornography should not be accessible on the Internet. The government must police the Internet because people are breaking laws. "Right now, cyberspace is like a neighborhood without a police department."10 Currently anyone can put anything he wants on the Internet with no penalties. "The Communications Decency Act gives law enforcement new tools to prosecute those who would use a computer to make the equivalent of obscene telephone calls, to prosecute 'electronic

Sunday, November 24, 2019

Delphi Thread Pool Example Using AsyncCalls

Delphi Thread Pool Example Using AsyncCalls This is my next test project to see what threading library for Delphi would suite me best for my file scanning task I would like to process in multiple threads / in a thread pool. To repeat my goal: transform my sequential file scanning of 500-2000 files from the non threaded approach to a threaded one. I should not have 500 threads running at one time, thus would like to use a thread pool. A thread pool is a queue-like class feeding a number of running threads with the next task from the queue. The first (very basic) attempt was made by simply extending the TThread class and implementing the Execute method (my threaded string parser). Since Delphi does not have a thread pool class implemented out of the box, in my second attempt Ive tried using OmniThreadLibrary by Primoz Gabrijelcic. OTL is fantastic, has zillion ways to run a task in a background, a way to go if you want to have fire-and-forget approach to handing threaded execution of pieces of your code. AsyncCalls by Andreas Hausladen Note: what follows would be more easy to follow if you first download the source code. While exploring more ways to have some of my functions executed in a threaded manner Ive decided to also try the AsyncCalls.pas unit developed by Andreas Hausladen. Andys AsyncCalls – Asynchronous function calls unit is another library a Delphi developer can use to ease the pain of implementing threaded approach to executing some code. From Andys blog: With AsyncCalls you can execute multiple functions at the same time and synchronize them at every point in the function or method that started them. ... The AsyncCalls unit offers a variety of function prototypes to call asynchronous functions. ... It implements a thread pool! The installation is super easy: just use asynccalls from any of your units and you have instant access to things like execute in a separate thread, synchronize main UI, wait until finished. Beside the free to use (MPL license) AsyncCalls, Andy also frequently publishes his own fixes for the Delphi IDE like Delphi Speed Up and DDevExtensions Im sure youve heard of (if not using already). AsyncCalls In Action source code HTML In essence, all AsyncCall functions return an IAsyncCall interface that allows to synchronize the functions. IAsnycCall exposes the following methods: //v 2.98 of asynccalls.pas IAsyncCall interface //waits until the function is finished and returns the return value function Sync: Integer; //returns True when the asynchron function is finished function Finished: Boolean; //returns the asynchron functions return value, when Finished is TRUE function ReturnValue: Integer; //tells AsyncCalls that the assigned function must not be executed in the current threa procedure ForceDifferentThread; end; Heres an example call to a method expecting two integer parameters (returning an IAsyncCall): TAsyncCalls.Invoke(AsyncMethod, i, Random(500)); function TAsyncCallsForm.AsyncMethod(taskNr, sleepTime: integer): integer; begin result : sleepTime; Sleep(sleepTime); TAsyncCalls.VCLInvoke( procedure begin Log(Format(done nr: %d / tasks: %d / slept: %d, [tasknr, asyncHelper.TaskCount, sleepTime])); end); end; The TAsyncCalls.VCLInvoke is a way to do synchronization with your main thread (applications main thread - your application user interface). VCLInvoke returns immediately. The anonymous method will be executed in the main thread. Theres also VCLSync which returns when the anonymous method was called in the main thread. Thread Pool in AsyncCalls An execution request is added to the waiting-queue when an async. function is started...If the maximum thread number is already reached the request remains in the waiting-queue. Otherwise a new thread is added to the thread pool. Back to my file scanning task: when feeding (in a for loop) the asynccalls thread pool with series of TAsyncCalls.Invoke() calls, the tasks will be added to internal the pool and will get executed when time comes (when previously added calls have finished). Wait All IAsyncCalls To Finish The AsyncMultiSync function defined in asnyccalls waits for the async calls (and other handles) to finish. There are a few overloaded ways to call AsyncMultiSync, and heres the simplest one: function AsyncMultiSync(const List: array of IAsyncCall; WaitAll: Boolean True; Milliseconds: Cardinal INFINITE): Cardinal; dynamic array If I want to have wait all implemented, I need to fill in an array of IAsyncCall and do AsyncMultiSync in slices of 61. My AsnycCalls Helper two dimensional array Heres a piece of the TAsyncCallsHelper: WARNING: partial code! (full code available for download) uses AsyncCalls; type TIAsyncCallArray array of IAsyncCall; TIAsyncCallArrays array of TIAsyncCallArray; TAsyncCallsHelper class private fTasks : TIAsyncCallArrays; property Tasks : TIAsyncCallArrays read fTasks; public procedure AddTask(const call : IAsyncCall); procedure WaitAll; end; WARNING: partial code! procedure TAsyncCallsHelper.WaitAll; var i : integer; begin for i : High(Tasks) downto Low(Tasks) do begin AsyncCalls.AsyncMultiSync(Tasks[i]); end; end; This way I can wait all in chunks of 61 (MAXIMUM_ASYNC_WAIT_OBJECTS) - i.e. waiting for arrays of IAsyncCall. With the above, my main code to feed the thread pool looks like: procedure TAsyncCallsForm.btnAddTasksClick(Sender: TObject); const nrItems 200; var i : integer; begin asyncHelper.MaxThreads : 2 * System.CPUCount; ClearLog(starting); for i : 1 to nrItems do begin asyncHelper.AddTask(TAsyncCalls.Invoke(AsyncMethod, i, Random(500))); end; Log(all in); //wait all //asyncHelper.WaitAll; //or allow canceling all not started by clicking the Cancel All button: while NOT asyncHelper.AllFinished do Application.ProcessMessages; Log(finished); end; Cancel all? - Have To Change The AsyncCalls.pas :( I would also like to have a way of cancelling those tasks that are in the pool but are waiting for their execution. Unfortunately, the AsyncCalls.pas does not provide a simple way of canceling a task once it has been added to the thread pool. Theres no IAsyncCall.Cancel or IAsyncCall.DontDoIfNotAlreadyExecuting or IAsyncCall.NeverMindMe. For this to work I had to change the AsyncCalls.pas by trying to alter it as less as possible - so that when Andy releases a new version I only have to add a few lines to have my Cancel task idea working. Heres what I did: Ive added a procedure Cancel to the IAsyncCall. The Cancel procedure sets the FCancelled (added) field which gets checked when the pool is about to start executing the task. I needed to slightly alter the IAsyncCall.Finished (so that a call reports finished even when cancelled) and the TAsyncCall.InternExecuteAsyncCall procedure (not to execute the call if it has been cancelled). You can use WinMerge to easily locate differences between Andys original asynccall.pas and my altered version (included in the download). You can download the full source code and explore. Confession NOTICE! :) 2.99 version of AsyncCalls The CancelInvocation method stopps the AsyncCall from being invoked. If the AsyncCall is already processed, a call to CancelInvocation has no effect and the Canceled function will return False as the AsyncCall wasnt canceled. The Canceled method returns True if the AsyncCall was canceled by CancelInvocation. The Forget method unlinks the IAsyncCall interface from the internal AsyncCall. This means that if the last reference to the IAsyncCall interface is gone, the asynchronous call will be still executed. The interfaces methods will throw an exception if called after calling Forget. The async function must not call into the main thread because it could be executed after the TThread.Synchronize/Queue mechanism was shut down by the RTL what can cause a dead lock. no need to use my altered version Note, though, that you can still benefit from my AsyncCallsHelper if you need to wait for all async calls to finish with asyncHelper.WaitAll; or if you need to CancelAll.

Thursday, November 21, 2019

The Role of International Employer Branding Research Paper

The Role of International Employer Branding - Research Paper Example Every organization needs to hire efficient people and with the different pressures that currently prevail in business industries; there is a need for employers to treat their employees with care and rationality. Strong management of employer brand has been the concern of business organizations more when expectations from the working employees are severe in nature (Barrow and Mosley). The concept of employer branding includes attention and consideration of the values of people. Through employer branding, organizations tend to express their values more such that the goals and objectives of the organizations may be managed in the right directions (Sparrow, Brewster and Harris, 118). Studies reveal that the most important expectations of employer branding include ease in attracting candidates, recognition as employer of choice, increased rates of retention, shortened time-to-fill, delivery of vision and values program, higher job acceptance rate, increase in number of unsolicited resumes , setting a standard and framework for all HR activity, increased appreciation for people activity among wider business, benefits to the service delivered to commercial customers, and large number of internal fills (Rosethorn, 63). The present study considers all these factors and focuses on an understanding of employer branding at an international level. 2. Definitions: While considering a study on employer branding, it is essential to understand its meaning and the key issues associated with it in terms of its use within business organizations. 2.1. Defining Key Issues of Employer Branding: There are certain key issues that define the role of employer branding in an organization. The most significant issues include the mandatories, objectives, process description of creating an employer brand, and discussion of the issues. Employer branding needs to take the responsibilities of coordination among the HR departments and employees, the reduction of cultural differences, the strategi c approach to long term economic benefits and incorporation of innovative research methods. The objectives in this regard involve presenting the employer in the best manner, ascertain confidence, direction and exclusivity, enhance contentment, enthusiasm and identity of working employees, and promote the USP of the organization. The process description involves planning, description and leadership issues being handled by employer branding (Wimmers, 14-15). Employer brand effectively considers the issues arising from the relationship of the employer and the employees. Thus it includes the experiences of all working employees and their expectations from their employer, involving issues like compensations, working environment, opportunities for growth, type of products and types of customers, as well as the expectations that an employer might have from its employees (Praeger, 82). 2.2. Brand Identity: The image or identity of a brand represents the perception of customers and employers in their minds about a particular brand. A brand identity is a message that is communicated to the world about itself by means of advertisement, forms of products, name, visuals, and other signs and symbols. It is essential in this regard to focus on what people are considering to be the message about the brand and what the actual message is since the perceptions might differ