Handling a TableColumn width change at the *end* of the resize

Hi all.
I have a table with AUTO_RESIZE_OFF where the user can resize the columns. I want to store off the column sizes in a file so that the next time they open the app they get the same sizes. (Yes, I could use Preferences for this, but on Windows this results in data in the registry, and we want the files to be more visible and in a format users can see.)
I can of course do this:
addPropertyChangeListener(new PropertyChangeListener() {
    public void propertyChange(PropertyChangeEvent event) {
        if ("width".equals(event.getPropertyName())) {
            saveToFile();
    });The problem is that as the user is dragging the column divider, I get 1 to 50 of these events, and each individual one results in saving the whole file again. :-(
Is there a "proper" way out of this, or should I just use a Timer to save the columns a second after I stop getting events?

Some people seem to misunderstand the word "general". A general solution solves it in all cases. If it doesn't solve it in all cases then it's not general, it's specific and solves it only for the assumptions made.Your the one who doesn't understand "general". It was a general solution.
"Generally" speaking when you have an application with multiple tables, the tables contain different information so the sizing of the columns will be different for every table. So changing the size of one table does not "generally" change the size of all other tables in the application
So if you have a special requirement then you should specify it.
Also, good to see that the forum mods are deleting the retaliation but not the original attack it was in response to. GJ guys. There was no original attack. There was no name calling. The point of the response was to get you to specify requirements so we don't waste time giving a "general solution" when a "specifc solution" is required.

Similar Messages

  • Plot area width changes as the precision changes !?

    need help to understand following thing:
    If I increase the precision of a graph manually, the plot area size decreases and vice versa.
    Otherwise there is an example posted demonstrating prcision change by property node which does not change plot area size.
    I've attached an example to demonstrate both.
    What I want is to change the precision manually with the default graph tools without decrease or increase plot area width.
    Is this possible in LV 6.02 ?
    Attachments:
    MyScaleProblem.vi ‏60 KB

    Hi.
    Resizing of the graph is the default behavior. The Graph resizes in LabVIEW 7 in both cases. I woud suggest building a text indicator with a transparent background and reading the properties of the graph to display the correct values to the side. This should give the desired response.
    -Erik

  • Movieclip stops after width change

    Hi,
    It's not my first time with flash, but it's with AS3. I'm
    having a problem and i don't get it. I'm working with Flash CS3
    PRO.
    The thing is that i'm working in AS3 with a movieclip. That
    movieclip has more nested movieclips within. So I've:
    + bicycle_01
    ++ body_low
    body_low is animated in bicycle_01. I've created a class that
    will manage my characters. (This is for a cyclist ranking). So
    within my main file I create the cyclist. I haven't even started
    and i found the first problem, i'm trying to change the width of
    body_low but it freezes. After i change the width of
    body_low,
    bicycle_01 stops playing.
    Here is my problem: _cyclist.getChildByName( "body_low"
    ).width = 10;
    If I add this line body_low width changes, but the animation
    stops. (right movieclip in
    this
    example)
    Any idea?
    Thanks. :)
    pd: Here is the fla and the two .as files:
    http://www.illarra.com/_lab/Follow-Flash/001.zip

    that's expected behavior: a timeline tween will be broken by
    actionscript that affects the tweened object.
    to remedy, use actionscript to tween your object.

  • On my windows Itunes I changed computers and ended up with two of every song. How do I delete the duplicates without doing it one at a time?

    I have duplicates of all the songs on my windows 7 computer.  I changed computers and ended up with duplicates of all of my songs. How can I delete them all without having to do it one at a time? thanks!

    Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • How do I change just the width or the height of a brush in CS4

    I have a brush that is square.  Is it possible to change just the width or just the height and if so, how?

      Thanks so much.  Before I asked this question I searched and searched for what I knew was going to be an easy answer, but just couldn't find it.  Thank you for your quick and perfect answer.

  • Tree table is not reflecting the updated model data changes at the front end

    I have two tables ,
    1) Provider table(tree table)  2)member table
    I have implemented drag and drop functionality using jQuery UI on both tables.
    In my scenario when I drag a member from the member table and drop it on the Provider table and also when I delete an assigned member from the provider table I will update the data fetched from odata model and again I will call the method which binds the data to the provider table so that the table will reflect the changes.
    here is the code,
    on drop:
    $("#Provider tbody tr").droppable({
      drop: function(event){
           oController.AssignMember(oProviderId, oMemberId)
      }).disableSelection();
    Assign member function:   here am updating the model.
    AssignMember : function(oProviderId, oMemberId){
      var oModel = new sap.ui.model.odata.ODataModel("../../../services/provider.xsodata/", true);
      var oParameters = {};
      oParameters.PROVIDER_ID = oProviderId;
      oParameters.MEMBER_ID = oMemberId;
      oParameters.CREATED_ON = new Date();
      oModel.setHeaders({"content-type" : "application/json;charset=utf-8"});
      oModel.create( "/PROVIDERMEMBERS", oParameters, null, function() {
      var oController = sap.ui.controller("adsm.provider.member_assignment_view");
      oController.GetProviderData();
      },function(jqXHR) {
      var errorMessage = jqXHR.response.body;
      var jsondata = JSON.parse(errorMessage);
      sap.ui.commons.MessageBox.alert(jsondata.error.message.value);
    GetProviderData function: here i bind the data to the table
    GetProviderData: function(){
    var oModel = new sap.ui.model.odata.ODataModel("../../../services/provider.xsodata/", true);
    var Context = "/PROVIDERS?expand=ASSIGNEDMEMBERS&$select=NAME,ID,ASSIGNEDMEMBERS/NAME,ASSIGNEDMEMBERS/ID,ASSIGNEDMEMBERS/PROVIDER_ID";
      var oTable = sap.ui.getCore().byId("tblProviders");
      oModel.read(Context, null, null, true, onSuccess, onError);
      function onSuccess(oEventdata){
      var outputJson = {};
      var p = 0;
      var r = {};
      if (oEventdata) {
      r = oEventdata;
      try {
      if (oEventdata.d){
      r = oEventdata.d;
      } catch(e){
      //alert('oEventdata.d failed');
      try {
      if (oEventdata.d.results){
      r = oEventdata.d.results;
      } catch(e){
      //alert('oEventdata.d.results failed');
      try {
      if (oEventdata.results){
      r = oEventdata.results;
      } catch(e){
      //alert('oEventdata.results failed');
      $.each(r, function(i, j) {
      outputJson[p] = {};
      outputJson[p]["NAME"] = j.NAME;
      outputJson[p]["ID"] = j.ID;
      outputJson[p]["PROVIDER_ID"] = j.ID;
      outputJson[p]["DELETE"] = 0;
      var m = 0;
      if (j.ASSIGNEDMEMBERS.results.length > 0) {
      $.each(j.ASSIGNEDMEMBERS.results, function(a,b) {
      outputJson[p][m] = { NAME: b.NAME,
      ID : b.ID,
      PROVIDER_ID: b.PROVIDER_ID,
      DELETE: 1};
      m++;
      p++;
    var oModel = new sap.ui.model.json.JSONModel();
      oModel.setData(outputJson);
      oTable.setModel(oModel);
      function onError(oEvent){
      console.log("Error on Provider Members");
    oTable.bindRows({
      path:"/"
    Its working fine in chrome but in IE the model data gets updated but the table is not reflecting the changes at front end.Can anyone suggest me a possible solution to fix this?
    Please have a look at the attached screen shots.
    Best regards,
    Amala Suganya.

    Hi Amala,
    I think this will help you:
    Disabling Cache for CRUD/FI OData scenarios for a UI5 Application on Internet Explorer
    Kind regards,
    RW

  • How do you change/adjust border width for all the cells in a table created in Pages?

    How do you change/adjust border width for all the cells in a table created in Pages?
    Note- I am trying to figure out how to create and format tables in the latest version of the Pages app on an iPad air (iOS 8.1.1.1) . Creating tables, adding or removing borders for individual/all cells in a table seems straight forward. However the default border style seems to be a heavy black line. How do I change this?
    I found the option add or remove borders for all/ individual cells in a table, however I can't find any option within style/format dialogue screens for changing colour or line thickness for table cells. Likewise I can't find any clear instructions on how to do this in apple help pages or support website
    Btw- I'm assuming  it is possible to customize/adjust the colour & thickness of selected lines in a table created in this app (it's fairly easy to do this word processing apps like MS Word) please let me  know if this is not actually possible in Pages

    They know perfectly well what they took out of Pages '09.
    Well over 90 features.
    Do you think you posting feedback is going to remind them of what they did?
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5 and rate/review it in the App Store, then get back to work.
    Peter

  • How to configure which changes in the document triggers Event Handler again

    Hi Experts
    Due to some reason after creation of Purchase Order, the event handler is not created in EM system. Now is there any way to resend this PO to EM? For example, is it possible to trigger Event Handler by changing some field in PO? If it is possible that way, Could you guide how to configure which changes in the document (PO/SO/Delivery/Shipment) can trigger Event Handler in EM system?
    Thanks
    Ravi

    Hello Ravi,
    if you change the PO Header/Item the respective EH  should be created if the Relevance condition is fullfilled.
    I'm not sure if it also works in the case that you change the PO Header and EH for PO Items will be created.
    Best regards,
    Steffen

  • Case number  0123115765 ser no serial numbers removed send me the download of the mac version please. You are the most troublesome to make a change did the same with Norton they handled it over the computer without

    case number  0123115765 ser no <serial numbers removed> send me the download of the mac version please. You are the most troublesome to make a change did the same with Norton they handled it over the computer without any fuss!!! Regards answer via email what to do! Regards Bo

    Call Apple to get the replacement DVD > http://support.apple.com/kb/HE57 When you have the DVD, insert it and install iPhoto. Finally, open  > Software Update and install the most recent version

  • Everytime I sync my iPhone 4 it pops up a notice saying that my iphone cannot be written to or read from. wont apply changes at the end of the sync cycle.

    everytime I sync my iPhone 4 it pops up a notice saying that my iphone cannot be written to or read from. wont apply changes at the end of the sync cycle. it synced once and now nothing! help?

    Did a health check on my Drive D:  Issues were found and repaired. Disabled Kaspersky and tried a sync with iTunes (Success). Re-enable Kaspersky and iTunes is still working.  Interesting in that I thought my iTunes only involved Drive C:  What led me to problems with Drive D: were indications that there was a problem with Adobe cache for Adobe Bridge.  I also purged that cache. In looking at my nightly backup there was also an indication there had been some intermittent issues of not being able to read the disk.
    Bottom line...  all is working again and need to continue to monitor the health of my second hard drive.

  • I'm often having issues with clients not seeing or being able to open attachments, font formatting changes (on the pc end) and the inability to use HTML signatures to promote our company brand.

    I'm often having issues with clients not seeing or being able to open attachments, font formatting changes (on the pc end) and the inability to use HTML signatures to promote our company brand.

    I imagine your clients must be using Outlook, which is seriously broken when it comes to e-mail standards, especially HTML e-mail. You can work around the issues with Outlook by only sending plain-text e-mails and making sure that, in the Edit -> Attachments menu, the last two options are checked. Unfortunately, that means that HTML signatures are out.
    If you need something with a fancy layout, either attach a PDF file to the e-mail or include a link to a website in the e-mail.

  • The musictracks on my iPod Nano don't play till the end but suddenly change to the next track. How can I solve this problem ?

    The musictracks on my iPod Nano don't play till the end but suddenly change to the next track. How can I solve this problem ?

    You have the accessibility VoiceOver feature turned on.
    Triple click the home button and try going to Settings>General>Accessibility and turn VoiceOver off. You may have to use three fingers to scroll the screen to get there. If problems see the following for how to turn off via iTunes:
    iPhone: Configuring accessibility features (including VoiceOver and Zoom)

  • 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

  • DIT Design -- Handling users in overlapping & changing groups/institutions

    Hi Folks-
    [My Apologies if there are duplicates, the forum doesn't show any sign of accepting this]
    I've been working on a DIT Design to solve a set of business requirements which conflicts with most traditional approaches. I've got some (overly) complicated ideas, but I'm wondering if anyone has encountered a similar situation, and if so did you find a good solution.
    Key Requirements:
    (1) We have a collection of users from various institutions and groups within them.
    (2) (THE MAIN WRINKLE) A certain amount of overlap and movement between institutions is expected (group overlap will be common). A user who is in overlapping institutions or moves between them MUST use a single, shared identity and SHOULD maintain a stable identity (i.e. no DN changes).
    (3) Much of the user administration should be decentralized and done at the group level (within each specific institution). An administor of GroupA in Foo Institution should only be able to administer the users in GroupA at Foo, but must be able to control membership within GroupA. Special precautions are permitted to keep a Group-A/Foo administrator from hijacking an arbitrary user by adding the target user to Group-A/Foo.
    (4) The number of institutions is expected to be start around 40-50, and could scale to the thousands. The number of people will probably be around 5-20 times the number of institutions. The design should accomodate that scale.
    Additional Notes:
    (A) I don't see any alternative to keeping any organizational information out of the users' DN's, essentially flattening the users out (I've currently got them all in one container).
    (B) I can obviously setup a hierarchy of roles/groups in institutional containers to handle membership and group administrator lists. All Directory Server administration will be done by a small central team and everything can be in containers under a common root suffix.
    (C) We currently have the necessary skillsets to develop scripts and programs as needed. But 2 different application families (incompatible foundations -- Java vs. Cobol+Perl) are already scheduled for deployment against this (hopefully more will follow). This means it's not very practical to use one "LDAP Superuser" id and rely on the application to enforce security policies. We really want to put as much of the security into the Directory as possible (calling for individual LDAP admins w/ the appropriate rights), but we can supplement it where we need to.
    (D) It looks like I'll have to rely heavily on filters based on the values of particular attributes of each user (whether in ACI's, Filtered Roles, or the like). Unfortunately, I don't see many ways that I can actually build those filters to be dependent on attributes/values of different entries. But I'm still working on that.
    (E) Because of the number of institutions (and probable continous growth), writing a master upper-level ACL which has each institution & group explicitly coded is probably unwise due to size and stability. If I have to I could have a helper program custom-code each user's ACL differently and change it as needed. But that doesn't seem like a good solution.
    Right now the designs I'm tossing around are calling for combinations of (all/most of) Roles (Filtered & Nested), Groups, CoS Template & Password Policies (yeah, we need those too), Macro ACI's, and a small amount of helper scripts and programs. We're running 5.2 but can probably upgrade to 6.0 if I can cite a good enough reason.
    My current design is pretty ugly and complicated but probably attainable. If people are interested enough I'll post a cleansed summary once it's working.
    Has anyone tackled anything like this before, and does anyone see any cleaner approach I've missed?
    Thanks,
    -Scott-

    Hi-
    We're basically putting all the users in one big container making a flat space.
    We then create lots of roles, each of which corresponds to a particular combination of institution, application, and access type/level (the user is implicit as it contains the nsRole). If a user has multiple types of access to an application for a given institution then they will be in multiple corresponding roles.
    We have the roles grouped together in a subtree which is divided by institution (and could be further subdivided by application within each institution or placed in the reverse order). But because of the scoping restrictions on nsRole's only a nsNestedRoleDefinition can be placed at this location (using nsRoleScopeDN), the Managed and Filter "working roles" must be in a branch of the tree above all things which will be contained within them (we put it at the top of that naming suffix).
    According to the docs, queries will ignore a ldapSubEntry (which all of the nsRoleDefinition's are) unless specifically requested, so the fact that there are hundreds or thousands of roles defined at the top shouldn't matter. However, all of the GUI's I've tried displayed all the roles.
    Currently the application code parses the DN of the role names from the user's nsRole entry, NOT the nsRoleDN entry. There end up being a lot of intermediate roles which get ignored. It uses this to determine the access type(s) to be granted. This is really convenient since one query for the user gets everything. However it builds dependencies into the DN format which arguably probably shouldn't be depended on. I've considered defining custom schema attributes which would contain the application/institution/access tuples (which could also be helpful for building nsFilteredRoleDefinition's), but that represents another round of queries and more substantial code changes for the pilot application.
    Once in place, the roles can easily be nested and combined in various ways (such as "roll-up" roles containing all users of an application). They can also be used for password policies, CoS templates, and building ACI's. The last should be very helpful in enabling decentralized administration, but that's going to be pretty dependent on your security policy.
    An issue with decentralized administration and Managed Roles is that normally anyone who can modify a user's nsRoleDN attribute can place any role in there, which isn't desirable in this environment. I haven't moved forward with the ACI work yet, but it appears that the "targattrfilters" ACI keyword may allow this problem to be solved (possibly in conjunction with Macro ACI's). Using some custom attributes with filtered roles might make this easier.
    So, we could have something like this very incomplete LDIF (not checked for errors), only the really important attributes are shown. Also similar entities with the same naming patterns have been omitted.
    dn: cn=appusers,ou=webmail,ou=inst01,ou=institutions,o=naming-suffix
    objectClass: nsNestedRoleDefinition
    nsRoleDN: cn=managed-webmail-inst01-appusers,o=naming-suffix
    nsRoleDN: cn=filtered-webmail-inst01-appusers,o=naming-suffix
    nsRoleScopeDN: o=naming-suffix
    dn: cn=managed-webmail-inst01-appusers,o=naming-suffix
    objectClass: nsManagedRoleDefinition
    dn: cn=filtered-webmail-inst01-appusers,o=naming-suffix
    objectClass: nsFilteredRoleDefinition
    nsRoleFilter: (customAppInstAccess=webmail:inst01:user)
    dn: uid=jsmith,ou=users,o=naming-suffix
    nsRoleDN: cn=managed-webmail-inst01-appusers,o=naming-suffix
    nsRoleDN: cn=managed-webmail-inst01-appadmins,o=naming-suffix
    dn: uid=jappleseed,ou=users,o=naming-suffix
    nsRoleDN: cn=managed-webmail-inst01-appusers,o=naming-suffix
    customAppInstAccess: blogger:inst03:user
    customAppInstAccess: webmail:inst03:userSo jsmith's nsRole attribute would contain the following values (the ones above the blank line are the main entries, the others are intermediate role to be ignored):
    cn=appusers,ou=webmail,ou=inst01,ou=institutions,o=naming-suffix
    cn=appadmins,ou=webmail,ou=inst01,ou=institutions,o=naming-suffix
    cn=managed-webmail-inst01-appusers,o=naming-suffix
    cn=managed-webmail-inst01-appadmins,o=naming-suffixAnd jappleseed's nsRole attribute would contain the following values (the ones above the blank line are the main entries, the others are intermediate role to be ignored):
    cn=appusers,ou=webmail,ou=inst01,ou=institutions,o=naming-suffix
    cn=appusers,ou=blogger,ou=inst03,ou=institutions,o=naming-suffix
    cn=appusers,ou=webmail,ou=inst03,ou=institutions,o=naming-suffix
    cn=managed-webmail-inst01-appusers,o=naming-suffix
    cn=filtered-blogger-inst03-appusers,o=naming-suffix
    cn=filtered-webmail-inst03-appusers,o=naming-suffixIf that doesn't make sense, then you can email me details of what you're trying to do at <[email protected]>, but it may take some time before I can respond.
    -Scott-

  • Lock Role for Changes till the transport is released

    Issue : since roles are managed by multiple security administrators, changes are moving against the sequence.
    We have multiple security administrators, is there a way to lock a role for changes until the task/ req is released.
    Example Scenario :
    Security admin 1 : if there is a change request to add SU01 to the role: Z_TESTROLE, Security admin adds it and creates a Change request but does not release it.
    Security Admin 2 : the security admin 2 will get a Change req for the same role Z_TESTROLE to add a tcode PFCG to it. Security admin 2 does his job and moves his transport now even though the first transport does not move the change made by the first security admin moves with the transport for the second admin.
    We have multiple security administrators, is there a way to lock a role for changes until the task/ req is released.

    Hi all,
    Thanks for your responses.we follow a change procedure but I guess its just needs to be refined. Everybody figured out that this is a coordination issue but I was asked to research on any technical ability to handle this.
    Here is a brief overview of our process :
    1) BPO approves the change
    2) Role owner support manager approves the change
    then the Change request comes to 3)Security Manager for her approval.
    I feel from Sox prespective the 3rd approval in not manadatory.
    I'm I correct ??? where can I find Sox guide for SAP ?
    Recap of the incident:
    1)A change ticket is created for the t-code creation and a task is created for the role in which this report is to be added.
    State I role Z_TESTROLE  is with ZMMR0025
    After adding the new report ZMMR0055 the old report ZMMR0025 is removed.
    State II
    The role Z_TESTROLE has tcode ZMMR0055
    now this is tested in development system by the requestor.
    Before this goes into PRD via QA a newsflash is sent to all the endusers (so that they know which t-code to use)
    Meanwhile if another security administrator works (suppose adds a new tcode or changes an authorization)  on this while the role is in state II changes made by Admin 1 are transported along with the second change.
    State II + new changes = State III
    When the role reaches PRD in state III result is the end user losses access to the required functionality ZMMR0025 before ZMMR0055 is made available.
    I hope I’m clear , please let me know if I need to be more specific on any part.
    I appreciate your help.
    regards,
    Salman.

Maybe you are looking for