Moving bits from a long to a int

How do u remove bits from a long and then put then into a int???
thanks,
kelvin

int i = (int)meLong;?

Similar Messages

  • My folders take forever to open and then the docs within take a long time for the icon to pop up. the same thing with moving itmes from the desktop to a folder, and also emptying the trashh

    my folders take forever to open and then the docs within take a long time for the icon to pop up. the same thing with moving itmes from the desktop to a folder, and also emptying the trashh

    Don't know if that would be a failing hard drive, but it may be that you are out of available space. How much hard drive space do you have available? Please highlight the Macintosh HD icon and then press Command and I for a get info window. Once open, please copy and post the following:
    Capacity:
    Used:
    Available:
    Mac OS requires a minimum of 10 - 15% of total hard drive space available and empty at all times in order to operate properly.

  • Moved Acrobat from C drive to D drive, print to PDF no longer works.  How can I fix this?

    I recently moved a few programs from my C drive to the D drive to free up space.  Now, choosing "Adobe PDF" as the printer no longer seems to work.  The save screen appears, but no PDF is created.  Do I need to reconfigure the Adobe "printer" or similar?  Thanks.

    Hey parlorsoldier,
    Could you please elaborate the same on how have you moved Acrobat from C to D drive.
    Did you completely uninstalled the software and then performed custom installation for the C drive location.
    Let me know your workflow, please.
    Regards,
    Anubha

  • Read byte from a long

    Hi,
    How can I read bytes from a long. i..e read one byte by one byte from long.
    Naman Patel

    ok here is my problem how do i ignore the sign byte i.e please check this code
    long nr=1345345333L, add=7, nr2=0x12345671L;
              long tmp;
              long[] result = new long[2];
              char[] pwd = password.toCharArray();
              for (int pCount = 0; pCount < pwd.length; pCount++){
                   if (pwd[pCount] == ' ' || pwd[pCount] == '\t')
                        continue;
                   tmp= (long) pwd[pCount];
                   nr^= (((nr & 63)+add)*tmp)+ (nr << 8);
                   nr2+=(nr2 << 8) ^ nr;
                   add+=tmp;
              result[0]=nr & (((long) 1L << 31) -1L); /* Don't use sign bit (str2int) */;
              result[1]=nr2 & (((long) 1L << 31) -1L);
              int i = 0;
              long x = result[0];
              byte b[] = longToBytes(x);
              String str = "";
              i = 0;
              while(i < 4){
                   if(b[i] == 0x00) {
                        System.out.println("byte is 0x00");
                        str += "00";
                   else {
                        if(b[i] <= 0x0f && b[i] >= 0) {
                             System.out.println("byte is 0x0f" + b);
                             str += "0";
                        break;
                   i++;
              i = 0;
              str += Long.toHexString(result[0]);
              x = result[1];
              b = longToBytes(x);
              while(i < 4){
                   if(b[i] == 0x00) {
                        System.out.println("byte is 0x00");
                        str += "00";
                   else {
                        if(b[i] <= 0x0f && b[i] >= 0) {
                             System.out.println("byte is 0x0f");
                             str += "0";
                        break;
                   i++;
              str += Long.toHexString(result[1]);

  • Why does the new operating system not delete the moved files from their original location - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it

    Why does the new operating system not delete the moved files from their original locations - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it - also, when transferring large amounts of files it becomes a very large problem remembering which files were transferred and which not.

    You're going to need to be more specific, as I'm not quite sure I understand what you're talking about.
    If you're referring to copying from an external hard drive or flash drive, and you want to actually move files rather than copy them, you can hold down the option key to force it to do a "move" rather than a "copy." This is not new behavior, though... the Mac OS has worked this way as long as I can recall (and I've been using it since 1984).
    If you're having a problem with trying to move files from one place to another on a single drive causing them to be copied instead, that is likely because of some permissions issue preventing you from actually being able to move them.

  • Copying or moving video from your Event Library to an external hard disk

    I have a Network Drive where I'm used to putted all my iMovie08 files.
    I'm start using iMovie09 and i'm no longer able to have my *files/library in a network drive*. Did apple remove this functionality? If this is true this is unbelievable because now a days everything goes to network storage. On iTunes i can have my library virtually anywhere. I need to have the same behavior when i'm using iMovie.
    Can someone help me?
    with my best regards,
    Paulo
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Copying or moving video from your Event Library to an external hard disk
    If you want to save space on your computer’s hard disk, you can move your stored video in your Event Library to a compatible external hard disk connected to your computer with a FireWire or USB 2.0 cable.
    You can also copy Events to another hard disk. You might do this, for example, if you want to create a duplicate copy of your video library or an Event on a friend’s hard disk.
    NOTE:When using an external hard disk with iMovie, make sure it has been formatted as Mac OS Extended (Journaled).
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    - If i understood correctly, the solution you propose will replace completely my hard disk library with NAS location.
    - What i need (because when i'm travelling i dont have my NAS) is to have both. My hard disk library and the ability to copy/move (drag & drop within iMovies09 ) events and projects to my NAS at my description as i use to do on iMovies08.
    And yes all my NAS locations appears with and yellow flag on iMovies09.
    best regards,
    Paulo

  • Moving Stack from one folder to another?

    Is there a way to keep a stack together while moving it from one folder to another. When I grab the stack and drop it to a folder, I view the folder and the images are no longer in a stack. It would save me a lot of time if they would stay stacked. Am I missing something?
    Thank you.

    Well your code is unreadable because you didn't post it properly, but I'd guess you've fallen into the old multiple-delete trap in a new way. It's like this:
    To start with you have messages numbered 0, 1, and 2, let's say. So you write a loop that lets i run from 0 to 2 and delete message number i in the loop. What really happens? The first time through the loop you delete message number 0, after which you are left with messages numbered 0 and 1. The second time through the loop you delete message number 1, after which you are left with message 0 only. The third time through the loop you delete message 2, which isn't there and you get that message.
    That's just a guess, I didn't have the patience to read that ugly unformatted code. There are two ways to do the multiple delete properly, if that's actually your problem: (1) run the loop upwards from 0 and always delete message 0; (2) run the loop downwards from N-1 to 0 and delete message i.

  • Moving Photos from One Event to Another

    I don't entirely understand how to do this. When I want to move photos from one event to another, I usually just drag the photos from one event to another. This works fine when the two events are next to each other (within the same window). However, it he event is not in the same window (requiring a scroll up or down) then the drag and drop can't happen (i.e., having to drag photos from my last event to the first event). Any suggestions here?

    If you're merging two Events you ca do this in Event View - just drag one Event to the Other and they will be merged.
    If you're moving pics from an Event to another (but not a Full Merge):
    Photos View, the go View -> Event Titles and option Click on the wee triangle to close all the Events.
    Then open the Event you want to get the Files From. Select the Files.
    Drag them to the bottom of the iPhoto Window - above the toolbar - and the Window will scroll. (There's a bit of a knack to doing this: there's a sweet spot just above the tool bar. Get the Cursor there and the window will scroll. With practise you can even control the rate and speed of scrolling)
    Drop them on the target Event.
    Regards
    TD

  • Moving Away From Auto Modes

    Moving Away From Auto-Exposure   
    Exposure modes
    Auto-exposure mode on your camera does provide generally good photographs, but taking full advantage of the more advanced capabilities of your digital camera will provide even better results. Most modern camera’s have a number of preset exposure modes, and some more advanced cameras’ (especially DSLR’s) have two semi-manual exposure modes and full manual exposure control.
      Portrait mode
    The most common preset is the portrait setting. This mode should have the flash on at all times in case it is needed for correct exposure, as well as isolating the subject in a way that the background and foreground are out of focus and only the subject is in focus.
    Action mode
    Another common preset is the action setting. As the name implies this is a great setting to use if you are photographing sports, or any subject that is moving fast and you want to stop its action.
    Landscape mode
    Landscape preset is also a common preset mode on modern cameras. This mode should have the flash off since the subject is most often outside and well lit, and this mode should also keep detail in the foreground and especially the background in focus.
    Macro mode
    For those of you that like taking images of small subjects (i.e. flowers) most digital cameras also have a preset called macro mode. Macro mode should have the flash on at all times since at higher magnifications even the slightest movement of the subject will blur the image. The flash not only effectively stops the movement of the subject but also evenly illuminates the subject.
    Night mode
    Night mode as the name implies is a preset some camera’s have for taking photographs at night. This mode is generally the least useful preset due to the fact that nighttime photography is perhaps the most challenging photography there is. This mode will turn the flash off, and also turn what’s called noise reduction on. Noise reduction is a setting that helps eliminate the digital noise that is caused by low levels of light on digital camera sensors.
    Semi-manual modes
    Most DSLR’s and some more advanced point and shoot cameras have two semi-manual modes and full manual mode. The semi-manual modes are aperture priority which generally controls what is in focus by adjusting the aperture (the size of the opening in the lens), and shutter priority controls how long the shutter is open which either will blur the image or stop action. The last mode is full manual which allows the user to control both the shutter and the aperture to get the correct exposure allowing the greatest creative control over your images, but requiring the most expertise.
    Moving Away From Auto-Flash   
    Turn off your Auto-Flash
    Most digital camera’s while set on auto-flash, especially point and shoot cameras, don’t allow the user to choose when the flash is on or off. This will usually produce adequately exposed images, but just because your subject is correctly exposed doesn’t mean it’s lighted how it should be. Controlling how you light your subject will make the difference between good images and great ones. To do this you should definitely consider moving away from auto-flash.
    Fill Flash
    When shooting outdoors the camera might read that there is enough light and not fire the flash, but if your shooting a subject that is back lit or top lit a small amount of flash will light up your subject and provide superior results ( this is called fill flash ).
    Red eye reduction
    Another flash setting that most cameras provide is red eye reduction. This setting will fire a series of flashes at your subject to contract their pupils so the flash doesn’t reflect the red from their retinas back to the sensor. This mode works fairly well, but due to the time needed for the pre flashes your subject often will have changed by the time the image is actually taken.
    Allan
    Community Connector
    Best Buy® Corporate
    Allan|Senior Social Media Specialist | Best Buy® Corporate
     Private Message

    Hey Gabriel,
    You don't have to feel sorry.
    I'm sorry that you feel sorry to people who dislike your products.
    Could you tell me how to precompile JSP files and deploy? And, I would like to turn off JSP compilation functionality on live servers completely.
    What's the benefit of using database pm? I'm aware of tarpm bug where it deletes data tar files during tarpm optimization and index merge. Does databasepm have the same problem?
    If I use databasepm, can I be free from regular maintainance such as datastore garbage collection, tarpm optimization..etc? I find it very difficult to run such maintainance scripts on a live server where the repository is heavily utilized 24/7.
    I wouldn't mind shutting down the server and run those maintanence offline. Actually, it would be much better if I could run through maintanance offline.
    Also, I heard that there is a bug for share nothing clustering for CQ5.4. I'm not sure if this is jackrabbit bug. If CQ instances are all clustered and I can take one out at a time for offline maintance, it would be superb.
    And, what about backups and restoration? Why aren't there set of maintenance scripts? There are documentations with script snippets on knowledgebase... But why aren't there official maintenance tools?
    And, where is a book? There are documentations that explain what dispatcher is, what repository is, how to develop custom components, how to configure repositories, ... etc. But why isn't there a book that covers architecture for production site, application development practices, maintenance know-hows?
    Does this all mean that Adobe does not care for CQ, and it will not pursue CQ as a viable technology stack for ADEP WEM? (which will be an excellent news by the way).
    Or is it Adobe's scheme to monetize support  (less publicaly available documents/books.. more support tickets)?

  • Moving Data from Normal table to History tables

    Hi All,
    I'm in the process of moving data from normal tables to
    History tables.
    It can be some sort of a procedure which should be a cron job running at night.
    My aim is to move data say 1.5 yrs or 2yrs old data to History tables.
    What aspects i need to check when moving data. And how can i write a procedure for this requirement.
    The schema is same in both the normal table and history table.
    It has to be a procedure based on particular field RCRE_DT.
    If the rcre_dt is above 2 yrs the data needs to be moved to HIS_<table>.
    I have to insert record in to HIS_table and simultaneously delete record from the normal table.
    This is in Production system and the tables are quite big.
    Pls do find enclosed the attached sample schema for Normal table and HIS_<table>.
    If i want to automate this script as a Cron job for similarly other History tables
    how am i to do it in a single procedure assuming the procedure for moving the data is the same procedure.
    Thanks for ur help in advance.
    SQL> DESC PXM_FLT;
    Name Null? Type
    RCRE_USER_ID NOT NULL VARCHAR2(15)
    RCRE_DT NOT NULL DATE
    LCHG_USER_ID VARCHAR2(15)
    LCHG_DT DATE
    AIRLINE_CD NOT NULL VARCHAR2(5)
    REF_ID NOT NULL VARCHAR2(12)
    BATCH_DT NOT NULL DATE
    CPY_NO NOT NULL NUMBER(2)
    ACCRUAL_STATUS NOT NULL VARCHAR2(1)
    FLT_DT NOT NULL DATE
    OPERATING_CARRIER_CD NOT NULL VARCHAR2(3)
    OPERATING_FLT_NO NOT NULL NUMBER(4)
    MKTING_CARRIER_CD VARCHAR2(3)
    MKTING_FLT_NO NUMBER(4)
    BOARD_PT NOT NULL VARCHAR2(5)
    OFF_PT NOT NULL VARCHAR2(5)
    AIR_CD_SHARE_IND VARCHAR2(1)
    UPLOAD_ERR_CD VARCHAR2(5)
    MID_PT1 VARCHAR2(5)
    MID_PT2 VARCHAR2(5)
    MID_PT3 VARCHAR2(5)
    MID_PT4 VARCHAR2(5)
    MID_PT5 VARCHAR2(5)
    PAX_TYPE VARCHAR2(3)
    PAY_PRINCIPLE VARCHAR2(1)
    SQL> DESC HIS_PXM_FLT;
    Name Null? Type
    RCRE_USER_ID NOT NULL VARCHAR2(15)
    RCRE_DT NOT NULL DATE
    LCHG_USER_ID VARCHAR2(15)
    LCHG_DT DATE
    AIRLINE_CD NOT NULL VARCHAR2(5)
    REF_ID NOT NULL VARCHAR2(12)
    BATCH_DT NOT NULL DATE
    CPY_NO NOT NULL NUMBER(2)
    ACCRUAL_STATUS NOT NULL VARCHAR2(1)
    FLT_DT NOT NULL DATE
    OPERATING_CARRIER_CD NOT NULL VARCHAR2(3)
    OPERATING_FLT_NO NOT NULL NUMBER(4)
    MKTING_CARRIER_CD VARCHAR2(3)
    MKTING_FLT_NO NUMBER(4)
    BOARD_PT NOT NULL VARCHAR2(5)
    OFF_PT NOT NULL VARCHAR2(5)
    AIR_CD_SHARE_IND VARCHAR2(1)
    UPLOAD_ERR_CD VARCHAR2(5)
    MID_PT1 VARCHAR2(5)
    MID_PT2 VARCHAR2(5)
    MID_PT3 VARCHAR2(5)
    MID_PT4 VARCHAR2(5)
    MID_PT5 VARCHAR2(5)
    PAX_TYPE VARCHAR2(3)
    PAY_PRINCIPLE VARCHAR2(1)

    Hi All,
    Thanks for ur valuable suggestion.But can u explain me bit more on this as i'm still confused about switching between partitoned tables and temporary table.Suppose if i have a table called PXM_FLT and an correspoding similar table named HIS_PXM_FLT.How can i do the partitioning shd i do the partitioning on the normal table or HIS_PXM_FLT.i do have a date field for me to partition based on range.Can u pls explain why shd i again create a temp.table.What's the purpose.Now the application is designed in such a way that old records have to be moved to HIS_PXM_FLT.can u pls highlight more on this.Your suggestions are greatly appreciated.As i'm relatively new to this partitioning technique i'm bit confused on how it works.But i came to understand Partitioning is a better operation than the normal insert or delte as it is more data intensive as millions of record need to be moved.Thanks for feedback and ur precious time.

  • I have to generate a 4 char unique string from a long value

    I got a requirment
    I have to generate a 4 char unique string from a long value
    Eeach char can be any of 32 character defined has below.
    private static final char char_map[] = new char[]{'7','2','6','9','5','3','4','8','X','M','G','D','A','E','B','F','C','Q','J','Y','H','U','W','V','S','K','R','L','N','P','Z','T'};
    So for 4 char string the possible combination can be 32 * 32 * 32 * 32 = 1048576
    If any one passes a long value between 0 - 1048576 , it should generate a unique 4 char string.
    Any one with idea will be a great help.

    Well, a long is 64 bits. A char is 16 bits. Once you determine how you want to map the long's bits to your char bits, go google for "java bitwise operators".

  • Computer freezes when moving files from USB, or to another partitioned HD

    Hello, i've been moving files from two USB's to my Macintosh HD, and when I do that, the computer kinda freezes up, i can move the cursor, but not kinda click anywhere, and then a minute after or something, it gets normal again, but the transfer is going horribly slow. this happens when i move from Macintosh HD, to Macintosh HD 2 (a partitioned one). the files are 2 gb each USB. which means im transferring 4 gb at the time.

    Neurot wrote:
    I have 6 folders on my hard drive. These folders were created by downloading a bunch of rar files, then extracting them each to their own folder. I have not touched the permissions, so they should be the default of me having read/write and everyone else having read (correct me if i'm wrong).
    Using two Finder windows, I drag and drop the six folders from one hard drive to another, and hold down the Apple key so that it moves instead of copies. I let go and it starts copying the files (since there is no "move", but rather a "copy and then delete").
    I would recommend you don't use this method to move a lot of files between drives. it's much safer first to copy and if the copy is successful to delete the original afterward. there was a data loss bug in OS X a while back that wold sometimes lead to total loss on both the source and the target when doing this.
    this bug is supposed to be long fixed but still...
    How is the hard drive you are moving the files to formatted? what yo describe sometimes happens when moving a lot of stuff to or from FAT formatted drives. also, repair both drives in disk utility. repair disk, not permissions.
    Message was edited by: V.K.

  • I am having trouble with resetting my ipad mini. I have been having it on reset for 2 hours already and its still on the same spot and not moving anywhere. How long does it usually take to restore settings?

    Anyone having same issue as mines please help me put. I am having trouble with resetting my ipad mini. I have been having it on reset for 2 hours already and its still on the same spot and not moving anywhere. How long does it usually take to restore settings? And how can i exot put of ot from restoring anymore?

    This is how you Reset  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    Are you trying to do a Restore?
    Restoring iOS software
    http://support.apple.com/kb/ht1414
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    If you can’t update or restore your iOS device
    http://support.apple.com/kb/ht1808
     Cheers, Tom

  • Moving videos from iPod

    Hi everyone. I know that moving files from the iPod is a common topic on here. I have CopyPod that works fine for audio, but I'm trying to move some video files, and they're not showing up. I have to move them off because the computer they are on is no longer available to me, and I have a legal right to these files. Does anyone know of a program that will work for moving video files?
    Thanks!
    ~broadcasterchick

    There are two ways I know of:
    1. Load iTunes on the new / replacement computer and log into your iTunes account (actually click on your AppleID and use your password to confirm it is you). Then sync and iTunes "SHOULD" prompt you telling you there are "Purchases" on the iPod that aren't in your Library (that is if you bought them from the iTunes Store). Then it will ask you if you want to copy them into your Library.
    OR
    2. You can search for one of the many FREE programs available that allow you to fairly easily copy to and from your iPod without the use of iTunes.
    Either one has risks involved, but you should be able to choose the best option for your own circumstances.

  • Moving images from external HD to internal - lost metadata (mac)

    got myself in a bit of a pickle here...
    got a new imac - and upgraded from LR2 to LR4
    all images are stored on an external hard drive - i *want* all of my pictures on the internal HD
    so i copied the pictures folder to the internal HD - opened LR4, updated the catalog file (moved it from the extHD - pointed it to the new location on the internalHD)
    apparently the lrcat file didn't get informed though - i had blank spaces in grid-view where there used to be pictures
    so.. jiggered around with it until it found all the pictures (they appeared in grid view) - except, now there were alternating picture/blank-spaces
    i discovered a way to "find" all the missing pictures - then "removed" them
    unfortunately, when we checked our work, we found that the meta-data didn't come with the pictures that remained - so, no stars, tags, flags, etc.......
    good thing is.. i still have the original files and LRCAT file on the extHD
    can somebody help me right this ship??
    (i think i want to just uninstall LR4 and start all over)

    Obviously you can just use the Finder to copy the external iPhoto Library to your new Mac Pro. You should change the name of it first so you don't get the two mixed up or accidentally replace one with the other.
    If you want the old and new photos in a single library you have a couple of choices. The free choice would be to import the "several images" from the MacPro's current library into the external library.
    An easy way to merge two libraries is to use iPhoto Library Manager. It's available here: http://www.fatcatsoftware.com/iplm/
    It has some functions in the free download version but more advanced functions require the US$19.95 shareware fee.

Maybe you are looking for

  • Can't Connect To The Internet Or Router

    I have had my router set up for about three years.  It's always worked perfectly fine until the other day. I think that the router just died, but I'm not sure and I want to try and fix this one before I just go out and buy a new one. Basic Background

  • IPad2 reboots every few minutes

    My iPad2 recently began to reboot every few minutes of use.  It has been reformatted, all added apps removed and the battery allowed to completely deplete then recharge, all to no avail.  Any suggestions?

  • Dual monitors not working in bootcamp?

    Recently added 8 more gigs of ram, and after this my video driver shows a triangle with an ! under bootcamp running windows 7, i have tried countless times to update the driver to no evail even used the bootcamp drivers from the original discs to rep

  • Importing TSV Captions/Metadata into Lightroom?

    Does anyone know if it is possible to import a TSV Metadata file into lightroom? I can't seem to find any option for this. Thinking about moving to Lightroom and the only way I can bring 400,000 captions with me is to hopefully Import. If I can't I'm

  • Fotos vom iPad löschen

    Hallo, ich habe Fotos direkt vom PC auf mein iPad übertragen, also nicht über iTunes. Jetzt bekomme ich sie nicht mehr gelöscht. Ich kann über den PC nicht auf den Ordner zugreifen, in dem die Fotos auf dem iPad gespeichert sind. Auf dem iPad direkt