Search Results

Search found 37183 results on 1488 pages for 'string conversion'.

Page 77/1488 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • Android Development - Conversion to Dalvik format failed with error 1

    - by KP65
    So I'm dipping my toes into this area for the first time - i followed instructions to install the android SDK and eclipse plug in. I created a blank new android project and I get the following build errors: [2011-01-08 16:34:55 - xxx]: Dxno classfiles specified [2011-01-08 16:34:55 - xxx] Conversion to Dalvik format failed with error 1 I've googled the problem and tried to clean and rebuild, or hitting F5 on the project in the explorer but the issue remains. I've verified the build paths and the libraries to make sure only Android 2.3 is there but still get this issue. I have also tried to load a sample project and I get the same error. Any ideas?

    Read the article

  • How should I call the operation that limit a string's length?

    - by egarcia
    This is a language-agnostic question - unless you count English as a language. I've got this list of items which can have very long names. For aesthetic purposes, these names must be made shorter in some cases, adding dots (...) to indicate that the name is longer. So for example, if article.name returns this: lorem ipsum dolor sit amet I'd like to get this other output. lorem ipsum dolor ... I can program this quite easily. My question is: how should I call that shortening operation? I mean the name, not the implementation. Is there a standard English name for it?

    Read the article

  • invalid conversion from 'char' to 'int* in C

    - by majdal
    Hi, I have the following arrays: int A[] = {0,1,1,1,1, 1,0,1,0,0, 0,1,1,1,1}; int B[] = {1,1,1,1,1, 1,0,1,0,1, 0,1,0,1,0}; int C[] = {0,1,1,1,0, 1,0,0,0,1, 1,0,0,0,1}; //etc... for all letters of the alphabet And a function that prints the letters on a 5x3 LED matrix: void printLetter(int letter[]) I have a string of letters: char word[] = "STACKOVERFLOW"; and I want to pass each character of the string to the printLetter function. I tried: int n = sizeof(word); for (int i = 0; i < n-1; i++) { printLetter(word[i]); } But I get the following error: invalid conversion from 'char' to 'int*' What should i be doing? Thanks!!

    Read the article

  • How would you create a string of all UTF-8 characters? [PHP]

    - by Xeoncross
    There are many ways to represent the +1 million UTF-8 characters. Take the latin capital "A" with macron (A). This is unicode code point U+0100, hex number 0xc4 0x80, decimal number 196 128, and binary 11000100 10000000. I would like to create a collection of the first 65,535 UTF-8 characters for use in testing applications. These are all unicode characters up to code point U+FFFF (byte3). Is it possible to do something like a for($x=0) loop and then convert the resulting decimal to another base (like hex) which would allow the creation of the matching unicode character? I can create the value A using something like this: $char = "\xc4\x80"; // or $char = chr(196).chr(128); However, I am not sure how to turn this into an automated process. // fail! $char = "\x". dechex($a). "\x". dexhex($$b);

    Read the article

  • How to change the behavior of string objects in web service calls via Windows Communication Foundati

    - by Geri Langlois
    I have third party api's which require string values to be submitted as empty strings. On an asp.net page I can use this code (abbreviated here) and it works fine: public class Customer { private string addr1 = ""; public string Addr1 { get {return addr1;} set {addr1 = value;} } private string addr2 = ""; public string Addr2 { get {return addr2;} set {addr2 = value;} } private string city = ""; public string City { get {return city;} set {city = value;} } } Customer cust = new Customer(); cust.Addr1 = "1 Main St."; cust.City = "Hartford"; int custno = CustomerController.InsertCustomer(cust); The Addr2 field, which was not initialized is still an empty string when inserted. However, using the same code but called it through a web service based on Windows Communication Foundation the Addr2 field is null. Is there a way (or setting) where all string fields, even if uninitialized, would return an empty string (unless, of course, a value was set).

    Read the article

  • Why is passing a string literal into a char* arguament only sometimes a compiler error?

    - by Brian Postow
    I'm working in a C, and C++ program. We used to be compiling without the make-strings-writable option. But that was getting a bunch of warnings, so I turned it off. Then I got a whole bunch of errors of the form "Cannot convert const char* to char* in argmuent 3 of function foo". So, I went through and made a whole lot of changes to fix those. However, today, the program CRASHED because the literal "" was getting passed into a function that was expecting a char*, and was setting the 0th character to 0. It wasn't doing anything bad, just trying to edit a constant, and crashing. My question is, why wasn't that a compiler error? In case it matters, this was on a mac compiled with gcc-4.0.

    Read the article

  • How to map (large) integer on (small in size( alphanumeric string with PHP? (Cantor?)

    - by Glooh
    Dear all, I can't figure out how to optimally do the following in PHP: In a database, I have messages with a unique ID, like 19041985. Now, I want to refer to these messages in a short-url service but not using generated hashes but by simply 'calculate' the original ID. In other words, for example: http://short.url/sYsn7 should let me calculate the message ID the visitor would like to request. To make it more obvious, I wrote the following in PHP to generate these 'alphanumeric ID versions' and of course, the other way around will let me calculate the original message ID. The question is: Is this the optimal way of doing this? I hardly think so, but can't think of anything else. $alphanumString = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_'; for($i=0;$i < strlen($alphanumString);$i++) { $alphanumArray[$i] = substr($alphanumString,$i,1); } $id = 19041985; $out = ''; for($i=0;$i < strlen($id);$i++) { if(isset($alphanumString["".substr($id,$i,2).""]) && strlen($alphanumString["".substr($id,$i,2).""]) 0) { $out.=$alphanumString["".substr($id,$i,2).""]; } else { $out.=$alphanumString["".substr($id,$i,1).""]; $out.=$alphanumString["".substr($id,($i+1),1).""]; } $i++; } print $out;

    Read the article

  • Using a Time Zone Conversion When Dynamically Generating Results

    - by John
    Hello, If I understand correctly, the code below converts $row["datesubmitted"] from one timezone to another. I would like to print the converted $row["datesubmitted"] dynamically in an HTML table. Is there a way that I can apply the conversion below for each row that is pulled from MySQL? I assume that I can't just plug $row["dt"] into the code since there is no field called "dt" in the MySQL that I am using. Thanks in advance, John $dt = new DateTime($row["datesubmitted"], $tzFrom); $dt->setTimezone($tzTo);

    Read the article

  • How do I apply a string function to an array?

    - by ggg
    I was fortunate enough to receive this code (flips Lastname, Firstname) from an earlier post. $name = "Lastname, Firstname"; $names = explode(", ", $name); $name = $names[1] . " " . $names[0]; How do I apply the function to each value in an array that is in the form: $ginfo ->$(LastName, FirstName). I tried the code below, but it doesn't work. $name1 =($ginfo->White); $name1 = explode(", ", $name1); $FLw = $name1[1] . " " . $name1[0]; foreach ($name1 as ($ginfo->White)) {return($FLw);}

    Read the article

  • Passing dynamic string in hyperlink as parameter in jsp

    - by user3660263
    I am trying to pass a dynamic string builder variable in jsp I am generating a string through code. String Builder variable has some value but i am not able to pass it in at run time.It doesn't get the value. CODE FOR VARIABLE <% StringBuilder sb=new StringBuilder(""); if(request.getAttribute("Brand")!=null) { String Brand[]=(String[])request.getAttribute("Brand"); for(String brand:Brand) { sb.append("Brand="); sb.append(brand); sb.append("&&"); } } if(request.getAttribute("Flavour")!=null) { String Flavour[]=(String[])request.getAttribute("Flavour"); for(String flavour:Flavour) { sb.append(flavour); sb.append("&&"); } sb.trimToSize(); pageContext.setAttribute("sb", sb); } out.print("this is string"+sb); %> CODE FOR HYPERLINK <a href="Filter_Products?${sb}page=${currentPage + 1}" style="color: white;text-decoration: none;">Next</a></td>

    Read the article

  • String split operations in C# .

    - by Indigo Praveen
    Hi All, I have a string say string s ="C:\\Data" , I have an array which contains some strings containg "C:\Data" in the beginning i.e. string[] arr = new {"C:\\Data\abc.xml","C:\\Data\Test\hello.cs"};. I have to remove the string "C:\Data" from each entry and have to combine it with another string say string fixed = "D:\\Data". What is the best way to do it, please help as I am a new programmer in C#.

    Read the article

  • C# string equality operator returns false, but I'm pretty sure it should be true... What?!

    - by Daniel Schaffer
    I'm trying to write a unit test for a piece of code that generates a large amount of text. I've run into an issue where the "expected" and "actual" strings appear to be equal, but Assert.AreEqual throws, and both the equality operator and Equals() return false. The result of GetHashCode() is different for both values as well. However, putting both strings into text files and comparing with DiffMerge tells me they're the same. Additionally, using Encoding.ASCII.GetBytes() on both values and then using SequenceEquals to compare the resulting byte arrays returns true. The values are 34KB each, so I'll hold off putting them here for now. Any ideas? I'm completely stumped.

    Read the article

  • Delete the last instance of a certain string from a text file without changing the other instances o

    - by fraXis
    Hello, I have a C# program where I am using a lot of RegEx.Replace to replace text in my text file. Here is my problem. In my text file, I have a code such as "M6T1". This code is listed in numerous places in the text file. However, I only want to delete it from the bottom (last instance) in the text file. There will always be a "M6T1" at the bottom of the text file, but it is not always the last line. It could be the 3rd line from the bottom, the 5th line from the bottom etc. I only want to get rid of the last instance of "M6T1" so RegEx.Replace won't work here. I don't want to interfer with the other "M6T1"'s in the other locations in the text file. Can someone please give me a solution to this problem? Thanks

    Read the article

  • Why is passing a string literal into a char* argument only sometimes a compiler error?

    - by Brian Postow
    I'm working in a C, and C++ program. We used to be compiling without the make-strings-writable option. But that was getting a bunch of warnings, so I turned it off. Then I got a whole bunch of errors of the form "Cannot convert const char* to char* in argmuent 3 of function foo". So, I went through and made a whole lot of changes to fix those. However, today, the program CRASHED because the literal "" was getting passed into a function that was expecting a char*, and was setting the 0th character to 0. It wasn't doing anything bad, just trying to edit a constant, and crashing. My question is, why wasn't that a compiler error? In case it matters, this was on a mac compiled with gcc-4.0. EDIT: added code: char * host = FindArgDefault("EMailLinkHost", ""); stripCRLF(linkHost, '\n'); where: char *FindArgDefault(char *argName, char *defVal) {// simplified char * val = defVal; return(val); } and void stripCRLF(char *str, char delim) { char *p, *q; for (p = q = str; *p; ++p) { if (*p == 0xd || *p == 0xa) { if (p[1] == (*p ^ 7)) ++p; if (delim == -1) *p = delim; } *q++ = *p; } *q = 0; // DIES HERE } This compiled and ran until it tried to set *q to 0...

    Read the article

  • How to serialize a data of type string without using StringWriter as input

    - by starz26
    I want to serialize a input data of type string, but do not want to use StringWriter and StringReader for for serializing/Deserializing. The reason for this is when a escapse chars are sent as part of the Input string for serializing, it is serialized but some Spl chars are inserted in the xml(eg:"").I'm getting an XMl error while deserializing this serialized data. void M1() { string str = 23 + "AC"+(char)1; StringWriter sw = new StringWriter(); XmlSerializer serializer = new XmlSerializer(typeof(String)); serializer.Serialize(sw, str); System.Console.WriteLine("String encoded to XML = \n{0} \n", sw.ToString()); StringReader sr = new StringReader(sw.ToString()); String s2 = (String)serializer.Deserialize(sr); System.Console.WriteLine("String decoded from XML = \n {0}", s2); }

    Read the article

  • Bit conversion operations in PHP

    - by Goro
    Hello, I find myself in need of performing bit-level conversion on variables in PHP. In more detail, I have a bit stream that is read as an integer by hardware, and I need to do some operations on the bits to make it into what its actually supposed to be (a float). I have to do this a few times for different formats, and the functionality I need is Being able to select and move individual bits in a variable Being able to cast statically one type of variable to the other (ie. int to float) I know php natively supports bitwise AND, OR, etc, and shift operations, but I was wondering if: there may already be a library in php that does this sort of thing I would be better off with delegating the calculations to some other language Thanks,

    Read the article

  • How do I effectively store a connection string in machine.config only?

    - by Scott Bedwell
    We are moving to an environment with multiple engines of MS SQL running on the same server (a test engine and a production engine). We also have separate test and production web servers, and would like for our asp.net applications to "magically" use the test database engine on the test web server and the production database engine on the production web servers. We would like to store the connection strings in machine.config rather than in web.config, but when we put it in machine.config, visual studio's IDE (particularly with datasets) does not recognize that the machine.config contains the connection. Does anyone know of a solution for displaying these machine.config connection strings in visual studio, or of a different solution that would accommodate for this? Thanks.

    Read the article

  • C++ String pointers

    - by gnm
    In my previous app I had an object like this: class myType { public: int a; string b; } It had a lot of instances scattered everywhere and passed around to nearly every function. The app was slow. Profiling said that 95% of time is eaten by the string allocator function. I know how to work with the object above, but not how to work with string pointers. class myType { public: int a; string* b; } They told me to use pointers as above. How much faster is it with a string pointer? What is copied when I copy the object? How to the following using the class with the pointer: Access the string value Modify the string value without modifying the one in the object (copy?) General things that change if I use string pointers?

    Read the article

  • Books on string algorithms

    - by Max
    There have been numerous posts on string algorithms: http://stackoverflow.com/questions/246961/algorithm-to-find-similar-text, http://stackoverflow.com/questions/451884/similar-string-algorithm, http://stackoverflow.com/questions/613133/efficient-string-matching-algorithm However, no general literature was mentioned. Could anyone recommend a book(s) that would thoroughly explore various string algorithms? The topic which is of special interest is approximate string matching [things like google-offered corrected search string variants :) ]. Thanks a lot for advice.

    Read the article

  • C# - High Quality Byte Array Conversion of Images

    - by Lijo
    Hi Team, I am converting images to byte array and storing in a text file using the following code. I am retrieving them successfully as well. My concern is that the quality of the retrieved image is not up to the expectation. Is there a way to have better conversion to byte array and retrieving? I am not worried about the space conception. Please share your thoughts. string plaintextStoringLocation = @"D:\ImageSource\Cha5.txt"; string bmpSourceLocation = @"D:\ImageSource\Cha50.bmp"; ////Read image Image sourceImg = Image.FromFile(bmpSourceLocation); ////Convert to Byte[] byte[] clearByteArray = ImageToByteArray(sourceImg); ////Store it for future use (in plain text form) StoreToLocation(clearByteArray, plaintextStoringLocation); //Read from binary byte[] retirevedImageBytes = ReadByteArrayFromFile(plaintextStoringLocation); //Retrieve from Byte[] Image destinationImg = ByteArrayToImage(retirevedImageBytes); //Display Image pictureBox1.Image = destinationImg; Thanks Lijo

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >