Large Database read into a List Object Memory Problem

Hi,
Im building a new database, ive just imported over 50,000 rows into the database across a number of tables from existing csv files.
I want to extract these rows into a List object. Once extracted i want to process them in a specific way. However when i try to read in over 20,000 rows i get an error which indicates the buffer is full
java.lang.OutOfMemoryError: Java heap space
        at java.nio.ByteBuffer.wrap(ByteBuffer.java:350)Im currently using the DAO design pattern to read in the values. Could anyone provide me with some advise how i might read in so many rows without running out of memory. The current process is not only failing but is also extreamly slow.
Thanks in advance

h1400046 wrote:
Hi,
Thanks for your reply,
This database is fully normalised. Five tables, no relations between them at all.
The DAO design pattern was chosen so that each table may be selected individually. DAO usually means objects to me. What you're describing sounds more like Table Gateway.
This means that i get the values from each table in turn. (there isnt a single query). No possibility to JOIN? None whatsoever?
Five tables must be read for each select. Ouch.
Therefore i am selecting 5 times for each of the 50,000 rows and some of the rows will bring back more than one record for each table. So it's one object that has references to five others.
This OO object is tread back into a List object. Once i have this i want to then process this list as a whole. However this obejct gets to big and just kills the memoryYes, that's been clear all along.
I have been told that jdbc supports a cursor type mechanism which enables you to read from a result set in manageable chunks which can then be processed chunk by chunk without killing the memory. But i dont know how to do that or even if that is advisable.Yes, you can process chunk by chunk with JDBC. Check setFetchSize(), or manage the chunk size yourself.
I currently have primary keys in each table. I have indexs on both the primary and forigen keysSo there are relationships. I'll ask again - why not JOIN?
Can the database do any of the processing? What about calling a stored proc to create a cursor and iterate through the data on the server? Just bring the result over via JDBC.
%

