Surprising results on BSEG

I read that  instead of using BSEG, using index tables BSIS & BSA, we can improve performance. We have a old code in our system and I tried to modify using BSIS & BSAS... but my changes are taking more time than the old code.
Old:
loop at TEMPBKPF.
Keep index
  tmpidx = sy-tabix.
Transfering Sy-MANDT value.
  TEMPBKPF-MANDT = SY-MANDT.
  select        BUKRS            "Company Code
                BELNR            "Accounting document number
                GJAHR            "Fiscal year
                BUZEI            "Number of Line Item Within Accounting
                                 "Document
                SHKZG            "Debit/credit indicator
                DMBTR            "Amount in local currency
                SGTXT            "Item Text
                KOSTL            "Cost Center
                HKONT            "General ledger account
                PRCTR            "Profit Center
    into (tempbseg-bukrs,
          tempbseg-belnr,
          tempbseg-gjahr,
          tempbseg-buzei,
          tempbseg-shkzg,
          tempbseg-dmbtr,
          tempbseg-sgtxt,
          tempbseg-kostl,
          tempbseg-hkont,
          tempbseg-prctr)
    from BSEG                    "[Accounting Document Segment]
   where BUKRS = tempbkpf-bukrs  "Company Code
     and GJAHR = tempbkpf-gjahr  "Fiscal year
     and BELNR = tempbkpf-belnr. "Accounting document Number.
        TEMPBSEG-MANDT = SY-MANDT.
        append TEMPBSEG.
Updating TEMPBKPF internal table.
  endselect.
  modify tempbkpf index tmpidx.
endloop.
My Code:
I replaced the loop with FOR ALL ENTRIES & used BSIS & BSAS
access the index tables, for each record in bseg
  SELECT bukrs
         hkont
         gjahr
         belnr
         buzei
         shkzg
         dmbtr
         sgtxt
         kostl
         prctr
         INTO TABLE i_bsis
         FROM bsis
         FOR ALL ENTRIES IN i_bkpf[]
        WHERE bukrs EQ i_bkpf-bukrs        " Company Code
          AND gjahr EQ i_bkpf-gjahr        " Fiscal year
          AND belnr EQ i_bkpf-belnr.       " Accounting document Number.
  IF sy-subrc EQ 0.
    SORT i_bsis.
  ENDIF.
  SELECT bukrs
         hkont
         gjahr
         belnr
         buzei
         shkzg
         dmbtr
         sgtxt
         kostl
         prctr
         INTO TABLE i_bsas
         FROM bsas
         FOR ALL ENTRIES IN i_bkpf[]
        WHERE bukrs EQ i_bkpf-bukrs        " Company Code
          AND gjahr EQ i_bkpf-gjahr        " Fiscal year
          AND belnr EQ i_bkpf-belnr.       " Accounting document Number.
  IF sy-subrc EQ 0.
    SORT i_bsas.
  ENDIF.
Finally, I will loop through both these itabs and build my final itab.
Any thoughts please.
Thanks,
Kiran

I don't know where you read that you should avoid BSEG and use BSIS and BSAS instead, but you should have read Please Read before Posting in the Performance and Tuning Forum instead.
You can also have a look at [Performance - what will kill you and what will leave you with only a flesh wound|/people/rob.burbank/blog/2006/11/16/performance--what-will-kill-you-and-what-will-leave-you-with-only-a-flesh-wound]
A SELECT/ENDSELECT within a loop is something we generally try to avoid, but in your old code, it was using the primary key; in the new code, it is using two SELECTS with at best a secondary index (depending on your release). Then you LOOP through both table to create a final table. But both BSIS and BSAS have the same structure. You could have used the APPENDING option on the second SELECT and avoided some extra work (both programming and execution time).
Finally, depending on what you are trying to do, you will be missing any line items against customers and vendors. BSIS and BSAS have only GL items.
Rob
Edited by: Rob Burbank on Jun 25, 2010 9:59 AM

