How to save Jobs with different priority level in a Queue?

Hi, Friends,
I have a set of Job (see below) objects.
I would make a queue: if they have the save priority level, first in and first out. this is easy to do by ArrayList. however, If they have different priority level, I would like make the Jobs with the highest level first out.
How can I implemented this idea in Java?
Regards,
Youbin
public class Job {
private short _priorityLevel = 0;
public void setPriorityLevel(short priorityLevel) {
this._priorityLevel = priorityLevel;
public short getPriorityLevel() {
return _priorityLevel;

Hi,
Here is my test code, it works:
public class Job implements Comparable{
private int _priorityLevel=0;
private String _jobDescription=null;
public Job() {
public void setPriorityLevel(int priorityLevel) {
this._priorityLevel=priorityLevel;
public int getPriorityLevel() {
return this._priorityLevel;
public void setJobDescription(String jobDescription) {
this._jobDescription=jobDescription;
public String getJobDescription() {
return this._jobDescription;
public int compareTo(Object obj) {
return (this._priorityLevel-((Job)obj)._priorityLevel);
import java.util.LinkedList;
import java.util.Iterator;
import java.util.Collections;
import java.util.Collection;
public class test {
public test() {
public static void main(String[] args) {
Job job1 = new Job();
job1.setJobDescription("Job1");
job1.setPriorityLevel(2);
Job job2 = new Job();
job2.setJobDescription("Job2");
job2.setPriorityLevel(2);
Job job3 = new Job();
job3.setJobDescription("Job3");
job3.setPriorityLevel(2);
Job job4 = new Job();
job4.setJobDescription("Job4");
job4.setPriorityLevel(1);
Job job5 = new Job();
job5.setJobDescription("Job5");
job5.setPriorityLevel(1);
Job job6 = new Job();
job6.setJobDescription("Job6");
job6.setPriorityLevel(1);
LinkedList linkedList = new LinkedList();
linkedList.addLast(job1);
linkedList.addLast(job2);
linkedList.addLast(job4);
Iterator ite=linkedList.iterator();
while (ite.hasNext()) {
System.out.println(((Job)ite.next()).getJobDescription());
System.out.println("---------");
Collections.sort(linkedList);
ite=linkedList.iterator();
while (ite.hasNext()) {
System.out.println(((Job)ite.next()).getJobDescription());
System.out.println("---------");
linkedList.addLast(job3);
ite=linkedList.iterator();
while (ite.hasNext()) {
System.out.println(((Job)ite.next()).getJobDescription());
System.out.println("---------");
Collections.sort(linkedList);
ite=linkedList.iterator();
while (ite.hasNext()) {
System.out.println(((Job)ite.next()).getJobDescription());
System.out.println("---------");
linkedList.addLast(job5);
linkedList.addLast(job6);
ite=linkedList.iterator();
while (ite.hasNext()) {
System.out.println(((Job)ite.next()).getJobDescription());
System.out.println("---------");
Collections.sort(linkedList);
ite=linkedList.iterator();
while (ite.hasNext()) {
System.out.println(((Job)ite.next()).getJobDescription());
}

Similar Messages

  • How to define job with different username

    Friends,
    How can I define a job with another username . Or how can I change a job running with a user name to another username. Please advise.
    Thanks.

    You can change the ID of the user than is used to run each step of the job, but not the user that created the job. In SM37 go into the job of interest (the next scheduled job) choose Job -> Change. From here choose the steps and go into each job step by choosing Change, the first field in the pop-up holds the user ID that will be used to run that step when the job is executed.
    The user ID that created the job will still show in the SE37 job overview, it it nolonger plays an active part in the job.
    ~As found in forum

  • 3850 stackable with different License Levels?

    We will be decommissioning a 3750 that is uplinked to a 3850-48 port and will be connecting a 3850-24 port in full stack-wise and stack-power High availability mode………now it will have the same IOS but the License Level will be different….so my question is will the two switches become stackable with different License Levels?

    Based on the FAQ that is not supported:
    You find the FAQ on http://www.cisco.com/go/3850 -> FAQ
    Q. What are the license requirements for a Cisco Catalyst 3850 switch stack?
    A. In a Cisco Catalyst 3850 stack, all switches should be at the same image-based license (IP Services/IPBase/LAN Base) level. The active switch license level is considered as the reference, and the member switch licenses are compared against it. If there is a mismatch, the active switch with the syslog message “ license mismatch error” indicates that the stacking was unsuccessful.
    Q. How is a “ license mismatch error” fixed in a Cisco Catalyst 3850 stack?
    A. The license level of the mismatch stack member switch can be changed with the license right-to-use activate <license> all acceptEULA CLI command (entire stack should have the same wired license level) and reloaded from the active switch console. This will enable the member switch to join the stack successfully. The customer has to purchase a license before moving to a specific license level.

  • Save Task with Different name in workspace

    Hi,
    While using SAVE button in workspace, is there a way to save tasks with different names?
    steps:
          1) Click on start Process in workspace  - Complete task order
           2) Click on save button with some data.
                      - Is it possible to change the name here?
    if there are 50 tasks named "Complete task order" in To-do list, users want the ability to rename task.
    Any help is appreciated.
    Thanks,
    Krishna

    Hi,
    While using SAVE button in workspace, is there a way to save tasks with different names?
    steps:
          1) Click on start Process in workspace  - Complete task order
           2) Click on save button with some data.
                      - Is it possible to change the name here?
    if there are 50 tasks named "Complete task order" in To-do list, users want the ability to rename task.
    Any help is appreciated.
    Thanks,
    Krishna

  • Export with different audio levels

    I need, very often, to export the same clip with different audio levels.
    Is it possible to make presets with altered audio levels, let's say one for -12db and one for -8db.
    Until now, i alter the audio level in Premiere, then I make one export, then I go back to Premiere, change again the audio level, I make the second export etc. It works, but it is very time consuming.
    Thanx in advance.

    It is currently not possible. However, feel free to log a feature request:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • IRQxx is being shared by drivers with different interrupt levels

    Hi
    Oracle Solaris 10 8/11 s10x_u10wos_17b X86
    HP DL380 G5
    We have some messages in /var/adm/messages:
    Oct 24 07:39:15 phssmb0a unix: [ID 954099 kern.info] NOTICE: IRQ17 is being shared by drivers with different interrupt levels.
    Oct 24 07:39:40 phssmb0a unix: [ID 954099 kern.info] NOTICE: IRQ16 is being shared by drivers with different interrupt levels.
    This may result in reduced system performance
    echo ::interrupts -d | mdb -k
    IRQ Vect IPL Bus Trg Type CPU Share APIC/INT# Driver Name(s)
    1 0x40 5 ISA Edg Fixed 3 1 0x0/0x1 i8042#0
    3 0xb1 12 ISA Edg Fixed 6 1 0x0/0x3 asy#1
    4 0xb0 12 ISA Edg Fixed 5 1 0x0/0x4 asy#0
    9 0x81 9 PCI Lvl Fixed 1 1 0x0/0x9 acpi_wrapper_isr
    12 0x41 5 ISA Edg Fixed 4 1 0x0/0xc i8042#0
    14 0x46 5 ISA Edg Fixed 2 1 0x0/0xe ata#0
    16 0x84 9 PCI Lvl Fixed 7 2 0x0/0x10 ehci#0, uhci#0
    17 0x85 9 PCI Lvl Fixed 0 1 0x0/0x11 uhci#1
    18 0x86 9 PCI Lvl Fixed 3 2 0x0/0x12 uhci#2, cpqary3#0
    19 0x87 9 PCI Lvl Fixed 1 1 0x0/0x13 uhci#3
    22 0x88 9 PCI Lvl Fixed 2 2 0x0/0x16 uhci#4, cpqci#0
    24 0x82 7 Edg MSI 2 1 - pcieb#1
    25 0x30 4 Edg MSI 4 1 - pcieb#0
    26 0x83 7 Edg MSI 5 1 - pcieb#2
    27 0x31 4 Edg MSI 6 1 - pcieb#4
    28 0x42 5 Edg MSI-X 5 1 - qlc#0
    29 0x43 5 Edg MSI-X 6 1 - qlc#0
    30 0x44 5 Edg MSI-X 7 1 - qlc#1
    31 0x45 5 Edg MSI-X 0 1 - qlc#1
    32 0x60 6 Edg MSI 1 1 - e1000g#0
    160 0xa0 0 Edg IPI all 0 - poke_cpu
    192 0xc0 13 Edg IPI all 1 - xc_serv
    208 0xd0 14 Edg IPI all 1 - kcpc_hw_overflow_intr
    209 0xd1 14 Edg IPI all 1 - cbe_fire
    210 0xd3 14 Edg IPI all 1 - cbe_fire
    240 0xe0 15 Edg IPI all 1 - xc_serv
    241 0xe1 15 Edg IPI all 1 - apic_error_intr
    What is the solution, help needed please
    Walter

    I am looking at something similar.
    On boot I receive the above notices for IRQ 17 and IRQ18. Not seeing any further messages after boot, though.
    # echo ::interrupts -d | mdb -k
    IRQ Vect IPL Bus Trg Type CPU Share APIC/INT# Driver Name(s)
    9 0x80 9 PCI Lvl Fixed 1 1 0x0/0x9 acpi_wrapper_isr
    16 0x20 1 PCI Lvl Fixed 0 1 0x0/0x10 sdhost#0
    17 0x81 9 PCI Lvl Fixed 1 4 0x0/0x11 ehci#2, ehci#1, ehci#0, yge#0
    18 0x82 9 PCI Lvl Fixed 0 5 0x0/0x12 ohci#3, ohci#2, ohci#1, ohci#0, yge#1
    19 0x40 5 PCI Lvl Fixed 0 2 0x0/0x13 pci-ide#0, pci-ide#0
    24 0x83 7 PCI Edg MSI 1 1 - pcieb#0
    25 0x30 4 PCI Edg MSI 0 1 - pcieb#1
    26 0x84 7 PCI Edg MSI 1 1 - pcieb#2
    27 0x31 4 PCI Edg MSI 0 1 - pcieb#4
    28 0x85 7 PCI Edg MSI 1 1 - pcieb#5
    29 0x60 6 PCI Edg MSI 1 1 - rge#0
    160 0xa0 11 Edg IPI all 0 - poke_cpu
    208 0xd0 14 Edg IPI all 1 - kcpc_hw_overflow_intr
    209 0xd1 14 Edg IPI all 1 - cbe_fire
    210 0xd3 14 Edg IPI all 1 - cbe_fire
    240 0xe0 15 Edg IPI all 1 - xc_serv
    241 0xe1 15 Edg IPI all 1 - apic_error_intr

  • IRQ20 is being shared by drivers with different interrupt levels.

    Hello!
    In my logs this error occurs about once a day:
    unix: [kern.info] NOTICE: IRQ20 is being shared by drivers with different interrupt levels.
    This may result in reduced system performance.I cannot find any information about this message. Do I have to worry about it?
    TIA
    Stephan

    I'm seeing the same error msg as well (with IRQ28).. Bump..

  • SW-3850 stacking with different License Levels?

    we will be decommissioning the 3750 that is uplinked to a 3850-48port and will be connecting a 3850-24port in full stack-wise and stack-power High availability mode………now it will have the same IOS but the License Level will be different….so my question is will the two switches become stackable with different License Levels?

    Hi,
    it so not possible stack two switches with different licence. You will have to order new license to be same on both switches.
    Please read Q&A for 3850 switch. See link below question "What are the license requirements for a Cisco Catalyst 3850 switch stack?"
    http://www.cisco.com/c/en/us/products/collateral/switches/catalyst-3850-series-switches/qa_c67-722110.html
    HTH
    Jan
    Please rate answer if useful

  • How to sign in with different apple id

    how to sign in with different apple id?

    I would also caution you to make sure that you understand the implications of signing in with another Apple ID. If you changed your Apple ID, go to Settings>iTunes & App Store>Apple ID. Tap the old ID and sign out, then sign in with the new ID. Read this as well.
    What to do after you change your Apple ID email address or password - Apple Support
    If you want to sign into another Apple ID so that you can download purchased content with that other ID without paying for it, that will lock you out of your own ID for 90 days. Read this for more information.
    Manage your associated devices in iTunes - Apple Support

  • How do I save document with different name

    Since I updated my softwhere, can't seem to find how to "save as"....help!

    Hi Draomin,
    Your profile shows this:
    Draomin's Products
    iMac, Mac OS X (10.7.5)
    iPad, iOS 6.1
    Mac Book Pro 17", Mac OS X (10.4.6), 1 Gig/Manuf date of April 2006
    Mac Pro, Mac OS X (10.6.8)
    MacBook Pro, Mac OS X (10.7.5)
    If your profile is correct, then I surmise that you are using OSX Lion. "Save As" is not available in Lion.
    Your options:
    1. Upgrade to Mountain Lion. You will see that "Save As" is back. You will find "Save As" by holding down the option (alt) key when you use the File menu in Pages, Numbers, TextEdit and other apps under Mountain Lion.
    2. Stay with Lion and learn how to use "Duplicate". It is not hard.  See my replies to this thread:
    https://discussions.apple.com/message/21418250#21418250
    3. Stay with Lion and don't bother to learn how to use "Duplicate". Join the 38574 Views 1,085 Replies on what I call the Whinge Thread:
    https://discussions.apple.com/thread/3216589?start=0&tstart=0
    Your choice.
    Ian.

  • How to save file with the "/" symbol in the name?

    Hi,
    I have Adobe Professional 8.  I need to save files with names that include the symbol /, but Adobe interprets, for example, A/88/6, as file name 6, in a folder named 88, in a folder named A, and sets up new folders to accommodate that.  I cannot substitute another symbol as I already have thousands of pdf files in a database using the / symbol, and I need them in the same folders.
    I would very greatly appreciate any advice,
    thanks,
    Mo.

    Thanks.
    As I said, I'm pretty ignorant about these things.  I wouldn't know how to begin using a "hack".  All I know is that I was able, for over a year, to save .pdf files directly from my browser on several computers, and use the forbidden "/" symbol in every file name.  After saving the files, Adobe will happily open them, and allow me to edit and re-save them, although I now see that it will not allow me to "save as" them under a different name without removing that symbol.
    I may not be tech-savvy, but I can state that everything I have said here and above is entirely accurate.  I would be happy to open a dropbox account to show you countless .pdfs with the symbol "/" in the name.
    This is honestly not that big a deal.  I greatly appreciate this discussion, and you have inspired me to become slightly less computer-ignorant.
    Hope you all had a great New Year.  I am still recovering.
    Cheers,
    Mo.

  • How to save layers with cropping?

    I want to export layers to files (basically what "Export Layers To Files.jsx" does) but with cropping each layer (to different sizes). I know how to crop a document from script, but that also crops all other layers (erases their content outside of the cropping area). So my question is - how do I keep/retrieve the cropped out content of the document (layers)? Or maybe there's a better approach altogether?

    Seems to me that you only need to keep the cropped pixels because of way you want to do this.
    However if you want to do it this way you could create a history snapshot, crop and save the first layer. Then restore the document using the snapshot and crop and save the second.
    Or you may be able to just store the current history state in a variable then restore the document using that history state if you are only using a few history states to crop and save.
    With a snapshot you don't have to worry about the number of history states but it needs action manager. Storing the current history state can be done using the DOM.

  • Restrict Access To Page Not Working with Different Auth Levels

    I have just started playing with the idea of using different auth levels to allow different users access to certain pages on my site.
    Within my SQL database I have a authlevel table consisting of 3 possible levels (guest, user, admin)
    I am using the Dreamweaver "Log in user" to log in users based on username, pass, and auth level and "Restrict access to page" set to allow user levels 'user' and 'admin'.
    The problem, however, occurs when trying to log in.  No matter what auth level I try I am redirected to my page where users should be redirected if they are not allowed to enter that page.
    I have included below my code from my login page and the page where all authorized users (user and admin) should be directed upon entering the restricted area.
    Login Page:
    <?php require_once('../Connections/hondovfd.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=$_POST['password'];
      $MM_fldUserAuthorization = "authlevel";
      $MM_redirectLoginSuccess = "/membersonly/membersonly.php";
      $MM_redirectLoginFailed = "/membersonly/loginfailed.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_hondovfd, $hondovfd);
      $LoginRS__query=sprintf("SELECT username, password, authlevel FROM login WHERE username=%s AND password=%s",
      GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $hondovfd) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        $loginStrGroup  = mysql_result($LoginRS,0,'authlevel');
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;          
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];    
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/phptemplate.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="Title" -->
    <title>Log In</title>
    <!-- InstanceEndEditable -->
    <meta name="description" content="Hondo Fire and Rescue serves the Arroyo Hondo and Canada Village areas of Santa Fe County, NM." />
    <meta name="keywords" content="hondo, hondo fire, hondo vfd, hondo fire department, santa fe county fire department, santa fe county, volunteer fire department, hondo volunteer fire department" />
    <link href="../stylesheet.css" type="text/css" rel="stylesheet" />
    <!--[if IE]>
    <style type="text/css">
    #mainContent, #sidebar1 { zoom: 1;}
    </style>
    <![endif]-->
    <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="thrColLiqHdr">
    <div id="container">
    <div id="header"></div>
      <div id="sidebar1">
      <h3>Navigation : </h3>
      <ul id="MenuBar1" class="MenuBarVertical">
      <li><a href="/index.php">Home</a></li>
    <li><a href="/support.php">Support Hondo</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Information Menu</a>
        <ul>
          <li><a href="/people.php">Our People</a></li>
          <li><a href="http://www.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=101620713606637979698.00045b6ead4ab4ea70b78&z=11" target="_blank">Response Area</a></li>
          <li><a href="/medical.php">Medical</a></li>
          <li><a href="/apparatus.php">Apparatus</a></li>
          <li><a href="/training.php">Training</a></li>
          <li><a href="/volunteer.php">Volunteer</a></li>
          <li><a href="/statistics.php">Statistics</a></li>
          <li><a href="/patchtrading.php">Patch Trading</a></li>
        </ul>
      </li>
      <li><a href="/album.php">Photo Gallery</a></li>
      <li><a href="/calendar.php">Calendar</a></li>
      <li><a href="/news.php">Blog/News</a></li>
      <li><a href="/links.php">Links</a></li>
      <li><a href="/contact.php">Contact Us</a></li>
    </ul>
    <br />
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <span class="lefttext">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="8567201">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </img></input></input>
      </span>
    </form>
    <span class="lefttext"><br />
    </span>
    <center>
      <span class="lefttext"><a href="http://www.facebook.com/pages/Santa-Fe-NM/Hondo-Volunteer-Fire-Department/74284233488" target="_blank" class="lefttext">Hondo VFD on Facebook</a></span>
    </center>
      <!-- end #sidebar1 --></div>
      <div id="sidebar2"> 
        <p><a href="/membersonly/login.php">Log In</a> | <a href="/membersonly/logout.php">Log Out</a></p>
        <p>Call Statistics for <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/month.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?> as of <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/date.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></p>
      <table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="60%">EMS Calls</td>
        <td width="40%"><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/emscalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
      <tr>
        <td>Fire Calls</td>
        <td><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/firecalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
    </table>
      <hr />
        <div id="cse" style="width:100%;">Loading</div>
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript">
      google.load('search', '1');
      google.setOnLoadCallback(function(){
        new google.search.CustomSearchControl().draw('cse');
      }, true);
    </script>
         <!-- End Google Search Element -->
      </div>
      <!-- end #sidebar2 -->
      <div id="mainContent">
      <div class="top"></div><div class="wrap"><!-- InstanceBeginEditable name="Main Content" -->
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="47" class="h2">Members Only Login</td>
      </tr>
      <tr>
        <td><form ACTION="<?php echo $loginFormAction; ?>" id="login" name="login" method="POST">
        <table width="40%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="31%">Username:</td>
        <td width="69%"><input name="username" type="text" /></td>
      </tr>
      <tr>
        <td>Password</td>
        <td><input name="password" type="password" /></td>
      </tr>
    </table>
    <input name="Submit" type="submit" />
        </form></td>
      </tr>
    </table>
      <!-- InstanceEndEditable -->
    </div>
    <div class="bottom"></div>
    </div>
         <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> <br class="clearfloat" />
      <div id="footer">
        <p align="center">&copy; Copyright 2009 Hondo Volunteer Fire Department | <a href="mailto:[email protected]">Contact Us</a><a href="http://www.legalhelpers.com/chapter-13-bankruptcy/chapter13.html"></a><br />Hosting provided by <a href="http://studiox.com/" target="_blank">Studio X</a></p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    <?php include_once("/var/home/hondovfd/hondovfd.org/www/analyticstracking.php"); ?>
    </body>
    <!-- InstanceEnd --></html>
    Other Page:
    <?php
    if (!isset($_SESSION)) {
      session_start();
    $MM_authorizedUsers = "user,admin";
    $MM_donotCheckaccess = "false";
    // *** Restrict Access To Page: Grant or deny access to this page
    function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
      // For security, start by assuming the visitor is NOT authorized.
      $isValid = False;
      // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
      // Therefore, we know that a user is NOT logged in if that Session variable is blank.
      if (!empty($UserName)) {
        // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
        // Parse the strings into arrays.
        $arrUsers = Explode(",", $strUsers);
        $arrGroups = Explode(",", $strGroups);
        if (in_array($UserName, $arrUsers)) {
          $isValid = true;
        // Or, you may restrict access to only certain users based on their username.
        if (in_array($UserGroup, $arrGroups)) {
          $isValid = true;
        if (($strUsers == "") && false) {
          $isValid = true;
      return $isValid;
    $MM_restrictGoTo = "/membersonly/loginfailed.php";
    if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {  
      $MM_qsChar = "?";
      $MM_referrer = $_SERVER['PHP_SELF'];
      if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
      if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
      $MM_referrer .= "?" . $QUERY_STRING;
      $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
      header("Location: ". $MM_restrictGoTo);
      exit;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/phptemplate.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="Title" -->
    <title>Members Only Area</title>
    <!-- InstanceEndEditable -->
    <meta name="description" content="Hondo Fire and Rescue serves the Arroyo Hondo and Canada Village areas of Santa Fe County, NM." />
    <meta name="keywords" content="hondo, hondo fire, hondo vfd, hondo fire department, santa fe county fire department, santa fe county, volunteer fire department, hondo volunteer fire department" />
    <link href="../stylesheet.css" type="text/css" rel="stylesheet" />
    <!--[if IE]>
    <style type="text/css">
    #mainContent, #sidebar1 { zoom: 1;}
    </style>
    <![endif]-->
    <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="thrColLiqHdr">
    <div id="container">
    <div id="header"></div>
      <div id="sidebar1">
      <h3>Navigation : </h3>
      <ul id="MenuBar1" class="MenuBarVertical">
      <li><a href="/index.php">Home</a></li>
    <li><a href="/support.php">Support Hondo</a></li>
      <li><a class="MenuBarItemSubmenu" href="#">Information Menu</a>
        <ul>
          <li><a href="/people.php">Our People</a></li>
          <li><a href="http://www.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=101620713606637979698.00045b6ead4ab4ea70b78&z=11" target="_blank">Response Area</a></li>
          <li><a href="/medical.php">Medical</a></li>
          <li><a href="/apparatus.php">Apparatus</a></li>
          <li><a href="/training.php">Training</a></li>
          <li><a href="/volunteer.php">Volunteer</a></li>
          <li><a href="/statistics.php">Statistics</a></li>
          <li><a href="/patchtrading.php">Patch Trading</a></li>
        </ul>
      </li>
      <li><a href="/album.php">Photo Gallery</a></li>
      <li><a href="/calendar.php">Calendar</a></li>
      <li><a href="/news.php">Blog/News</a></li>
      <li><a href="/links.php">Links</a></li>
      <li><a href="/contact.php">Contact Us</a></li>
    </ul>
    <br />
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
      <span class="lefttext">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="8567201">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </img></input></input>
      </span>
    </form>
    <span class="lefttext"><br />
    </span>
    <center>
      <span class="lefttext"><a href="http://www.facebook.com/pages/Santa-Fe-NM/Hondo-Volunteer-Fire-Department/74284233488" target="_blank" class="lefttext">Hondo VFD on Facebook</a></span>
    </center>
      <!-- end #sidebar1 --></div>
      <div id="sidebar2"> 
        <p><a href="/membersonly/login.php">Log In</a> | <a href="/membersonly/logout.php">Log Out</a></p>
        <p>Call Statistics for <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/month.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?> as of <?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/date.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></p>
      <table width="90%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="60%">EMS Calls</td>
        <td width="40%"><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/emscalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
      <tr>
        <td>Fire Calls</td>
        <td><?php
    $myFile = "/var/home/hondovfd/hondovfd.org/www/membersonly/firecalls.txt";
    $fh = fopen($myFile, 'r');
    $theData = fread($fh, filesize($myFile));
    fclose($fh);
    echo $theData;
    ?></td>
      </tr>
    </table>
      <hr />
        <div id="cse" style="width:100%;">Loading</div>
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script type="text/javascript">
      google.load('search', '1');
      google.setOnLoadCallback(function(){
        new google.search.CustomSearchControl().draw('cse');
      }, true);
    </script>
         <!-- End Google Search Element -->
      </div>
      <!-- end #sidebar2 -->
      <div id="mainContent">
      <div class="top"></div><div class="wrap"><!-- InstanceBeginEditable name="Main Content" -->
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="47" class="h2">Members Only Area</td>
      </tr>
      <tr>
        <td><p><a href="/membersonly/documents.php">Useful Documents</a></p>
          <p><a href="/membersonly/IncidentCount01_08.pdf">Current Call Statistics</a> as of 9/3/09</p>
          </td>
      </tr>
    </table>
      <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script><!-- InstanceEndEditable -->
    </div>
    <div class="bottom"></div>
    </div>
         <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> <br class="clearfloat" />
      <div id="footer">
        <p align="center">&copy; Copyright 2009 Hondo Volunteer Fire Department | <a href="mailto:[email protected]">Contact Us</a><a href="http://www.legalhelpers.com/chapter-13-bankruptcy/chapter13.html"></a><br />Hosting provided by <a href="http://studiox.com/" target="_blank">Studio X</a></p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    <?php include_once("/var/home/hondovfd/hondovfd.org/www/analyticstracking.php"); ?>
    </body>
    <!-- InstanceEnd --></html>

    you don't need all that bloat.  set a session during login of some kind of uniquely identifying id.  i.e.
    $_SESSION['id'] = $row_rs['id'];
    then on the pages you need to protect, check it like this....
    <?php
    session_start();
    if (!(isset($_SESSION['id']) && $_SESSION['id'] != '')) {
    die(header("Location: http://www.notinprotectedareas.com")); }
    ?>
    you can use an include file i.e.
    <?php require_once('login_check.php'); ?>
    where file is name login_check.php to make your auth controls clean on your protected pages.

  • How to read data with different XML schemas within the single connection?

    I have Oracle 11g database
    I access it through jdbc:oracle:thin, version 11.2.0.3, same as xdb.
    I have several tables, each has one XMLType column, all schema-based.
    There are three different XML schemata registered in the DB
    I may need to read the XML data from several tables.
    If all the XMLTypes have the same XML schema ,there is no problem,
    If the schemata are different, the second read throws BindXMLException.
    If I reset the connection between the reads of the XMLType column with different schemata, it works.
    The question is: how can I configure the driver, or the connection to be able to read the data with different XML schemata without resetting the connection (which is expensive).
    The code to get the XMLType data is textbook implementation:
    1   ResultSet resultSet = statement.executeQuery( sql ) ;
    2   String result = null ;
    3    while(resultSet.next()) {
    4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
    5   result = sqlxml.getString() ;
    6   sqlxml.free();
    7   }
    8   resultSet.close();
    9    return result ;

    It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
    1    final Statement statement = connection.createStatement() ;
    2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
    3   ResultSet resultSet = statement.executeQuery( sql ) ;
    4   String result = null ;
    5    while(resultSet.next()) {
    6   Blob blob = resultSet.getBlob( 1 );
    7   InputStream inputStream = blob.getBinaryStream();
    8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
    9   inputStream.close();
    10   blob.free();
    11   }
    12   resultSet.close();
    13   statement.close();
    14
    15   System.out.println( result );
    16    return result ;
    17
    Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

  • How to save layout with ALV Pivot format

    Hi
    In ALV report I have  25 fields but I want to use 10 fields out of 25 fields in Pivot Table. My problem is how to save this layout with Pivot format for on going use. At every time execution of report I need not required to set  Pivot Table.
    Please help me.
    -Sanjay

    Hi,
    Are you using FM REUSE_ALV_GRID_DISPLAY? If yes, then pass 'X' to the parameter I_SAVE while calling the fm.
    if you are using Object Oriented ALV, then call the below method before calling the method for display
    DATA : gr_layout TYPE REF TO cl_salv_layout,
           gr_layout_key TYPE salv_s_layout_key.
    CALL METHOD gr_functions->set_all
      EXPORTING
        value  = IF_SALV_C_BOOL_SAP=>TRUE.
      MOVE sy-repid TO gr_layout_key-report.
      CALL METHOD gr_table->get_layout
        RECEIVING
          value = gr_layout.
      CALL METHOD gr_layout->set_key
        EXPORTING
          value = gr_layout_key.
      CALL METHOD gr_layout->set_save_restriction
        EXPORTING
          value = if_salv_c_layout=>restrict_none.
      CALL METHOD gr_layout->set_default
        EXPORTING
          value = if_salv_c_bool_sap=>true.
    Regards
    Vinod
    Edited by: Vinod Kumar on Jul 2, 2010 3:40 PM
    Edited by: Vinod Kumar on Jul 2, 2010 4:43 PM

Maybe you are looking for