Inspect this method please.

Hello,
I would greatly appreciate some feedback on this method. The method is part of a class that is part of a project called FileSwap which I am developing in school. (My first networking app)
Please ignore any syntax errors (I just wrote this up and haven't compiled...), and assume that a connection is established and all variables have been properly initialized. I am only looking for feedback on the meat of the method and logic, mainly reading from the socket and writing to a file. Lastly, the method is by no means complete...
Thanks in advance...
// FileSwap - receiveFile()
private final int LENGTH_TO_READ = 1024;
private String lastFileRequested;   // set for every sendCommand() not containing "List"
private String separator;          // dependent on OS
private String sharedDirectoryPath;
byte[] bytesRead;
InputStream is;
BufferedInputStream bis;
FileOutputStream fos;
Socket fsSocket;
public void receiveFile()
     // Before saving the file, verify to overwrite if it already exists
     int overwrite;
     File testOverwrite = new File(sharedDirectoryPath + separator + lastFileRequested);
     if (testOverwrite.exists())
          overwrite = JOptionPane.showConfirmDialog(
               null,
                  ("File: " + lastFileRequested + " already exists. Overwrite?"),
               "Message from FileSwap.",
               YES_NO_OPTION);
          if (overwrite == JOptionPane.YES_OPTION)
               // Save the file
               try
                    fos = new FileOutputStream(sharedDirectoryPath + separator + lastFileRequested);
                    bytesRead = new byte[LENGTH_TO_READ];
                    // Get the sockets input stream
                    is = new InputStream(fsSocket.getInputStream());
                    bis = new BufferedInputStream(is, LENGTH_TO_READ);
                    // read the bytes, write them to a new file
                    while ((lengthRead = bis.read(bytesRead, 0, LENGTH_TO_READ) != -1)
                         fos.write(bytesRead, 0, lengthRead);
               catch (IOException ioe)
                    JOptionPane.showMessageDialog(null, ioe.getMessage());
               // TODO: cleanup
          else
               // Do not overwrite, save new or discard...
               // TODO
     else     
          // File doesn't exist, just save it
          try
               fos = new FileOutputStream(sharedDirectoryPath + separator + lastFileRequested);
               // Get the sockets input stream
               is = new InputStream(fsSocket.getInputStream());
               bis = new BufferedInputStream(is, lengthToRead);
               // read the bytes, write them to a new file
               while ((lengthRead = bis.read(bytesRead, 0, lengthToRead) != -1)
                    fos.write(bytesRead, 0, lengthRead);
          catch (IOException ioe)
               JOptionPane.showMessageDialog(null, ioe.getMessage());
          // TODO: cleanup
}

If I use a buffer larger than 8192, I would have to set the socket receive buffer to reflect this... correct?Not necessarily. Large socket receive buffers always help, but there's no necessary connection between the size of the application buffer and the size of the socket receive buffer. The reason I said 8192 is that BufferedInputStream has an 8192 byte buffer.
This would also prove to be much faster when downloading large files... correct?Definitely, and in this case the larger the socket receive buffer the better. Set it to 64k-1.

Similar Messages

  • Help me in this method please

    I have this problem in this method. This method receives a Creator object(contains: String sip, Sting dip)
    but is returning only the last two, not the first one.
    It seems that the first creator that I input goes stright to the last return, do not passes through the for loop
    So I don't have idea what is going on.
      public Display check(Creator c){
        int counter=0;    
        int index;        
        Display nD = new Display();
        Creator c1 = new Creator(c._sip,1);  
        if(c._sip.equals("")){
          Display nopacket = new Display();
          return nopacket;
        for (index = 0; index < currentSize; index++){
          if (c._sip.equals((data[index])._sip)){  // Check if the index of the data base is equal to the input
            counter = data[index]._counter += 1;   // If it is increment the counter
            nD = new Display(c._sip, c._dip, counter); // initialize the display
            return nD;                             // return the new display with the incrementation of the counter
          else
            nD = new Display(c._sip, c._dip, 1, c._flag);
        enqueue(c1); // Insert the new creator to the database
        return nD;
    I suppose to have:
    192.168.1.1  192.168.4.4  1  0
    192.168.2.2  192.168.5.5  1  0
    192.168.3.3  192.168.6.6  1  0
    and I got:
        0  0
    192.168.2.2  192.168.5.5  1  0
    192.168.3.3  192.168.6.6  1  0please help me.
    Thanks.

    counter = data[index]._counter += 1;  
    nD = new Display(c._sip, c._dip, counter);
    return nD; 
    //should be
    nD = new Display(c._sip, c._dip, counter);
    counter = data[index]._counter += 1;  
    return nD;you are incrementing your counter b4 showing the first item (item 0).

  • HT204266 What happend to my payment account It say "Payment Method Please contact iTunes support to complete this transaction."

    What happend to my payment account It say "Payment Method Please contact iTunes support to complete this transaction."

    If you haven't already done so then you can contact iTunes support via this page and ask them why the message is appearing (these are user-to-user forums, we won't know the actual reason) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then try selecting Purchases, Billing & Redemption

  • Please tell me if this method of backup would work

    Folks:
    I've been reading through ways to backup iPhoto libraries that are larger than a single DVD (i.e. 10 gig, etc). Well, my Library happens to be 10.2 Gig and I've not found a good solution.
    After thinking about it, I might have come to a solution and I'd like opinions on it to see if I'm missing something.
    General Assumptions: You must be happy with the current version of all your pictures (i.e. if you changed/improved an original, you have to be willing to only backup the latest version iPhoto shows you via the application.)
    By highlighting the years you want to export under the
    Source window, use the "Export" feature and export entire years of pictures to a folder. This way the user can monitor the size of the year(s) and begin building a backup-by-year approach. For example, export years 2000 to 2003 (assuming they are under 4.7 or ~8 Gig for Dual layer), then backup 2004 to 2005, etc...once you get to the current year, use a DVD+Rewritable "RW" DVD and continue to add to it till it gets full. Once your RW DVD gets full, burn a permanent DVD and start the RW over from scratch. This way your only permanent DVD burns are true archives and the current stuff resides on a RW.
    By using the export feature, the user would get all their most current pictures exported by a date range, thus allowing the user control as to how large of an archive they are creating.
    Thoughts?
    iMac G5 250 Gig HD, 1 Gig RAM Mac OS X (10.4.5) iLife 6

    Hi TKRWH,
    Burning within iPhoto produces mountable libraries. These libraries will include the original photo and the edited photo. They will not include your slideshows, books, etc. (I am guessing on this) The structure of this library will be the same as your iPhoto Library folder in the Finder.
    This is a great way to backup just your photos and be able to mount the backup within iPhoto to browse the photos on the disc.
    This is not the way to burn the library if you want a working copy of your entire library with keywords, comments, slideshows, books, etc.
    the entire iPhoto Library folder has to be burned or backed up to an external if you want a working copy of the library.
    Here is the info I usually give posters when they ask about backing up a library. There are also programs out there (I think toast is one of them) that will burn the folder over multi discs for you.
    Backing up your iPhoto Library
    1. Burn the iPhoto Library folder in the Finder to a CD or DVD
    This method will give you a burned iPhoto Library folder that can be copied back to your computer to replace a damaged library. You can also use this method to backup an old library when you want to create a new Library to use as your current library.
    insert a blank CD into your internal or external CD-RW drive and copy the iPhoto library to the CD icon on your desktop. When you drag the CD icon to the Trash/Eject button in the Dock, you are given the option to burn the CD. Click Burn and the CD is created. To burn a DVD backup of your digital images, use a DVD and a SuperDrive-equipped Mac
    The easiest way to burn an iPhoto Library folder in the Finder that is larger than 4.7 gig to fit on one DVD is to burn sections of the folder.
    Drag the iPhoto Library folder to the desktop
    Double click the folder to open it.
    Drag each Year folder to the desktop.
    You should be left with the iPhoto Library folder containing all the data files, and the Year folders.
    Combine whatever year folders that amount closest to a DVD burn size on one DVD. Make sure that you have burned all the Year folders, then the iPhoto Library folder with all the data files.
    If you ever need to use this backup, insert the DVDs into your computer and copy the folders to the desktop. Put all the Year folders back into the iPhoto Library folder. Then put the iPhoto Library folder back into the Pictures folder.
    2. Copy the ENTIRE iPhoto Library to an external drive formated for a Mac. Do not use this as your only back up as the external can also go bad.
    3. Copy the ENTIRE iPhoto Library to your iPod in disk mode
    4.Creating your own CDs and DVDs for viewing in iPhoto
    This method is a great way to back up Albums of older photos or even your entire library if it is small enough to fit on a DVD. This method will give you a library that will mount within iPhoto in the source column to be viewed. To import any images from this library they need to be dragged into your library in the source column.
    If you just want to backup the images in your library:
    1) Within iPhoto select the images, albums or rolls you want to backup. Go to Share>Export and export them to a newly created folder on the desktop. Follow the directions in the next link.
    Creating a CD or DVD to be viewed in Windows or by a photo processing company
    1.. If you backed up the entire iPhoto Library by burning within iPhoto or burning the folder in the Finder, make sure the burned copy is a good working copy before you delete the iPhoto Library folder in the Finder. You delete the iPhoto Library in the finder by dragging it to the trash when iPhoto is closed. When you next launch iPhoto it will create a new empty library for you to start anew.
    2. If you burned just the images, be aware that that is all you are archiving. No metadata will travel with the images such as comments, keywords, etc.
    You can then delete those images within iPhoto by highlighting them and hitting the delete key, then empty iPhoto's trash. Do this often and in groups so iPhoto will not choke on too many images.

  • I accidentally uploaded songs from cds to the wrong itunes library. i would like to move those songs to my regular itunes library that i use to purchase and download music, since my ipod cant sync to both libraries. how can i do this? please advise. thank

    i accidentally uploaded songs from cds to the wrong itunes library. i would like to move those songs to the regular itunes library that i use to purchase and download music, since my ipod cant sync to both libraries. how can i do this? please advise? thank you.

    See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • You cannot be signed in at this time please check ...

    Hi friends, i am using Walton Primo X1 phone. It has problem in skype. I downloaded the skype app and installed in my android 4.1.2 phone `. When i enter into skype and giving my login details its showing error that You cannot be signed in at this time please check your mobile network settings. But in my mobile, the network is perfectly alright. It doesn't has any problem. The internet is working properly in browser & in some other apps. I tried many options which are all gave in forums. But stil it has the same problem. Coudn't login into skype. Please give some ideas that would be perfectly suitabale for get rid from it. The mentioned methods which was used by me for solve problems. but it doesn't work.
    Note: I am using Robi Live
    1. Went to SETTINGS, APPS, SKYPE, CLEAR DATA, FORCE STOP, REBOOT THE PHONE. (Not work)
    2. Uninstalled and Reinstalled skype (Not work)
    3. Tried in WIFI (Not Work)
    4. Changed mobile network from Robi live to Robi GPRS (Not work)
    Please help me...
    Regards
    Bappa Nandi
    Khulna,Bangladesh

    Hi! We tested the issue on HTC ONE M8 device and couldn’t reproduce the issue ourselves. Did you experience the issue while you logged in the first time after installing Skype on your device? Could you please give more details about this issue – exact steps how to reproduce that, Skype version number, exact OS version, network type? You can find more details about specifics we need to know from here: http://community.skype.com/t5/Android/How-to-create-a-good-Android-issue-report/td-p/211384.

  • Is this method good or I need to use another way

    I am making designing and developing my report in Report Builder 3.0
    and by using this method
    http://technet.microsoft.com/en-us/library/aa337089.aspx
    I am showing the report in Windows Form.
    I want to know is this a right way or I have to use any other method
    prakash kumar jha

    Hi prakash,
    As per my understanding, I think it is a right way. However, it depends on your purpose to determine whether it is a good method.
    If you just want to design and display a report, I suggest that you can use Report Builder to design and develop a report, and then save the report to a report server (also known as developing a report). When the report is saved to a report server, other
    users can view the report on report server.
    If you want to display the report in Windows Form, after add a ReportViewer Control to a Windows application, there are two ways to view the report:
    Viewing reports in remote processing mode: After designing a report in Report Builder and saving the report to report server, we can use select the <Server Report> option from the Choose Report by Report Server Url or Report Path.
    Viewing reports in local processing mode: We can design a new report by launching the report designer, and then add the designed report to the ReportViewer Control.
    Hope this helps.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    Why can't I buy any app ? Iv tried creating a new Appel account ect but it says the same thing everytime . Sorry your payment was declined . How can I sort this ? Please help

    - Try another payment method.
    - Contact iTunes
    Apple - Support - iTunes - Contact Us
    - Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • I need help with this method, i don't know how to call it correct.

    public void method397(byte byte0, int i)
            if(byte0 != 6)
                for(int j = 1; j > 0; j++);
            aByteArray1405[anInt1406++] = (byte)(i + cacheMod.method246());
        }This code is for a Game client im making for a 2dmmorpg, the method was refactored by a friend but he isn't online at the moment because his on holiday; This method sends a packet to the server, i have handled it in the server;
    So i would think you would call it like this;
    super.engineStream.method397((byte)6, 103);But that gives me a huge exception, so please could someone explain how i could fix?
    Thanks
    Ill get the error in a second.

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
            at Gui.ClientStreamLoader(Gui.java:328)
            at Gui.actionPerformed(Gui.java:323)
            at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
            at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
            at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
            at javax.swing.AbstractButton.doClick(Unknown Source)
            at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
            at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknow
    Source)
            at java.awt.Component.processMouseEvent(Unknown Source)
            at javax.swing.JComponent.processMouseEvent(Unknown Source)
            at java.awt.Component.processEvent(Unknown Source)
            at java.awt.Container.processEvent(Unknown Source)
            at java.awt.Component.dispatchEventImpl(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
            at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
            at java.awt.Container.dispatchEventImpl(Unknown Source)
            at java.awt.Component.dispatchEvent(Unknown Source)
            at java.awt.EventQueue.dispatchEvent(Unknown Source)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
            at java.awt.EventDispatchThread.run(Unknown Source)

  • I need help instantly on this program please

    import java.util.*;
    public class D3
              private static int[] z = new int[100000];
    private static int first=z[0];
              private static int last=z[n-1];
              private static int n=100000;
    public static void main(String args[])
    Scanner input=new Scanner(System.in);
    for(int i=0;i<z.length;i++)
              z=2*i;
    int seqSearch(z;50000;n); //method call 4 key where key=mid
              int binSearch(z;first;last;50000);
              int seqSearch(z;35467;n); //method call 4 key where key in the left half
              int binSearch(z;first;last;35467);
              int seqSearch(z;89703;n); //method call 4 key where key in the right half
              int binSearch(z;first;last;89703);
              public int seqSearch(int z[];int key;int n)
         long start = System.currentTimeMillis();
    int count=0;
    int ans=-1;
    for(int i=0;i<n;i++)
    if z[i]=key
    count++
    {ans=i
    break;}
    return ans;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
         public int binSearch(int z[];int first;int last;int key)
         long start = System.currentTimeMillis();
         int count=0;
         if(last<first){
         count++;
         index=-1;
         else
         count++;
         int mid=(first+last)/2
         if(ket=z[mid]{
         index=mid;
         else
         if(key<z[mid]){
         index = binSearch(z[];first;mid-1;key);
         else
         index=binSearch(z[];mid+1;last;key);
         return index;
         long elapsed = System.currentTimeMillis() - start;
         System.out.print("Execution Time:" + elapsed);
         System.out.print("# of Basic Operations:" + count);
    // if anyone could tell me whats wrong with my code i'd be greatful...the program is supposed to perform binary and sequential search on a sorted array of 100000 numbers.once on an item in the middle of the array once on the right side of it and once on the left side...i also need to count the number of basic operations for the same number in both sequential and binary to see whats better.and i need to check the time...plz i need help now,,,

    "Guide to a first-time poster"
    you need to add exclamation marks to signify how urgent it is
    e.g.
    i need help instantly on this program please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    capital letters is better
    I NEED HELP INSTANTLY ON THIS PROGRAM PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    starting the italics on line 1, better again
    import java.util.*;
    public class D3
    private static int[] z = new int[100000];
    private static int first=z[0];
    private static int last=z[n-1];
    private static int n=100000;
    public static void main(String args[])
    Scanner input=new Scanner(System.in);
    for(int i=0;i<z.length;i++)
    z=2*i;
    int seqSearch(z;50000;n); //method call 4 key where key=mid
    int binSearch(z;first;last;50000);
    int seqSearch(z;35467;n); //method call 4 key where key in the left half
    int binSearch(z;first;last;35467);
    int seqSearch(z;89703;n); //method call 4 key where key in the right half
    int binSearch(z;first;last;89703);
    public int seqSearch(int z[];int key;int n)
    long start = System.currentTimeMillis();
    int count=0;
    int ans=-1;
    for(int i=0;i<n;i++)
    if z=key
    count++
    {ans=i
    break;}
    return ans;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    public int binSearch(int z[];int first;int last;int key)
    long start = System.currentTimeMillis();
    int count=0;
    if(last><first){
    count++;
    index=-1;
    else
    count++;
    int mid=(first+last)/2
    if(ket=z[mid]{
    index=mid;
    else
    if(key><z[mid]){
    index = binSearch(z[];first;mid-1;key);
    else
    index=binSearch(z[];mid+1;last;key);
    return index;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    and what about the dukes, offer 10 (never to be awarded, of course)
    do this, then sit back and watch the replies roll in.

  • Java.lang.RuntimeException: Caller doesn't have enough permission to call this method

    Hi,
    I am trying to abort a composite instance from SOA BPM Worklist.
    I was able to do the same using weblogic 10.3.6 and SOA 11.1.1.6
    Now, I am using weblogic 10.3.6 (same server) and SOA 11.1.1.7 . I have done the complete FacadeFinderBean and SOATestBean JNDI setup on my servers.
    I am getting the below error now.
    Caused by:  An error occurred while aborting or purging composite instance.
    Caused by: java.rmi.RemoteException: EJB Exception: ; nested exception is:
      java.lang.RuntimeException: Caller doesn't have enough permission to call this method.
      at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:237)
      at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:223)
      at oracle.soa.management.internal.ejb.impl.FacadeFinderBean_4vacyo_FacadeFinderBeanImpl_1036_WLStub.getCompositeInstances(Unknown Source)
      at oracle.soa.management.internal.ejb.EJBLocatorImpl.getCompositeInstances(EJBLocatorImpl.java:401)
    Caused by: java.lang.RuntimeException: Caller doesn't have enough permission to call this method.
      at oracle.soa.management.internal.ejb.impl.BaseSOABeanImpl.checkSecurityRole(BaseSOABeanImpl.java:55)
      at oracle.soa.management.internal.ejb.impl.FacadeFinderBeanImpl.getCompositeInstances(FacadeFinderBeanImpl.java:913)
      at oracle.soa.management.internal.ejb.impl.FacadeFinderBeanImpl.getCompositeInstances(FacadeFinderBeanImpl.java:905)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
    Please provide your valuable inputs to solve the issue.
    Thanks and Regards,
    Vijay

    Hi,
    I was able to solve the issue by a workaround >>>
    Set the facade.security.check system property to false in setDomainEnv.sh on SOA domain under java_options
    -Dfacade.security.check=false
    Regards,
    Vijay

  • SetDataValueAt() ? How do i use this method ?

    Hello,
    I have a application that was made using jdeveloper and
    bc4j,and in it I want to update a jjtextfield that is bound to a view object.I've read up on jutextfieldbinding and it has a method setDataValueAt(java.lang.Object,int attrindx) that I think i need.
    Please show me how to use this method as I can't find examples anywhere.I am new to programming with BC4j.
    Thanks in advance,
    Carl Lang

    For textfields bindings, you may use
    setDataValueAt(yournewvalue, 0)

  • Rooting US K1 --- this method wipes tablet clean

    Hi I used this method last night to root my US K1 tablet. It took about 20 mins to do. This method comes from a user timmyDean. Read the bottom of this page to see more information :
    http://forum.xda-developers.com/showthread.php?t=1404351&page=5
    He also created another method for permanent root and for users with Non US K1 tablets.
    http://forum.xda-developers.com/showthread.php?t=1444219
    Cool K1_a301_13_13_111209_us rooted K1-V2 - Rooting and Flashing TOOL K1_A301_13_13_111209_US
    With some help from (gallahad2000), I've got K1-V2 Root and flash all done. Please read the readme.pdf. Also, note that this tool will erase everything on your tablet. This tool will flash your tablet to the latest US version (K1_A301_13_13_111209_US). It is TOTALLY stock other than root(#).
    =================================== Release notes-- V2
    http://www.multiupload.com/97J3WS7P1D
    ===================================
    - Fixed factory restore and OTA's - Fixed Superuser and busybox applications - Added back in the additional 'bloatware' user applications which also fixes missing favorites.
    The original tool V1, was based on K1_A301_04_04_111017_US and was buggy, plus the rooting process also broke factory restore and OTA's, and the Superuser tools weren't the latest. Plus it removed the default user applications that some people liked
    This is TOTALLY stock A301_13_12_11209US with only su, busybox, and Superuser tools. This is what everyone has been wanting. Everything should work (Netflix etc), because it is the latest release.
    WARNING: OTA's will download and install which will remove root. So be careful when accepting an OTA. I did not turn OTA's off, so beware updates will break root. I created a backdoor application that you can use to install a backdoor prior to installing an OTA. It is a script and it is in the folder called backdoor (you need adb working). Then you can use the backdoor to get back in and set back up root. But, this should be only done by someone that knows what they are doing. Also, some OTA's reset the entire tablet which also removes the backdoor. So, prior to installing any OTA, you should look at the update and ensure it won't break root and ensure the backdoor would allow you back in as root.
    ================================================ Flashing none US Stock ROMS ================================================ In theory, you could download a different ROM from http://download.lenovo.com/slates/k1/OTA/ and then replace the boot.img in the tools Image folder. Then, all you'd have to do is mount the system.img (which is also in the Image folder) and replace the files with the ones from your OTA. However, be careful because Lenovo changed the boot blob in 04_04. If you mismatch the boot blob, your tablet will just loop rebooting and rebooting. ================================================
    //////////////////////////////////////////////////////////////////////// I could make a flashing tool to flash back to TOTAL STOCK with no root. Let me know if anyone is interested in that? I have K1_A301_02_02_110725_US.zip flash I could post. This would allow you go back in time to stock and then roll forward using OTA's. You could even download a different country OTA (as long as it's newer) and manually flash a different stock image. //////////////////////////////////////////////////////////////////////
    Hope this all works for you, TD Last edited by timmyDean; Yesterday at 07:09 AM.

    monilall11 wrote:
    Hi I used this method last night to root my US K1 tablet. It took about 20 mins to do. This method comes from a user timmyDean. Read the bottom of this page to see more information :
    http://forum.xda-developers.com/showthread.php?t=1404351&page=5
    Very interesting. I recently installed Avast Internet Security...part way. There were a few items that indicated the need to be root to get full functionality. I'm not sure I want to root my device. I had  Nook Tablet and was pretty happy with it until the day B&N decided to block me from sideloading non B&N downloads. They took it back and for $30 more I got the K-1 at a Staples in Massachusetts.
    Very happy to have regular Android Market. Am learning to like Honeycomb after using Gingerbread on my phone for a year plus. Not sure I'm all that excited about getting ICS and haven't heard if Lenovo will be doing an OTA update, or any other kind of update. If Lenovo doesn't do it there's always CM9...eventually.
    I did root a refurbished Nook Color and install CM7 on it for my daughter and she's happy. She was overseas when I got the B&N "security update" that was the last straw for me. I emailed her to turn OFF automatic updates before she gets back to the States or she'd probably have the same fate as I did with the Nook Tab.
    Is it device specific or do those OTA updates always remove root from any Android device?
    ***Ken Browne clacking the keys in Old Sturbridge Village,Massachusetts***
    Thinkpad X-60 (Linux Mint 13_Maya, running VBox WinXP and Win7
    Ideapad K-1 Now running Jelly Bean (kudos to Khanning and krook

  • This method cannot be translated into a store expression

    I am using oracle entity framework with .net 4.0 & i am trying to use UDF function within LINQ query but facing the following error:
    LinQ to entities does not recognize the method System.Data.Objects.ObjectResult and this method can not be translated into a store expression
    Please provide the solution. I will appreciate your help.
    Thanks
    Pankaj Kumar

    LinQ to entities does not recognize the method System.Data.Objects.ObjectResult and this method can not be translated into a store expression
    What you are being told is the EF P-SQL engine cannot genterate P-SQL based on the Linq query you have created. You can't use the Linq query in the manner in which you are trying to use it. And you need to try something else.

  • GetCollectionMetaData:  this method is not supported by 'OracleXMLDataSetGenJdbc' cla

    The following Java code:
    // Create an OracleOCIConnectionPool instance with default configuration
    OracleOCIConnectionPool cpool = new OracleOCIConnectionPool("appserver", "9ias", url, null);
    // Print out the default configuration for the OracleOCIConnectionPool
    System.out.println ("-- The default configuration for the OracleOCIConnectionPool --");
    displayPoolConfig(cpool);
    // Get a connection from the pool
    OracleOCIConnection conn1 = (OracleOCIConnection) cpool.getConnection("usecase", "uml");
    // Create a Statement
    Statement stmt = conn1.createStatement ();
    // Select the ENAME column from the EMP table
    ResultSet rset = stmt.executeQuery ("select * from usecases_ov");
    OracleXMLQuery q = new OracleXMLQuery(conn1,"select * from usecases_ov");
    System.out.println(q.getXMLString());
    Produces:
    -- The default configuration for the OracleOCIConnectionPool --
    Min poolsize Limit: 1
    Max poolsize Limit: 1
    Connection Increment: 0
    NoWait: false
    Timeout: 0
    PoolSize: 1
    ActiveSize: 0
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: getCollectionMetaData: this method is not supported by 'OracleXMLDataSetGenJdbc' class. Please use 'OracleXMLDataSetExtJdbc' instead.</ERROR>
    Any Suggestions?

    One import piece of info: This OracleXMLQuery works against a standard table. The query that fail goes against the following view and uses nested tables(object lists).
    SELECT v.name as PACKAGE,
    u.name,
    u.version,
    u.iteration,
    u.summary,
    u.events_basic,
    u.author,
    u.rev_date,
    u.ext_points,
    u.assumptions,
    u.preconditions,
    u.revision_notes,
    u.trigger_event,
    u.package as PUID,
    u.ALTERNATE_PATHS AS ALTERNATE_PATHS_LIST,
    u.EXCEPTION_PATHS AS EXCEPTION_PATHS_LIST,
    u.BUSINESS_RULES AS BUSINESS_RULE_LIST
    FROM USECASE u, DESIGN_PACKAGE v
    WHERE u.package=v.puid
    AND EXISTS(SELECT 'X'
         FROM DESIGN_CUR_VER d
         WHERE d.name = u.name
         AND d.version = u.version
         AND d.design_date = u.rev_date)
    AND EXISTS (SELECT 'X'
         FROM USECASE_AUDIT a
         WHERE a.package = u.package
         AND a.name = u.name
         AND a.version = u.version
         AND a.timestamp = u.rev_date
         AND a.status_code IN('created','modified','rejected'))
    ORDER BY v.name, u.name

Maybe you are looking for