Similar Messages

  • Tuning the 975x memory: surprising results

    Since I begin to overclock my system, I leave the memory latencies relaxed at 5-5-5-15, because I didn't wanted memory problems. But some days ago I tried some new setting:
    Original settings:  333 x 2 x 1.25 (835 Mhz)  -  5-5-5-15
    New settings: 333 x 2 x 1 (666 Mhz)  -  4-4-4-12
    I knew that, at the same 5-5-5-15 latencies the difference in bandwidth between 666 and 835 mhz were about 5%, so I was very surprised when with the new settings the memory bandwidth improved, despite the lower frecuency. Then I tried (obviously) this new settings:
    New settings 2: 333 x 2 x 1.25 (835 Mhz)  -  4-4-4-12
    And the surprise was even bigger: it was a little better than the original settings, but the overall perfomance was lower than at 666 mhz with 4-4-4-12.
    I didn't do an extensive perfomance testing, but I've tried SuperPI and Sisoft Sandra's processor benchmark, and the numbers were about the same with all configurations, but the memory bandwidth, according Sandra, was better with 666 mhz - 4-4-4-12, and about 6500 MB (with 835 mhz - 5-5-5-15 was 6300 MB). I've tried many times and also tried Everest test, and the pattern was the same.
    Anyone has a theory to explain this ??
    Note: the maximun memory bandwidth I've got was 6700 (with bios 7.5 or newer), when my system had only 2 GB (5-5-5-15). When I've installed the other 2 GB, then dropped to 6300, so I regained some bandwidth now...
    Note 2: 4-4-4-12 are latencies supported by the memory

    Quote from: Heidi on 21-December-07, 12:02:33
    Last report on this is...all problems solved...still running as reported, 9*333 with 1.25 RAM multi @ standard voltage with no locks or any other BS! Rock stable, temperatures on idle (30 degrees ambient) 42-38-36-40, max out with all 4 core employed, 57-49-47-52, run all night long with no one BSOD or anything! Tested with Vista X86, Vista X64, Ubuntu 7.10 in both flavors, Sabayon 64...even I give it a go under OS2 Warp 5...very surprising result! Tested with various benches, but I'll just point out my Everest which claims that this is nearly the fastest of all on their list! I am very pleased with final findings and all it's missing would be employing Core center where I could chose few profiles accordingly! Then this machine would be surprise of all time! If this works out as promised there would be no end of my pleasure using it! Excellent finale! Advice to anyone, if doesn't OC, check the CPU as having Core2 doesn't mean it will reach sky high! I had lot's of issues and nearly all of them was solved simply by replacing the Allendale in one shot! Great board, as I said once earlier, and pity thee is EOL on this mobo!
    Thanks MSI!
    p.s.
    does anyone knows of any utility which can change clock and keep few profiles in it...thanks again!
    I think you should re-apply the thermal paste on your processor, because the temperature difference between cores is too great. Anyway they are pretty low, what cpu cooler are you using ??

  • Surprising results for HashSet

    Some thing wrong in my program? Please help me.
    I am trying to create a TreeSet. I have created a class by name Person which implements equals(Object obj) method. In this program, I am trying to add an unique Person object (new Person(23,"test",6.3f,"blue")) twice to the HashSet. To my surprise takes. Again I am adding the same object to the 2nd HashSet. Then when I try to retainAll() method of the 1st HashSet and 2nd HashSet, I dont see any object being retained at all.
    ======================PROGRAM BELOW============================
    ==============================MAIN PRG=========================
    import java.util.*;
    public class TreeCompare
         public static void main(String args[])
              HashSet set1=new HashSet();
              HashSet set2=new HashSet();
              set1.add(new Person(20,"sun",5.5f,"blue"));
              set1.add(new Person(25,"moon",6.0f,"green"));
              set1.add(new Person(23,"test",6.3f,"blue"));
              set1.add(new Person(23,"test",6.3f,"blue"));
              System.out.println("\nFirst Set:\n"+set1);
              set2.add(new Person(23,"test",6.3f,"blue"));
              System.out.println("\nSecond Set:\n"+set2);
              set1.retainAll(set2);
              System.out.println("\nResultant Set:\n"+set1);
    ==============================PERSON CLASS=========================
    class Person implements Comparable
         int      age;
         String      name;
         float      height;
         String      eye;
         public Person(int age,String name,float height,String eye)
              this.age=age;
              this.name=name;
              this.height=height;
              this.eye=eye;
         public boolean equals(Object obj)
              if(!(obj instanceof Person))
                   return false;
              Person person=(Person) obj;
              return
                        (person.age==this.age)
                        &&(person.height==this.height)
                        &&(person.eye.equals(this.eye))
                        &&(person.name.equals(this.name))
         public String toString()
              return ("\n"+this.age+"\t"+this.name+"\t"+this.height+"\t"+this.eye+"\n");
         public int compareTo(Object obj)
              Person person=(Person) obj;
              if(this.age > person.age)
                   return 1;
              }else if(this.age < person.age)
                   return -1;
              }else if(this.height > person.height)
                   return 1;
              }else if(this.height < person.height)
                   return -1;
              }else
                   int i=this.eye.compareTo(person.eye);
                   if(i!=0)
                        return i;
                   }else
                        int j=this.name.compareTo(person.name);
                        return j;
    }

    Something that is based on those four values, which always returns the same result when the four values are the same, and produces fairly random-looking results, like this:public int hashCode() {
      int value = age;
      value = 37 * value + name.hashCode();
      value = 37 * value + (int)height;
      value = 37 * value + eye.hashCode();
      return value;
    }

  • Surprising Result swith EtreCheck

    My 13" MB Air has been running Mavericks without incident since I installed 10.9 on Day One. Yesterday I downloaded EtreCheck and ran it on both machines (the other is a late 2011 MacBook Pro also running Mavericks).
    The result from this Air is pasted below. The surprising thing is that under CPU it says "100% Notificator". It does that everytime I run EtreCheck on this Mid-2013 MB Air, but never when I run it on the earlier machine. Does anyone know why?
    Phil
    Hardware Information:
      MacBook Air (13-inch, Mid 2013)
      MacBook Air - model: MacBookAir6,2
      1 1.7 GHz Intel Core i7 CPU: 2 cores
      8 GB RAM
    Video Information:
      Intel HD Graphics 5000 - VRAM: 1024 MB
    Audio Plug-ins:
      BluetoothAudioPlugIn: Version: 1.0
      AirPlay: Version: 1.9
      AppleAVBAudio: Version: 2.0.0
      iSightAudio: Version: 7.7.3
    Startup Items:
      HP IO - Path: /Library/StartupItems/HP IO
    System Software:
      OS X 10.9 (13A603) - Uptime: 0 days 7:26:9
    Disk Information:
      APPLE SSD SM0512F disk0 : (500.28 GB)
        EFI (disk0s1) <not mounted>: 209.7 MB
        Macintosh HD (disk0s2) /: 432.19 GB (165.57 GB free)
        Recovery HD (disk0s3) <not mounted>: 650 MB
        BOOTCAMP (disk0s4) /Volumes/BOOTCAMP: 64.72 GB (19 GB free)
    USB Information:
      Western Digital My Passport 0740 1 TB
        EFI (disk1s1) <not mounted>: 209.7 MB
        MBA13_BKUP (disk1s2) <not mounted>: 521.17 GB
        MBA11_BKUP (disk1s3) <not mounted>: 275 GB
        TRANSFER (disk1s4) <not mounted>: 203.52 GB
      Apple Internal Memory Card Reader
      Apple Inc. BRCM20702 Hub
        Apple Inc. Bluetooth USB Host Controller
    FireWire Information:
    Thunderbolt Information:
      Apple Inc. thunderbolt_bus
    Kernel Extensions:
      com.sophos.nke.swi  (9.0.53)
      com.paragon-software.filesystems.ntfs  (112.0.11)
    Problem System Launch Daemons:
    Problem System Launch Agents:
      [failed]  com.paragon-software.NTFS.SparkleUpdate.plist
      [loaded]  com.paragon.NTFS.notify.plist
    Launch Daemons:
      [loaded]  com.adobe.fpsaud.plist
      [loaded]  com.adobe.SwitchBoard.plist
      [not loaded]  com.barebones.textwrangler.plist
      [loaded]  com.bombich.ccc.plist
      [loaded]  com.bresink.system.securityagent3a.plist
      [loaded]  com.google.keystone.daemon.plist
      [failed]  com.livescribe.PenCommService.plist
      [loaded]  com.microsoft.office.licensing.helper.plist
      [loaded]  com.stclairsoft.DefaultFolderXAgent.plist
    Launch Agents:
      [not loaded]  com.adobe.AAM.Updater-1.0.plist
      [loaded]  com.canon.MFManager.plist
      [loaded]  com.google.keystone.agent.plist
      [loaded]  com.paragon.updater.plist
      [not loaded]  com.twocanoes.bootrunner.plist
      [loaded]  net.culater.SIMBL.Agent.plist
    User Launch Agents:
      [loaded]  com.adobe.AAM.Updater-1.0.plist
      [loaded]  com.adobe.ARM.[...].plist
      [loaded]  com.adobe.ARM.[...].plist
      [loaded]  com.adobe.ARM.[...].plist
      [loaded]  com.divx.agent.postinstall.plist
      [loaded]  ws.agile.1PasswordAgent.plist
    User Login Items:
      System Events
      MagicMenu
      CapSee
      PenAutoLaunch
      Transport Monitor
      CalcuBar
      FlashFrozen
      SpeechSynthesisServer
      SIMBL Agent
      AdobeResourceSynchronizer
      Dropbox
      Boot Runner Menu
      AdobeResourceSynchronizer
      finderpop-daemon
      TrapsMonitor
      HP Scheduler
    3rd Party Preference Panes:
      Boot Runner
      RCDefaultApp
      Default Folder X
      FinderPop
      Flash Player
      Logitech Control Center
      Paragon NTFS for Mac ® OS X
      Secrets
    Internet Plug-ins:
      AdobePDFViewer.plugin
      AdobePDFViewerNPAPI.plugin
      AmazonMP3DownloaderPlugin.plugin
      AmazonMP3DownloaderPlugin101750.plugin
      CANONiMAGEGATEWAYDL.plugin
      Default Browser.plugin
      Flash Player.plugin
      FlashPlayer-10.6.plugin
      Flip4Mac WMV Plugin.plugin
      GarminGpsControl.plugin
      Google Earth Web Plug-in.plugin
      googletalkbrowserplugin.plugin
      iPhotoPhotocast.plugin
      npgtpo3dautoplugin.plugin
      o1dbrowserplugin.plugin
      OfficeLiveBrowserPlugin.plugin
      PDF Browser Plugin.plugin
      PDEPrint.plugin
      QuickTime Plugin.plugin
      RealPlayer Plugin.plugin
      SharePointBrowserPlugin.plugin
      Silverlight.plugin
      Unity Web Player.plugin
    User Internet Plug-ins:
      CitrixOnlineWebDeploymentPlugin.plugin
      fbplugin_1_0_3.plugin
      PDF Browser Plugin.plugin
      PDEPrint.plugin
      Picasa.plugin
    Bad Fonts:
      None
    Time Machine:
      Time Machine not configured!
    Top Processes by CPU:
      100%  notificator
        3%  firefox
        1%  WindowServer
        1%  fontd
        1%  EtreCheck
        0%  TrapsMonitor
        0%  coreservicesd
        0%  loginwindow
        0%  warmd
        0%  Finder
    Top Processes by Memory:
      918 MB     firefox
      377 MB     com.apple.IconServicesAgent
      311 MB     thunderbird
      172 MB     Finder
      147 MB     softwareupdated
      147 MB     mds_stores
      82 MB      Dropbox
      82 MB      installd
      74 MB      storeagent
      74 MB      WindowServer
    Virtual Memory Statistics:
      3.23 GB    Free RAM
      755 MB     Active RAM
      3.17 GB    Inactive RAM
      885 MB     Wired RAM
      2.37 GB    Page-ins
      0 B        Page-outs

    w7ox:
    now that your immediate issue is solved by etresoft, I would like to note that you have a chance also to better organise your mac:
    1. in SystemPreferences->Users&Groups->LoginItems:  you have doubles which is frutrating the system, and you have a lot that is not necessary to run at all times, and you have some software that I would avoid in the first place, because it does not do anything for you. I advise to move all entries out with the minus sign underneath, and start them by hand when needed. Rethink which software you do not need at all and uninstall them.
    2. The same multitude in    your-username>Library->LaunchAgents  delete all Adobe entries.
    3. I advise to  uninstall Sophos, and only install the manual scanner if you really think it contributes, better still install ClamXav from the appstore if you want a scanner at all. On access security software is counterproductive in OSX.
    The same for the Bresink software, uninstall it.
    4. It seems you have installed (in an earlier OS maybe) non original Adobe software, often these irregular softwares are infected. Rethink this.
    5. In  MacintoshHD->Library->InternetPlug-ins folder  delete at least   npgtpo3dautoplugin.plugin    : this is a google "video accelerator" plugin in which does not work well and eats resources 'by the truck load'.
    There is a lot more, but this already would help you real seriously.
    Lex

  • Surprising results with unibody MBP

    I picked up a unibody MBP last weekend and am thrilled with it (more here). Last night, with the machine set to "Higher performance" for the 9600M GT chipset, I exported 50 raw images with varying amounts of correction and timed the process. Several runs averaged 234 seconds. I then switched to "Higher battery life", logged out and back in again and repeated the process, getting the exact same time.
    Any idea why these times are the same when the 9600 GT is supposed to be so much faster?
    Thanks,
    Andreas

    Processing the presentation of the progress bar you see on your screen.. or something like that...
    Well, in Mac OS X Snow Leopard the GPU should become more involved in other computational operations, so hopefully you will see a performance increase when it (and perhaps an update to Aperture to make use of the new tech) is released.

  • Background colour expression brings up a surprising result

    0
    down vote
    favorite
    I have a report where I want a cell colour to change if a duplicate value appears. I have used this expression for Background Colour:
    IIF(Previous(Fields!CustomerSurname.Value) = Fields!CustomerSurname.Value, "Red", Fields!CustomerSurname.Value)
    This works fine but if the customer surname is 'Brown' or 'Grey' then the cell colour matches the colour of the surname, eg the surname 'Brown' creates a brown cell background, not red. This doesn't happen with other surnames, eg ones that are not the names
    of colours...
    Any tips / guidance on how to avoid this would be appreciated - thanks.

    IIF(Previous(Fields!CustomerSurname.Value) = Fields!CustomerSurname.Value, "Red", Nothing)
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Simple interface vs. inline speed comparison with unexpected results

    I posted this question also to the Hotspot internals section which was, may be, the wrong place.
    Recently, I wrote a simple superficial test to inform myself about the potential penalty for calling methods through interfaces, generic interfaces, final classes vs. inlined code. The example consists of two interfaces
    public interface A{
        public long doA( long a );
    public interface B{
        public long doB( long b );
    }an interface that extends both
    public interface AB extends A, B {}and two final classes, one implementing AB and the other implementing A and B
    final public class ABClass implements AB {
        final long c;     
        public ABClass( final long c ) { this.c = c; }
        @Override
        final public long doA( final long a ) {
            return a * a + c;
        @Override
        final public long doB( final long b ) {
            return b * b + c;
    final public class APlusBClass implements A, B {
        final long c;     
        public APlusBClass( final long c ) { this.c = c; }
        @Override
        final public long doA( final long a ) {
            return a * a + c;
        @Override
        final public long doB( final long b ) {
            return b * b + c;
    }I perform five tests, each looping over long i from 0 to 1000000000, summing up the return values of both methods called with i. The test is performed calling methods using the parameters AB, a generic Type implementing A & B, and the final classes directly in all possible combinations
    final static private long finalAB( final ABClass ab, final long x ) {
        return ab.doA( x ) + ab.doB( x );
    final static private long finalAPlusB( final APlusBClass ab, final long x ) {
        return ab.doA( x ) + ab.doB( x );
    final static private long nonGeneric( final AB ab, final long x ) {
        return ab.doA( x ) + ab.doB( x );
    final static private < T extends A & B >long generic( final T ab, final long x ) {
        return ab.doA( x ) + ab.doB( x );
    }Furthermore, as a last test, the calls to doA( x ) + doB( x ) are explicitly inlined
    x * x + c + x * x + c;All six tests are performed 10 times.
    The test is here, including the sources:
    [http://www.speedyshare.com/files/22401605/download/test.jar|http://www.speedyshare.com/files/22401605/download/test.jar]
    java -jar test.jar
    When running the test, I get two surprising results:
    1. The first run is the fastest for all tests but the explicitly inlined test. All tests are approx. equally fast but the inlined version is slowest(?).
    2. From the second run, all tests are about 1.5x slower, except the explicitly inlined which has constant speed in all runs and is now the fastest.
    I would be very happy if somebody could highlight to me the rationale behind these effects.
    Thank you very much in advance.

    axtimwalde wrote:
    Again, you're wrongly interpreting, I assume it would help to look at and understand the test?! It demonstrates nicely, that, in Java 6, there is no additional cost for calling methods through interface hierarchies vs. final classes which is very nice. With Java 5, this is not the case, which is also clearly demonstrated by this test. So?
    Referring to nanoseconds makes no sense at all, what matters is the factor that separates two different execution speeds. There are applications, where it matters a lot if it is an order of magnitude slower or not, that may be the argument that separates great from trash. Name one application where your results would make the major functionality of the application an order of magnitude faster.
    Consider also, that there are platforms that still lack support for Java > 5.I write high performance servers for a living. And I have been doing it for years. I have done it in C#, Java and C++. I have profiled applications in all of those languages in multiple problem domains.
    And there was never a single case where call semantics impacted the speed of the application in anyway that was even measurable.

  • Minor Problem with MagSafe Power Adapter

    I got my MBP almost a year ago now (partially why I'm asking the question) and I've noticed that my power adapter doesn't always show the charge light. Sometimes it is not on at all, and sometimes it is less bright in color (both green and amber).
    If I remove it and put it back it usually corrects itself.
    It if fully functional; even if the light is completely out and plugged in it still shows as charging.
    So, is this normal? I never remember having this sort of problem with my PB G4.

    I would think the led light on my adapter cable was broken, but I discovered it works fine on a co-workers MBP. His adapter, which we know works, does NOT work (ie. the led does not come on) when attached to my computer. This indicate to me that the problem, whatever it is, can sometimes be with the computer and not the adapter.
    I would be curious if others with apparently dead leds have tried their chargers on other MBPs.
    Here's the long version of my story:
    My 5W MagSafe completely fried after only 9 months.
    The new adapter was fine for several days until this morning.
    My "low battery" warning popped up, so so I plugged it in to recharge and immediately noticed the little led on the charger cord did not come on.
    I found it hard to believe that I had another bad adapter, so before making the trip back to the store, I went into the studio where there are some other MBP users.
    I plugged my adapter into another laptop and the led came on. It appeared to function completely normally. I tried MagSafe adapters from two other MBPs, but the led did not come on on either of them while attached to my computer.
    This made me think there was some sort of problem with the connector on the computer itself. Just visually, it appears to be clean and corrosion free.
    The next obvious step, it seemed, would have been to try swapping batteries with the other laptops, but mine is a 17" and everyone else here has 15"... and so we have different battery sizes.
    One of the people here at the studio had a little utility called "Coconut Battery", that reports information about the battery health. When I ran it on my laptop, I got what I thought were rather surprising results.
    It showed the usual things like current charge (21%), battery capacity and so on. But under "Additional Info" it said "Charger connected: Yes" and "Battery is charging: No".
    I figured this narrowed it down to a problem with the battery. But as I was showing these results to my co-worker, the "Current Battery Charge" changed from 21 to 22%. Huh? We left it plugged in and it continued to show a steady climb in the charge, as if it is working normally. Except there is no led light, and the software still says it is not charging. Odd.
    I then noticed that the built-in battery level indicator on the status bar was also showing the same increases. The led lights on the back of the battery are indicating an increase as well.
    Just out of curiosity, I ran a second battery health analyzer program and again got these conflicting results. This one reported the same battery charge and capacity and so on as the previous one. It also recognized that the laptop was running off of AC power, that there was a battery, but it said "Not Chargeable."
    So now I am going to let it continue until I have a full charge and then see if the computer will run as usual from the battery.
    I don't think the store here is going to give me another adapter since this one appears to work just fine on the other computers.
    Any thoughts on why the led would work on other laptops but not mine?
    Why the battery health monitors report that the battery is being charged, but also that it is "not chargeable"?

  • [SOLVED]systemd and make a camera visible GUI-wise in your filemanager

    After reading a lot about systemd in the wiki and in this forum I understand there are different opionons about systemd. Anyway, I have a adapted all the changes to rc.conf leaving out only a few daemons to start there. So why not give systemd a try? If you dont want to read the full posting I finally got it to work, basically by reading carefully and checking the suggested tests in the systemd wiki. (loginctl)
    As suggested by the wiki, I tried the systemd yesterday. Enabled via systemctl some services to "replace" my rc.conf daemons. I got what I thought everything to work, including autologin directly to my Xfce4 desktop. Everything except the digital camera.
    When starting Arch traditionally via initscripts I immediately can see the camera in the filemanager (Nautilus) when the camera is attached via USB.
    Some minutes later, after adding "init=/usr/lib/systemd/systemd" to the APPEND line in Syslinux and rebooting, my machine reboots
    fine.But when connecting the camera again it is not visible graphically.
    The camera is there because when using gphoto2 (the commandline) as root I can transfer pictures etc.
    Even if I am no happy CLI user I can handle it when necessary. Handling pictures a graphical view of them is much easier...
    As the wiki about systemd says one can try it out. I have not removed anything from the system and when starting Arch again, the initscript way, I can see the camera again in my filemanager, gthumb works again and pictures can be transferred to my machine.
    In the wiki again, this time about digital cameras
    Permission issues
    Camera devices should be granted permission using ACLs. For this to work, users need to have consolekit or systemd running and the user session must be registered with them accordingly.
    Check this using /usr/bin/ck-list-sessions to verify a value of "TRUE" should be returned for both the "active" and "is-local" fields:
    $ ck-list-sessions | grep TRUE
    active = TRUE
    is-local = TRUE
    ACL=Atlantic Container Line is what first comes into my mind. I have had some connections to transport business...I admit I had to google it to find the correct interpretation of this mumbo-jumbo.
    The wiki also gives a "hint", if this is not working try to use the obsolete camera group and edit some udev rules.
    Should not be necessary when it has worked before systemd and earlier experiences
    But what is this about "Permission issues"?  Here is my listings relative the wiki hints. All seems OK.. or why the heck are there two sessions??
    [leif@krasaki ~]$ ck-list-sessions | grep TRUE
    is-local = TRUE
    active = TRUE
    is-local = TRUE
    [leif@krasaki ~]$ ck-list-sessions
    Session1:
    unix-user = '1000'
    realname = '(null)'
    seat = 'Seat1'
    session-type = ''
    active = FALSE
    x11-display = ''
    x11-display-device = ''
    display-device = '/dev/tty1'
    remote-host-name = ''
    is-local = TRUE
    on-since = '2012-10-24T07:12:56.499847Z'
    login-session-id = '1'
    idle-since-hint = '2012-10-24T07:13:26.994037Z'
    Session2:
    unix-user = '1000'
    realname = '(null)'
    seat = 'Seat1'
    session-type = ''
    active = TRUE
    x11-display = ':0'
    x11-display-device = '/dev/tty7'
    display-device = '/dev/tty1'
    remote-host-name = ''
    is-local = TRUE
    on-since = '2012-10-24T07:13:02.361157Z'
    login-session-id = '1'
    [leif@krasaki ~]$
    As one can see, the ACTIVE values are here as the wiki says. But no camera. Those values are the same, wheter which way the machine is started. But 2 sessions??
    Further reading in the systemd wiki article and consolekit vs systemd.logind gives a clue.
    From the wiki:
    In order to check the status of your user session, you can use loginctl. To see if your user session is properly set up, check if the following command contains Active=yes. All polkit actions like suspending the system or mounting external drives with Udisks should then work automatically.
    So when started via systemd and running logintctl, it gives this surprising result. Does not matter wheter as normal user, nor as root....
    [leif@krasaki ~]$ loginctl
    SESSION UID USER SEAT
    1 1000 leif seat0
    1 sessions listed.
    [leif@krasaki ~]$ loginctl show-session 1
    Id=1
    Timestamp=Wed, 24 Oct 2012 10:57:03 +0200
    TimestampMonotonic=20040019
    DefaultControlGroup=name=systemd:/user/leif/1
    VTNr=1
    TTY=tty1
    Remote=no
    Service=login
    Leader=315
    Audit=1
    Type=tty
    Class=user
    Active=no
    State=online
    KillProcesses=no
    IdleHint=yes
    IdleSinceHint=1351069009642296
    IdleSinceHintMonotonic=6664433
    Name=leif
    [leif@krasaki ~]$
    Surprising? Should it not have been Active=Yes? So something is wrong in my settings although it had worked "before" starting using systemd..
    OK, so far. Lost? Not yet. Double check again everything and I found the culprit, my  ~/.bash_profile which had worked before seemed a bit different to what is suggested in the wiki. The old one, actually started 2 sessions, as also could be seen here above checking ck-list-sessions. That was the problem
    Using a fresh edited ~/.bash_profile as suggested here, the camera is visible graphically
    Finally, just for fun, start again the old initscipt way. Enabling daemon and so on. Still 2 sessions going on....Here it was the "/.xinitrc, which also had some old fashions and I removed the ck-launch-session from the exec line. So even here, now only 1 session..
    Anyway, now the camera is visible, both starting with initscripts, naturally also some daemons active in rc.conf and by starting with systemd.
    I rest my case and it seems systemd works with everything on my machine which is just a normal desktop used by an old man.
    Thanks for reading...

    Solved now! Boot times are as fast as posssible on my HDD I think. Only thing after uninstalling initscripst and initscripts-systemd was that locale was not set inspite of a correct /etc/locale.conf. I had to make /etc/profile.d/locale.sh with this content;
    if [ -s /etc/locale.conf ]; then
    . /etc/locale.conf
    fi
    export LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE
    export LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS
    export LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION

  • Persisting serialized bean in EJB 3.0

    Hello,
    I'm seeing some surprising results in EJB 3.0 when executing an update to some bean that is unmarshalled from a remote client. Perhaps I'm misunderstanding the API, but I reached the conclusion, from documentation and various online discussions, that merge() could handle this need - but it does not. An exception is thrown.
    Via the EntityManager API I can't update a bean that's being constructed from a remote payload. However, if I access the underpinning Toplink Session, I can use its API to execute an update via the unmarshalled bean. So, I'm able to satisfy my need, but I'm a bit surprised in how I have to do it. It seems surprising to me that the public API of EntityManager wouldn't support it, and, instead, I have to navigate to the Toplink API for its mergeClone API. Am I misunderstanding or misconfiguring something?

    Post your update code.

  • MacBook Power Consumption

    We operate tens of macbooks at our campus for student loans. We are trying to cut on the power consumption of the loans operation. I am interested to know how much power does the power brick consume when:
    a) nothing is connected to the MagSafe jack.
    b) the macbook is fully charged and the LED is lit green.
    Please don't guess or think! give me a firm answer if you know. I appreciate that!

    I pulled out my 1940s era General Electric Wattmeter. This is a two-coil instrument that measures Vrms * Irms * cos( phase angle) = actual Watts. This type of meter does not measure reactive power that does not deliver energy to the load but circulates in the system. Reactive power is a concern because the out-of-phase current of reactive power does cause energy loss (I squared R loss) by heating the wires carrying the current.
    Power brick energized, but not attached to computer - unmeasurable.
    Power brick energized, attached to computer, green LED on - about 0.7 Watt.
    Power brick energized, attached to computer, OSX booted, but idle - 8 to 10 Watts.
    Power brick energized, attached to computer, screen saver running - 8 - 12.5 Watts.
    Power brick energized, attached to computer, 5th Element DVD playing - 12.5 -15 Watts.
    Power brick energized, attached to computer, Grapher, contours.gcx - 18.5 - 20.5 Watts.
    Once in a while, I could get the MacBook to peak at about 25 Watts (averaged by the mechanical dynamics of my meter) of power consumption. The initial plug-in of the power pack to the socket also consumes several amps for a split second - too hard to measure accurately with my crude equipment. There's also a little audible crack! as the prong touches the outlet, so it is obviously a pretty large momentary in-rush of current.
    When the power brick is unplugged, the Irms current draw is about 22 mA according to my Fluke 8060A. Presumably that's almost all reactive at close to -90 degrees phase angle relative to the voltage. Switch mode power packs like the MacBook's tend to be capacitive loads. That's about 2.64 VARs of reactive power.
    When the MacBook is idling at about 9.5 Watts of real power consumption, the current draw is about 245 mA. The real power corresponds to about 70 mA of in phase current. This gives the surprising result of about 234 mA of lagging reactive current.
    In terms of what real-world thing can you do? For 10 to 100 MacBooks, I don't belive it is worthwhile to do anything. Probably remediating the power supply to reduce the reactive current load would be good thing. At industrial scales, factories worry about current phase angle a lot. Power providers bill for reactive current they have to generate, otherwise they would lose revenue by heating their transmission lines, but the customer gets no energy delivered to the manufacturing process by the out-of-phase reactive current.
    Probably, the energy consumed and eventual environmental waste generated by remediating 10-100 power supplies, not to mention the engineering hours required, would not offset the power that would be saved over the useful life of the MacBook.
    On the other hand, grumbling at Apple to contract with the manufacturer for a greener design for the power pack for the many thousands of users would be a good thing on which to expend a little energy.
    PS: just to be sure my Wattmeter is giving reasonable results, I plugged in a "60 Watt" bulb that's been used for about 200 hours. According to the meter, it draws 58 watts.
    Bill
    Message was edited by: impulse_telecom

  • I want to create a TTL pulse. The stepper motor I'm trying to control responds to a high to low edge, when the low pulse width is greater than 0.5 microsecon​ds. What is the best way to go about creating a pulse like this?

    I'm using the NI PCI-6025E card connected to an SCB-100 wiring peripheral. I'm programming the DAQ card using LabVIEW 6.0.2 on a win95 box.
    My first attempt has yielded some surprising results.
    I created a vi with a single while loop set to true. Within that while loop is a two frame sequence. Both frames use the "Write to Digital Line.vi".
    The first frame sets the line in wire to false.
    The second frame sets the line in wire to true.
    The device channel on both frames has been set to my user defined channel nam
    e -> clock.
    clock --> sets the DIO0 channel to be digital write out.
    Using an oscilloscope and some wires I hook ground to the SCB-100's digital ground and I hook the probe to the DIO0 channel. What I see are two different pulses alternating between one another. One has a pulse width of 5ms and the other has a pulse width of about 50ms. You seem to get a grouping of one type of pulse followed by a grouping of the other type of pulse.
    Obviously this is very strange and not what I want. It is also far too slow. So I'd like to know if anyone knows how to do this properly. Remember I only need a low pulse width of 0.5 microseconds.
    Thanks,
    Any help or guidance would be much appreciated.
    Scott

    Scott,
    You don't need to use a digital line to create a TTL pulse. The PCI-6025E has two onboard general purpose counters. You can use one of these counters to create a single pulse of the desired pulse width. For an example of how to program the counters on your board, refer to LabVIEW's Search Examples>>I/O Interfaces>>Counters>>Pulse Generation>>DAQ-STC based.
    The advantage of using a counter over the digital line is that it allows you to control the timing of the pulse through hardware and not software. Thus, it is inherently faster, and the timing resolution is more accurate. The counter will count down an internal 20 MHz timebase to create the pulse delay and the pulse width.
    For more information on the hardware capabilities of your board, you can refe
    r to the User Manual online at www.ni.com/manuals.
    Hope this helps.
    Regards,
    Erin

  • Problem with non currency field calculations to become curr

    Hi guys,
    Is there a problem if I have a QUAN field and DEC field forming to become a CURR field? I mean a have this computation below:
    v_var1 = v_var2 * v_var3.
    where v_var1 type QUAN, v_var2 type DEC and v_var3 type CURR...
    would it incur any problem with the calculations?
    Thanks!

    Hi,
    Did you try ?
    Worked for me flawlessly
    tables bseg.
    parameters : qty like bseg-menge,
                       amt like bseg-dmbtr.
    data : result like bseg-dmbtr.
    result = qty * amt.
                write result.
    The only issue is that the result will be rounded upto 2 decimals.
    But if you declare result as
    data : result(13) type p decimals 3.
    Then there will be no issues.
    regards,
    Advait
    Edited by: Advait Gode on Oct 3, 2008 3:59 PM

  • Restrict Withholding Tax change in not cleared documents

    Hello,
    We want to adjust the Document chnage rules - OB32 in a manner that it restricts Withholding Tax fields from changing when the document is not cleared.
    We tested & found that the Withholding tax fields as below when defined in document change rules are giving strange results.
    BSEG-QBSHB          Withholding tax amnt
    BSEG-QSFBT          Wthld.tax-exempt amt
    BSEG-QSSHB          Withhold.tax base
    BSEG-QSSKZ          Withholding tax code
    BSEG-QSZNR          Exemption number
    Of these the field BSEG-QSZNR - Exemption number field remains unmodifiable in FB02 when the document is cleared & also when it is not cleared. We tested it for Vendor & the settings were made for Account type K.
    The field is always greyed out even if we make the field as modifiable in OB32.
    The rest of the fields are remaining modifiable when the document is not cleared & become non modifiable when the document is cleared. This behaviour is not affected by whatever settings we make in OB32.
    We tried to search for an SAP note for this peculiar behaviour but could not find one.
    Could you please help.
    Thanks & Regards
    Shreenath

    Dear Shreenath,
    if You want to retrict, please delete from V_TBAER table the entries I suggested and then go to IMG > Extended Withholding Tax>Calculation>Withholding Tax Type> Define Withholding Tax Type for Invoice Posting or  Define Withholding Tax Type for Payment Posting -->
    There will be a frame named  Control data; there please switch off the flag "W/tax base manual" and "Manual W/tax amount.
    Please do a test and let me know.
    Mauri

  • Trying to understand StreamReader (BinaryReader) BaseStream Position

    This is my first attempt to use BinaryReader in VB 2012 (having previously done so in VBA).
    I am reading an extremely large text (TSV) file which I ultimately intend to divide into many more manageable-sized files that (in the future) I want to be able to randomly access - hence my need to understand the "Position" method.
    My VB code for reading the TSV file is as follows:
    If (File.Exists(TSVFile)) Then
    Using reader As BinaryReader = New BinaryReader(File.Open(TSVFile, FileMode.Open))
    While reader.PeekChar <> -1
    '~~> TEMPORARY MSGBOX TO VIEW STREAMREADER POSITION
    MsgBox(reader.BaseStream.Position)
    '~~> TEMPORARY MSGBOX TO VIEW STREAMREADER POSITION
    '~~> Set up 0 to 4095 Char array to receive Reader buffer
    Dim chrBuffer(4095) As Char
    '~~> Assume it will be the final, probably incomplete, read
    CompleteBufferRead = False
    '>> Complete the Read, return the no. of Chars read - was it complete?
    If reader.Read(chrBuffer, 0, 4096) = 4096 Then CompleteBufferRead = True
    ' BLAH
    ' BLAH
    ' BLAH
    End While
    End Using
    Else
    Exit Sub
    End If
    As you can see, I am using reader.read(Char(),Int32,Int32) to read 4096 characters at a time into a 0-to-4095 Char array - and this code apparently works fine.
    HOWEVER, when I attempted to follow progress by examining the result of "reader.BaseStream.Position" I got the following surprising results: 0; 4098; 8194; 12290; 16386; etc.  The first Position is 0 (i.e. the beginning of the file).  However,
    having just read the first 4096 characters, the second Position is 4098.  The subsequent Position results are all increments of 4096 (as you might reasonably expect) except the final Position which reflects the fact that the very last data is not on the
    4096 boundary.
    What I am trying to understand is why the very first read of 4096 Characters offsets the StreamReader's Position forward an extra two Characters (when all subsequent reads of 4096 Characters increments Position by 4096)?
    Solving this conundrum will help me in devising my future random-access strategy.
    As ever any and all help and assistance will be very much appreciated.
    Paul J

    DON'T USE CHAR with binary data. A CHAR is really two bytes with a private property to indicate that the character is one or two bytes to handle Unicode characters. Use Byte array instead. it is not necessary to use peek instead.  See code below
    Imports System.IO
    Module Module1
    Sub Main()
    Dim byteBuffer(4096) As Byte
    Dim bytesAvail As Integer = 0
    Using reader As BinaryReader = New BinaryReader(File.Open(TSVFile, FileMode.Open))
    Do
    bytesAvail = reader.Read(byteBuffer, 0, 4096)
    If bytesAvail > 0 Then
    End If
    Loop While bytesAvail > 0
    End Using
    End Sub
    End Module
    jdweng

Maybe you are looking for