Similar Messages

  • Since latest upgrade display distorting standard layout eg size of h2 to text is disproportionately large so reading newspaper sites is now a problem

    None of the zoom functions address this problem.
    It is not that all the text is too large or too small, but that the headings in relation to the text are now too big. This means that if I decrease the zoom level to one that the headings appear normal then the text is articles is too small. This is a consistent problem across for instance news papers sites such as the Guardian (UK) but even on the standard google search page. ie if I reduce the search box text size to the level I normally have, then the text of the search results are far too small. And even on the wordpress sites that I maintain I have this problem. The headings and sub headings now appear too large in relation to the text size.
    So not only is this a problem for using other sites, but means I no longer have confidence in using Firefox when setting up styles etc..
    Any ideas as to what the problem might be?

    wouldn't it make more sense to offer 2 versions of the browser. One for those using high resolution displays and one for those that dont.
    Most ordinary users will accept an automatic update and then not know what to do.

  • How to get values/data stored in the database into a list-item.

    how to get values/data stored in the database into a list-item.
    i tried to make a list item without any values assigned to it...but i got the below error.
    FRM-30191: No list items defined for required poplist.
    or
    FRM-32082: Invalid value for given item type.
    List EMPNO
    Item: EMPNO
    Block: EMP
    Form: MODULE5
    FRM-30085: Unable to adjust form for output.
    then according to some docs, i tried the the following for the trigger
    when-new-form-instance
    declare
         rg_name varchar2(40) := 'emp_rec';
         status number;
         groupid recordgroup;
         it_id item;
    begin
         it_id := Find_Item('empno');
         groupid := create_group_from_query(rg_name, 'select empno from emp');
         status := populate_group(groupid);
         populate_list(it_id, groupid);
    end;
    but yet didnt work... :(
    so how the heck do i get values fetched from the database table into the list item?

    for list items you need to values in the record group, one is the shown value and one is the returned value.
    Check out the online help for the populate_list built-in.
    You'll need something like select ename,ename from emp as the record group query.

  • Want to read a Query list of results into a defined variable "as Collection" for later use (ie create reports)

    The following code works great (Functions Main and OpenThisFile ) to select files from a folder and read into defined variable "FileToProcess As Collection" (I guess then renamed fil) and use that list of files to run through
    an import process defined in a function "StartMe". 
    What I want to do is read the results of a query into a similar collection variable and then use in a function like "StartMe" to run a series of reports.  The functions to do that below (PrintCKListTables and ReadQueryOfSDGs) currently
    don't work erring out "For Each s In .selectedQuery".  I would appreciate any help guiding me how to fix function
          ReadQueryOfSDGs() As Collection
    Thank you very much in advance for your help!
    Public Function Main()
    Dim FilesToProcess As Collection, fil
    Dim initialFilePath As String
    initialFilePath = CreateObject("WScript.Shell").specialfolders("C:\temp")
    Set FilesToProcess = OpenThisFile(initialFilePath)
    For Each fil In FilesToProcess
    StartMe fil
    Next fil
    End Function
    Public Function OpenThisFile(initialFilePath As String) As Collection
    'Requires reference to Microsoft Office 12.0 Object Library.
    Dim fDialog As Office.FileDialog
    Dim varFile As Variant
    'Clear listbox contents.
    'Me.FileList.RowSource = ""
    'Set up the File Dialog.
    Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
    With fDialog
    'Allow user to make multiple selections in dialog box.
    .AllowMultiSelect = True
    .InitialFileName = initialFilePath
    'Set the title of the dialog box.
    .Title = "Please select one or more files"
    'Clear out the current filters, and add our own.
    .Filters.Clear
    .Filters.Add "XML Files", "*.XML"
    'Show the dialog box. If the .Show method returns True, the
    'user picked at least one file. If the .Show method returns
    'False, the user clicked Cancel.
    If .Show = True Then
    'Loop through each file selected and add it to the list box.
    Dim s
    Set OpenThisFile = New Collection
    For Each s In .SelectedItems
    OpenThisFile.Add s
    Next s
    Else
    MsgBox "You clicked Cancel in the file dialog box."
    NotContinue = True
    End If
    End With
    End Function
    Public Function PrintCkListTables()
        Dim FilesToProcess As Collection, fil
        Dim ListSDGs As String
        Set FilesToProcess = ReadQueryOfSDGs(ListSDGs)
        For Each fil In FilesToProcess
            fNameExportpdfReport (fil)
        Next fil
    End FunctionPublic Function ReadQueryOfSDGs() As Collection       DoCmd.OpenQuery "y_qs_DataIn_All_SDGList"
           Dim s
           Set ReadQueryOfSDGs = New Collection
           For Each s In .selectedQuery
           ReadQueryOfSDGs.Add s
           Next s
    End Function

    There are a few problems here. In function PrintCkListTables() you define a string variable ListSDGs and then use that as an argument to the function ReadQueryOfSDGs(), but ReadQueryOfSDGs() as written does not accept any arguments.  It's also not clear
    what ListSDGs represents...a list of files, names of queries? Also, the line
    For Each s In .selectedQuery in
    ReadQueryOfSDGs()
    references something called .selectedQuery which is undefined. 
    Is it that you want ReadQueryOfSDGs() to loop through the records returned by a query and add a field from each record to a collection?  If so, something like the following might better serve you:
    Public Function ReadQueryOfSDGs() As Collection
        Dim C As New Collection
        Dim rst As DAO.Recordset
        Set rst = DBEngine(0)(0).OpenRecordset("y_qs_DataIn_All_SDGList", dbOpenForwardOnly, dbReadOnly)
        Do Until rst.EOF
            C.Add rst!MyField ' where MyField is the field in y_qs_DataIn_All_SDGList you want to add to your collection
            rst.MoveNext
        Loop
        rst.Close
        Set rst = Nothing
        Set ReadQueryOfSDGs = C
    End Function

  • Best way to transfer a List Object into a view object?

    Hi Guys and Gals,
    I'm working with some 3rd party code. This code queries a 3rd party database and returns the data into a List like so:
            PlatformSessionContext context = webutils.getPlatformContext(accesstoken,accessstokensecret,realmID,dataSource);
         QBCustomerService customerService = customerService = QBServiceFactory.getService(context, QBCustomerService.class);
         List<QBCustomer> customers = customerService.findAll(context, 1, 100);What is then the best way to populate a view object with that list? I would think I would need to do a couple of things ...
    1) Map the QBCustomer's fields/getters to my ViewObject attributes somehow ...
    2) Iterate through the List and sync the QBCustomer field values to the VO rows/attributes.
    Am I on the right track? What do you think is the best way to accomplish this? I've come across populating a VO via XML here (How do I implement an HTTP Get which returns XML into a View Object? ). Should I look for this QBCustomer.class's query and XML?
    This is all a little over my head. Any help would be appreciated. Using JDev 11.1.2.2.0.
    Thanks,
    Will

    Hi,
    bets is to do it similar as in https://blogs.oracle.com/smuenchadf/resource/examples#134
    In this sample, a list of selected keys is passed to a custom method exposed on the ViewObject. In your case you need to make sure the QBCustomer class is known by the ADF BC project. Then from the custom method, you create new rows in the VO and populate the attributes with values from the QBCustomer object. The method can be dragged from the data control palette (as a parameter form) or manually create in the PageDef (method binding). The latter case requires you to reference an object holding the list of QBCustomer
    Frank

  • Reading from a txt file and storing into a list

    i want to read a list of counters(String) which are there in a flat txt file and store them into a List.
    Any suggestion will be helpful
    sanjeev

    Try this
    try {
              FileReader fr = new FileReader("C:/abc.txt");
              BufferedReader br = new BufferedReader(fr);
              String record = null;
              while ((record = br.readLine()) != null)
                   System.out.println(record );     
              

  • I see an "archive" group listed in the ibook catagories section.  How do i put the books that I've read into that catagory?

    I see an "archive" group listed in the ibook catagories section.  How do i put the books that I've read into that catagory?

    Are you sure that you are not talking about the Kindle App? I might be missing it, but I don't see an Archive section in iBooks categories.
    You can create a section for the books that you have read in collections in the iBooks app.
    Tap on Collections, tap New - name it Archived if that is what you want to call it. Tap Done, then tap the bookshelf anywhere. Tap the Edit button, tap the books that you want to move to Archved - tap Move in the upper left and select Archived.

  • How to update a large (over 4 million item) List(Of Byte) quickly by altering indexes contained in a Dictionary(Of Integer, Byte) where the Dictionaries keys are the indexes in the List(Of Byte) that need to be changed to the values for those indexes?

       I'm having some difficulty with transferring images from a UDP Client to a UDP Server. The issue is receiving the bytes necessary to update an original image sent from the Client to the Server and updating the Servers List(Of Byte) with the
    new bytes replacing bytes in that list. This is a simplex connection where the Sever receives and the Client sends to utilize the least amount of bandwidth for a "Remote Desktop" style application where the Server side needs image updates of whatever
    occurs on the Client desktop.
       So far I can tranfer images with no issue. The images can be be any image type (.Bmp, .Gif, .JPeg, .Png, etc). I was working with sending .JPeg's as they appear to be the smallest size image when a Bitmap is saved to a memory stream as type
    .JPeg. And then I am using GZip to compress that byte array again so it is much smaller. However on a loopback on my NIC the speed for sending a full size screen capture is not very fast as the Server updates fairly slowly unless the Clients screen capture
    Bitmap is reduced in size to about 1/3'd of the original size. Then about 12000 bytes or less are sent for each update.
       Due to .JPeg compression I suppose there is no way to get the difference in bytes between two .JPegs and only send those when something occurs on the desktop that alters the desktop screen capture image. Therefore I went to using .Bmp's as each
    .Bmp contains the same number of bytes in its array regardless of the image alterations on the desktop. So I suppose the difference in bytes from a second screen capture and an inital screen capture are what is different in the second image from the initial
    image.
       What I have done so far is save an initial Bitmap of a screen capture using a memory stream and saving as type .Bmp which takes less than 93 milliseconds for 4196406 bytes. Compressing that takes less than 118 milliseconds to 197325 bytes for
    the current windows on the desktop. When that is done PictureBox1 is updated from nothing to the captured image as the PictureBox's background image with image layout zoom and the PictureBox sized at 1/2 my screens width and 1/2 my screens height.
       Then I save a new Bitmap the same way which now contains different image information as the PictureBox is now displaying an image so its back color is no longer displayed (solid color Aqua) and the cursor has moved to a different location. The
    second Bitmap is also 4196406 in bytes and compressed it was 315473 bytes in size.
       I also just found code from this link Converting a Bitmap to a Byte Array (and Byte Array to Bitmap) which gets a byte array
    directly from a Bitmap and the size of that is 3148800 for whatever is full screen captured on my laptop. So I should be able to work with smaller byte arrays at some point.
       The issue I'm having is that once the Client sends an image of the desktop to the Server I only want to update the server with any differences occuring on the Clients desktop. So what I have done is compare the first screen captures bytes (stored
    in a List(Of Byte)) to the second screen captures bytes (stored in a List(Of Byte)) by using a For/Next for 0 to 4196405 where if a byte in the first screen captures List is not equal to a byte in the second screen captures List I add the index and byte of
    the second screen captures list to a Dictionary(Of Integer, Byte). The Dictionary then only contains the indexes and bytes that are different between the first screen capture and second screen capture. This takes about 125 milliseconds which I think is pretty
    fast for 4196406 byte comparison using a For/Next and adding all the different bytes and indexes for each byte to a Dictionary.
        The difference in Bytes between the inital screen capture and the second screen capture is 242587 as an example which changes of course. For that amount of bytes the Dictionary contains 242587 integers as indexes and 242587 bytes as different
    bytes totaling 485174 bytes for both arrays (keys, values).  Compressed the indexes go from 242587 to 43489 bytes and the values go from 242587 to 34982 bytes. Which means I will have to send 78, 481 bytes from the Client to the Server to update the display
    on the server. Quite smaller than the original 4196406 bytes of the second Bitmap saved to type .Bmp or the compressed size of that array which was 315473 bytes. Plus a few bytes I add as overhead so the server knows when an image array ends and how many packets
    were sent for the array so it can discard complete arrays if necessary since UDP is lossfull although probably not so much in current networks like it may originally have been when the internet started.
        In reality the data from the Client to the Server will mostly be the cursor as it moves and updating the Server image with only a few hundred bytes I would imagine at a time. Or when the cursor selects a Button for example and the Buttons
    color changes causing those differences in the original screen capture.
       But the problem is if I send the Dictionaries Indexes and Bytes to the Server then I need to update the original Bitmap List(Of Byte) on the server by removing the Bytes in the received informations Index locations array from the Servers Bitmap
    List(Of Byte) and replacing those Bytes with the Bytes in the received informations Byte array. This takes so long using a For/Next for however many indexes are in the received informations Index array to update the Bitmap List(Of Byte) on the server using
    "Bmp1Bytes.RemoveAt(Index As Integer)" followed by "Bmp1Bytes.Insert(Index As Integer, Item As Byte)" in the For/Next.
        I've tried various For/Next statements including using a new List(Of Byte) with If statements so If the the integer for the For/Next ='s the Key in a Dictionary(Of Integer, Byte) using a Counter to provide the Dictionaries Key value then
    the Dictionaries byte value will be added to the List(Of Byte) and the counter will increas by one Else the List(Of Byte) adds the original "Bmp1Bytes" byte at that index to the new List(Of Byte). This takes forever also.
       I also tried the same For/Next adding to a new Dictionary(Of Integer, Byte) but that takes forever too.
       I think I could use RemoveRange and AddRange to speed things up. But I don't know how to retrieve a contiguous range of indexes in the received indexes that need to be updated in the servers "Bmp1Bytes" List(Of Byte) from the received
    array of indexes and bytes which are in a Dictionary(Of Integer, Byte).  But I believe this would even be slower than some realistic method for replacing all Bytes in a List(Of Byte) when I have the indexes that need to be replaced and the bytes to replace
    them with.
       Even if I just used AddRange on a new List(Of Byte) to add ranges of bytes from the original "Bmp1Bytes" and the changes from the Dictionary(Of Integer, Byte) I think this would be rather slow. Although I don't know how to do that
    by getting contiguous ranges of indexes from the Dictionaries keys.
       So I was wondering if there is some method perhaps using Linq or IEnumerable which I've been unable to figure anything out which could do this.
       I do have some copy and pasted code which I don't understand how it works that I am using which I would guess could be altered for doing something like this but I can't find information that provides how the code works.  Or even if I did
    maybe I can't understand it. Like the code below which is extremely fast.
       Dim strArray() As String = Array.ConvertAll(Of Integer, String)(BmpComparisonDict.Keys.ToArray, Function(x) x.ToString())
    La vida loca

    Monkeyboy,
    That was quite a bit to read, but still a bit unclear. Could you put a specific list of goals/questions, asked in the smallest possible form?
    It seems like either you're making a program that monitors activity on your computer, or you're writing some kind of remote pc app.
    When you do get your bytes from using lockbits, keep in mind all the files header info would be lost. I think retaining the header info is worth the extra bytes.
    The other, thing: I'm not sure if you're taking 32bpp screen shots, but also keep in mind that the "whole desktop" is the final destination for blended graphics, if that makes sense. What I mean is that there is no need to capture an "alpha"
    channel for a desktop screenshot, as alpha would always be 255, this could save you 1 byte per pixel captured... Theres nothing "behind" the desktop, therefore no alpha, and every window shown above the desktop is already blended. I suggest using
    24Bpp for a full screen capture.
    Your X,Y information for the mouse could be stored as UINT16, this would save you a measly 2 bytes per location update/save.
    When you update your byte arrays, maybe you can turn the array into a stream and write to whatever index, however many bytes, that should prevent a "Shift" of bytes, and instead overwrite any bytes that "get in the way".
    ex
    Dim example As String = "This is an example."
    Dim insertString As String = "was"
    Dim insertBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(insertString)
    Dim bytes As Byte() = System.Text.Encoding.ASCII.GetBytes(example)
    Dim modifiedBytes As Byte() = {}
    Using ms As New System.IO.MemoryStream(bytes)
    ms.Position = 5
    ms.Write(insertBytes, 0, 3)
    modifiedBytes = ms.ToArray
    End Using
    Dim newString As String = System.Text.Encoding.ASCII.GetString(modifiedBytes)
    'Notice how below there isn't the word "is" anymore, and that there isn't a
    'space.
    'This demonstrates that you overwrite existing data, versus shifting everything to
    'the right.
    'Returns: This wasan example.
    MsgBox(newString)
    “If you want something you've never had, you need to do something you've never done.”
    Don't forget to mark
    helpful posts and answers
    ! Answer an interesting question? Write a
    new article
    about it! My Articles
    *This post does not reflect the opinion of Microsoft, or its employees.
    Well it's too much to read. I was really tired when I wrote it. Even the below is too much to read but perhaps gets the point across of what I would like to do which I think
    Joel Engineer may have answered but I'm not sure. As I'm still too tired to understand that yet and research what he said in order to figure it out yet.
    But maybe the code below can provide the concept of the operation with the comments in it. But seeing as how I'm still tired it may be confused.
    Option Strict On
    Imports System.Windows.Forms
    Imports System.IO
    Imports System.IO.Compression
    Imports System.Drawing.Imaging
    Imports System.Runtime.InteropServices
    Public Class Form1
    Dim Bmp1Bytes As New List(Of Byte)
    Dim Bmp1BytesCompressed As New List(Of Byte)
    Dim Bmp2Bytes As New List(Of Byte)
    Dim BmpComparisonDict As New Dictionary(Of Integer, Byte)
    Dim BmpDifferenceIndexesCompressed As New List(Of Byte)
    Dim BmpDifferenceBytesCompressed As New List(Of Byte)
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    SomeSub()
    End Sub
    Private Sub SomeSub()
    ' Pretend this code is in UDP Client app. A screen capture is performed of the desktop. Takes about 90 milliseconds.
    Bmp1Bytes.Clear()
    Using BMP1 As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
    Using g1 As Graphics = Graphics.FromImage(BMP1)
    g1.CopyFromScreen(0, 0, 0, 0, BMP1.Size)
    Cursor.Draw(g1, New Rectangle(Cursor.Position.X, Cursor.Position.Y, Cursor.Size.Width, Cursor.Size.Height))
    Using MS As New MemoryStream
    BMP1.Save(MS, System.Drawing.Imaging.ImageFormat.Bmp)
    Bmp1Bytes.AddRange(MS.ToArray)
    End Using
    End Using
    End Using
    Bmp1BytesCompressed.AddRange(Compress(Bmp1Bytes.ToArray))
    ' UDP Client app sends Bmp1BytesCompressed.ToArray to UDP Server which is the entire image of the desktop that the UDP
    ' Client is on. This image takes awhile to send since compressed it is about 177000 bytes from over 4000000 bytes.
    ' I will be using different code just to get the bytes from the actual Bitmap in the future. That is not important for now.
    ' Pretend the UDP Server has received the bytes, decompressed the array received into a List(Of Byte) and is displaying
    ' the image of the UDP Clients desktop in a PictureBox.
    ' Now the image on the UDP Clients desktop changes due to the mouse cursor moving as an example. Therefore a new Bitmap
    ' is created from a screen capture. This takes about 90 milliseconds.
    Bmp2Bytes.Clear()
    Using BMP2 As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
    Using g1 As Graphics = Graphics.FromImage(BMP2)
    g1.CopyFromScreen(0, 0, 0, 0, BMP2.Size)
    Cursor.Draw(g1, New Rectangle(Cursor.Position.X, Cursor.Position.Y, Cursor.Size.Width, Cursor.Size.Height))
    Using MS As New MemoryStream
    BMP2.Save(MS, System.Drawing.Imaging.ImageFormat.Bmp)
    Bmp2Bytes.AddRange(MS.ToArray)
    End Using
    End Using
    End Using
    ' Now I have the original images bytes in Bmp1Bytes and the new images bytes in Bmp2Bytes on the UDP Client. But I don't
    ' want to send all of the bytes in Bmp2Bytes to the UDP Server. Just the indexes of and the bytes that are different in
    ' Bmp2Bytes from Bmp1Bytes.
    ' This takes less than 100 milliseconds for what I've tested so far where over 500000 bytes in Bmp2Bytes are different
    ' than the bytes in Bmp1Bytes. Usually that amount would be much less. But during testing I was displaying the image
    ' from Bmp1 bytes in a PictureBox so a large amount of data would change between the first screen shot, the PictureBox
    ' then displaying an image on the same PC and then the second screen shot.
    BmpComparisonDict.Clear()
    For i = 0 To Bmp1Bytes.Count - 1
    If Bmp1Bytes(i) <> Bmp2Bytes(i) Then
    BmpComparisonDict.Add(i, Bmp2Bytes(i))
    End If
    Next
    ' So now I have all the difference bytes and their indexes from Bmp2Bytes in the BmpComparisonDict. So I compress
    ' the indexes into on List and the Bytes into another List.
    BmpDifferenceIndexesCompressed.Clear()
    BmpDifferenceBytesCompressed.Clear()
    BmpDifferenceIndexesCompressed.AddRange(Compress(BmpComparisonDict.Keys.SelectMany(Function(d) BitConverter.GetBytes(d)).ToArray()))
    BmpDifferenceBytesCompressed.AddRange(Compress(BmpComparisonDict.Values.ToArray))
    ' Now pretend the UDP Client has sent both those arrays to the UDP Server which has added both decompressed arrays
    ' to a Dictionary(Of Integer, Byte). And the server has the original image decompressed bytes received in a List
    ' called Bmp1Bytes also.
    ' This is where I am stuck. The UDP Server has the Dictionary. That part was fast. However there is no
    ' fast method I have found for creating a new List(Of Byte) where bytes in the originally received List(Of Byte) that
    ' do not have to be altered are placed into a new List(Of Byte) except for the indexes listed in the
    ' Dictionary(Of Integer, Byte) that need to be placed into the appropriate index locations of the new List(Of Byte).
    ' The below example for doing so is exceptionally slow. Pretend UpdateDictionary has all of the decompressed indexes
    ' and bytes received by the UDP Server for the update contained within it.
    Dim UpdateDictionary As New Dictionary(Of Integer, Byte)
    Dim UpdatedBytes As New List(Of Byte)
    Dim Counter As Integer = 0
    For i = 0 To Bmp1Bytes.Count - 1
    If i = UpdateDictionary.Keys(Counter) Then ' Provides the index contained in the Keys for the Dictionary
    UpdatedBytes.Add(UpdateDictionary.Values(Counter))
    Counter += 1
    If Counter > UpdateDictionary.Count - 1 Then Counter = 0
    Else
    UpdatedBytes.Add(Bmp1Bytes(i))
    End If
    Next
    ' So what I'm trying to do is find an extremely fast method for performing something similar to what the
    ' above operation performs.
    End Sub
    Private Function Compress(BytesToCompress() As Byte) As List(Of Byte)
    Dim BytesCompressed As New List(Of Byte)
    Using compressedStream = New MemoryStream()
    Using zipStream = New GZipStream(compressedStream, CompressionMode.Compress)
    zipStream.Write(BytesToCompress, 0, BytesToCompress.Count)
    zipStream.Close()
    BytesCompressed.AddRange(compressedStream.ToArray)
    End Using
    End Using
    Return BytesCompressed
    End Function
    Private Function Decompress(BytesToDecompress() As Byte) As List(Of Byte)
    Dim BytesDecompressed As New List(Of Byte)
    Using DecompressedStream = New MemoryStream()
    Using zipStream = New GZipStream(DecompressedStream, CompressionMode.Decompress)
    zipStream.Write(BytesToDecompress, 0, BytesToDecompress.Count)
    zipStream.Close()
    BytesDecompressed.AddRange(DecompressedStream.ToArray)
    End Using
    End Using
    Return BytesDecompressed
    End Function
    End Class
    La vida loca

  • EXPORTING LIST TO MEMORY / LIST_FROM_MEMORY / LIST_TO_ASCI    ?

    Hi  Guys
    I am trying to export a list to memory with the help of function module LIST_FROM_MEMORY downloading it from the memory. But its not in readable format.  Then i am LIST_TO _ASCI  functionmodule  and i am pulling data into internal table..
      when i am doing this there are some fields are blank. i am not getting the  one field value ?
       can anyone explain me ?
    Thanks in advance ..

    because it was blank or initial in database or in the list?

  • How do I know when a file loaded into a Sound object is invalid?

    I'm writing an app that allows the user to play various sound files.
    Some of these files are mp3, but some may also be ogg, wma, etc.  The selection is out of my control, so I need the sound API to tell me if it can't play something.
    To test, I loaded some test files into a sound object like so:
                    var urlRequest:URLRequest = new URLRequest("http://support.microsoft.com/support/MediaPlayer/wmptest/samples/new/mediaexample.wma");
                    var sound:Sound = new Sound();
                    var soundChannel:SoundChannel = sound.play();
    Even though Flex doesn't play wma's there is no error information or null objects anywhere.  Everthings seems to be fine to flex, I can even register for progress events and see the wma being loaded.
    Just to see how far this goes, I loaded a gif instead of an audio file and the same thing happened.  Progress went fine with no errors of any kind even though I registered for every listed event.  As expected though, no sound played from the gif file.
    What is the recommended way for checking if a file is not playable?

    I'm looking more for an "is it playable" value (since it might be an FLA or FLV as well).
    Even a meaningful length value would work (for some reason duration is set to a value even when loading a gif file - not sure what it means for a GIF to have a length of 96 milliseconds).
    For now I'll have to filter on extension as you mentioned.

  • Memory problem if OLE-object references to WMF files

    Hi there,
    I have a report with an OLE object containing WMFs.
    The graphic files are variable and their name is loaded from the database during runtime (path + filename).
    Running the report leads to 185 pages, each one containing a different WMF.
    If I preview the report in CR, everything looks fine.
    If I print the report, the OLE object / graphic is left empty....
    If I export the report to PDF (as an example) I get the error message 'memory full'. Reducing the data set to ~50, the PDF is created. But the pictures get resized (much bigger) and only parts are visible.
    The machine I'm using doesn't have any memory problems.
    The WM files are only 3 to 12 KB each.
    If I convert the WMFs to JPG and use these within the report it works...
    Problem with this: a loss of quality (it is necessary to stretch the pictures to certain size)
    Thanks in advance for any ideas!
    Susanne
    I'm using CR 2008 SP 3 on Windows 2003 Server

    Format the pictures outside of CR for best results.

  • Problem with  large databases.

    Lightroom doesn't seem to like large databases.
    I am playing catch-up using Lightroom to enter keywords to all my past photos. I have about 150K photos spread over four drives.
    Even placing a separate database on each hard drive is causing problems.
    The program crashes when importing large numbers of photos from several folders. (I do not ask it to render previews.) If I relaunch the program, and try the import again, Lightroom adds about 500 more photos and then crashes, or freezes again.
    I may have to go back and import them one folder at a time, or use iView instead.
    This is a deal-breaker for me.
    I also note that it takes several minutes after opening a databese before the HD activity light stops flashing.
    I am using XP on a dual core machine with, 3Gigs of RAM
    Anyone else finding this?
    What is you work-around?

    Christopher,
    True, but given the number of posts where users have had similar problems ingesting images into LR--where LR runs without crashes and further trouble once the images are in--the probative evidence points to some LR problem ingesting large numbers.
    I may also be that users are attempting to use LR for editing during the ingestion of large numbers--I found that I simply could not do that without a crash occuring. When I limited it to 2k at a time--leaving my hands off the keyboard-- while the import occured, everything went without a hitch.
    However, as previously pointed out, it shouldn't require that--none of my other DAMs using SQLite do that, and I can multitask while they are ingesting.
    But, you are right--multiple single causes--and complexly interrated multiple causes--could account for it on a given configuration.

  • Placing a variable value into an XML Object

    I am trying to figure out how I would get the value of a variable into an XML Object.
    I have the variable
    var dragonName:String = "Samuel";
    var listing:XML = new XML();
    listing = <thedragon>
                            <dragon>
                                  <myname> dragonName.valueOf()</myname>
                             </dragon>
                   </thedragon>
    However, the dragon name does not show up when I go trace(listing);
    How do I do it and should I have imported something as well or what?

    yeah - in fact you can do all sort of things. This is extremely useful when you creating an XML dynamically e.g.
    var names:Array = ["Sammy", "Samuel", "Sancho"];
    var xml:XML =     <dragon>
                         <myname>{Math.floor(Math.random()*names.length) < 2 ? names[1] : names[Math.round(Math.PI) - 1]}</myname>
                      </dragon>;
    or you can even run a function:
    var xml:XML =     <dragon>
                         <myname>{dragonName()}</myname>
                      </dragon>;
    private function dragonName():String {
       return "Samuel";

  • Make CA database read-only?

    Is it possible to make Firefox not accept any new Certificate Authorities without user interaction?
    Long story short, I have having a problem where Firefox is adding a CA to it's database that is hosing things up. The actual problem is with the cert that is being offered to me, and I am working with that system owner to fix the cert, but in the mean time I would like to have Firefox not ever load the CA into it's database. This new CA is added without the user being prompted at all. Simply visiting a specific website causes this new CA to be added to the list (but again, not trusted, just added to the list).
    By default when it is loaded the new cert has no permissions so it is not trusted, but the problem is the fact that the CA that is added is a duplicate name with another known good CA in my list and it causes things to go wacky when there are two with the same name (different signatures, different issuer, the only thing the same is the nickname).
    I know this isn't a problem with Firefox directly. In 99.9999% of cases when it adds an additional CA to the list it doesn't cause a problem at all because it is not trusted and it won't inherently allow the secure connection. But since fixing the real problem with the owner of the website is going to take a long time (weeks/months) I would like to put a band-aid on the symptom so that I can cut my maintenance of this topic down greatly.
    I am running Red Hat Enterprise Linux 5.9 with Firefox 10.0.12 (RHEL distributed Firefox).
    I could go into extreme detail to explain what is causing my problem, but the short question I have is "Is there a way to make the CA database read-only"?
    I have tried editing the permissions of cert8.db in ~/.mozilla/firefox/*.default/ to only be readonly (0400) vice read-write (0600) currently. However this causes Firefox to have kittens when I try to use anything that reads the CA list so I had to change it back.
    I have a hacky script to remove the CA using certutil, but since certutil uses the 'nickname' of the cert to decide which one to delete, and both the good cert and the bad cert have the same nickname I get worried I'll blow away the good one and not the bad one. So far it has consistently matched the bad cert, but I don't have enough confidence that it will do that every time to push it out to my users. If I could use certutil -D with something more specific than nickname (fingerprint, signature value, etc) I would be OK with that as well.
    I know there are options to restrict user changes to things like proxies and the such, is there a similar way to do it with CAs? about:config doesn't appear show anything that looks like it would do it.
    Can I have it prompt me when it tries to add a CA to the database and allow me to say yes/no?
    I am OK if the change is something that requires manual intervention if we do decide to add another CA to the list. Currently I am having to repair this problem multiple times a day and new CAs don't come all that often.
    Unfortunately, I can't simply upgrade to the latest Firefox as software restrictions are in place. I'm open to any ideas you may have.

    Seems unlikely two unrelated CA or sub-CA certs would have the exact same issuer name. Was the name too generic? If they actually related and I assume created by your organization perhaps you could simply add the "Integration CA 456" certificate to your root store -- assuming you trust it.
    Firefox validates certificate chains by looking up issuers, and in case of duplicates by default it grabs the one with the most recent "Not Before" date. There is a newer algorithm under development that won't stop at the first match but will continue to trying intermediate combinations until it finds a match or runs out of options. If you'd like to try it you need to add the boolean preference "security.use_libpkix_verification" and set it's value to true. This pref will not appear in about:config by default, but you can right-click in about:config to add it.

  • Send Crystal Report by email reading Domino email list

    Hello all,
    Do you know how do I configure Crystal Reports, so that when I address a report to be sent by email, it reads the contacts list in a Domino server (lotus notes)?
    Thanks in advance,
    Cristina.

    As of CR 9 all functionality has changed, database, exporting, API's etc.
    Also, by default the export dll's are not installed. Go into add/remove programs and change CR. Select the modify, or what ever it is called on your OS, and expand the export types and scroll down until you see Lotus Domino...
    Test again
    Thank you
    Don

Maybe you are looking for

  • FTP/SFTP/FISH (etc) slow file transfer rate over LAN

    Hi everyone, I have a problem with transferring files over my home network that has been bothering me for quite some time. I have a 802.11n router which should provide me with the transfer rate up to 150 Mbps (afaik). When I download files from the I

  • Save as PDF (compatibility option)

    Still a bloody newby at Illustrator... I often need to save an AI document as PDF to send it on to someone.  There is always that panel that asks for Compatibility level and Options. The Compatibility default is always 'Acrobat 6 (PDF 1.5)'.  I have

  • Connect two macs?

    I have a Macbook pro and a Power Mac G4. I would like to use the older G4 as storage for pics, movies, music, etc. What is the best/easiest way to connect the two machines? Thanks, Brent

  • Where is my download for LR4?

    Purchased LR4 student version and received an email confirmation, Went to downloads and nothing is there. Where is it?

  • Fixed layout ePub not display truetype font properly when uploaded to Amazon

    I've created a kids book with inDesign CC which works fine on iPad but when I upload the book to Amazon KDP, the font which is a truetype font and not protected doesn't display properly. It has unusual spacing between the charaters and sometimes the