Unwanted code

Hi,
Please run my simple program below and save the mac key in a named file you like where you will see the mac key with some weird code in the beginning. If I print the mac key directly to screen, it will be fine. Please help.
import java.io.*;
import java.security.*;
import javax.crypto.*;
public class GenMacKey {
static String MAC_TYPE = "HmacMD5";
public static void main(String[] args) throws Exception {
if (args.length != 1) {
throw (new IllegalArgumentException("md5: md5 <string>"));
try {
// Generate secret key for HMAC-MD5
KeyGenerator kg = KeyGenerator.getInstance(MAC_TYPE);
SecretKey sk = kg.generateKey();
// Get instance of Mac object implementing HMAC-MD5, and
// initialize it with the above secret key
Mac mac = Mac.getInstance(MAC_TYPE);
mac.init(sk);
//System.out.println(bytesToHexString(mac.doFinal()));
ObjectOutputStream oos = new ObjectOutputStream(
     new FileOutputStream(args[0]));
oos.writeObject(bytesToHexString(mac.doFinal()));
oos.close();
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
catch (InvalidKeyException e) {
e.printStackTrace();
public static String bytesToHexString(byte[] buf){
StringBuffer sb= new StringBuffer(buf.length *2);
for (int i=0; i < buf.length; i++){
int v = buf[i] & 0xff;
if (v<16){
sb.append('0');
sb.append(Integer.toHexString(v));
return sb.toString().toLowerCase();
}

Thanks for that and any suggestion ?
I have tried writeByte or writeBytes but in failure.Why are you writing an object? All you need is a FileWriter then you can use the Writer.write(String str) method!

Similar Messages

  • When I forward and email a whole set of Unwanted codes, names addreses etc shows up under the original name

    When I forward a message, all the stuff below shows up--- I don't want it there....how do I make it go away--thanks, RRies
    -------- Forwarded Message --------
    Received: via tmail-2007f.22 (invoked by user rries) for rries; Mon, 20 Apr 2015 10:49:12 -0700 (PDT)
    Received: from mxe28.s.uw.edu (mxe28.s.uw.edu [140.142.32.172]) by cg33.u.washington.edu (8.14.4+UW14.03/8.14.4+UW15.02) with ESMTP id t3KHnBKQ007663 for <[email protected]>; Mon, 20 Apr 2015 10:49:11 -0700
    Received: from o1.mail.lingscars.com (o1.mail.lingscars.com [198.37.148.68]) by mxe28.s.uw.edu (8.14.4+UW14.03/8.14.4+UW15.02) with ESMTP id t3KHn7eZ010112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for <[email protected]>; Mon, 20 Apr 2015 10:49:08 -0700
    DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.net; h=subject:from:to:mime-version:content-type; s=smtpapi; bh=oTm9iVExcbyI9RqCjBdDvM1rudI=; b=rd8Hk6ForQMBjaoS9C+F4CKz7amAc 4KUJINh/sH47trYHskkGsA7Q+MmkJ5dhFuPFC1u/SNxcRsgAa8L4GxuuEJNHWZBk dy2xh38wg6veONqlBCcC5LfJqRjLmZWsBonMPzBNf/CxsIz4f4Dex9kX9EtMQ1SF VYWiSo+WmSA03U=
    Received: by filter-174.sjc1.sendgrid.net with SMTP id filter-174.11440.55353C12F 2015-04-20 17:49:06.986016946 +0000 UTC
    Received: from [127.0.0.1] (localhost [104.200.19.77]) by ismtpd-067 (SG) with ESMTP id 14cd7f2a926.4e65.105d23 for <[email protected]>; Mon, 20 Apr 2015 17:49:06 +0000 (UTC)
    Message-ID: <[email protected]>
    Date: Mon, 20 Apr 2015 12:49:06 -0500
    Subject: Dr. Ries / Telepsychiatry
    From: Bo Claypool <[email protected]>
    To: [email protected]
    MIME-Version: 1.0
    Content-Type: multipart/alternative; boundary="_=_swift_v4_1429552146_433ba0753bd26b60eddd714368989b8e_=_"
    X-SG-EID: MwiF63ndBICLH9c9aBgcAMCj+jo/TuOLvSdO55kIv8HUoSMNIrHKkH10ESXAYx+O1yGOZZHIlwfjeM +oJlJ/W9oKIWoY8YbnVYPxNjAi+C3hGmn9gjVAESSPOuVsuw/VPPEU6xJJpFOzBDKU40UGwQ9jbJI3 G6nhea5kVAtu77I=
    X-PMX-Version: 6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.4.20.173924
    X-PMX-Server: mxe28.s.uw.edu
    X-Uwash-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_ENDS_IN_URL 0, BODY_SIZE_1200_1299 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BULK_EMAIL_SENDER 0, DATE_TZ_NA 0, DKIM_SIGNATURE 0, IP_HTTP_ADDR 0, MIME_TEXT_ONLY_MULTI 0, SMALL_BODY 0, SPF_PASS 0, SXL_IP_TFX_ESP 0, __ANY_URI 0, __CANPHARM_UNSUB_LINK 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_ALT 0, __DQ_NEG_HEUR 0, __DQ_NEG_IP 0, __HAS_FROM 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NS '
    Dr. Ries -
    I was wondering if you perhaps.......

    From the menu bar select View-Headers-Normal instead of All.
    No menu bar? Press the alt key.

  • Unwanted code in some browsers

    When I test a set of pages I get this appearing in some browsers, but not all, at the top of the page.
    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
    What have I done and how can I lose it?

    Does this thread apply to your situation?
    http://www.gthelp.com/showthread.php?t=127587

  • File:///center%3E,br%3E%3Cbr%3E page not found appears when opening looks to be html code. How can I rectify the problem.

    On first search file:///center%3E,br%3E%3Cbr%3E appears in the search bar looks to be html code that has got in there somehow. How can I remove the unwanted code so that the browser returns to normal.

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Firefox > Preferences > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Peculiar behavior of Shared Variable RT FIFO

    I'm trying to "leverage" the enhanced TCP/IP and Shared Variable properties of LabView 8.5.  My application involves (among other things) doing continuous sampling (16 channels, 1KHz/channel) using 6-year-old PXIs (Pentium III) and streaming data to the host.  I developed a small test routine that was more than capable of handling this data rate, even when I had the host put a 20msec wait between attending to the PXI (to simulate other processing on the host).  To do this, I enabled the "RT FIFO" property of the Shared Variable (which was an array of 16 I16 integers) and specified a buffer size of 50 (that's 50 arrays).  Key to making this work was figuring out the "error codes" associated with the SV RT FIFO, particularly the one that says the FIFO is empty (so don't save the "non-data" that is present).
    Flush with success, I started developing a more realistic routine that involves rather more traffic between Host and Remote, including the passing back and forth of "event" data.  These include, among other things, "state variables" to enable both host and remote to run state machines that stay "in sync"; in addition, the PXI also acquires digital data (button pushes, etc.) which are other "events" to be sent to the Host and streamed to disk.  I developed the dual state-machine model without including the "analog data" machine, just to get the design of the Host/Remote system down and deal with exchanging digital data through other Shared Variables.  Along the way, I decided to make these also use an RT FIFO, as I didn't want to "miss" any data.  One problem I had noticed when using Shared Variables is the difficulty of telling "is this new?", i.e. is the variable present one that has been already read (and processed) or something that needs processing.  I ended up adopting something of a kludge for the events by including an incrementing "event ID" that could be tested to see if it was "new".
    Today, I put the two routines together by adding the "generate 16-channels of integer data at 1 KHz and send it to the Host via the Shared Variable" code to my existing Host/Remote state machine.  I used exactly the same logic I'd previously employed to monitor the RT FIFO associated with this Shared Variable (basically, the Host reads the SV, then looks at the error code -- a value of -2220 means "Shared Variable FIFO Read Buffer Empty", so the value you just read is an "old" value, so throw it away).  Very sad -- my code threw EVERYTHING away!  No matter how slowly the Host ran, the indicator always said that the Shared Variable FIFO Read Buffer was empty!  This wasn't true -- if I ignored the flag, and saved anyway, I saw reasonable-looking data (I was generating a sinusoid, and I saw numbers going up and down).  The trouble was that I read many more points than were actually generated, since I read the same values multiple times!
    Looking at the code, the error line coming into the Shared Variable (before it was read) was -2220, and it remained so after it was read.  How could this be?  One possibility is that my other Shared Variables were mucking up the error line, but I would have thought that the SV Engine handling reading my "analog data" SV would have set the error line appropriately for my variable.  On a hunch, I turned of the RT FIFO on the two Event shared variables, and wouldn't you know, this more-or-less fixed it!
    But why?  What is the point of having a shared variable "attached" to an error line and having it return "Shared Variable FIFO Read Buffer Empty" if it doesn't apply to its own Read Buffer?  This seems to me to be a very serious bug that renders this extremely useful feature almost worthless (certainly mega-frustrating).  The beauty of the new Shared Variable structure and the new code in Version 8.5 is that it does seem to allow better and faster communication in real-time using TCP/IP, so we can devote the PXI to "real-time" chores (data acquisition, perhaps stimulus generation) and let the PC handle data streaming, displays, controls, etc.
    Has anyone been successful in developing a data-streaming application using shared variables between a PXI and and PC, particularly one with multiple real-time streams (such as mine, where I have an analog stream from the PXI at 16 * 1KHz, a digital stream from the PXI at irregular intervalus, but possibly up to 300 Hz, and "control" information going between PC and PXI to keep them in step)?  Note that I'm attempting to "modernize" some Version 7 code that (in the absence of a good communication mechanism) is something of a nightmare, with data being kept in PXI memory, written on occasion to the PXI hard drive (!), and then eventually being written up to the PC; in addition, because the data "stayed" on the PXI, we split the signal and ran a second A/D board in the PC just so we could "see" the signal and create a display.  How much better to get the PXI to send the data to the PC, which can sock it away and take samples from the data stream to display as they fly by on their way to the hard drive!
    But I need to get Shared Variables (or something similar) working more "understandably" first ...
    Bob Schor

    Bob,
    The error lines passed into and out of functions are just just clusters with a status boolean, an error code, and an error string, and are not "attached" to a particular function as you describe in your post.  Most functions have an error in input and an error out output, and most functions will simply do nothing except pass through the error cluster if the error in status is True (to verify this for yourself, double click on a function such as a DAQmx Read or Write and look at the block diagram.  If there is an error passed in, no read/write occurs).  This helps prevent unwanted code from  executing when an error does arise in your program.  By wiring the error cluster from your other shared variables to your analog data variable, you're essentially telling LabVIEW that these functions are related and that your analog data variable depends requires that the other shared variables are functioning properly.  The error wire is a great way to enforce the flow of your program, but you must always consider how it will affect other functions if an error does arise.
    Anyways, it's great that you have things more or less working at the moment.  Keep us all updated!

  • OBIEE 11g ignoring custom styles after a space in the formatting

    Hi,
    Has anyone else ran into this odd little problem?
    I'm applying custom styles to our new corporate skin, and it's all working just fine until I enter a piece of code like this:
    .QCPageColumnSectionSidebar{padding-bottom:1px;width:100%;border:solid 1px #000080;background-color:#dce4f9;}
    It appears that as soon as OBIEE encounters the spaces in the CSS formatting, it escapes and ignores the rest. In this case, the border gets applied, but the background color does not. If I swap places of the two classes, then the background color is applied and the border is not.
    In addition, any styles defined after this style are ignored.
    When I inspect element in Firebug, I am seeing this behavior coming through on the presentation side. The CSS that follows the style with a space in it isn't appearing.
    The styles defined by default have very similar styles and they appear to work; does anyone have any idea why my custom styles aren't?
    Thanks in advance,
    Krista

    Some times we get unwanted code.. some thing like when you copy from browser to MS word some html code come along with...

  • Can't get rid of space without the page shifting out of view

    Hello. I've got a big space appearing above my title line in this page. http://www.sarahpellerdesign.com/jordan/schooner.html See how there is a lot of white space above the words "Schooner Adventuress"? So, I went to the code and saw this on line 56:  <p>& n b s p;</p> (put spaces in there, otherwise it won't show up)
    I tried to delete that line and it resulted in the entire page below the nav bar shifting over to the right, so that it is sort of "attached" to the right end of the nav bar. When I preview it in the Chrome browser, it looks like nothing's changed, but it remains shifted to the right in dreamweaver. Unfortunately, in that position, I can't get to the content. It's stuck off the side of the page and I can't scroll over to it.
    Anyone know how to fix this?
    Thanks!

    Hi Sarah -
    Code view is a better place to delete unwanted code precisely. 
    In design view you can accidently remove more than you intended and disrupt your layout.
    You also have some wonky partial table code at the very bottom.
    <table width="850" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>  </tr>
    </table>
    After you remove it, run your URL through the validator at
    http://validator.w3.org/

  • Why does adobe Premiere Pro CC Crash every time I export a movie file?

    Why does adobe Premiere Pro CC Crash every time I export a movie file?

    Please hand type your posts directly into the browser window.  Copy/Paste leaves unwanted code throughout.
    span style="color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #000000;"

  • Adobe Premiere Pro CC Crashing Every time.

    I just stared using Premiere and I like it! Fast rendering, great quality and small file sizes. Everything you want! But after the video I edited and rendered in Premiere, I went on to do another and now it crashes when i'm editing, crashes when i'm rendering. I have used the same file type for both the video that I successfully edited and rendered. The video file is a AVI 1280x720 30fps from Dxtory with the audio files (2) extracted to there on file, my voice and then windows audio. everything on my computer including Premiere is up to date. I have re-installed it once and even tired a few different video drivers. My PC spec are i5-2320 @ 3.00GHz, 8 GB ram GDDR3, 1TB Hard Drive, GTX 660 SC and it is all running on Windows 7 64bit.
    This is what it is telling me when it crashes.
    Files that help describe the problem:
    C:\Users\Ryan\AppData\Local\Temp\WERE239.tmp.WERInternalMetadata.xml
    C:\Users\Ryan\AppData\Local\Temp\WERFAAA.tmp.appcompat.txt
    C:\Users\Ryan\AppData\Local\Temp\WERFD0B.tmp.mdmp
    Read our privacy statement online:
    http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
    C:\Windows\system32\en-US\erofflps.txt

    Please hand type your posts directly into the browser window.  Copy/Paste leaves unwanted code throughout.
    span style="color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #000000;"

  • LABVIEW VIs STRUCK RANDOMLY

    Hi,
    I would like to receive few inputs about
    the issue that I am facing in My Project.
    Station Details:
                          Intel[R]Xeon[R]
    CPU
                          W3530
    @2.80GHz
                          2.80 GHz, 3.00 GB
    of RAM
    LabVIEW Version:
    LV8.6
    We have developed two VIs [say
    A.vi & B.vi] & We are using Notifier
    to communicate between VIs.
     Functionality: A.vi communicates B.vi in a loop of 50,000+  iterations by using Notifier. 
                              At each loop, 
                                    i)   B.Vi performs SMBUS Write & Read operations with custom DLLs
                                    ii)  UI Tree Update will also happen.
                               We have configured Notifier timeout as 10secs.
     Issue:  During 50,000+  iterations, B.Vi is getting struck at somewhere for more than 2hrs. At that period, we expect A.vi to throws
                 Notifier timeout [as Notifier timeout was configured as 10secs] 
                 But suppressingly, both B.vi & A.vi hangs at that time. 
    Note:T
    here is no Delay or Infinite loop in B.vi which causes B.vi to hang.
    Approaches
    taken to figure out the Issue:
      1. We have logged Timestamp between actions in both A.vi & B.vi & we came to know both the VIs got struck at that period.
          We are guessing LabVIEW may hang at that period.
      2. We have avoided memory building &
    removed the unwanted code from both VIs. But still we are facing the issue at
    randomly.
     We are trying to understand the following things:
            1. Even if B.vi hangs why A.vi does not throws any timeout error.
            2. Based on debugging, we found that LabVIEW gets freezed at that time due to either SMBUS DLL or other actions.
            3. We have figured out there is no delay / issue in SMBUS DLL.
    Possibilities for the
    Issue may be:
    1. Memory Leaking / Memory
    Overflow: We have noticed that while
    running the VI, the memory occupied by LabVIEW is:
                                                                          179,300KBytes.
     During the execution also, LabVIEW occupies more or less same the
    memory.
    2. Data BackUP
    Software:                           We have disabled the DataBackUp
    Software in the System. But still we are facing the
                                                                           issue.
     Please provide your suggestions of how to
    debug this further to figure out the issue.
    Thanks,
    Saranya 

    What is "getting struck". This term is usually used in combination with lightning.
    How long is "more than 2 hours"?
    Does it recover soon after 2 hours or does the condition typically continue forever?
    What is your operating system?
    How do you know there is no problem with the dll?
    How is the dll call configured? does it run in the user interface thread?
    Have you tried a newer LabVIEW version?
    LabVIEW Champion . Do more with less code and in less time .

  • Preserving Source Clip Information Upon Export In Premiere

    Is there a way to export clips from sequence timeline and preserve source clip metadata?
    Example - I have a clip I used warp stabilizer on and I have marked the clip with in/out. Now I would like to export the clip with same clip name and source timecode and hoping there is a setting to do so.
    Thanks, Chris

    [Please manually type your posts into the browser.  Copy/Paste leaves unwanted code throughout.]
    span style="color: #000000; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; font-size: 12pt; background-color: #6b7fa0;

  • Do I understand AP Divs & relative positioning?

    Hello.
    So to cut a long story short....
    I am newbie & plunged into creating my first website using all AP elements, only to find out that this is not a good way because of the nature of the AP's.
    After much help from this forum (PZ in particular) I decided to do my research a little bit more.
    I still have to create another website that I guess should really be built in flash (as suggested by someone). But as I dont know Flash this is not an option. (please see attached design concept).
    The only elements I really need at this point would be for the "get a quote" & "about", "contact" bubbles to have rollover states that change colour when the mouse goes over them.
    I have been trying to find the best way of doing this without AP elements.
    1) Create a Div container with the main image for the background, then insert a table and try to insert the rollover images that way. But after research, I am finding that I should be steering away from tables and moving towards CSS. Which then led me to Idea no 2.
    2) Create a Div container with the main image for the background, then insert Div's and adjust the margins (relative positioning?) to move to the Divs in correct places I need the rollovers. But again I read that this method should only be done for tweaking a web page and not  structuring a webpage as may cause problems.
    3) Create a Div container with the main image for the background, then insert Div's in a grid like system (see attached image of my guides where I would place Div's), But this seems a over complicated way to do it and you end up with divs that have no use & lots of unwanted code.
    OR am I right in thinking this works?
    4) Apply a relative positioned Div, set background image, then place AP div's inside RP Div that I would use for my rollovers? If I did this would this then avoid the problem of the AP divs moving in different browsers?
    Or have I got this all completely wrong and have to go back to the drawing board again?
    Your thoughts would be appreciated :-)
    Many thanks in advance
    Louisa

    Build your HTML content logically from top of page to bottom of page.  Use default CSS positioning (which is no positioning at all) for the majority of your page layout.
    Use AP Divs only when absolutely necessary because doing so removes them from normal content flow.
    To control APDivs in relation to other content on the page, you many need to wrap them inside a relatively positioned container.
    Example of APDivs inside a Relatively positioned container:
    http://alt-web.com/DEMOS/CSS-Disjointed-Menu-Rollover.shtml
    As far as your design concept goes, you could do this a number of ways.  With CSS sprites or an Image Map, for example.
    http://alt-web.com/DEMOS/CSS-Sprites.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Need help in automating batch placing of images on spreads

    My workflow is :
    I have jpeg files (mostly 100+).
    They are the size of 2 pages (e.g. 1 spread per jpeg file)
    I need to place them on either even or odd page (aligned Top-Left).
    Currently I’m doing this work manually.
    Need help to automate this.
    Thanks and regards.

    As I mentioned earlier I have very little experience with JavaScript.
    I also copied the ImageCatalog script to a new file and read it atleast five times, and tried to wrap my head around the flow of execution.
    The comments were really helpful in the process.
    I proritized what i want to achive with my script and started deleting unwanted code. I also tested it frequently.
    Here is my script as it stands right now.
    function Init(){
            var myFilteredFiles;
            //Make certain that user interaction (display of dialogs, etc.) is turned on.
            app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
            myExtensions = [".jpg", ".jpeg"]
            //Display the folder browser.
            var myFolder = Folder.selectDialog("Select the folder containing the images", "");
            //Get the path to the folder containing the files you want to place.
            if(myFolder != null){
                        if(File.fs == "Macintosh"){
                            myFilteredFiles = myMacOSFileFilter(myFolder);
                        else{
                            myFilteredFiles = myWinOSFileFilter(myFolder);
                        if(myFilteredFiles.length != 0){
                                myPlaceImages(myFilteredFiles);
                                alert("Done!");
    // call the initial function
    Init();
    //Windows version of the file filter.
    function myWinOSFileFilter(myFolder){
              var myFiles = new Array;
              var myFilteredFiles = new Array;
              for(myExtensionCounter = 0; myExtensionCounter < myExtensions.length; myExtensionCounter++){
                        myExtension = myExtensions[myExtensionCounter];
            myFiles = myFolder.getFiles("*"+ myExtension);
                        if(myFiles.length != 0){
                                  for(var myFileCounter = 0; myFileCounter < myFiles.length; myFileCounter++){
                                            myFilteredFiles.push(myFiles[myFileCounter]);
              return myFilteredFiles;
    function myMacOSFileFilter(myFolder){
              var myFilteredFiles = myFolder.getFiles(myFileFilter);
              return myFilteredFiles;
    //Mac OS version of file filter
    //Have to provide a separate version because not all Mac OS users use file extensions
    //and/or file extensions are sometimes hidden by the Finder.
    function myFileFilter(myFile){
              var myFileType = myFile.type;
              switch (myFileType){
                        case "JPEG":
            return true;
                                  break;
                        default:
                        for(var myCounter = 0; myCounter<myExtensions.length; myCounter++){
                                  var myExtension = myExtensions[myCounter];
                                  if(myFile.name.indexOf(myExtension)>-1){
                                            return true;
                                            break;
              return false;
    function myPlaceImages(myFiles){
            var myDocument = app.documents.item(0);
            var myDocumentPreferences = myDocument.documentPreferences;        
            var myNumberOfFiles = myFiles.length;
            alert(myNumberOfFiles);
            var myNumberOfPages = (myNumberOfFiles * 2) + 1;
            myDocumentPreferences.pagesPerDocument = myNumberOfPages;       
            var myPage = myDocument.pages.item(0);
            var myPages = myDocument.pages;
            for (myCounter = myDocument.pages.length-1; myCounter >= 0; myCounter--){ 
                if(myCounter%2 == 1){
                     myPage = myPages.item(myCounter);
                    var myLiveWidth = myDocumentPreferences.pageWidth
                    var myLiveHeight = myDocumentPreferences.pageHeight
                    myY1 = 0
                    myY2 = myLiveHeight
                    myX1 = 0
                    myX2 = myLiveWidth * 2
                    myRectangle = myPage.rectangles.add(myDocument.layers.item(-1), undefined, undefined, {geometricBounds:[myY1, myX1, myY2, myX2], strokeWeight:0, strokeColor:myDocument.swatches.item("None")}); 
            for (myCounter = 0; myCounter < myNumberOfFiles; myCounter++){ 
                myFile = myFiles[myCounter]; 
                //alert(myFile);           
                myRectangle = myDocument.rectangles.item(myCounter);
                myRectangle.place(File(myFile));
                        for (var myCounter = myDocument.rectangles.length-1; myCounter >= 0;myCounter--){ 
                                  if (myDocument.rectangles.item(myCounter).contentType == ContentType.unassigned){
                                            myDocument.rectangles.item(myCounter).remove();
                                  else{
                                            //As soon as you encounter a rectangle with content, exit the loop.
                                            break;

  • SAP Printers and Mass Printing of SAP Work Orders

    Good day Experts,
    We have a printer related issue especially mass printing of Work Orders. We have discovered that printing a list
    of work orders takes longer with intervals of 10min up to an hour, as compared to printing smaller list(1-5 etc)
    We are not certain whether this problem originates from the Network or SAP. The problem is not one of uniform nature,
    changes frequently, Sometimes better and sometimes worse.
    Please advise me.
    Thank you.
    Regards,
    Sibusiso

    hi,
    There could be many reason behind this
    1. Logic put to fetch data without key fields
    2. unwanted code
    3. Using System status search
    4. getting data from User status tables such as JCDS
    just check by giving print with one order, even if it results in performance issues, then it requires Fine tuning
    you have to check with developer to removed unwanted code
    regards,
    santosh

  • Makepkg: Record PKGBUILD sources in .PKGINFO files for maintenance

    To me, it seems like a good idea to record all the source files listed in PKGBUILD's to their accompanying .PKGINFO files; then, should the user have configured the $SRCDEST variable in his /etc/makepkg.conf, this would allow old source files to be (optionally) automatically removed when `pacman -Sc' is run, the package is upgraded, or uninstalled.  Such a feature would save (me) a lot of time and effort manually sorting through and cleaning them.
    Do you "concur"? ( )
    Of course, for this feature to be really useful, you would have to compile from source often.

    This script will parse all the PKGBUILD's in your $ABSROOT directory, collect all their sources into an array, and interactively remove each package NOT in the array from your $SRCDEST, although recording each pkg's source files into its .PKGINFO file would be SO much easier, faster, simpler, and safer (as no unwanted code -- such as little tid bits outside the build() method of PKGBUILD's -- is executed while the sources are being collected).
    #!/bin/bash
    . /etc/makepkg.conf
    . /etc/abs.conf
    if [[ "${SRCDEST}" != "" && "${ABSROOT}" != "" && -d "${SRCDEST}" && -d "${ABSROOT}" ]]; then
    # Holds the column width of the current terminal window
    COLS=$(tput cols)
    # Create an empty row of the width of the current terminal window
    #+ which will be used to erase the current row.
    for sp in $(seq $COLS); do
    empty_row="${empty_row} "
    done
    # Array to hold the sources
    sources=()
    # Array to hold the files to remove
    remove_files=()
    echo "Collecting sources..."
    for PKGBUILD in $(find "${ABSROOT}" -type f -name PKGBUILD); do
    echo -ne "${empty_row}\r${PKGBUILD:0:$COLS}\r"
    . "${PKGBUILD}" &> /dev/null # Silence is golden
    sources=(${sources[@]} ${source[@]##*/})
    done
    # Sort and prune the files
    sources=($(for src_file in ${sources[@]}; do echo "${src_file}"; done | sort | uniq))
    echo -e "${empty_row}\rExamining ${SRCDEST}..."
    for src_file in $(find "${SRCDEST}" -type f | sort); do
    # Show the status
    echo -ne "${empty_row}\r${src_file:0:$COLS}\r"
    # Copy the basename of the current source file for comparisons
    current=${src_file##*/}
    i=0
    j=${#sources[@]}
    k=$(( (i + j) / 2 ))
    # Perform a binary search for the current file
    for (( c = 0; c < ${#sources[@]}; c++ )); do
    let "k = (i + j) / 2"
    if [[ "${sources[k]}" < "${current}" ]]; then
    let "i = k + 1"
    elif [[ "${sources[k]}" > "${current}" ]]; then
    let "j = k - 1"
    else
    break
    fi
    done
    # If the file at ${sources[k]} isn't the one we're looking for,
    #+ check the element immediately before and after it.
    if [[ "${sources[k]}" < "${current}" ]]; then
    # Bash will let me slide when I try to print an element beyond its indices ...
    let "k += 1"
    elif [[ "${sources[k]}" > "${current}" && $k > 0 ]]; then
    # ... but complains when I try to print an element at an index < 0
    let "k -= 1"
    fi
    # If a match is not found ...
    if [[ "${sources[k]}" == "${current}" ]]; then
    # Since both arrays are sorted, I can remove all the elements
    #+ in ${sources[@]} up to index k.
    sources=(${sources[@]:k + 1})
    # Proceed to the next iteration
    continue
    fi
    # Else, add the file to the list of those to be removed
    remove_files=(${remove_files[@]} ${src_file})
    done
    echo -e "${empty_row}\rFound ${#remove_files[@]} files to remove:"
    if (( ${#remove_files[@]} )); then
    for index in $(seq ${#remove_files[@]}); do
    echo " ${index}) ${remove_files[index - 1]}"
    done
    echo -n | read # Clear the buffer (I had some issues)
    echo -n "Would you like to remove all these? [Y|n|c]"
    read ans # or `read -n 1 ans' if you prefer
    case "$ans" in
    ""|[Yy]|[Yy][Ee][Ss])
    for f2r in ${remove_files[@]}; do
    rm "$f2r" || echo "cannot remove $f2r"
    done
    [Cc]|[Cc][Hh][Oo][Ss][Ee])
    for f2r in ${remove_files[@]}; do
    echo -n "${f2r}? [Y|n] "
    echo -n | read # Clear the buffer, again
    read ans
    if [[ "$ans" == "" || "$ans" == [Yy] || "$ans" == [Yy][Ee][Ss] ]]; then
    rm "$f2r" || echo "cannot remove $f2r"
    fi
    done
    esac
    fi
    elif [[ "${SRCDEST}" == "" || ! -d "${SRCDEST}" ]]; then
    echo "Your \$SRCDEST variable is invalid" 1>&2
    echo "Be sure it's set correctly in your \`/etc/makepkg.conf'" 1>&2
    exit 1
    else
    echo "Your \$ABSROOT variable is invalid" 1>&2
    echo "Be sure you have \`abs' installed and that \`/etc/abs.conf' exists" 1>&2
    exit 1
    fi
    (06/02/2009) If we depended on many little scripts to handle our package management, what would then be the purpose of package managers?
    (06/02/2009) Minor edit -> changed `echo' to `echo -n'  on line 90 of my script (superficial modification).
    Last edited by deltaecho (2009-06-02 21:42:54)

Maybe you are looking for

  • Issues during technical upgrade from 4.6c to ecc 6.0

    Hi We are doing a technical upgrade from 4.6C to ECC 6.0. Some transactions in QM module when tested in ECC 6.0 test client give a abap termination message (or dump) and certain transactions like qs42,46, qa18, qs34 etc do not get executed (error = n

  • FRM-40011 Error on Oracle 9i AS

    Hi! I have a form deployed on Oracle 9i AS Release 2. The form is compiled on forms 6i -Patchset 14 and when I try to access this form on the client PC I get FRM-40011 error that the form has been created using lower version of From builder. If I com

  • Zen Vision M static sounding while playi

    I have a 30gb Zen Vision M and I love the heck out of this thing! I've always been devoted to Creative like a fanboy. I've had a few problems with my Micros(plural, at least 2, both broke cause I'm clumsy) and my original MuVo. Anyways, I've dropped

  • How do I start using CS6 on MacBook Pro (yosemite)? I'm getting a configuration error 16 message

    I've used Carbon Copy Cloner to clone CS6 and lots of other Adobe programs onto a newer MacBook Pro (yosemite), and I'm getting a configuration error 16 message... tried making the Adobe PCD and the SLStore stuff "read & write" but no good. Any help

  • Error when trying to register VMM as Virtual Machine Cloud provider

    Hello, I have some unusual problem with registering VMM server 2012 SP1 in WAP. The error is in WAP application log Windows Azure Log\Mgmt-SVC-AdminAPI: ''...An error occurred while processing this request.</message><innererror><message>Execution of