Search Results

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

Page 41/1447 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Charater string buffer too small

    - by Ruslan
    I have select: select v.accs, v.currency,v.amount,v.drcr_ind, count(*) qua,wm_concat(ids) npx_IDS, wm_concat(px_dtct) npx_DTCT from table v group by accs, currency, amount, drcr_ind but i get error ORA-06502: PL/SQL: : character string buffer too small if i'll remove one string, because sometimes (when v.accs= 3570) count(*) = 215 but when i try to skip using wm_concat for v.accs= 3570 for example this way: select v.accs, v.currency,v.amount,v.drcr_ind, count(*) qua,wm_concat(ids) npx_IDS, (case when v.accs = 3570 then wm_concat(px_dtct) else 'too many' end) npx_DTCT from table v group by accs, currency, amount, drcr_ind i still have the same error message. But why? How can i fix it? Thanx

    Read the article

  • catDog string problem at Codingbat.com [closed]

    - by stanny110
    public boolean catDog(String str) { int catAnswer = 0; int dogAnswer = 0; int cat_Count = 0; int dog_Count = 0; for (int i=0; i< str.length()-1; i++) { String sub = str.substring(i, i+2); if ((sub.equals("cat"))) cat_Count++; if ((sub.equals("dog"))) dog_Count++; catAnswer = cat_Count; dogAnswer = dog_Count; } //end for if(dogAnswer == catAnswer ) {return true;} // else return (dogAnswer != catAnswer) ;

    Read the article

  • Django model: Reference foreign key table in __unicode__ function for admin

    - by pa
    Example models: class Parent(models.Model): name = models.CharField() def __unicode__(self): return self.name class Child(models.Model): parent = models.ForeignKey(Parent) def __unicode__(self): return self.parent.name # Would reference name above I'm wanting the Child.unicode to refer to Parent.name, mostly for the admin section so I don't end up with "Child object" or similar, I'd prefer to display it more like "Child of ". Is this possible? Most of what I've tried hasn't worked unfortunately.

    Read the article

  • Get Specific part of a String in Javascript

    - by streetparade
    I have a string containing something like this "Hello bla bla bla bla ok, once more bla können. // this is static: it doesn't change This is a text, this also a text. // this is dynamically added text it can change each time My name mysurename // this is also static text www.blabla.com " Now I have content and I have to get the first part of the string and the third part, I want to be able to have 3 parts, I think I have to split it using something like split(); string1 = "Hello bla bla bla bla ok, once more bla können.; string2 = ""; // i have this part string3 ="My name mysurename"; If it helps the first part ends with "können. " and the third part ends with the url above // its a fictional URL

    Read the article

  • How to parse a string of boolean logic in PHP

    - by TheOddLinguist
    I'm building a PHP class with a private member function that returns a string value such as: 'true && true || false' to a public member function. (This string is the result of some regex matching and property lookups.) What I'd like to do is have PHP parse the returned logic and have the aforementioned public function return whether the boolean result of the parsed logic is true or false. I tried eval(), but I get no output at all. I tried typecasting the boolean returns...but there's no way to typecast operators...hehe Any ideas? (Let me know if you need more information.)

    Read the article

  • Convert XMLDocument to String

    - by mnh
    Here is how I'm currently converting XMLDocument to String StringWriter stringWriter = new StringWriter(); XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter); xmlDoc.WriteTo(xmlTextWriter); return stringWriter.ToString(); The problem with this method is that if I have " ((quotes) which I have in attributes) it escapes them. For Instance: <Campaign name="ABC"> </Campaign> Above is the expected XML. But it returns <Campaign name=\"ABC\"> </Campaign> I can do String.Replace "\" but is that method okay? Are there any side-effects? Will it work fine if the XML itself contains a "\"

    Read the article

  • very large string in memory

    - by bushman
    Hi, I am writing a program for formatting 100s of MB String data (nearing a gig) into xml == And I am required to return it as a response to an HTTP (GET) request . I am using a StringWriter/XmlWriter to build an XML of the records in a loop and returning the stringWriter.ToString() during testing I saw a few --out of memory exceptions-- and quite clueless on how to find a solution? do you guys have any suggestions for a memory optimized delivery of the response? is there a memory efficient way of encoding the data? or maybe chunking the data -- I just can not think of how to return it without building the whole thing into one HUGE string object thanks

    Read the article

  • Seg Fault when using std::string on an embedded Linux platform

    - by Brad
    Hi, I have been working for a couple of days on a problem with my application running on an embedded Arm Linux platform. Unfortunately the platform precludes me from using any of the usual useful tools for finding the exact issue. When the same code is run on the PC running Linux, I get no such error. In the sample below, I can reliably reproduce the problem by uncommenting the string, list or vector lines. Leaving them commented results in the application running to completion. I expect that something is corrupting the heap, but I cannot see what? The program will run for a few seconds before giving a segmentation fault. The code is compiled using a arm-linux cross compiler: arm-linux-g++ -Wall -otest fault.cpp -ldl -lpthread arm-linux-strip test Any ideas greatly appreciated. #include <stdio.h> #include <vector> #include <list> #include <string> using namespace std; ///////////////////////////////////////////////////////////////////////////// class TestSeg { static pthread_mutex_t _logLock; public: TestSeg() { } ~TestSeg() { } static void* TestThread( void *arg ) { int i = 0; while ( i++ < 10000 ) { printf( "%d\n", i ); WriteBad( "Function" ); } pthread_exit( NULL ); } static void WriteBad( const char* sFunction ) { pthread_mutex_lock( &_logLock ); printf( "%s\n", sFunction ); //string sKiller; // <----------------------------------Bad //list<char> killer; // <----------------------------------Bad //vector<char> killer; // <----------------------------------Bad pthread_mutex_unlock( &_logLock ); return; } void RunTest() { int threads = 100; pthread_t _rx_thread[threads]; for ( int i = 0 ; i < threads ; i++ ) { pthread_create( &_rx_thread[i], NULL, TestThread, NULL ); } for ( int i = 0 ; i < threads ; i++ ) { pthread_join( _rx_thread[i], NULL ); } } }; pthread_mutex_t TestSeg::_logLock = PTHREAD_MUTEX_INITIALIZER; int main( int argc, char *argv[] ) { TestSeg seg; seg.RunTest(); pthread_exit( NULL ); }

    Read the article

  • string parsing to double fails in C++

    - by helixed
    Here's a fun one I've been trying to figure out. I have the following program: #include <iostream> #include <string> #include <sstream> using namespace std; int main(int argc, char *argv[]) { string s("5"); istringstream stream(s); double theValue; stream >> theValue; cout << theValue << endl; cout << stream.fail(); } The output is: 0 1 I don't understand why this is failing. Could somebody please tell me what I'm doing wrong? Thanks, helixed

    Read the article

  • Efficiently check string for one of several hundred possible suffixes

    - by Ghostrider
    I need to write a C/C++ function that would quickly check if string ends with one of ~1000 predefined suffixes. Specifically the string is a hostname and I need to check if it belongs to one of several hundred predefined second-level domains. This function will be called a lot so it needs to be written as efficiently as possible. Bitwise hacks etc anything goes as long as it turns out fast. Set of suffixes is predetermined at compile-time and doesn't change. I am thinking of either implementing a variation of Rabin-Karp or write a tool that would generate a function with nested ifs and switches that would be custom tailored to specific set of suffixes. Since the application in question is 64-bit to speed up comparisons I could store suffixes of up to 8 bytes in length as const sorted array and do binary search within it. Are there any other reasonable options?

    Read the article

  • Crystal Reports Formula Workshop boolean condition to string

    - by Jay
    Hello, I'm currently trying to create a report using Crystal Reports that comes with Visual Studio 2008. I would like to include a field of type boolean on my report that shows a string rather than true or false. The string should contain either contain a € or a % sign. How would I go about doing this in the Formula Workshop? I've tried things like e.g. if {tblAankoopDetails.SoortKorting} = true then "€" else "%" However this never seems to work and results in warnings such as "The formula result must be a number". This should be fairly simple but this is my first go at using Crystal Reports. Help would be much appreciated. Jay

    Read the article

  • PHP: How to check if query string or POST vars contain same var twice

    - by thomasrutter
    It may sound strange, but in my PHP application I need to check if the same variable name has been declared more than once in the query string or POST variables, and return an error value if this is the case. If my application doesn't return an error in this case, it fails a compliance check. When accessing vars using $_GET, $_POST, etc, PHP only returns the last value given for each variable name. I can't find a way to tell if any variable appeared more than once. I simply need to find out if the query string or the variables in the POST body contained the same variable name more than once, whatever the values.

    Read the article

  • Not-quite-JSON string deserialization in Python

    - by cpharmston
    I get the following text as a string from an XML-based REST API 'd':4 'ca':5 'sen':1 'diann':2,6,8 'feinstein':3,7,9 that I'm looking to deserialize into a pretty little Python dictionary: { 'd': [4], 'ca': [5], 'sen': [1], 'diann': [2, 6, 8], 'feinstein': [3, 7, 9] } I'm hoping to avoid using regular expressions or heavy string manipulation, as this format isn't documented and may change. The best I've been able to come up with: members = {} for m in elem.text.split(' '): m = m.split(':') members[m[0].replace("'", '')] = map(int, m[1].split(',')) return members Obviously a terrible approach, but it works, and that's better than anything else I've got right now. Any suggestions on better approaches?

    Read the article

  • String labels on boxplot outliers

    - by Benoît Collette
    Hi! I want to put string labels on outliers in a boxplot. Here's a simplification of the dataset I'm using: [,x] [,y] [,z] 7 2 a 10 2 b 112 3 c boxdata<-boxplot(x ~ y) To put values as label on outliers by group, I use this function: for(i in 1:length(boxdata$group)){ text(boxdata$group[i], boxdata$out[i], which(x==boxdata$out[i]),labels=boxdata$out[i],pos=4) } The problem is that I want to put z (string) as label instead of outlier value, but I don't know how to proceed. What do I need to do? Thank you! Ben

    Read the article

  • varchar comparison in SQL Server

    - by Ram
    I am looking for some SQL varchar comparison function like C# string.compare (we can ignore case for now, should return zero when the character expression are same and a non zero expression when they are different) Basically I have some alphanumeric column in one table which needs to be verified in another table. I cannot do select A.col1 - B.col1 from (query) as "-" operator cannot be applied on character expressions I cannot cast my expression as int (and then do a difference/subtraction) as it fails select cast ('ASXT000R' as int) Conversion failed when converting varchar 'ASXT000R' to int Soundex would not do it as soundex is same for 2 similar strings Difference would not do it as select difference('abc','ABC') = 4 (as per msdn, difference is the difference in the soundex of 2 character expressions and difference =4 implies least different) Is there any other way of doing it ?

    Read the article

  • parse XML file that contains unicode characters in iphone

    - by Jim
    Hi, I am trying to parse one XML file that contains some unicode characters.I tried to parse the file using NSXMLParser but i am unable to parse XML.Parser stops when it encounters any unicode characters. Is there any other good solution to parse XML file with unicode letters? Please suggest. Thanks, Jim.

    Read the article

  • parsing string off a configuration using strtok in C

    - by Jessica
    in the configuration file i have entries similar to this one: filepath = c:\Program Files\some value Where the path can contain spaces and there are no quotes on that string. I tried parsing this with strtok like: char *option; char *value; value = strtok(line, " ="); strcpy(option, value); value = strtok(NULL, " ="); where line is the line I am reading from the file, option will contain the left side of the equal (filepath) and value will contain the right side (c:\program files\some value). I know, it's poor coding, but I haven't found something better. sorry... In any case, for those options where there's no space in the right side it works great, but in those containing spaces it only return the string until the 1st space: c:\Program. Is there any other way to do this? Code is appreciated. Jessica

    Read the article

  • Copying part of a string in C

    - by wolfPack88
    This seems like it should be really simple, but for some reason, I'm not getting it to work. I have a string called seq, which looks like this: ala ile val I want to take the first 3 characters and copy them into a different string. I use the command: memcpy(fileName, seq, 3 * sizeof(char)); That should make fileName = "ala", right? But for some reason, I get fileName = "ala9". I'm currently working around it by just saying fileName[4] = '\0', but was wondering why I'm getting that 9. Note: After changing seq to ala ile val ser and rerunning the same code, fileName becomes "alaK". Not 9 anymore, but still an erroneous character.

    Read the article

  • C#, string replace russian to english

    - by Fabio Beoni
    Hello, I have a strange problem replacing chars in string... I read a .txt file containing russian text, and starting from a list of letters russian to english (ru=en), I loop the list and I WOULD like to replace russian characters with english characters. The problem is: I can see in the debug the right reading of the russian and the right reading of the english, but using myWord = myWord.Replace(ruChar, enChar), the string is not replaced. My txt file is a UTF-8 encoding. Any suggestions?? Thank you to all...

    Read the article

  • jQuery AJAX converting variable string to html styled text

    - by sadmicrowave
    I've got an AJAX transmission of a variable string in my primary coding language (Visual FoxPro 9) that looks like this: AjaxResponse = CREATEOBJECT("Custom") lcMessage = "<li class='hello'>Hello</li>" AjaxResponse.AddProperty("Reply", lcMessage) Response.ContentType = "text/html" Response.Write(AjaxResponse.Reply) While using the jQuery function .ajax() I've created a success: function that looks like this: $.ajax({ url: 'index?Proc=GetUuserHistory', dataType: "html", success: function(data){ $("div#history-text").text(data); }; }); My problem is that the text inserting into 'div#history-text' is unformatted and contains the li tags still. I've tried substituting the .text for .prepend, .append, and .html with no luck...is there a way to convert this string back to html format after its been received using Ajax?

    Read the article

  • Accessing object property as string and setting its value

    - by ludicco
    Hello there, I have an object in csharp from the class Account each account have a owner, reference, etc. One way I can access an accounts properties is through accessors like account.Reference; but I would like to be able to access it using dynamic string selectors like: account["PropertyName"]; just like in javascript. so I would have account["Reference"] which would return the value...but I also would like to be able to sign a new value after that like: account["Reference"] = "124ds4EE2s"; I've noticed I can use DataBinder.Eval(account,"Reference") to get a property based on a string, but using this I can't sign a value to the property. Any idea on how I could do that? Thanks a lot

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >