Need help writing startupItem/launchd for dansguardian

Hey there,
i want to write a startupitem for dansguardian (or should i use launchd?).
i am quite new to this stuff, but thinking positive! the problem is i don't really know which file exactly starts dansguardian. there is a unix-executable in usr/local/sbin/dansguardian which i can use to start dansguardian through
sudo /usr/local/sbin/dansguardian
in terminal. without sudo it won't work, i then get a message saying
vierstein$ /opt/local/sbin/dansguardian; exit
Unable to setgid()
logout
i can manage dansguardian through a webinterface called webmin and i can easily start and stop it there through a link.
i did not figure out yet how the dansguardian webmin module starts/stops it and which files/commands it uses to do that..
how can i write a startup script for dansguardian, because doing it manually is a bit laborious. i am a bit desperate here, have been trying so many things during the last two days and i'm really stuck. hopefully somebody here knows a way to do this.
the following code I put in a file called DansGuardian in /Library/StartupItems/Dansguardian - the file is a unix-executable
#! /bin/sh
# DansGuardian Filter
. /etc/rc.common
StartService ()
if [ "${DGSQUID:=-NO-}" = "-YES-" ]; then
CheckForNetwork
if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
ConsoleMessage "Starting DansGuardian Content Filter"
/usr/local/sbin/dansguardian -s
fi
StopService ()
/usr/local/sbin/dansguardian -q
RestartService ()
/usr/local/sbin/dansguardian -r
RunService "$1"
my StartupParameters.plist file in the same folder says
Description = "DansGuardian Content Filter";
Provides = ("Content Filter");
Requires = ("Web Proxy");
OrderPreference = "None";
after rebooting i get this in console
SystemStarter[55]: The following StartupItems were not attempted due to failure of a required service:
SystemStarter[55]: /Library/StartupItems/DansGuardian
it would be great if somebody here knew how to do this right

in case somebody else is looking for an answer on this, here is the working launchd script. i did not write it myself though..
put the following code in
/Library/LaunchDaemons/org.dansguardian.dansguardian.plist
change the "Program" string to point to your binary, and the "WatchPaths" as well. The way this one works is that it waits until Squid is launched before it starts. That's what the WatchPath does - it looks for Squid's PID file to be created, and then launches DansGuardian.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.dansguardian.dansguardian</string>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>root</string>
<key>GroupName</key>
<string>nogroup</string>
<key>Program</key>
<string>/opt/dansguardian/sbin/dansguardian</string>
<key>ProgramArguments</key>
<array>
<string>dansguardian</string>
<string>-N</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>OnDemand</key>
<false/>
<key>WatchPaths</key>
<array>
<string>/opt/squid/var/logs/squid.pid</string>
</array>
<key>Umask</key>
<integer>027</integer>
<key>ServiceDescription</key>
<string>The DansGuardian Content Filter Daemon</string>
</dict>
</plist>

