DateTimeAxis min/max bug? Problems with consistent padding. Date Wrapping.

I have been working on a problem with a BarChart object that I've created using dynamic data.
My primary issue is that I can't seem to get the proper min/max values to set for the chart.
To solve this I manually found the min and max of the data set of Dates and set the min and max of the chart. This allowed me to finally see all the floating custom bars (each bar is rendered with a user set fill), however now if I have a bar that extends over a year change the horizontal axis labels do not wrap the date properly, so instead of 2/10 (feb 2010) being the last date, 12/09 (dec 2009) is the last date.
I've been trying to dynamically adjust the padding based upon a change event, but so far to no avail. Partially I think because I'm not sure which event for the function to fire on.
private function dateAxisGen(r:Array):void {
                var min:Number = r[0].startTime.time;
                var max:Number = r[0].endTime.time;
                const PAD:Number = 2;
                const MILLISEC_IN_MONTH:Number = 2629743830;
                const MILLISEC_IN_WEEK:Number = 604800000;
                const MILLISEC_IN_DAY:Number = 864;
                for (var i:int = 1; i < r.length; i++) {
                    var o:OperationXT = OperationXT(r[i]);
                    min = Math.min(o.startTime.time, min);
                    max = Math.max(o.endTime.time, max);
                // Calculates the maximum range, then adds an appropriate
                // padding to the chart via extra time. TODO
                /* var range:Number = max - min;
                if(range >= MILLISEC_IN_MONTH) {
                    dAxis.padding = (MILLISEC_IN_WEEK/1000000)/PAD;
                    dAxis.padding = (MILLISEC_IN_WEEK/1000000)/PAD;
                } else if(range >= MILLISEC_IN_WEEK) {
                    dAxis.padding = (MILLISEC_IN_DAY)/PAD;
                    dAxis.padding = (MILLISEC_IN_DAY)/PAD;
                } else {
                    dAxis.padding = PAD;
                dAxis.minimum = new Date(min);
                dAxis.maximum = new Date(max);
this, however, does not adjust the padding properly when an operation is removed from the list. Not to mention I still have the date wrapping error. It gives me the following error:
Cannot access a property or method of a null object reference.
    at mx.charts::AxisRenderer/measureHorizontalGutters()[C:\work\flex\dmv_automation\projects\d atavisualisation\src\mx\charts\AxisRenderer.as:2244]
    at mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\work\flex\dmv_automation\projects\dat avisualisation\src\mx\charts\AxisRenderer.as:1858]
    at mx.charts::AxisRenderer/adjustGutters()[C:\work\flex\dmv_automation\projects\datavisualis ation\src\mx\charts\AxisRenderer.as:1534]
    at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\work\flex\dmv_automation\pro jects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2239]
    at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\work\flex\dmv_automation\pr ojects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1366]
    at mx.core::UIComponent/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8065]
    at mx.managers::LayoutManager/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\f ramework\src\mx\managers\LayoutManager.as:663]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects \framework\src\mx\managers\LayoutManager.as:736]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\gumbo_beta2\frameworks\ projects\framework\src\mx\managers\LayoutManager.as:1069]
Any help with my problem would be greatly appreciated.
ADDITIONAL INFO:
Alright, so I've discovered that the ONLY time the date wrapping error occurs is when the axis labels contain only the month and year, any other time it places it properly.
Does anyone know where I can report this bug?

Perre wrote:I'm used to being able to pick one or a couple of songs and then adding it a specified playlist. Is this impossible in sonata?
It's clearly not impossible, just different than you expect. Create your playlist as you want it to appear in the Current tab (meaning don't dump every single song from your library in there, just the ones you want) and then save the playlist.
Perre wrote:And if I try to play the m3u file created (the one with every song listed) through freevo I get a message that the directory is empty. What am I doing wrong??
Look at save_absolute_paths_in_playlists in your mpd.conf.

Similar Messages

  • G4 mini has a problem with its volume structure

    My G4 mini has a problem with its volume structure according to Tech Tools Deluxe. One that the application can't seem to repair. Ran it 3 times and it always hangs before it completes the fix. Never hangs in exactly the same place in the repair routine, but always hangs.
    Ran these tests because for the longest time the mini would accelerate (panic) and shut down. Installation on a new system hangs before it completes the install of all the upgrades. Any help would be appreciated.

    I realize it was not clear from the original post whether or not DiskUtility had been tried yet to fix the hard drive.
    To use DiskUtility to repair the drive, you have to boot from the original install disc that shipped with your Mini.
    1) Insert the Install disc and the shutdown the Mini.
    2) Restart the Mini and hold down the C key as soon as the startup chime or beep is heard. Hold it down until you see the "gear" spinning on the screen.
    3) Select your language, but don't proceed any farther with installation. Use the Utilities menu at the top of the screen to run DiskUtility.
    4) In DiskUtility, click once on the hard drive in the left panel, then click on the Repair Disk button in the right panel.

  • Problem with displaying chart data

    Hello everybody,
    I have problem with displaying chart data correctly. I'm using a cartesian chart with DateTimeAxis. The stockdata I'm using is for half a year and
    with ticks for every day. The problem is, that Flex displays the data of february in march together with the data of march. I have added a picture
    to show the result. The second column of the grid is for february and the third for march.
    Could anybody help me with this problem. Thanks in advance.
    Thomas

    Hi Chris,
    thanks for your reply. Here you get the source code:
    The following method creates the LineChart:
            public function init():void
                model.upperChart = this;
                model.upperChartStyle.setChartViewStyle(this);
                this.hAxis = new MyDateTimeAxis();
                model.upperChartData.configureHAxis(this.hAxis);
                this.vAxis = new LinearAxis();
                model.upperChartData.configureVAxis(this.vAxis);           
                this.vAxisTitle = new Label();
                this.vAxisTitle.text = model.upperChartData.getVAxisTitle();
                model.upperChartStyle.setVAxisTitleLabelStyle(this.vAxisTitle);
                this.vAxisTitle.x = 10
                this.vAxisTitle.y = 0;
                this.addChild(this.vAxisTitle);
                this.myChart = new CartesianChart();
                //remove default datatip
                this.myChart.showDataTips = false;
                this.myChart.x = 10;
                this.myChart.y = 0;
                this.myChart.width = 768; 
                this.myChart.height = 196;
                model.upperChartStyle.setChartStyle(this.myChart);
                this.addChild(this.myChart);
                //Remove line shadow
                this.myChart.seriesFilters = null;
                this.myChart.horizontalAxis = this.hAxis;
                this.myChart.verticalAxis = this.vAxis;
                this.hAxisRenderer = new AxisRenderer();
                model.upperChartData.configureHAxisRenderer(this.hAxisRenderer);
                this.hAxisRenderer.axis = this.hAxis;        
                model.upperChartStyle.setHAxisRendererStyle(this.hAxisRenderer);
                this.myChart.horizontalAxisRenderers.push(this.hAxisRenderer);
                this.vAxisRenderer = new AxisRenderer();
                model.upperChartData.configureVAxisRenderer(this.vAxisRenderer);
                this.vAxisRenderer.axis = this.vAxis;
                model.upperChartStyle.setVAxisRendererStyle(this.vAxisRenderer);
                this.myChart.verticalAxisRenderers.push(this.vAxisRenderer);
                model.upperChartStyle.setVAxisDataLabelStyle(this.vAxisMinLabel);
                this.addChild(this.vAxisMinLabel);   
                model.upperChartStyle.setSeriesStyle(model.upperChartData.series, model.upperChartData.shares);           
                this.myChart.dataProvider = model.upperChartData.dataProvider;
                this.myChart.series = model.upperChartData.series;
    The data for dataprovider and series you can see in attached file dataprovider.xml.
    xfield is equivalent to timestamp
    yfield is equivalent to absolute
    I think the problem could be the configuration of the datetimeaxis. The following method shows the parameter for the datetimeaxis:
            public function configureHAxis(axis:MyDateTimeAxis):void
                axis.parseFunction = UtilityClass.parseYYYYMMDDHHNNSSString2Date;
                axis.dataUnits = "days";
                axis.dataInterval = 1;
                axis.title = "";
                axis.minimum = new Date(UtilityClass.parseYYYYMMDDHHNNSSString2Date("2009-01-07 00:00:00").time);
                axis.maximum = new Date(UtilityClass.parseYYYYMMDDHHNNSSString2Date("2009-07-06 00:00:00").time);
    And finally you get the function, that I'm using for string to date conversion:
            public static function parseYYYYMMDDHHNNSSString2Date(input:String):Date
                var result:Date = new Date();
                var year:Number = Number(input.substring(0,4));
                var month:Number = Number(input.substring(5,7));
                var date:Number = Number(input.substring(8,10));
                var hours:Number = Number(input.substring(11,13));
                var minutes:Number = Number(input.substring(14,16));
                var seconds:Number = Number(input.substring(17,19));           
                result.setUTCFullYear(year);
                result.setUTCMonth(month-1);
                result.setUTCDate(date);
                result.setUTCHours(hours);
                result.setUTCMinutes(minutes);
                result.setUTCSeconds(seconds);
                return result;           
    I hope that will help to locate the reason for the wrong chart visualization.
    Thanks for any help.

  • How can I debug a problem with the 3g data connection on my iPhone 4s?

    This question didn't get any answers in the "Using iPhone" forum. Thought I would re-ask here. Note, I had to reset the network again today 2 days after the last reset:
    I've been having intermittent problems with my 3g data connection on my iPhone 4s on ATT. Whenever this happens I see full bars etc, but can't browse from safari or get any data in other apps. My wife's iPhone 4 right next to me has no issues at all. Switching on/off airplane mode and turning off/on Cellular Data does not help. The only thing that helps is resetting the Network Settings or hard restarting the phone.
    I figured my problems were hardware related so I took my phone in for a replacement the other day. Things started out fine but after I upgraded it to 5.01 and restored my backup and now I am back to having the same issue today. I assume the issue is with something coming from my backup / restore but is there any way for me to pinpoint what could be causing the issue. I have a lot of apps, I'd rather not have to reinstall and set them all backup manually, but I would if I knew that would fix the problem... but for all I know one of the apps could be causing it.
    Anyone have any logs I can check or testing I can do on my end?
    Thanks!

    Unfortunately, Apple does not make any logs available to the average schmoe (like us) for networking, kernel dumps, or anything else (assuming, of course, it is not jailbroken).
    Your best bet is to take it back into the store. Ask them to look at the notes in GCRM regarding the last time this occured, then explain after upgrading to 5.01 it is occuring again. Then ask them for a phone swap since it is a reoccuring issue and doesn't sound like an OS/SW issue. Good luck!

  • Sql Devloper 4.0.0.13 - problems with displaying user data types

    Hi,
    I have installed new version of sqldeveloper and have discovered some problems with displaying user data types. The data that is described as VARCHAR2 are displayed with ‘???’.
    The problem persist in table view, script output and exported files.
    My type is described as follows:
    create or replace TYPE "DPTY_ADRESA" AS OBJECT
      ID_DPSF_OPCINE                                         NUMBER,
      ID_DPSF_MJESTA                                        NUMBER,
      OPCINA                                            VARCHAR2(100),
      MJESTO                                            VARCHAR2(100),
      ULICA                                 VARCHAR2(200),
      BROJ                                   VARCHAR2(20),
      SPRAT                VARCHAR2(20),
      OSTALO                             VARCHAR2(100),
      CONSTRUCTOR FUNCTION dpty_adresa RETURN SELF AS RESULT
    add MEMBER FUNCTION dajAdresu RETURN VARCHAR2 cascade;
    when make select column from table that contains this type I get next results:
    CASE 1:
    SQLDeveloper Version 3.2.20.09; Build MAIN-09.87; JDK 1.6.0_43; Windows 7 64 bit
    Select:
    select id, adresalokacija
    from dptr_saglasnosti
    where id = 1;
    Result:
            ID ADRESALOKACIJA
             1 COMP.DPTY_ADRESA(124,4913,'TRAIK','TURBE','BABANA','3452','0',NULL)
    END CASE 1;
    CASE 2:
    SQLDeveloper Version 4.0.0.13; Build MAIN-13.80; JDK 1.7.0_40; Windows 7 64 bit
    Select1:
    select id, adresalokacija
    from dptr_saglasnosti
    where id = 1;
    Result1:
    ID ADRESALOKACIJA
             1 COMP.DPTY_ADRESA(124,4913,'???','???','???','???','???',NULL)    
    But if I select one element it is displayed normal.
    Select2:
    select id, a.adresalokacija.opcina
    from dptr_saglasnosti a
    where id = 1;
    Result2:
    ID ADRESALOKACIJA.OPCINA
             1 TRAVNIK                  
    END CASE 2;
    I have tried this scenario on three different pc with same output.
    Pleas help me to get rid of the '???' in result.
    Best Regards,
    Omer

      I tried on SQLDeveloper Version 4.0.0.13; Build MAIN-13.80; JDK 1.7.0_45; Windows 7 64 bit; NLS setting is default
    all data can show,No ??? in result
    Test step as following:
    create or replace TYPE "DPTY_ADRESA" AS OBJECT
      ID_DPSF_OPCINE                                         NUMBER,
      ID_DPSF_MJESTA                                        NUMBER,
      OPCINA                                            VARCHAR2(100),
      MJESTO                                            VARCHAR2(100),
      ULICA                                 VARCHAR2(200),
      BROJ                                   VARCHAR2(20),
      SPRAT                VARCHAR2(20),
      OSTALO                             VARCHAR2(100),
      CONSTRUCTOR FUNCTION dpty_adresa RETURN SELF AS RESULT
    alter TYPE "DPTY_ADRESA" add MEMBER FUNCTION dajAdresu RETURN VARCHAR2 cascade;
    CREATE TABLE dptr_saglasnosti (
    adresalokacija        DPTY_ADRESA,
      id    number);
      INSERT INTO dptr_saglasnosti VALUES (
      DPTY_ADRESA (65,225,'Vrinda Mills', '1-800-555-4412','sss','aaaa','eeeee','attta'),1 );
    select id, adresalokacija from dptr_saglasnosti where id = 1;
    ID ADRESALOKACIJA
    1    HRCP.DPTY_ADRESA(65,225,'Vrinda Mills','1-800-555-4412','sss','aaaa','eeeee','attta')

  • When I try and restore from iCloud it says problem with back up data help !!!

    Can anyone help me back up my phone from iCloud. It is saying there is a problem with my data

    Hey Shopaholic1181,
    Thanks for using Apple Support Communities.
    iCloud: Understanding alert messages when restoring from an iCloud Backup
    http://support.apple.com/kb/TS4585
    "Your iPhone cannot be restored because there is a problem with your backup data. Choose a different backup to restore from."
    Your backup does not appear to be usable. If you receive this alert, you should check the iCloud System Status at the iCloud Support website to make sure there are not any issues occurring with iCloud Backup. If there is not a widespread issue notated on the iCloud System Status, the error may self-resolve if you wait several minutes and try again. If issues persist, you should contact iCloud Support via the iCloud Support website.
    Have a nice day,
    Mario

  • JInternalFrame min/max button problem???

    Hi,
    I was just wondering if anyone can help me on this. I'm creating simple desktopPane applet with JInternalFrame in it. When i try to run it from browser, the min/max button got screwed up. When i iconized the jif, the '_' icon (minimized) is still there. When i deiconized it, the maximized icon (two rect icons) is there. Has anyone noticed this? I'm using the latest JSDK version. Any clues/helps greatly appreciated.
    Mike

    I don't recall seeing a bug regarding this issue. Do you know of one already filed against this? Does it only happens in the applet context? Can you reproduce this in a application context. Can someone post a small test case for me to run? I'm very interested in fixing these issues. We want all of you to be happy! :)
    Josh

  • Problems with track pad and osx installation disc on macbok.

    Okay so I am having two separate problems with my macbook.
    First, the track pad, or the button beneath it, is pretty much completely out of commission. When I try and use it, the computer acts as if I am holding down the button all the time. Example, when I drag it across the desktop, the "click-and-drag" square starts appearing next to the cursor or when move the cursor on an icon, it tries to click and drag that. The only way that I can fix it thus far is to hook up my wireless mouse. Hoping someone else has a better solution so that I can continue to use the notebook on the go without having to bring the mouse. Note: the button does not appear to be depressed in anyway.
    Second problem is happening when I attempt to reboot the computer with the OS X Leopard disk in for a re-installation. When the gray start-up screen appears, before the gray apple comes on the middle of the screen, a folder icon with a question mark on it appears for a split second and then turns into the normal apple icon after which my OSX disk is spit out of the drive and the computer boots straight to the desktop. I have attempted holding down the control button, the option button, and starting the process while the computer is still turned on and then just restarting it, the disc is ejected upon restart every time. I have reinstalled the OS with this disk once before and it has worked fine and other disks seem to be working fine in the drive, so I am at a lost here.
    I know that was a lot of info but if anyone out there can help me out with either one of these problems it would be much appreciated.
    Thanks.

    exactly the same issu with the track pad here.
    I v tried to use it without the battery but the problem persist.
    If I use an USB mouse i can move it arnd but wen I click or double click nothing happen...so is useless.Same problem with the Blur Tooth wireless mouse.
    The issue appear several months ago...after a couple of weeks went away, and now is back again. I try the routine manteinance but nothing solved the issue.
    Any suggestion? I have some urgent work to do ...I will try tomorrow to bring it in an apple store but I can't leave it with them ..
    Thanx in advance

  • HDMI On Mac Mini Late 2012: Problem with hardware?

    Just converted from PC to Mac.
    Purchased latest mac mini (Late 2012 version)
    Have tried several monitors through HDMI port and each time the picture quality is poor with very bad text resolution.
    Have tried HDMI to HDMI  and also tried HDMI to DVI adaptor.
    This is with full 1080p 27 inch samsung monitor and HP 2010i monitor.
    Is there a problem with the HDMI port on this new mac mini?
    The monitors I have are fine and are crystal sharp when connected to PC.
    Many thanks if you can answer this

    OK. So I have now tried LG 27 Inch E2742 Monitor as follows:
    1) Mini display to DVI-D : Picture good with decent text resolution
    2) HDMI-HDMI: Picture poor with poor colour and text resolution. This is not a calibration issue.
    The samsung monitor 27 inch series 3 also has poor picture and colour and text resolution with HDMI-HDMI. Again this is not a calibration issue. It does not have a DVI-D input to test the minidisplay port.
    So it seems the HDMI port is not working properly but the minidisplay one is ok as I suspected.
    From reading the other threads it seems this is a common problem including those people that have taken their minis back for an exchange and experienced same problem.
    Is there likely to be a software update to resolve this?

  • Zen Touch: problem with touch pad and formatt

    Hi guys!
    I have a Zen Touch 20gb but I'm experiencing big problems with my touch pad: it really doesn't work fine, precision is almost none, to poit the desired voice in any menu I have to work hard. If the menu is longer it is almost impossible to navigate it with precision. I can't move of a single position, it jumps at least two... Is it a common problem or should I take it to be checked up?
    2nd problem:
    I was trying to format the player's HD. Instructions said press play botton and contemporarly reset hole.
    But nothing happens. When I release the system reboots.
    Any idea?
    Thanx!
    Gp

    Please be patient with the touch pad. Reading these boards, I think a lot of people are not really understanding how the touch pad works and assuming it's defecti've and returning the Touch. First, set the sensitivity to where it's best for you. If you can't move only one line at a time, you may have it set too sensiti've. Second, use your index finger, not your thumb. Then, practice moving around. For me, it was really easy to move rapidly through the choices or to move just one line at a time. But moving at medium speed always tripped me up, until I figured out the technique of repeatedly stroking the touch pad through the slow zone to move several lines at a time, just like you were using a scroll wheel.

  • Problem with touch pad

    ''Duplicate post, continue here - [https://support.mozilla.com/en-US/questions/794303]''
    i can't use the '''touch pad''' in FF4 RC2..why?..with mouse no problem but with touch pad there is...
    i have acer aspire 7520G
    thank you!

    Dear samarif 
    Welcome to Lenovo Forums
    Please toatally Shut Down the machine
    then unpluge the ac adpter
    press and hold on the power button for 10 Second
    then check the TP performance
    Thanks
    Alaa
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • 845PE Max-L problem with pci cards

    Got a weird issue with the 845PE Max-L and was wondering if anyone else has come across this. I work in the RMA dept of a nationwide computer wholesaler and recently we've come across atleast 4 of these boards with the same problem. under windows xp it will not detect any pci cards. tried various sticks of ram, video cards, network cards, modems, usb cards, hard drives, pretty much anything we can think of to check for incompatiblities. did the latest bios flash, installed the newest updates in windows xp, but still cant get these boards to detect any pci cards whatsoever. yes we tried different power supplies and yes we tested the pci cards in other systems to make sure none of it was defective, all passed with flying colors. now here's the kicker, under windows 2000 it DID detect the pci cards, however i was unable to successfully load any drivers to any of the devices. We've made a call to our MSI rep to find out if anyone else has run into this or are we just dealing with a bad batch. unfortunatly noone from MSI has contacted us back yet so i decided to try and post here to see if anyone else has come across this odd situation. Any feedback would be much appreciated.

    Weaksauce;
    Two replies two separate motherboards.  In reference to the 865 / 875 motherboards not recognizing PCI cards I think your link has something to offer.   :biggthumbsup:I'm not going to go back and test it but the reason the PCI cards were not recognized may very well be that the old bios did not properly inspire the intel inf utility to install the correct drivers.  The force method you suggest may well overcome that particular problem.  I would still suggest that merely doing the BIOS upgrade first is the more elegant approach.
    Regarding the usb problem with MS update, the inf chipset article would appear to have little to offer.  The 845 MB uses the Intel 845 chipset which is ICH4 by the way.  The updated inf utility was installed in as early in the process as possible.

  • Bug: problems with the Escape key

    Hi all,
    In an attempt to get around real estate problems, I set my Dell 24" monitor in portrait mode. Logic 8 behaves as it should most of the time. However, there appears to be a problem with the Escape key. Most of the time, the Tools menu doesn't appear until you mouse out of the editing areas (eg into the menu area above the piano roll).
    Clearly, Logic should just take its resolution and screen dimensions from the OS but there appears to be a problem in extreme portrait mode.
    I'll report this but wanted to check that I'm not being an absolute and total plonker first. Anybody confirm this behaviour?
    Thanks!
    Pete

    that sounds like a memory issue. have you tried reorganizing memory?

  • Problems with 2 transaction data getting intermixed !!!

    Hi,
    i am using weblogic in my project both as a webserver and as the application server.
    But i am facing problems with requests being sent to the server. Basically i have
    a form in my jsp which, if submitted by multiple clients at the same instant in
    time, the server gets confused and mixes up the data in the requests !! the form
    is submitted to another jsp which in turn calls a SLSB which in turn calls various
    entity Beans to fulfill the request.
    Now if 2 or more clients hit the submit button together, the server is mixing
    the data from the requestsand i get corrupted output as a result.
    That if i submit values (a,b,c) from one client machine and values (x,y,z) from
    another machine, the server puts one of the transactions properly and in the other
    it picks up the data from the other request and takes something like (x,y,c) !!
    Is this a bug in Weblogic 6.1 or am doing something wrong ??
    Any help would be appreciated. Anyone faced something similar ?
    Raja

    Hi.
    Please open a case with support if you haven't already done so.
    Regards,
    Michael
    Raja wrote:
    Hi,
    i am using weblogic in my project both as a webserver and as the application server.
    But i am facing problems with requests being sent to the server. Basically i have
    a form in my jsp which, if submitted by multiple clients at the same instant in
    time, the server gets confused and mixes up the data in the requests !! the form
    is submitted to another jsp which in turn calls a SLSB which in turn calls various
    entity Beans to fulfill the request.
    Now if 2 or more clients hit the submit button together, the server is mixing
    the data from the requestsand i get corrupted output as a result.
    That if i submit values (a,b,c) from one client machine and values (x,y,z) from
    another machine, the server puts one of the transactions properly and in the other
    it picks up the data from the other request and takes something like (x,y,c) !!
    Is this a bug in Weblogic 6.1 or am doing something wrong ??
    Any help would be appreciated. Anyone faced something similar ?
    Raja--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Problems with Concatenating Binary Data

    Hi
    I am experiencing a problem with the unreliable concatenation of binary data.
    I have a stored procedure that I wrote to perform cell encryption on long text fields (> 4000 characters in length). This takes the string, splits it into chunks of a set length, encrypts and concatenates the encrypted chunks into a varbinary(max) variable.
    It then stores the length of the encrypted chunk at the beginning of the data (the length of output when encrypting strings of a set length is always be the same), e.g.
    DECLARE @output VARBINARY(MAX), @length INT
    SELECT @length = LEN(@encryptedchunk1)
    SELECT @output = CONVERT(binary(8), @length) + @encryptedchunk1 + @encryptedchunk2 + @encryptedchunk3 + ...
    So far so good, and when I decrypt the data, I can read the first 8 bytes of data at beginning of the binary data to get the length of the chunk:
    -- get the length of the encrypted chunk
    SELECT @length = CONVERT(INT, CONVERT(binary(8), LEFT(@encrypteddata, 8)))
    -- then remove the first 8 bytes of data
    SELECT @encrypteddata = CONVERT(VARBINARY(MAX), RIGHT(@encrypteddata, LEN(@encrypteddata) - 8))
    <snip> code to split into chunks of length @length and decrypt
    </snip>
    This is where I am experiencing an issue. 99.4% of the time, the above code is reliable. However, 0.6% of the time this fails for one of two reasons:
    the length is stored incorrectly. The length of the encrypted chunks is usually 4052 and substituting 4052 for the returned value (4051) allows the encrypted chunks to be decrypted.
    the encrypted data sometimes starts at offset 8 instead of 9. The @length variable is correctly read at length 8 but only 7 bytes should be removed from the start, e.g.
    SELECT @length = CONVERT(INT, CONVERT(binary(8), LEFT(@encrypteddata, 8)))
    SELECT @encrypteddata = CONVERT(VARBINARY(MAX), RIGHT(@encrypteddata, LEN(@encrypteddata) - 7))
    Has anyone any ideas on why this is happening and how the process can be made more reliable?
    Julian

    Use datalength, not len. Len() is designed for character strings and will ignore trailing bytes. And count characters. Datalength does exactly what you want: it counts bytes. Look at this:
    DECLARE @b varbinary(200)
    SELECT @b = 0x4142434420202020
    SELECT @b, len(@b), datalength(@b)
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for