Saturday, March 21, 2020
Does alcohol have as much of a focus as drug addiction in UK essays
Does alcohol have as much of a focus as drug addiction in UK essays Alcohol is the most commonly used drug in Britain with only 7 per cent of men and 13 per cent of women describing themselves as non-drinkers (Joseph Rowntree Foundation, 2000: 6). When considered in population terms, alcohol is a more important risk factor for antisocial behaviour than are other drugs because it is more frequently taken in excess (Rutter et al, 1998: 154). Most people consume alcohol socially and moderately; however there are some who drink heavily, with not just adverse physical and psychological effects for themselves. It has been estimated that alcohol misuse contributes to 40% of violent crime, 78% of assaults and 88% of criminal damage cases (Deehan, 1999: 1). Coupled with reports that 28% of all offenders seen by the probation service have alcohol problems compared with 12% with drug problems (Alcohol Concern, 1999: 16), it would seem that alcohol has a larger part to play in crime than the misuse of drugs. However, the Government has invested heavily in drug use prevention - 94 million per year - but has seemingly neglected the issue of alcohol misuse, spending as little as 1 million per year on promoting prevention and treatment (Dean, 2000). Add to this a lack of true alcohol-related crime figures, with only specific drink-driving offences having a recorded statistic; until recent Home Office guidance, an absence of an ade quate definition of an alcohol-related incident (Alcohol Concern, 1999: 14); and the creation of a community order specifically for drug misusing offenders and not alcohol misusers (the Drug Treatment and Testing Order, or DTTO) and it would seem that alcohol has been left to take a back seat in the Governments agenda. To try and ascertain whether alcohol is the forgotten issue in the Criminal Justice System (CJS), this essay will be examining (albeit briefly) the relationship between alcohol ...
Thursday, March 5, 2020
Start Programming C With raspberry Pi
Start Programming C With raspberry Pi This set of instructions wont suit everybody but Ill try to be as generic as possible. I installed the Debian Squeeze distribution, so the programming tutorials are based on that. Initially, Im starting off by compiling programs on the Raspi but given its relative slowness to any PC in the last ten years, its probably best to switch to developing on another PC and copying the executables over. Ill cover that in a future tutorial, but for now, its about compiling on the Raspi. Preparing for Developing The starting point is you have a Raspi with a working distribution. In my case, its Debian Squeeze which I burnt with instructions from the RPI Easy SD Card Setup. Make sure you bookmark the Wiki as its got tons of useful stuff. If your Raspi has booted and youve logged in (username pi, p/w raspberry) then type gcc - v at the command line. Youll see something like this: Using built-in specs.Target: arm-linux-gnueabiConfigured with: ../src/configure -v with-pkgversionDebian 4.4.5-8 with-bugurlfile:///usr/share/doc/gcc-4.4/README.Bugsenable-languagesc,c,fortran,objc,obj-c prefix/usr program-suffix-4.4 enable-shared enable-multiarch enable-linker-build-idwith-system-zlib libexecdir/usr/lib without-included-gettext enable-threadsposix with-gxx-include-dir/usr/include/c/4.4 libdir/usr/libenable-nls enable-clocalegnu enable-libstdcxx-debug enable-objc-gc disable-sjlj-exceptions enable-checkingrelease buildarm-linux-gnueabihostarm-linux-gnueabi targetarm-linux-gnueabiThread model: posixgcc version 4.4.5 (Debian 4.4.5-8) Install Samba One of the first things I did and recommend to you if you have a Windows PC on the same network as your Raspi is to install and setup Samba so you can access the Raspi. Then I issued this command: gcc -v l.txt To get the above listing into the file l.txt that I could view and copy on my Windows PC. Even if you are compiling on the Raspi, you can edit source code from your Windows box and compile on the Raspi. You cant just compile on your Windows box using say MinGW unless your gcc is configured to output ARM code. That can be done but lets learn to walk first and learn how to compile and run programs on the Raspi. Read up on Cygwin and MinGW. GUI or Terminal Ill assume that you are new to Linux, so apologies if you know it already. You can do most of the work from the Linux terminal ( command line). But it can be easier if you fire up the GUI (Graphical User Interface) to have a look around the file system. Type startx to do that. The mouse cursor will appear and you can click in the bottom left-hand corner (it looks like a mountain( to see the menus. Click on Accessories and run File Manager to let you view folders and files. You can close it down any time and return to the terminal by clicking the little red button with a white circle in the bottom right-hand corner. Then click on Logout to return to the command line. You may prefer to have the GUI open all the time. When you want a terminal click the bottom left button then click Other on the menu and Terminal. In the Terminal, you can close it by typing Exit or click the Windows like x in the top right-hand corner. Folders The Samba instructions on the Wiki tell you how to setup a public folder. Its probably best to do that. Your home folder (pi) will be readonly and you want to write to the public folder. I created a sub-folder in public called code and created the hello.c file listed below in it from my Windows PC. If you prefer to edit on the PI, it comes with a text editor called Nano. You can run it from the GUI on the other menu or from the terminal by typing sudo nanosudo nano hello.c The sudo elevates nano so it can write files with root access. You can run it just as nano, but in some folders that wont give you write access and you wont be able to save files so running things with sudo is usually best. Hello World Heres the code: #includeint main() {printf(Hello World\n);return 0;} Now type in gcc -o hello hello.c and it will compile in a second or two. Take a look at the files in the terminal by typing in ls -al and youll see a file listing like this: drwxrwxx 2 pi users 4096 Jun 22 22:19 .drwxrwxr-x 3 root users 4096 Jun 22 22:05 ..-rwxr-xr-x 1 pi pi 5163 Jun 22 22:15 hello-rw-rw 1 pi users 78 Jun 22 22:16 hello.c and type in ./hello to execute the compiled program and see Hello World. That completes the first of the programming in C on your Raspberry Pi tutorials. Into games programming in C? Try our free Games programming in C Tutorials.
Subscribe to:
Posts (Atom)