Similar Messages

  • Need help writing a query for following scenario

    Hi all, I need some help writing a query for the following case:
    One Table : My_Table
    Row Count: App 5000
    Columns of Interest: AA and BB
    Scenario: AA contains some names of which BB contains the corresponding ID. Some
    names are appearing more than once with different IDs. For example,
    AA BB
    Dummy 10
    Me 20
    Me 30
    Me 40
    You 70
    Me 50
    Output needed: I need to write a query that will display only all the repeating names with their corresponding IDs excluding all other records.
    I would appreciate any input. Thanks

    Is it possible to have a records with the same values for AA and BB? Are you interested in these rows or do you only care about rows with the same value of AA and different BB?
    With a slight modification of a previous posting you can only select those rows that have distinct values of BB for the same value of AA
    WITH t AS (
    SELECT 'me' aa, 10 bb FROM dual
    UNION ALL
    SELECT 'me' aa, 20 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    UNION ALL
    SELECT 'you' aa, 30 bb FROM dual
    SELECT DISTINCT aa, bb
      FROM (SELECT aa, bb, COUNT(DISTINCT bb) OVER(PARTITION BY aa) cnt FROM t)
    WHERE cnt > 1;

  • Need help writing StartupItem(or launchd?) for dansguardian

    Hey there,
    i have successfully set up squid and dansguardian (what a pain that was, haha!!!!!) and got squid to launch as a daemon at startup. i am quite new to this stuff, but thinking positive! i manage squid and dansguardian through webmin. i can easily start dansguardian through webmin and i can also start it by doing.
    sudo /usr/local/sbin/dansguardian
    in terminal. it's a unix-executable
    without sudo it says
    Viersteins-Power-Mac-G5:~ vierstein$ /opt/local/sbin/dansguardian; exit
    Unable to setgid()
    logout
    i did not figure out yet how the dansguardian webmin module starts/stops dansguardian and which files it uses to do that..
    now to finish all this i need to write a startup script for dansguardian, because doing it manually is a bit laborious. i am a bit desperate here, have been trying so many things during the last two days and i'm really stuck. hopefully somebody here knows a way to do this.
    the following code I put in a file called DansGuardian in /Library/StartupItems/Dansguardian - the file is a unix-executable
    #! /bin/sh
    # DansGuardian Filter
    . /etc/rc.common
    StartService ()
    if [ "${DGSQUID:=-NO-}" = "-YES-" ]; then
    CheckForNetwork
    if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
    ConsoleMessage "Starting DansGuardian Content Filter"
    /usr/local/sbin/dansguardian -s
    fi
    StopService ()
    /usr/local/sbin/dansguardian -q
    RestartService ()
    /usr/local/sbin/dansguardian -r
    RunService "$1"
    my StartupParameters.plist file in the same folder says
    Description = "DansGuardian Content Filter";
    Provides = ("Content Filter");
    Requires = ("Web Proxy");
    OrderPreference = "None";
    after rebooting i get this in console
    SystemStarter[55]: The following StartupItems were not attempted due to failure of a required service:
    SystemStarter[55]: /Library/StartupItems/DansGuardian
    it would be great if somebody here knew how to do this:)

    (copy&paste from http://discussions.apple.com/thread.jspa?threadID=2094011&messageID=9887461#9887 461 )
    in case somebody else is looking for an answer on this, here is the working launchd script. i did not write it myself though..
    put the following code in
    /Library/LaunchDaemons/org.dansguardian.dansguardian.plist
    change the "Program" string to point to your binary, and the "WatchPaths" as well. The way this one works is that it waits until Squid is launched before it starts. That's what the WatchPath does - it looks for Squid's PID file to be created, and then launches DansGuardian.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.dansguardian.dansguardian</string>
    <key>Disabled</key>
    <false/>
    <key>UserName</key>
    <string>root</string>
    <key>GroupName</key>
    <string>nogroup</string>
    <key>Program</key>
    <string>/opt/dansguardian/sbin/dansguardian</string>
    <key>ProgramArguments</key>
    <array>
    <string>dansguardian</string>
    <string>-N</string>
    </array>
    <key>RunAtLoad</key>
    <false/>
    <key>OnDemand</key>
    <false/>
    <key>WatchPaths</key>
    <array>
    <string>/opt/squid/var/logs/squid.pid</string>
    </array>
    <key>Umask</key>
    <integer>027</integer>
    <key>ServiceDescription</key>
    <string>The DansGuardian Content Filter Daemon</string>
    </dict>
    </plist>

  • Need help writing a code for this program

    Design a code that reads a sentence and prints each individual word on a different line

    tsith's suggestion is excellent. Run it and see what happens. I just did that myself and doing so I learned something new about the Scanner class.
    Before you run it, add a couple of extra System.out.println for (hopefully) illustrating debugging purposes:
    import java.lang.String;
    import java.util.Scanner;
    public class Sentence {
        // main line of program
        public static void main(String[] args) {
            boolean z;
            String a;
            Scanner keyboard = new Scanner(System.in);
            System.out.print("Enter sentence: ");
            z = keyboard.hasNext();
            while (z) {
                System.out.println("z = " + z + ". Fetching the next word...");
                a = keyboard.next();
                System.out.println(a);
            System.out.println("Done!");
    }Let us know if the program ever prints "Done!" to the console. While you are waiting, read what the javadocs has to say about the Scanner class, and pay extra attention to what it says about the hasNext() and next() methods:
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

  • Need help writing correct code for nested button

    This is the code on the main timeline.
    stop();
    garage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
        gotoAndPlay("open");
    The movieClip gDoor is nested inside of garage and "open" is a label on that timeline.  I know the gotoAndPlay("open"); isn't correct.  How would i target the label on the nested timeline.
    the link below is to dowload the fla
    clienttestsite.x10.mx/beta/garage.fla

    The problem is that you have an event listener assigned to the garage, which is blocking/overriding interaction with anything inside of it.  When you click on the chest's button, you are still clicking on the garage, which does the gotoAndPlay("open")... where it stops at the stop();
    One way to get around this is to assign an instance name to the door and assign the opening code to that....
    stop();
    garage.door.addEventListener(MouseEvent.CLICK, openHandler);
    function openHandler(event:MouseEvent):void{
       garage.play();
    garage.chest.closeBtn.addEventListener(MouseEvent.CLICK, closeHandler);
    function closeHandler(event:MouseEvent):void{
       garage.gotoAndPlay("close");
    Notes: as shown in the code above...
    - use CLICK instead of MOUSE_DOWN.
    - in the openHandler use play() instead of gotoAndPlay("open"). You are already in the "open" frame, and it is only because the stop() is used up that it actuallys works.
    Doing what I explain above also makes it so that you can click the door to close things as well.

  • Need help writing host program using LabView.

    Need help writing host program using LabView.
    Hello,
    I'm designing a HID device, and I want to write a host program using National Instrument's LabView. NI doesn't have any software support for USB, so I'm trying to write a few C dll files and link them to Call Library Functions. NI has some documentation on how to do this, but it's not exactly easy reading.
    I've written a few C console programs (running Win 2K) using the PC host software example for a HID device from John Hyde's book "USB by design", and they run ok. From Hyde's example program, I've written a few functions that use a few API functions each. This makes the main program more streamlined. The functions are; GetHIDPath, OpenHID, GetHIDInfo, Writ
    eHID, ReadHIC, and CloseHID. As I mentioned, my main program runs well with these functions.
    My strategy is to make dll files from these functions and load them into LabView Call Library Functions. However, I'm having a number of subtle problems in trying to do this. The big problem I'm having now are build errors when I try to build to a dll.
    I'm writing this post for a few reasons. First, I'm wondering if there are any LabView programmers who have already written USB HID host programs, and if they could give me some advice. Or, I would be grateful if a LabView or Visual C programmer could help me work out the programming problems that I'm having with my current program. If I get this LabView program working I would be happy to share it. I'm also wondering if there might already be any USB IHD LabView that I could download.
    Any help would be appreciated.
    Regards, George
    George Dorian
    Sutter Instruments
    51 Digital DR.
    Novato, CA 94949
    USA
    [email protected]
    m
    (415) 883-0128
    FAX (415) 883-0572

    George may not answer you.  He hasn't been online here for almost eight years.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Need help writing small program!

    Hi. I'm learning Java programming, and I need help writing a small program. Please someone help me.
    Directions:
    Create a program called CerealCompare using an if-then-else structure that obtains the price and number of ounces in a box for two boxes of cereal. The program should then output which box costs less per ounce.

    class CerealCompare {
        public static void main(String[] args) {
            // your code goes here
    }Hope that helps.
    P.S. Java does not have an if-then-else statement.

  • Need Help Writing Server side to submit form via API

    Hey
    I need help writing a serverside application to submit
    information via API to a separate server.
    I have a client that uses constant contact for email
    campaigns. We want to add to her website a form taht submits the
    information needed to subscribe to her email list, to constant
    contact via API.
    FORM.asp :: (i got this one under control)
    name
    email
    and submits to serverside.asp
    SERVERSIDE.ASP
    In serverside.asp i need to have
    the API URL
    (https://api.constantcontact.com/0.1/API_AddSiteVisitor.jsp)
    username (of the constant contact account)
    password (of the constant contact account)
    name (submited from form.asp)
    email (submitted from form.asp)
    redirect URL (confirm.asp)
    Can anyone help get me going in the right direction?
    i have tried several things i found on the net and just cant
    get anyone to work correctly.
    One main issue i keep having is that if i get it to submit to
    the API url correctly - i get a success code, it doesnt redirect to
    the page i am trying to redirect to.
    ASP or ASP.NET code would be find.
    THANKS
    sam

    > This does require server side programming.
    > if you dont know what that is, then you dont know the
    answer to my question. I
    > know what i need to do - i just dont know HOW to do it.
    If you are submitting a form to a script on a remote server,
    and letting
    that script load content to the browser, YOU have no control
    over what it
    loads UNLESS there is some command you can send it that it
    will understand.
    No amount of ASP on your server is going to change what the
    remote script
    does.
    http://www.constantcontact.com/services/api/index.jsp
    they only allow their customers to see the instructions for
    the API so i
    can't search to see IF there is a redirect you can send with
    the form info.
    But posts on their support board say that there is.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Need help in developing BADI for IT0001

    Hi All,
    I need help in developing BADI for IT0001.
    On IT0001 create or change, there is need to update IT0017 with following data from IT0001
    -Company Code
    -Cost center
    -Business Area
    -Begin and End Date.
    Other fields from IT0017 need to be derived from Position and update in IT0017.
    Please guide me how I can address this. I do not want to go for dynamic action, as it is not getting evoked during background jobs.
    I am new to BADI development and will appreciate step by step instructions.
    Thanks

    Hi,
         follow the below steps to achive
    Steps:
    1.     Execute Business Add-In(BADI) transaction SE18
    2.     Enter BADI name i.e. HRPAD00INFTY and press the display
            button
    3.     Select menu option Implementation->Create
    4.     Give implementation a name such as Z_HRPAD00INFTY
    5.      You can now make any changes you require to the BADI within this
            implementation, for example choose the Interface tab there are 3 methods avialble
    6.     Double click on the method you want to change, you can now enter
            any code you require.
    7.      Please note to find out what import and export parameters a
            method has got return the original BADI definition
            (i.e. HRPAD00INFTY) and double click on the method name
            for example within HRPAD00INFTY contract is a method
    8.      When changes have been made activate the implementation
    <b>Reward points</b>
    Regards

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • I need help scrolling and highlighting for a vast amount of pics that I'm trying to transfer. I have a macbook pro osx 10.5.8

    I need help scrolling and highlighting for a vast amount of pics that I'm trying to transfer. I have a macbook pro osx 10.5.8

    I need help scrolling and highlighting for a vast amount of pics that I'm trying to transfer. I have a macbook pro osx 10.5.8

  • I still need help with the Dictionary for my Nokia...

    I still need help with the Dictionary for my Nokia 6680...
    Here's the error message I get when trying to open dictionary...
    "Dictionary word information missing. Install word database."
    Can someone please provide me a link the where I could download this dictionary for free?
    Thanks!
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

    oops, im sorry, i didnt realised i've already submitted it
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

  • Need help choosing optimal hardware for a laptop that will run AE CS5

    BACKGROUND INFO (Questions listed below)
    I need some help figuring out the best hardware configuration for a new laptop. I’m a student at a design school and I will be using the laptop to mainly run After Effects and to a lesser extent Photoshop and Illustrator. I don’t need to worry about 3D rendering software or Premier Pro. I am primarily interested in getting the best performance during editing. I am not looking for the best performance for final output. I would prefer to sacrifice final output times for better editing/interface performance.
    I will be working with standard definition content and perhaps HD up to 720p on occasion. I do not need to operate in resolutions higher than 720p. My projects are generally animation and use many sources and many layers.
    I’ve been reading up on optimal hardware configurations for CS5 but my understanding is still a little foggy and I would like to use this thread to figure out how to build the best machine for my budget. The budget is about $1400 to $1600 CANADIAN after tax.
    I DON’T need help finding the laptop. I will search for it on my own. I just need to understand the best hardware to purchase within my budget.
    I realize that it is probably impossible to buy the laptop I want with the hardware configuration I need “off the shelf”. Instead I will be looking for a good base model (~$900-$1100) and I will purchase the necessary hardware upgrades separately. I will not be purchasing a Mac.
    Right now I’m thinking of a machine built something like this:
    - 15”-16” screen (17” models are too big/heavy)
    - Mid to high end i5 processor OR entry level i7 quad core
    - 8GB RAM (I would go to 12GB, but it’s hard to find a 15”-16” laptop with 3 memory slots)
    - SSD to replace HDD (However, if possible, I would like a laptop with dual HDD support or swap the optical drive for another HDD. If I had access to 2 drives, I would have and HDD/SSD combo).
    - Medium/high end NVIDIA GPU to take advantage of OpenGL while editing.
    QUESTIONS
    1) Does the “Render Multiple Frames Simultaneously” option enhance general editing performance (applying filters, scrubbing through the timeline, reverting history states)? Or does it ONLY help speed up RAM previews and final output? Does it reduce the length of RAM previews?
    1b) Is this option even necessary to enable on 64bit systems? (As far as I understand it was used to solve a problem where 32bit systems/software would only recognize 4GB of RAM per instance of AE).
    1c) If I turn this option on to help with RAM previews, would I be hindering general editing performance in any way? Or does this option have basically zero drawbacks?
    2) How come “Actual CPUs that will be used” will read 0 even if the sum total of RAM assigned to the CPUs plus the RAM reserved for other applications is less than the total available system RAM (on a 64bit system)? For example, I currently have 4GB RAM and 2 installed CPUs. I have 1.5GB reserved for other programs and when I set 0.75GB per CPU both CPUs are used. However when I set 1GB per CPU then 0 CPUs are used, even though the total RAM adds up to only 3.5GB.
    CPU
    3.) Considering the fact that I am more concerned with smooth performance while editing rather than final output speeds, would it be better to get a dual core i5 clocked around 2.5 or a quad core i7 clocked around 1.8?
    4.) What is the difference between an i3 and an i5 processor even if they are clocked at the same speed? How does an i5 460M compare on the grand scheme of things?
    RAM
    6.) Should the quantity of RAM that I get (8GB vs 12GB) be based on the number of cores in my CPU? If so, how should I be calculating optimal RAM based on # of cores. Should I also be counting threads, or just actual physical cores?
    STORAGE/SWAP
    7.) Should I replace the HDD with an SSD? I'm looking for snappy interface performance while editing. I would think that if the RAM fills up it would be best to have the SSD for scratch/cache.
    8.) What performance benchmarks are most important when considering an SSD for After Effects? (4k writes? IOs per second? Max read/write?)
    9.) I can afford the OCZ Vertex2 120GB SSD. Would this be a good choice if an SSD is recommended?
    10.) Would it be better to have 8GB of RAM and an SSD, or 12GB of RAM and an HDD? Explain why.
    GPU
    10.) After Effects utilizes OpenGL to enhance editing performance. I will not really be using Premier Pro, so catering to the CUDA Mercury Engine is not a concern. Do high end gaming cards provide significant gains in OpenGL performance? Or do OpenGL performance gains taper off around the mid-range GPUs? (i.e. can you justify buying a high end GTX 260M graphics card for enhanced editing performance versus an "entry level" dedicated card like the 310M?)
    11.) What hardware specs are most important when considering a GPU for editing performance in AE? (Memory size? # of Pixel shaders? Core speed? Shader speed?)
    Thanks so much for any answers you can offer to these questions.

    Please make sure that you've read through this page and what it points to.
    > 1) Does the “Render Multiple Frames Simultaneously” option
    enhance general editing performance (applying filters, scrubbing through
    the timeline, reverting history states)? Or does it ONLY help speed up
    RAM previews and final output? Does it reduce the length of RAM
    previews?
    It only increases rendering speed for RAM previews and rendering for final output. In After Effects CS5, it doesn't decrease the length of RAM previews. (In CS4, it does.)
    1b) Is this option even necessary to enable on 64bit
    systems? (As far as I understand it was used to solve a problem where
    32bit systems/software would only recognize 4GB of RAM per instance of
    AE).
    You misunderstood. Yes, it's still relevant on 64-bit computers. Moreso, in a way. (I'd rather not spend my entire Sunday writing out detailed answers to satisfy idle curiosity, so I'm not going to give all the technical detail to that answer.)
    > 1c) If I turn this option on to help with RAM previews,
    would I be hindering general editing performance in any way? Or does
    this option have basically zero drawbacks?
    It takes a small but nonzero time for the background processes to start up when they need to be used and shut down when they're done. And as they sit waiting, they take up a little bit of memory. So, it's not exactly correct to say that there are no downsides to leaving it on. But it's close. I leave it on.
    > 2) How come “Actual CPUs that will be used” will read 0 even
    if the sum total of RAM assigned to the CPUs plus the RAM reserved for
    other applications is less than the total available system RAM (on a
    64bit system)? For example, I currently have 4GB RAM and 2 installed
    CPUs. I have 1.5GB reserved for other programs and when I set 0.75GB per
    CPU both CPUs are used. However when I set 1GB per CPU then 0 CPUs are
    used, even though the total RAM adds up to only 3.5GB.
    4GB - 1.5GB for other software leaves 2.5 GB for After Effects.
    If you have 1GB assigned per background CPU, then the foreground takes 1.2x that = 1.2GB. That leaves 1.3GB for background processes, which is enough for one background process. There's no point in starting only one background process to do rendering, so it doesn't bother. (Note: When background processes are rendering, the foreground process isn't rendering.)
    > 3.) Considering the fact that I am more concerned with
    smooth performance while editing rather than final output speeds, would
    it be better to get a dual core i5 clocked around 2.5 or a quad core i7
    clocked around 1.8?
    Get the quad-core. That gives you a greater total number of cycles. And After Effects works very well with mutliple processors, even beyond Render Multiple Frames Simultaneously multiprocessing. An entirely unrelated sort of multiprocessing (multithreading) spreads work out to multiple processors.
    > 6.) Should the quantity of RAM that I get (8GB vs 12GB) be based on the number of cores in my CPU? If
    so, how should I be calculating optimal RAM based on # of cores. Should
    I also be counting threads, or just actual physical cores?
    The optimum amount is the amount that you can cram into the computer. I'm not kidding. Spend your budget on RAM until you have 4GB installed per processor (and I'm counting the virtual processors due to hyperthreading). If you have a quad-core, that's 8 CPUs with hyperthreading, so the optimum amount of RAM installed is 32GB. You can work with less, but you did ask about optimum. For HD work (i.e., 1920 pixels across), you're OK with more like 3GB installed per CPU. That's what I have at home: 24GB in a quad-core. You're going to assign 2/3 or so of the RAM to After Effects, so 3GB installed per CPU is 2GB per core for HD work in After Effects.
    > 10.) Would it be better to have 8GB of RAM and an SSD, or 12GB of RAM and an HDD? Explain why.
    12GB of RAM. Because After Effects likes RAM. (If you're thinking of deliberatly using virtual memory to swap memory to the hard disk, don't. That's a performance killer.)
    > 10.) After Effects utilizes OpenGL to enhance editing performance.
    Not really. If you're on a limited budget, don't even think about the GPU until you've already got the most RAM, the fastest CPUs, the largest number of CPUs, two fast hard disks, and a couple of good monitors. Then, and only then, should you even consider getting soemthing beyond a non-stock graphics card. Yes, OpenGL can be used to accelerate some things, but that's only for the low-fidelity preview renderer. (Pardon the bluntness, but I want to make sure that you heed this.)

  • Need help with calculator project for an assignment...

    Hi all, I please need help with my calculator project that I have to do for an assignment.
    Here is the project's specifications that I need to do"
    """Create a console calculator applicaion that:
    * Takes one command line argument: your name and surname. When the
    program starts, display the date and time with a welcome message for the
    user.
    * Display all the available options to the user. Your calculator must include
    the arithmetic operations as well as at least five scientific operations of the
    Math class.
    -Your program must also have the ability to round a number and
    truncate it.
    -When you multiply by 2, you should not use the '*' operator to perform the
    operation.
    -Your program must also be able to reverse the sign of a number.
    * Include sufficient error checking in your program to ensure that the user
    only enters valid input. Make use of the String; Character, and other
    wrapper classes to help you.
    * Your program must be able to do conversions between decimal, octal and
    hex numbers.
    * Make use of a menu. You should give the user the option to end the
    program when entering a certain option.
    * When the program exits, display a message for the user, stating the
    current time, and calculate and display how long the user used your
    program.
    * Make use of helper classes where possible.
    * Use the SDK to run your program."""
    When the program starts, it asks the user for his/her name and surname. I got the program to ask the user again and again for his/her name and surname
    when he/she doesn't insert anything or just press 'enter', but if the user enters a number for the name and surname part, the program continues.
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??
    Here is the programs code that I've written so far:
    {code}
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Project {
         private static String nameSurname = "";     
         private static String num1 = null;
         private static String num2 = null;
         private static String choice1 = null;
         private static double answer = 0;
         private static String more;
         public double Add() {
              answer = (Double.parseDouble(num1) + Double.parseDouble(num2));
              return answer;
         public double Subtract() {
              answer = (Double.parseDouble(num1) - Double.parseDouble(num2));
              return answer;
         public double Multiply() {
              answer = (Double.parseDouble(num1) * Double.parseDouble(num2));
              return answer;
         public double Divide() {
              answer = (Double.parseDouble(num1) / Double.parseDouble(num2));
              return answer;
         public double Modulus() {
              answer = (Double.parseDouble(num1) % Double.parseDouble(num2));
              return answer;
         public double maximumValue() {
              answer = (Math.max(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double minimumValue() {
              answer = (Math.min(Double.parseDouble(num1), Double.parseDouble(num2)));
              return answer;
         public double absoluteNumber1() {
              answer = (Math.abs(Double.parseDouble(num1)));
              return answer;
         public double absoluteNumber2() {
              answer = (Math.abs(Double.parseDouble(num2)));
              return answer;
         public double Squareroot1() {
              answer = (Math.sqrt(Double.parseDouble(num1)));
              return answer;
         public double Squareroot2() {
              answer = (Math.sqrt(Double.parseDouble(num2)));
              return answer;
         public static String octalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
    String octal1 = Integer.toOctalString(iNum1);
    return octal1;
         public static String octalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String octal2 = Integer.toOctalString(iNum2);
              return octal2;
         public static String hexadecimalEquivalent1() {
              int iNum1 = Integer.parseInt(num1);
              String hex1 = Integer.toHexString(iNum1);
              return hex1;
         public static String hexadecimalEquivalent2() {
              int iNum2 = Integer.parseInt(num2);
              String hex2 = Integer.toHexString(iNum2);
              return hex2;
         public double Round1() {
              answer = Math.round(Double.parseDouble(num1));
              return answer;
         public double Round2() {
              answer = Math.round(Double.parseDouble(num2));
              return answer;
              SimpleDateFormat format1 = new SimpleDateFormat("EEEE, dd MMMM yyyy");
         Date now = new Date();
         SimpleDateFormat format2 = new SimpleDateFormat("hh:mm a");
         static Date timeIn = new Date();
         public static long programRuntime() {
              Date timeInD = timeIn;
              long timeOutD = System.currentTimeMillis();
              long msec = timeOutD - timeInD.getTime();
              float timeHours = msec / 1000;
                   return (long) timeHours;
         DecimalFormat decimals = new DecimalFormat("#0.00");
         public String insertNameAndSurname() throws IOException{
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        while (nameSurname == null || nameSurname.length() == 0) {
                             for (int i = 0; i < nameSurname.length(); i++) {
                             if ((nameSurname.charAt(i) > 'a') && (nameSurname.charAt(i) < 'Z')){
                                       inputCorrect = true;
                        else{
                        inputCorrect = false;
                        break;
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your name and surname: ");
                             nameSurname = inStream.readLine();
                             inputCorrect = true;
                        }catch (IOException ex) {
                             System.out.println("You did not enter your name and surname, " + nameSurname + " is not a name, please enter your name and surname :");
                             inputCorrect = false;
                        System.out.println("\nA warm welcome " + nameSurname + " ,todays date is: " + format1.format(now));
                        System.out.println("and the time is now exactly " + format2.format(timeIn) + ".");
                        return nameSurname;
              public String inputNumber1() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter a number you want to do a calculation with and hit <ENTER>: ");
                             num1 = br.readLine();
                             double number1 = Double.parseDouble(num1);
                             System.out.println("\nThe number you have entered is: " + number1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("\nYou did not enter a valid number: " + "\""+ num1 + "\" is not a number!!");
                             inputCorrect = false;
                        return num1;
         public String calculatorChoice() throws IOException {
              System.out.println("Please select an option of what you would like to do with this number from the menu below and hit <ENTER>: ");
              System.out.println("\n*********************************************");
              System.out.println("---------------------------------------------");
              System.out.println("Please select an option from the list below: ");
              System.out.println("---------------------------------------------");
              System.out.println("1 - Add");
              System.out.println("2 - Subtract");
              System.out.println("3 - Multiply");
              System.out.println("4 - Divide (remainder included)");
              System.out.println("5 - Maximum and minimum value of two numbers");
              System.out.println("6 - Squareroot");
              System.out.println("7 - Absolute value of numbers");
              System.out.println("8 - Octal and Hexadecimal equivalent of numbers");
              System.out.println("9 - Round numbers");
              System.out.println("0 - Exit program");
              System.out.println("**********************************************");
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader inStream = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("Please enter your option and hit <ENTER>: ");
                             choice1 = inStream.readLine();
                             int c1 = Integer.parseInt(choice1);
                             System.out.println("\nYou have entered choice number: " + c1);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid choice number: " + "\""+ choice1 + "\" is not in the list!!");
                             inputCorrect = false;
                        return choice1;
         public String inputNumber2() throws IOException {
              boolean inputCorrect = false;
                   while (inputCorrect == false) {
                        try {
                             BufferedReader br2 = new BufferedReader (new InputStreamReader(System.in));
                             System.out.print("\nPlease enter another number you want to do the calculation with and hit <ENTER>: ");
                             num2 = br2.readLine();
                             double n2 = Double.parseDouble(num2);
                             System.out.println("\nThe second number you have entered is: " + n2);
                             System.out.println("\nYour numbers are: " + num1 + " and " + num2);
                             inputCorrect = true;
                        } catch (NumberFormatException nfe) {
                             System.out.println("You did not enter a valid number: " + "\""+ num2 + "\" is not a number!!");
                             inputCorrect = false;
                        return num2;
         public int Calculator() {
              int choice2 = (int) Double.parseDouble(choice1);
              switch (choice2) {
                        case 1 :
                             Add();
                             System.out.print("The answer of " + num1 + " + " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 2 :
                             Subtract();
                             System.out.print("The answer of " + num1 + " - " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 3 :
                             Multiply();
                             System.out.print("The answer of " + num1 + " * " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 4 :
                             Divide();
                             System.out.print("The answer of " + num1 + " / " + num2 + " is: " + decimals.format(answer));
                             Modulus();
                             System.out.print(" and the remainder is " + decimals.format(answer));
                             break;
                        case 5 :
                             maximumValue();
                             System.out.println("The maximum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             minimumValue();
                             System.out.println("The minimum number between the numbers " + num1 + " and " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 6 :
                             Squareroot1();
                             System.out.println("The squareroot of value " + num1 + " is: " + decimals.format(answer));
                             Squareroot2();
                             System.out.println("The squareroot of value " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 7 :
                             absoluteNumber1();
                             System.out.println("The absolute number of " + num1 + " is: " + decimals.format(answer));
                             absoluteNumber2();
                             System.out.println("The absolute number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 8 :
                             octalEquivalent1();
                             System.out.println("The octal equivalent of " + num1 + " is: " + octalEquivalent1());
                             octalEquivalent2();
                             System.out.println("The octal equivalent of " + num2 + " is: " + octalEquivalent2());
                             hexadecimalEquivalent1();
                             System.out.println("\nThe hexadecimal equivalent of " + num1 + " is: " + hexadecimalEquivalent1());
                             hexadecimalEquivalent2();
                             System.out.println("The hexadecimal equivalent of " + num2 + " is: " + hexadecimalEquivalent2());
                             break;
                        case 9 :
                             Round1();
                             System.out.println("The rounded number of " + num1 + " is: " + decimals.format(answer));
                             Round2();
                             System.out.println("The rounded number of " + num2 + " is: " + decimals.format(answer));
                             break;
                        case 0 :
                             if (choice2 == 0) {
                                  System.exit(1);
                             break;
                   return choice2;
              public String anotherCalculation() throws IOException {
                   boolean inputCorrect = false;
                   while (inputCorrect == false) {
                             try {                              
                                  BufferedReader br3 = new BufferedReader (new InputStreamReader(System.in));
                                  System.out.print("\nWould you like to do another calculation? Y/N ");
                                  more = br3.readLine();
                                  String s1 = "y";
                                  String s2 = "Y";
                                  if (more.equals(s1) || more.equals(s2)) {
                                       inputCorrect = true;
                                       while (inputCorrect = true){
                                            inputNumber1();
                                            System.out.println("");
                                            calculatorChoice();
                                            System.out.println("");
                                            inputNumber2();
                                            System.out.println("");
                                            Calculator();
                                            System.out.println("");
                                            anotherCalculation();
                                            System.out.println("");
                                            inputCorrect = true;
                                  } else {
                                       System.out.println("\n" + nameSurname + " thank you for using this program, you have used this program for: " + decimals.format(programRuntime()) + " seconds");
                                       System.out.println("the program will now exit, Goodbye.");
                                       System.exit(0);
                             } catch (IOException ex){
                                  System.out.println("You did not enter a valid answer: " + "\""+ more + "\" is not in the list!!");
                                  inputCorrect = false;
              return more;
         public static void main(String[] args) throws IOException {
              Project p1 = new Project();
              p1.insertNameAndSurname();
              System.out.println("");
              p1.inputNumber1();
              System.out.println("");
              p1.calculatorChoice();
              System.out.println("");
              p1.inputNumber2();
              System.out.println("");
              p1.Calculator();
                   System.out.println("");
                   p1.anotherCalculation();
                   System.out.println("");
    {code}
    *Can you please run my code for yourself and have a look at how this program is constructed*
    *and give me ANY feedback on how I can better this code(program) or if I've done anything wrong from your point of view.*
    Your help will be much appreciated.
    Thanks in advance

    Smirre wrote:
    Now my question is this: How can I restrict the user to only enter 'letters' (and spaces of course) but allow NO numbers for his/her surname??You cannot restrict the user. It is a sad fact in programming that the worst bug always sits in front of the Computer.
    What you could do is checking the input string for numbers. If it contains numbers, just reprompt for the Name.
    AND you might want to ask yourself why the heck a calculator needs to know the users Name.

  • Need help in dynamic report for a range of year and period

    Dear all,
    I need help in creating an ALV report with dynamic columns based on the Year and period entered on the selection screen. for example if in the year we enter 2002 and period range from 10 to 12 then we should get the 3 columns display for cost(example) for period 10/2002, 11/2002 and 12/2002.
    Can anyone help me in achieving this dynamically since the user can enter the year also in intervals along with the period and data also needs to be populated in the corresponding columns.
    An example code would be of great help.
    Thanks,
    Amit

    Hi,
    Use field symbols as follows.
    TYPE-POOLS : SLIS.
    TABLES : MARC,T001W.
    DATA : BEGIN OF ITAB OCCURS 0,
           MATNR LIKE MARC-MATNR,
           END OF ITAB.
    DATA : FIELDSTAB TYPE LVC_T_FCAT,
           STAB      TYPE LVC_S_FCAT,
           T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           S_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           NEW_LINE TYPE REF TO DATA,
           NEW_TABLE TYPE REF TO DATA,
           INDEX(3) TYPE C,
           STR(70),
           TEXT(6),
           CNT(1),
           TEXT1(16),
           REPID LIKE SY-REPID.
    FIELD-SYMBOLS : <FS> TYPE STANDARD TABLE,
                    <WA> TYPE ANY.
    SELECT-OPTIONS : S_WERKS FOR MARC-WERKS NO INTERVALS,
                     S_MATNR FOR MARC-MATNR NO INTERVALS.
    INITIALIZATION.
      REPID = SY-REPID.
    START-OF-SELECTION.
      SELECT * FROM MARC
               INTO CORRESPONDING FIELDS OF TABLE ITAB
               WHERE MATNR IN S_MATNR
               AND   WERKS IN S_WERKS.
      SORT ITAB BY MATNR.
      DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MATNR.
      STAB-FIELDNAME = 'MATNR'.
      STAB-DATATYPE  = 'CHAR'.
      STAB-INTLEN    = '18'.
      APPEND STAB TO FIELDSTAB.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR TEXT.
        CNT = CNT + 1.
        CONCATENATE  'EISLO' CNT INTO TEXT.
        STAB-FIELDNAME = TEXT.
        STAB-DATATYPE  = 'CHAR'.
        STAB-INTLEN    = '16'.
        APPEND STAB TO FIELDSTAB.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = FIELDSTAB
        IMPORTING
          EP_TABLE        = NEW_TABLE.
      ASSIGN NEW_TABLE->* TO <FS>.
      CREATE DATA NEW_LINE LIKE LINE OF <FS>.
      ASSIGN NEW_LINE->* TO <WA>.
      PERFORM MOVE_DATA.
      CLEAR S_FIELDCAT.
      S_FIELDCAT-FIELDNAME = 'MATNR'.
      S_FIELDCAT-TABNAME = ITAB.
      S_FIELDCAT-SELTEXT_M = 'Part Number'.
      S_FIELDCAT-NO_ZERO = 'X'.
      S_FIELDCAT-DDICTXT   = 'M'.
      APPEND S_FIELDCAT TO T_FIELDCAT.
      CLEAR CNT.
      LOOP AT S_WERKS.
        CLEAR T001W.
        CNT = CNT + 1.
        SELECT SINGLE * FROM T001W WHERE WERKS = S_WERKS-LOW AND SPRAS = SY-LANGU.
        CLEAR TEXT.
        CONCATENATE 'EISLO' CNT INTO TEXT.
        S_FIELDCAT-FIELDNAME = TEXT.
        S_FIELDCAT-SELTEXT_M = T001W-NAME2.
    S_FIELDCAT-NO_ZERO = 'X'.
        S_FIELDCAT-DDICTXT   = 'M'.
        APPEND S_FIELDCAT TO T_FIELDCAT.
        CLEAR S_WERKS.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          IT_FIELDCAT = T_FIELDCAT[]
        TABLES
          T_OUTTAB    = <FS>.
    *&      Form  MOVE_DATA
          text
    FORM MOVE_DATA.
      LOOP AT ITAB.
        CLEAR STR.
        CONCATENATE ITAB-MATNR ' ' INTO STR SEPARATED BY SPACE.
        LOOP AT S_WERKS.
          CLEAR MARC.
          SELECT SINGLE * FROM MARC WHERE MATNR = ITAB-MATNR AND WERKS = S_WERKS-LOW.
          IF SY-SUBRC EQ 0.
            CLEAR TEXT1.
            TEXT1 = MARC-EISLO.
            CONCATENATE STR TEXT1 INTO STR SEPARATED BY SPACE.
          ELSE.
            CONCATENATE STR '0' INTO STR SEPARATED BY SPACE.
          ENDIF.
        ENDLOOP.
        <WA> = STR.
        APPEND <WA> TO <FS>.
        CLEAR ITAB.
      ENDLOOP.
    ENDFORM.                    "MOVE_DATA
    Reward points if helpful.
    Regards,
    Sankar..

Maybe you are looking for

  • How do I give a separate task ID to two compute waveform sub vi's running sumiltaneously in one vi?

    I'm running two compute waveform sub vi's in one main vi. The idea is to output two signals that I can vary independently to each other but when I hook LabVIEW up to a Oscilloscope, I only get one output and the other is just a flat line. I noticed t

  • Error Deficit of PU IR quantity

    Hi W hen i tried to post goods reversal (102 MVMT) the error  "Deficit of PU IR quantity xxxxxxx" coming Could you please suggest what is the cause Regards Subbu

  • Windows 8.1 cannot find network connections

    i have installed windows 8.1 through boot camp on my retina macbook pro with osx mavericks 10.9.1 2 times now and both times it cannot find my network. ive read online and tried everything and nothing works. i would like to get this resolved because

  • Virtual circuit wait on XDB

    Hello, I'm facing a problem, I can't get behind... I've created a PL/SQL Package that generates a HTML page with the package procedure "HTP.PRN" in a Ora11gR2 DB. Everything works fine. A client with IE or Firefox can access the HTML page without any

  • ITunes 5 crashes when I insert CD

    When I insert an audio cd iTunes crashes every time. I've tried with over 10 cd's now and it crashes every F***G time and it's driving me nuts. I never had this problem untill I installed version 5. Is it possible to downgrade to version 4.9? I notic