Search Results

Search found 36172 results on 1447 pages for 'unicode string'.

Page 8/1447 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • An analog of String.Join(string, string[]) for List<T> or other generic enumerable

    - by abatishchev
    class String contains very useful method - String.Join(string, string[]). It creates a string from an array, separating each element of array with a symbol given. But general - it doesn't add a separator after the last element! I uses it for ASP.NET coding for separating with "<br />" or Environment.NewLine. So I want to add an empty row after each row in asp:Table. What method of IEnumerable<TableRow> can I use for the same functionality?

    Read the article

  • How to convert string with double high/wide characters to normal string [VC++6]

    - by Shaitan00
    My application typically recieves a string in the following format: " Item $5.69 " Some contants I always expect: - the LENGHT always 20 characters - the start index of the text always [5] - and most importantly the index of the DECIMAL for the price always [14] In order to identify this string correctly I validate all the expected contants listed above .... Some of my clients have now started sending the string with Doube-High / Double-Wide values (pair of characters which represent a single readable character) similar to the following: " Item $x80x90.x81x91x82x92 " For testing I simply scan the string character-by-character, compare char[i] and char[i+1] and replace these pairs with their corresponding single character when a match is found (works fine) as follows: [Code] for (int i=0; i < sData.length(); i++) { char ch = sData[i] & 0xFF; char ch2 = sData[i+1] & 0xFF; if (ch == '\x80' && ch2 == '\x90') zData.replace("\x80\x90", "0"); else if (ch == '\x81' && ch2 == '\x91') zData.replace("\x81\x91", "1"); else if (ch == '\x82' && ch2 == '\x92') zData.replace("\x82\x92", "2"); ... ... ... } [/Code] But the result is something like this: " Item $5.69 " Notice how this no longer matches my expectation: the lenght is now 17 (instead of 20) due to the 3 conversions and the decimal is now at index 13 (instead of 14) due to the conversion of the "5" before the decimal point. Ideally I would like to convert the string to a normal readable format keeping the constants (length, index of text, index of decimal) at the same place (so the rest of my application is re-usable) ... or any other suggestion (I'm pretty much stuck with this)... Is there a STANDARD way of dealing with these type of characters? Any help would be greatly appreciated, I've been stuck on this for a while now ... Thanks,

    Read the article

  • Padding a string in Postgresql with rpad without truncating it

    - by dmoebius
    Using Postgresql 8.4, how can I right-pad a string with blanks without truncating it when it's too long? The problem is that rpad truncates the string when it is actually longer than number of characters to pad. Example: SELECT rpad('foo', 5); ==> 'foo ' -- fine SELECT rpad('foo', 2); ==> 'fo' -- not good, I want 'foo' instead. The shortest solution I found doesn't involve rpad at all: SELECT 'foo' || repeat(' ', 5-length('foo')); ==> 'foo ' -- fine SELECT 'foo' || repeat(' ', 2-length('foo')); ==> 'foo' -- fine, too but this looks ugly IMHO. Note that I don't actually select the string 'foo' of course, instead I select from a column: SELECT colname || repeat(' ', 30-length(colname)) FROM mytable WHERE ... Is there a more elegant solution?

    Read the article

  • Is there stl and utf8 friendly C++ Wrapper for ICU, or other powerful unicode library

    - by artyom
    Hello, I need a good Unicode library for C++. I need Transformations in Unicode sensitive way. For example sort all strings in case insensitive way and get their first characters for index. Convert to upper and to lower various Unicode strings. Split text in reasonable position -- words that would work for Chinese and Japanese as well. Formatting numbers, dates in locale sensitive way (should be thread safe). Transparent support of utf8 (primary internal representation). As far as I know the best library is ICU. However, I can't find normal developer friendly API documentation with examples. Also as far as I see, it is not too friendly with modern C++ design, work with STL and so on. Like this std::string msg; unistring umsg.from_utf8(msg); unistring::word_iterator wi; for(wi=umsg.words().begin(),n=0;wi!=usmg.words().wi_end(),n<10;++wi,++n) ; msg=umsg.substr(umsg.words().begin(),wi).to_utf8(); cout<<_("Five 10 words are ")<<msg; Does anybody know good STL friendly ICU wrapper released under Open Source license preferred permissive like MIT or Boost, but others LGPLv2 compatible are ok as well. Is there another high quality library similar to ICU? Platform: UNIX/POSIX, Windows support is not required. Thanks, Artyom Edit: Unfortunatly I wasn't logged in so I can't make asnver accepted... I had attached the ansver by myself.

    Read the article

  • Problem using unicode in URLs with cgi.PATH_INFO in ColdFusion

    - by Loftx
    Hi there, My ColdFusion (MX7) site has search functionality which appends the search term to the URL e.g. http://www.example.com/search.cfm/searchterm. The problem I'm running into is this is a multilingual site, so the search term may be in another language e.g. ??????? leading to a search URL such as http://www.example.com/search.cfm/??????? The problem is when I come to retrieve the search term from the URL. I'm using cgi.PATH_INFO to retrieve the path of the search page and the search term and extracting the search term from this e.g. /search.cfm/searchterm however, when unicode characters are used in the search they are converted to question marks e.g. /search.cfm/??????. These appear actual question marks, rather than the browser not being able to format unicode characters, or them being mangled on output. I can't find any information about whether ColdFusion supports unicode in the URL, or how I can go about resolving this and getting hold of the complete URL in some way - does anyone have any ideas? Cheers, Tom

    Read the article

  • Why are there so many spaces and line breaks in Unicode?

    - by maaartinus
    Unicode has maybe 50 spaces \u0009\u000A-\u000D\u0020\u0085\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000][\u0009\u000A-\u000D\u0020\u0085\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000 and 6 line breaks not only CRLF, LF, CR, but also NEL (U+0085), PS (U+2029) and LS (U+2028). Maybe I could understand most of the spaces and PS ("Paragraph separator"), but what are "Next Line" and "Line separator" good for? It all looks like invented by a very big committee where everybody wanted their own space and the leaders were granted one line break each. But seriously, how do you deal with it when your programming language doesn't support it (or does it wrong as e.g. Java does)?

    Read the article

  • Trim a string in C

    - by Orion Edwards
    Briefly: I'm after the equivalent of .NET's String.Trim in C using the win32 and standard C api (compiling with MSVC2008 so I have access to all the C++ stuff if needed, but I am just trying to trim a char*). Given that there is strchr, strtok, and all manner of other string functions, surely there should be a trim function, or one that can be repurposed... Thanks

    Read the article

  • Regarding Java String dollar to cents conversion

    - by arav
    I have a java string which has an dollar value and cents value after decimal points and starting with a + or - sign. I want to convert into cents and store it in a integer (it can have + or -). Also i need to check if the cents part (after decimal point) not more than 2 digits and throw an error message if exists example : String dollval= "12.23" ,"12","-0.09", "-99","-99.0", "-99.23","0.00" int dollint = 1223,12,-9,-99,-00,-9923,0

    Read the article

  • Sql Server string to date conversion

    - by JosephStyons
    I want to convert a string like this: '10/15/2008 10:06:32 PM' into the equivalent DATETIME value in Sql Server. In Oracle, I would say this: TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS AM') This question implies that I must parse the string into one of the standard formats, and then convert using one of those codes. That seems ludicrous for such a mundane operation. Is there an easier way?

    Read the article

  • Finding out why Dell Controler is Degraded

    - by Kyle Brandt
    I installed open manage on a couple of my PE 2950s for snmp monitoring of the RAID. All the checks seem to come back okay except for controllerState: [root@aMachine ~]# snmpwalk -v 2c -c bestNotToPostPasswords myMachine -m +StorageManagement-MIB controllerstate StorageManagement-MIB::controllerState.1 = INTEGER: degraded(6) Other checks seems to indicate the battery, LD, and physicals disks are all good unless I missing something. Can anyone tell if I am missing something or neglecting something import in my RAID monitoring/understanding? I get degraded for both these servers I have set up. A walk of the entire storage management tree for on of them: StorageManagement-MIB::softwareVersion.0 = STRING: "3.2.0" StorageManagement-MIB::globalStatus.0 = INTEGER: warning(2) StorageManagement-MIB::softwareManufacturer.0 = STRING: "Dell Inc." StorageManagement-MIB::softwareProduct.0 = STRING: "Server Administrator (Storage Management)" StorageManagement-MIB::softwareDescription.0 = STRING: "Configuration and monitoring of disk storage devices." StorageManagement-MIB::displayName.0 = STRING: "Server Administrator (Storage Management)" StorageManagement-MIB::description.0 = STRING: "Configuration and monitoring of disk storage devices." StorageManagement-MIB::agentVendor.0 = STRING: "Dell Inc." StorageManagement-MIB::agentTimeStamp.0 = INTEGER: 1273842310 StorageManagement-MIB::agentGetTimeout.0 = INTEGER: 5 StorageManagement-MIB::agentModifiers.0 = INTEGER: 0 StorageManagement-MIB::agentRefreshRate.0 = INTEGER: 300 StorageManagement-MIB::agentMibVersion.0 = STRING: "3.2" StorageManagement-MIB::agentManagementSoftwareURLName.0 = "" StorageManagement-MIB::agentGlobalSystemStatus.0 = INTEGER: nonCritical(4) StorageManagement-MIB::agentLastGlobalSystemStatus.0 = INTEGER: ok(3) StorageManagement-MIB::agentSmartThermalShutdown.0 = INTEGER: notApplicable(3) StorageManagement-MIB::controllerNumber.1 = INTEGER: 1 StorageManagement-MIB::controllerName.1 = STRING: "PERC 5/i Integrated" StorageManagement-MIB::controllerVendor.1 = STRING: "DELL" StorageManagement-MIB::controllerType.1 = INTEGER: sas(6) StorageManagement-MIB::controllerState.1 = INTEGER: degraded(6) StorageManagement-MIB::controllerRebuildRateInPercent.1 = INTEGER: 30 StorageManagement-MIB::controllerFWVersion.1 = STRING: "5.0.2-0003" StorageManagement-MIB::controllerCacheSizeInMB.1 = INTEGER: 256 StorageManagement-MIB::controllerCacheSizeInBytes.1 = INTEGER: 0 StorageManagement-MIB::controllerPhysicalDeviceCount.1 = INTEGER: 5 StorageManagement-MIB::controllerLogicalDeviceCount.1 = INTEGER: 1 StorageManagement-MIB::controllerRollUpStatus.1 = INTEGER: nonCritical(4) StorageManagement-MIB::controllerComponentStatus.1 = INTEGER: nonCritical(4) StorageManagement-MIB::controllerNexusID.1 = STRING: "\\0" StorageManagement-MIB::controllerAlarmState.1 = INTEGER: disabled(2) StorageManagement-MIB::controllerDriverVersion.1 = STRING: "00.00.03.05 " StorageManagement-MIB::controllerPCISlot.1 = STRING: "embedded" StorageManagement-MIB::controllerClusterMode.1 = INTEGER: notApplicable(99) StorageManagement-MIB::controllerMinFWVersion.1 = STRING: "5.2.1-0067" StorageManagement-MIB::controllerMinDriverVersion.1 = STRING: "00.00.03.21" StorageManagement-MIB::controllerChannelCount.1 = INTEGER: 2 StorageManagement-MIB::controllerReconstructRate.1 = INTEGER: 30 StorageManagement-MIB::controllerPatrolReadRate.1 = INTEGER: 30 StorageManagement-MIB::controllerBGIRate.1 = INTEGER: 30 StorageManagement-MIB::controllerCheckConsistencyRate.1 = INTEGER: 30 StorageManagement-MIB::controllerPatrolReadMode.1 = INTEGER: automatic(1) StorageManagement-MIB::controllerPatrolReadState.1 = INTEGER: stopped(1) StorageManagement-MIB::controllerPatrolReadIterations.1 = INTEGER: 162 StorageManagement-MIB::controllerEntry.57.1 = INTEGER: 99 StorageManagement-MIB::controllerEntry.58.1 = INTEGER: 99 StorageManagement-MIB::channelNumber.1 = INTEGER: 1 StorageManagement-MIB::channelNumber.2 = INTEGER: 2 StorageManagement-MIB::channelName.1 = STRING: "Connector 0" StorageManagement-MIB::channelName.2 = STRING: "Connector 1" StorageManagement-MIB::channelState.1 = INTEGER: ready(1) StorageManagement-MIB::channelState.2 = INTEGER: ready(1) StorageManagement-MIB::channelRollUpStatus.1 = INTEGER: ok(3) StorageManagement-MIB::channelRollUpStatus.2 = INTEGER: ok(3) StorageManagement-MIB::channelComponentStatus.1 = INTEGER: ok(3) StorageManagement-MIB::channelComponentStatus.2 = INTEGER: ok(3) StorageManagement-MIB::channelNexusID.1 = STRING: "\\0\\0" StorageManagement-MIB::channelNexusID.2 = STRING: "\\0\\1" StorageManagement-MIB::channelBusType.1 = INTEGER: sas(8) StorageManagement-MIB::channelBusType.2 = INTEGER: sas(8) StorageManagement-MIB::enclosureNumber.1 = INTEGER: 1 StorageManagement-MIB::enclosureName.1 = STRING: "Backplane" StorageManagement-MIB::enclosureVendor.1 = STRING: "DELL" StorageManagement-MIB::enclosureState.1 = INTEGER: ready(1) StorageManagement-MIB::enclosureProductID.1 = STRING: "BACKPLANE " StorageManagement-MIB::enclosureType.1 = INTEGER: internal(1) StorageManagement-MIB::enclosureChannelNumber.1 = INTEGER: 0 StorageManagement-MIB::enclosureRollUpStatus.1 = INTEGER: ok(3) StorageManagement-MIB::enclosureComponentStatus.1 = INTEGER: ok(3) StorageManagement-MIB::enclosureNexusID.1 = STRING: "\\0\\0\\0" StorageManagement-MIB::enclosureFirmwareVersion.1 = STRING: "1.00" StorageManagement-MIB::enclosureSASAddress.1 = STRING: "50019090B4C67200" StorageManagement-MIB::arrayDiskNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskNumber.2 = INTEGER: 2 StorageManagement-MIB::arrayDiskNumber.3 = INTEGER: 3 StorageManagement-MIB::arrayDiskNumber.4 = INTEGER: 4 StorageManagement-MIB::arrayDiskName.1 = STRING: "Physical Disk 0:0:0" StorageManagement-MIB::arrayDiskName.2 = STRING: "Physical Disk 0:0:1" StorageManagement-MIB::arrayDiskName.3 = STRING: "Physical Disk 0:0:2" StorageManagement-MIB::arrayDiskName.4 = STRING: "Physical Disk 0:0:3" StorageManagement-MIB::arrayDiskVendor.1 = STRING: "DELL " StorageManagement-MIB::arrayDiskVendor.2 = STRING: "DELL " StorageManagement-MIB::arrayDiskVendor.3 = STRING: "DELL " StorageManagement-MIB::arrayDiskVendor.4 = STRING: "DELL " StorageManagement-MIB::arrayDiskState.1 = INTEGER: online(3) StorageManagement-MIB::arrayDiskState.2 = INTEGER: online(3) StorageManagement-MIB::arrayDiskState.3 = INTEGER: online(3) StorageManagement-MIB::arrayDiskState.4 = INTEGER: online(3) StorageManagement-MIB::arrayDiskProductID.1 = STRING: "ST3146755SS " StorageManagement-MIB::arrayDiskProductID.2 = STRING: "ST3146755SS " StorageManagement-MIB::arrayDiskProductID.3 = STRING: "ST3146755SS " StorageManagement-MIB::arrayDiskProductID.4 = STRING: "ST3146755SS " StorageManagement-MIB::arrayDiskSerialNo.1 = STRING: "3LN0LRL0 " StorageManagement-MIB::arrayDiskSerialNo.2 = STRING: "3LN0JYJS " StorageManagement-MIB::arrayDiskSerialNo.3 = STRING: "3LN0LR0V " StorageManagement-MIB::arrayDiskSerialNo.4 = STRING: "3LN0JH97 " StorageManagement-MIB::arrayDiskRevision.1 = STRING: "T106" StorageManagement-MIB::arrayDiskRevision.2 = STRING: "T106" StorageManagement-MIB::arrayDiskRevision.3 = STRING: "T106" StorageManagement-MIB::arrayDiskRevision.4 = STRING: "T106" StorageManagement-MIB::arrayDiskEnclosureID.1 = STRING: "0" StorageManagement-MIB::arrayDiskEnclosureID.2 = STRING: "0" StorageManagement-MIB::arrayDiskEnclosureID.3 = STRING: "0" StorageManagement-MIB::arrayDiskEnclosureID.4 = STRING: "0" StorageManagement-MIB::arrayDiskChannel.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskChannel.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskChannel.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskChannel.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskLengthInMB.1 = INTEGER: 139392 StorageManagement-MIB::arrayDiskLengthInMB.2 = INTEGER: 139392 StorageManagement-MIB::arrayDiskLengthInMB.3 = INTEGER: 139392 StorageManagement-MIB::arrayDiskLengthInMB.4 = INTEGER: 139392 StorageManagement-MIB::arrayDiskLengthInBytes.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskLengthInBytes.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskLengthInBytes.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskLengthInBytes.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInMB.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInMB.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInMB.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInMB.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInBytes.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInBytes.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInBytes.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskLargestContiguousFreeSpaceInBytes.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskTargetID.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskTargetID.2 = INTEGER: 1 StorageManagement-MIB::arrayDiskTargetID.3 = INTEGER: 2 StorageManagement-MIB::arrayDiskTargetID.4 = INTEGER: 3 StorageManagement-MIB::arrayDiskLunID.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskLunID.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskLunID.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskLunID.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskUsedSpaceInMB.1 = INTEGER: 139392 StorageManagement-MIB::arrayDiskUsedSpaceInMB.2 = INTEGER: 139392 StorageManagement-MIB::arrayDiskUsedSpaceInMB.3 = INTEGER: 139392 StorageManagement-MIB::arrayDiskUsedSpaceInMB.4 = INTEGER: 139392 StorageManagement-MIB::arrayDiskUsedSpaceInBytes.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskUsedSpaceInBytes.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskUsedSpaceInBytes.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskUsedSpaceInBytes.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInMB.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInMB.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInMB.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInMB.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInBytes.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInBytes.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInBytes.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskFreeSpaceInBytes.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskBusType.1 = INTEGER: sas(8) StorageManagement-MIB::arrayDiskBusType.2 = INTEGER: sas(8) StorageManagement-MIB::arrayDiskBusType.3 = INTEGER: sas(8) StorageManagement-MIB::arrayDiskBusType.4 = INTEGER: sas(8) StorageManagement-MIB::arrayDiskSpareState.1 = INTEGER: notASpare(5) StorageManagement-MIB::arrayDiskSpareState.2 = INTEGER: notASpare(5) StorageManagement-MIB::arrayDiskSpareState.3 = INTEGER: notASpare(5) StorageManagement-MIB::arrayDiskSpareState.4 = INTEGER: notASpare(5) StorageManagement-MIB::arrayDiskRollUpStatus.1 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskRollUpStatus.2 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskRollUpStatus.3 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskRollUpStatus.4 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskComponentStatus.1 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskComponentStatus.2 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskComponentStatus.3 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskComponentStatus.4 = INTEGER: ok(3) StorageManagement-MIB::arrayDiskNexusID.1 = STRING: "\\0\\0\\0\\0" StorageManagement-MIB::arrayDiskNexusID.2 = STRING: "\\0\\0\\0\\1" StorageManagement-MIB::arrayDiskNexusID.3 = STRING: "\\0\\0\\0\\2" StorageManagement-MIB::arrayDiskNexusID.4 = STRING: "\\0\\0\\0\\3" StorageManagement-MIB::arrayDiskPartNumber.1 = STRING: "SG0DR2381253172FLRL0A00 " StorageManagement-MIB::arrayDiskPartNumber.2 = STRING: "SG0DR2381253172FJYJSA00 " StorageManagement-MIB::arrayDiskPartNumber.3 = STRING: "SG0DR2381253172FLR0VA00 " StorageManagement-MIB::arrayDiskPartNumber.4 = STRING: "SG0DR2381253172FJH97A00 " StorageManagement-MIB::arrayDiskSASAddress.1 = STRING: "5000C50002380201" StorageManagement-MIB::arrayDiskSASAddress.2 = STRING: "5000C50002385B89" StorageManagement-MIB::arrayDiskSASAddress.3 = STRING: "5000C50002385AA9" StorageManagement-MIB::arrayDiskSASAddress.4 = STRING: "5000C500023841E1" StorageManagement-MIB::arrayDiskSmartAlertIndication.1 = INTEGER: no(1) StorageManagement-MIB::arrayDiskSmartAlertIndication.2 = INTEGER: no(1) StorageManagement-MIB::arrayDiskSmartAlertIndication.3 = INTEGER: no(1) StorageManagement-MIB::arrayDiskSmartAlertIndication.4 = INTEGER: no(1) StorageManagement-MIB::arrayDiskManufactureDay.1 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureDay.2 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureDay.3 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureDay.4 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureWeek.1 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureWeek.2 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureWeek.3 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureWeek.4 = STRING: "07" StorageManagement-MIB::arrayDiskManufactureYear.1 = STRING: "2005" StorageManagement-MIB::arrayDiskManufactureYear.2 = STRING: "2005" StorageManagement-MIB::arrayDiskManufactureYear.3 = STRING: "2005" StorageManagement-MIB::arrayDiskManufactureYear.4 = STRING: "2005" StorageManagement-MIB::arrayDiskMediaType.1 = INTEGER: hdd(2) StorageManagement-MIB::arrayDiskMediaType.2 = INTEGER: hdd(2) StorageManagement-MIB::arrayDiskMediaType.3 = INTEGER: hdd(2) StorageManagement-MIB::arrayDiskMediaType.4 = INTEGER: hdd(2) StorageManagement-MIB::arrayDiskEntry.36.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskEntry.36.2 = INTEGER: 1 StorageManagement-MIB::arrayDiskEntry.36.3 = INTEGER: 1 StorageManagement-MIB::arrayDiskEntry.36.4 = INTEGER: 1 StorageManagement-MIB::arrayDiskEntry.40.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskEntry.40.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskEntry.40.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskEntry.40.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskEntry.41.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskEntry.41.2 = INTEGER: 0 StorageManagement-MIB::arrayDiskEntry.41.3 = INTEGER: 0 StorageManagement-MIB::arrayDiskEntry.41.4 = INTEGER: 0 StorageManagement-MIB::arrayDiskEnclosureConnectionNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionNumber.2 = INTEGER: 2 StorageManagement-MIB::arrayDiskEnclosureConnectionNumber.3 = INTEGER: 3 StorageManagement-MIB::arrayDiskEnclosureConnectionNumber.4 = INTEGER: 4 StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskName.1 = STRING: "Physical Disk 0:0:0" StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskName.2 = STRING: "Physical Disk 0:0:1" StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskName.3 = STRING: "Physical Disk 0:0:2" StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskName.4 = STRING: "Physical Disk 0:0:3" StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskNumber.2 = INTEGER: 2 StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskNumber.3 = INTEGER: 3 StorageManagement-MIB::arrayDiskEnclosureConnectionArrayDiskNumber.4 = INTEGER: 4 StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureName.1 = STRING: "Backplane" StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureName.2 = STRING: "Backplane" StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureName.3 = STRING: "Backplane" StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureName.4 = STRING: "Backplane" StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureNumber.2 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureNumber.3 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionEnclosureNumber.4 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionControllerName.1 = STRING: "PERC 5/i Integrated" StorageManagement-MIB::arrayDiskEnclosureConnectionControllerName.2 = STRING: "PERC 5/i Integrated" StorageManagement-MIB::arrayDiskEnclosureConnectionControllerName.3 = STRING: "PERC 5/i Integrated" StorageManagement-MIB::arrayDiskEnclosureConnectionControllerName.4 = STRING: "PERC 5/i Integrated" StorageManagement-MIB::arrayDiskEnclosureConnectionControllerNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionControllerNumber.2 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionControllerNumber.3 = INTEGER: 1 StorageManagement-MIB::arrayDiskEnclosureConnectionControllerNumber.4 = INTEGER: 1 StorageManagement-MIB::batteryNumber.1 = INTEGER: 1 StorageManagement-MIB::batteryName.1 = STRING: "Battery 0" StorageManagement-MIB::batteryVendor.1 = STRING: "DELL" StorageManagement-MIB::batteryState.1 = INTEGER: ready(1) StorageManagement-MIB::batteryRollUpStatus.1 = INTEGER: ok(3) StorageManagement-MIB::batteryComponentStatus.1 = INTEGER: ok(3) StorageManagement-MIB::batteryNexusID.1 = STRING: "\\0\\0" StorageManagement-MIB::batteryPredictedCapacity.1 = INTEGER: ready(2) StorageManagement-MIB::batteryNextLearnTime.1 = INTEGER: 21 StorageManagement-MIB::batteryLearnState.1 = INTEGER: idle(16) StorageManagement-MIB::batteryEntry.13.1 = INTEGER: 0 StorageManagement-MIB::batteryMaxLearnDelay.1 = INTEGER: 168 StorageManagement-MIB::batteryConnectionNumber.1 = INTEGER: 1 StorageManagement-MIB::batteryConnectionBatteryName.1 = STRING: "Battery 0" StorageManagement-MIB::batteryConnectionBatteryNumber.1 = INTEGER: 1 StorageManagement-MIB::batteryConnectionControllerName.1 = STRING: "PERC 5/i Integrated" StorageManagement-MIB::batteryConnectionControllerNumber.1 = INTEGER: 1 StorageManagement-MIB::virtualDiskNumber.1 = INTEGER: 1 StorageManagement-MIB::virtualDiskName.1 = STRING: "Virtual Disk 0" StorageManagement-MIB::virtualDiskDeviceName.1 = STRING: "/dev/sda" StorageManagement-MIB::virtualDiskState.1 = INTEGER: ready(1) StorageManagement-MIB::virtualDiskLengthInMB.1 = INTEGER: 278784 StorageManagement-MIB::virtualDiskLengthInBytes.1 = INTEGER: 0 StorageManagement-MIB::virtualDiskWritePolicy.1 = INTEGER: writeBack(3) StorageManagement-MIB::virtualDiskReadPolicy.1 = INTEGER: noReadAhead(5) StorageManagement-MIB::virtualDiskCachePolicy.1 = INTEGER: not-applicable(99) StorageManagement-MIB::virtualDiskLayout.1 = INTEGER: raid-10(10) StorageManagement-MIB::virtualDiskCurStripeSizeInMB.1 = INTEGER: 0 StorageManagement-MIB::virtualDiskCurStripeSizeInBytes.1 = INTEGER: 65536 StorageManagement-MIB::virtualDiskTargetID.1 = INTEGER: 0 StorageManagement-MIB::virtualDiskRollUpStatus.1 = INTEGER: ok(3) StorageManagement-MIB::virtualDiskComponentStatus.1 = INTEGER: ok(3) StorageManagement-MIB::virtualDiskNexusID.1 = STRING: "\\0\\0" StorageManagement-MIB::virtualDiskArrayDiskType.1 = INTEGER: sas(1) StorageManagement-MIB::virtualDiskEntry.23.1 = INTEGER: 2 StorageManagement-MIB::virtualDiskEntry.24.1 = INTEGER: 0 StorageManagement-MIB::arrayDiskLogicalConnectionNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskLogicalConnectionNumber.2 = INTEGER: 2 StorageManagement-MIB::arrayDiskLogicalConnectionNumber.3 = INTEGER: 3 StorageManagement-MIB::arrayDiskLogicalConnectionNumber.4 = INTEGER: 4 StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskName.1 = STRING: "Physical Disk 0:0:0" StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskName.2 = STRING: "Physical Disk 0:0:1" StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskName.3 = STRING: "Physical Disk 0:0:2" StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskName.4 = STRING: "Physical Disk 0:0:3" StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskNumber.2 = INTEGER: 2 StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskNumber.3 = INTEGER: 3 StorageManagement-MIB::arrayDiskLogicalConnectionArrayDiskNumber.4 = INTEGER: 4 StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskName.1 = STRING: "Virtual Disk 0" StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskName.2 = STRING: "Virtual Disk 0" StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskName.3 = STRING: "Virtual Disk 0" StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskName.4 = STRING: "Virtual Disk 0" StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskNumber.1 = INTEGER: 1 StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskNumber.2 = INTEGER: 1 StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskNumber.3 = INTEGER: 1 StorageManagement-MIB::arrayDiskLogicalConnectionVirtualDiskNumber.4 = INTEGER: 1

    Read the article

  • String length differs from Javascript to Java code

    - by François P.
    I've got a JSP page with a piece of Javascript validation code which limits to a certain amount of characters on submit. I'm using a <textarea> so I can't simply use a length attribute like in a <input type="text">. I use document.getElementById("text").value.length to get the string length. I'm running Firefox 3.0 on Windows (but I've tested this behavior with IE 6 also). The form gets submitted to a J2EE servlet. In my Java servlet the string length of the parameter is larger than 2000! I've noticed that this can easily be reproduced by adding carriage returns in the <textarea>. I've used Firebug to assert the length of the <textare> and it really is 2000 characters long. On the Java side though, the carriage returns get converted to UNIX style (\r\n, instead of \n), thus the string length differs! Am I missing something obvious here or what ? If not, how would you reliably (cross-platform / browser) make sure that the <textarea> is limited.

    Read the article

  • Algorithm to see if keywords exist inside a string

    - by rksprst
    Let's say I have a set of keywords in an array {"olympics", "sports tennis best", "tennis", "tennis rules"} I then have a large list (up to 50 at a time) of strings (or actually tweets), so they are a max of 140 characters. I want to look at each string and see what keywords are present there. In the case where a keyword is composed of multiple words like "sports tennis best", the words don't have to be together in the string, but all of them have to show up. I've having trouble figuring out an algorithm that does this efficiently. Do you guys have suggestions on a way to do this? Thanks! Edit: To explain a bit better each keyword has an id associated with it, so {1:"olympics", 2:"sports tennis best", 3:"tennis", 4:"tennis rules"} I want to go through the list of strings/tweets and see which group of keywords match. The output should be, this tweet belongs with keyword #4. (multiple matches may be made, so anything that matches keyword 2, would also match 3 -since they both contain tennis). When there are multiple words in the keyword, e.g. "sports tennis best" they don't have to appear together but have to all appear. e.g. this will correctly match: "i just played tennis, i love sports, its the best"... since this string contains "sports tennis best" it will match and be associated with the keywordID (which is 2 for this example).

    Read the article

  • Finding character in String in Vector.

    - by SoulBeaver
    Judging from the title, I kinda did my program in a fairly complicated way. BUT! I might as well ask anyway xD This is a simple program I did in response to question 3-3 of Accelerated C++, which is an awesome book in my opinion. I created a vector: vector<string> countEm; That accepts all valid strings. Therefore, I have a vector that contains elements of strings. Next, I created a function int toLowerWords( vector<string> &vec ) { for( int loop = 0; loop < vec.size(); loop++ ) transform( vec[loop].begin(), vec[loop].end(), vec[loop].begin(), ::tolower ); that splits the input into all lowercase characters for easier counting. So far, so good. I created a third and final function to actually count the words, and that's where I'm stuck. int counter( vector<string> &vec ) { for( int loop = 0; loop < vec.size(); loop++ ) for( int secLoop = 0; secLoop < vec[loop].size(); secLoop++ ) { if( vec[loop][secLoop] == ' ' ) That just looks ridiculous. Using a two-dimensional array to call on the characters of the vector until I find a space. Ridiculous. I don't believe that this is an elegant or even viable solution. If it was a viable solution, I would then backtrack from the space and copy all characters I've found in a separate vector and count those. My question then is. How can I dissect a vector of strings into separate words so that I can actually count them? I thought about using strchr, but it didn't give me any epiphanies.

    Read the article

  • Interpolating environment variables into a string in Ruby using String#scan

    - by robc
    I'm trying to interpolate environment variables into a string in Ruby and not having much luck. One of my requirements is to do something (log an error, prompt for input, whatever) if a placeholder is found in the initial string that has no matching environment variable. It looks like the block form of String#scan is what I need. Below is an irb session of my failed attempt. irb(main):014:0> raw_string = "need to replace %%FOO%% and %%BAR%% in here" => "need to replace %%FOO%% and %%BAR%% in here" irb(main):015:0> cooked_string << raw_string => "need to replace %%FOO%% and %%BAR%% in here" irb(main):016:0> raw_string.scan(/%%(.*?)%%/) do |var| irb(main):017:1* cooked_string.sub!("%%#{var}%%", ENV[var]) irb(main):018:1> done irb(main):019:1> end TypeError: cannot convert Array into String from (irb):17:in `[]' from (irb):17 from (irb):16:in `scan' from (irb):16 from :0 If I use ENV["FOO"] to manually interpolate one of those, it works fine. I'm banging my head against the desk. What am I doing wrong? Ruby is 1.8.1 on RHEL or 1.8.7 on Cygwin.

    Read the article

  • Strange characters appearing on websites - ASCII? - UNICODE?

    - by Mick
    I have created many very simple pure HTML websites over the years. Most of them appear to work fine most of the time. But there is one recurring problem which I have never quite sorted out involving strange characters. The scenario goes like this: I create the site. I look at it in my browser, everything appears fine. I may look at it a great many times over the coming weeks or months as I make additions here and there. Perhaps on a variety of browsers on a variety of PC's. Then one day I look at the page and see a random sprinkling of white question marks against dark diamond shapes. These might appear where I had expected to see hyphens or quotes or apostrophes. My immediate thought is that my browser got into some strange state because I was looking at some foreign website with strange characters, but I'm never quite sure. I'm left with that nagging feeling that perhaps half the planet is seeing my website with funny question marks all over it. So my question is what's going on? What should I do to ensure that as many people as possible around the world can view my text as I originally intended? Should I be using those special html sequences like &pound; for all non alphanumeric characters? Should I worry at all? Edit: Right now I have the problem occurring on this page: http://www.fullreservebanking.com/papers.htm ... part of it looks like this: I am using FireFox 5 and the character encoding currently appears to be "UNICODE (UTF-8)". I do not remember manually setting the character encoding to anything since installation. I do occasionally look at Japanese websites for work related reasons - though when I do so, I do not manually make any changes to firefox settings. Edit: Now fixed. Web page altered accordingly.

    Read the article

  • Compare two String with MySQL

    - by Scorpi0
    Hi, I wan't to compare two strings in a SQL request so I can retrieve the best match, the aim is to propose to an operator the best zip code possible. For example, in France, we have Integer Zip code, so I made an easy request : SELECT * FROM myTable ORDER BY abs(zip_code - 75000) This request returns first the data closest of Paris. Unfortunatelly, United Kingdom have zip code like AB421RS, so my request can't do it. I see in SQL Server a function 'Difference' : http://www.java2s.com/Code/SQLServer/String-Functions/DIFFERENCEworkoutwhenonestringsoundssimilartoanotherstring.htm But I use MySQL.. Is there anyone who have a good idea to do the trick in one simple request ? PS : the Levenshtein Distance will not do it, as I really wan't to compare string like if they were number. ABCDEF have to be closer to AWXYZ than to ZBCDEF.

    Read the article

  • Why is Django reverse() failing with unicode?

    - by JeffS
    Here is a django models file that is not working as I would expect. I would expect the to_url method to do the reverse lookup in the urls.py file, and get a url that would correspond to calling that view with arguments supplied by the Arguments model. from django.db import models class Element(models.Model): viewname = models.CharField(max_length = 200) arguments = models.ManyToManyField('Argument', null = True, blank = True ) @models.permalink def to_url(self): d = dict( self.arguments.values_list('key', 'value') ) return (self.viewname, (), d) class Argument(models.Model): key = models.CharField(max_length=200) value = models.CharField(max_length=200) The value d ends up as a dictionary from a unicode string to another unicode string, which I believe, should work fine with the reverse() method that would be called by the permalink decorator, however, it results in: TypeError: reverse() keywords must be strings

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >