Search Results

Search found 22631 results on 906 pages for 'null character'.

Page 22/906 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Explaining NULL and Empty to your 6-year old?

    - by Atomiton
    I'm thinking in terms of Objects here. I think it's important to simplify ideas. If you can explain this to a 6-year old, you can teach new programmers the difference. I'm thinking that a cookie object would be apropos: public class Cookie { public string flavor {get; set; } public int numberOfCrumbs { get; set; } }

    Read the article

  • Is there a list of language only character regions for UTF-8 somewhere?

    - by Brehtt
    I'm trying to analyze some UTF-8 encoded documents in a way that recognizes different language characters. For my approach to work I need to ignore non-language characters, such as control characters, mathematical symbols etc. Just trying to dissect the basic Latin section of the UTF standard has resulted in multiple regions, with characters like the division symbol being right in the middle of a range of valid Latin characters. Is there a list somewhere that identifies these regions? Or better yet, a Regex that defines the regions or something in C# that can identify the different characters?

    Read the article

  • How to correct character encoding in IE8 native json ?

    - by mike_t2e
    I am using json with unicode text, and having a problem with the IE8 native json implementation. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script> var stringified = JSON.stringify("?????? olé"); alert(stringified); </script> Using json2.js or FireFox native json, the alert() string is the same as in the original one. IE8 on the other hand returns Unicode values rather than the original text \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 ol\u00e9 . Is there an easy way to make IE behave like the others, or convert this string to how it should be ? And would you regard this as a bug in IE, I thought native json implementations were supposed to be drop-in identical replacements for json2.js ?

    Read the article

  • Filtering null values with pig

    - by arianp
    It looks like a silly problem, but I can´t find a way to filter null values from my rows. This is the result when I dump the object geoinfo: DUMP geoinfo; ([longitude#70.95853,latitude#30.9773]) ([longitude#-9.37944507,latitude#38.91780853]) (null) (null) (null) ([longitude#-92.64416,latitude#16.73326]) (null) (null) ([longitude#-9.15199849,latitude#38.71179122]) ([longitude#-9.15210796,latitude#38.71195131]) here is the description DESCRIBE geoinfo; geoinfo: {geoLocation: bytearray} What I'm trying to do is to filter null values like this: geoinfo_no_nulls = FILTER geoinfo BY geoLocation is not null; but the result remains the same. nothing is filtered. I also tried something like this geoinfo_no_nulls = FILTER geoinfo BY geoLocation != 'null'; and I got an error org.apache.pig.backend.executionengine.ExecException: ERROR 1071: Cannot convert a map to a String What am I doing wrong? details, running on ubuntu, hadoop-1.0.3 with pig 0.9.3 pig -version Apache Pig version 0.9.3-SNAPSHOT (rexported) compiled Oct 24 2012, 19:04:03 java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.12.04.1) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

    Read the article

  • Japanese character stored in SQL Server DB using ASP page that assumed it as ISO-8859-1 encoding

    - by Vishal Seth
    We have a legacy ASP based product that allowed the UI and Data languages of user groups to be configured according to their locations. CodePage and CharSet in ASP pages collecting data was set accordingly. I've noticed few instances in the SQL Server DB where users posted Japanese characters in the ASP page that assumes the oncoming stream to be of ISO-8859-1/Western and as a result, the data in the SQL table has gobbled up. While upgrading the client to our new product, I want to back-convert those "garbage" Japanese (in some instances Chinese) characters back to their actual form. Can I create some utility ASP page that would go through such data values and "fix" the wrongly-encoded strings and store everything back as utf-8 strings? In any case, I don't want to affect my French/Spanish/English characters that might be there as well.

    Read the article

  • C# Automatic Properties - Still null after +=?

    - by Sam Schutte
    This seems like a bug to me... I accept that automatic properties, defined as such: public decimal? Total { get; set; } Will be null when they are first accessed. They haven't been initialized, so of course they are null. But, even after setting their value through +=, this decimal? still remains null. So after: Total += 8; Total is still null. How can this be correct? I understand that it's doing a (null + 8), but seems strange that it doesn't pick up that it means it should just be set to 8... Addendums: I made the "null + 8" point in my question - but notice that it works with strings. So, it does null + "hello" just fine, and returns "hello". Therefore, behind the scenes, it is initializing the string to a string object with the value of "hello". The behavior should be the same for the other types, IMO. It might be because a string can accept a null as a value, but still, a null string is not an initialized object, correct? Perhaps it's just because a string isn't a nullable...

    Read the article

  • return first non repeating character in a string

    - by Amm Sokun
    I had to solve this question in which given a string, i had to return the first non repeating character present in the string. I solved it using hashtable and wrote a method which takes a constant reference to the string and returns the first non repeating character. However, when there is no non repeating character present in the string, i return -1 and in the main program i check as follows char c = firstNonRepeating( word ); if (static_cast<int> (c) == -1) cout<<"no non repeating character present\n"; else cout<<c<<endl; is that the correct way to return -1 when required character is not present?

    Read the article

  • (NOT) NULL for NVARCHAR columns

    - by Anders Abel
    Allowing NULL values on a column is normally done to allow the absense of a value to be represented. When using NVARCHAR there is aldready a possibility to have an empty string, without setting the column to NULL. In most cases I cannot see a semantical difference between an NVARCHAR with an empty string and a NULL value for such a column. Setting the column as NOT NULL saves me from having to deal with the possibility of NULL values in the code and it feels better to not have to different representations of "no value" (NULL or an empty string). Will I run into any other problems by setting my NVARCHAR columns to NOT NULL. Performance? Storage size? Anything I've overlooked on the usage of the values in the client code?

    Read the article

  • SQL Server JOIN with optional NULL values

    - by Paul McLoughlin
    Imagine that we have two tables as follows: Trades ( TradeRef INT NOT NULL, TradeStatus INT NOT NULL, Broker INT NOT NULL, Country VARCHAR(3) NOT NULL ) CTMBroker ( Broker INT NOT NULL, Country VARCHAR(3) NULL ) (These have been simplified for the purpose of this example). Now, if we wish to join these two tables on the Broker column, and if a country exists in the CTMBroker table on the Country, we have the following two choices: SELECT T.TradeRef,T.TradeStatus FROM Trades AS T JOIN CTMBroker AS B ON B.Broker=T.Broker AND ISNULL(B.Country, T.Country) = T.Country or SELECT T.TradeRef,T.TradeStatus FROM Trades AS T JOIN CTMBroker AS B ON B.Broker=T.Broker AND (B.COUNTRY=T.Country OR B.Country IS NULL) These are both logically equivalent, however in this specific circumstance for our database (SQL Server 2008, SP1) two different execution plans are produced for these two queries with the second version significantly outperforming the first version in terms of both time and logical reads. My question really is as follows: as a general rule would (2) be preferred to (1), or does this just happen to be exploiting some particular idiosyncracy of the optimiser in 2008 SP1 (that could therefore change with future versions of SQL Server).

    Read the article

  • Table character encoding - exception in application

    - by zgnilec
    I have a code: CREATE TABLE IF NOT EXISTS Person ( name varchar(24) ... ) CHARACTER SET utf8 COLLATE utf8_polish_ci; This works OK in my application, but I read if someone put in name field a string that contains character wchich code is greater than 127, database will use 2 bytes (or more) to store this character. So i think, i will change character set to utf16: CHARACTER SET utf16 COLLATE utf16_polish_ci; But now when I run my application, exception apears: KeyNotFoundException. It apears exactly at these instructions: MySqlCommand komenda = baza.Polaczenie.CreateCommand (); komenda.CommandText = zapytanie; MySqlDataReader dr = komenda.ExecuteReader (); // HERE, at execute reader method if (dr.Read ()) ... 1) Anyone had similar problem? 2) Any idea how to use always 2 bytes/char in database field?

    Read the article

  • How do I read UTF-8 characters via a pointer?

    - by Jen
    Suppose I have UTF-8 content stored in memory, how do I read the characters using a pointer? I presume I need to watch for the 8th bit indicating a multi-byte character, but how exactly do I turn the sequence into a valid Unicode character? Also, is wchar_t the proper type to store a single Unicode character? This is what I have in mind: wchar_t readNextChar (char** p) { char ch = *p++; if (ch & 128) { // This is a multi-byte character, what do I do now? // char chNext = *p++; // ... but how do I assemble the Unicode character? ... } ... }

    Read the article

  • Count The Amount Of Data In An Array Including SOME Null

    - by Josephine
    I'm coding in java and I need to create a function that returns the number of Data objects that are currently in an ArrayList. At the moment I have this: int count = 0; for (int i = 0; i < data.length; i++) { if (data[i] != null) { count ++; } } return count; But the problem is that an array list that includes null data is acceptable, and I have to count their null data towards this counter. How do I include the null data that's in the middle of this array, and not the null data that's not supposed to be counted for? For example, I have some tester code that adds (8),null,null,(23),(25) to the array, and this function should return 5 when the initial array size is 10. Thank you so much

    Read the article

  • finding character in string C language

    - by iSight
    Hi, I am searching a character at first occurence in string using the following code. But, it is taking some time when the character is too long or the character that i am searching is at far extend, which makes delay in other operations. How could i tackle with this problem. The code is below here. Note: attrPtr is a char* which holds a reference to a string containing '"' character at far extend. int position = 0; char qolon = '"';//character to search while (*(attrPtr + position++) != qolon); char* attrValue = NULL; attrValue = (char*)malloc(position * sizeof(char)); strncpy(attrValue, attrPtr, position-1);

    Read the article

  • Corona SDK - Make a character pass through a platform

    - by Andy Res
    I'm building a game that has a character which should jump up on multiple platforms. The jumping functionality is done, but I would like if the character is just below a platform (static body), when I press the "jump" button, the character should pass through that platform and then sit on it. Right now it collides with the platform, and character cannot jump on it. Do you have any idea how this can be achieved? Right now the platforms are represented by rectangles with "static" body type: local platform = display.newRect( 50, 280, 150, 10 ) platform:setFillColor ( 55, 55, 55) physics.addBody ( platform, "static", {density=1.0, friction=1.0, bounce=0 }) And I was thinking if I could change, or remove the body type of platform when the character collids with it, so he can pass trough platform, but I don't know how to do this, or in general if this will work... maybe there are some built in techniques on how to achieve the effect I want?

    Read the article

  • MySql, InnoDB & Null Values

    - by pws5068
    Formerly I was using MyISAM storage engine for MySql and I had defined the combination of three fields to be unique. Now I have switched to InnoDB, which I assume caused this problem, and now NULL != NULL. So for the following table: ID (Auto) | Field_A | Field_B | Field_C I can insert (Field_A,Field_B,Field_C) Values(1,2,NULL) (1,2,NULL) (1,2,NULL) infinitely many times. How can I prevent this behavior?

    Read the article

  • sql error, NULL??

    - by Luke
    So I have a query, can someone let me know if it looks ok content wise? "INSERT INTO ".TBL_MESSAGES." (NULL, 'Your ranking points have changed', 'Due to your recent activity, your ranking points have increased by $r', '2', '$u', '0', '0', '0', '0', NULL, NULL, NULL, NULL, now())"; I can add further information if the query doesnt appear to have a problem? Thanks

    Read the article

  • xstream handles non-english character

    - by Yan Cheng CHEOK
    I have the following code : /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package helloworld; import com.thoughtworks.xstream.XStream; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import javax.swing.JOptionPane; /** * * @author yccheok */ public class Test { @SuppressWarnings("unchecked") public static <A> A fromXML(Class c, File file) { XStream xStream = new XStream(); InputStream inputStream = null; try { inputStream = new java.io.FileInputStream(file); Object object = xStream.fromXML(inputStream); if (c.isInstance(object)) { return (A)object; } } catch (Exception exp) { exp.printStackTrace(); } finally { if (inputStream != null) { try { inputStream.close(); inputStream = null; } catch (java.io.IOException exp) { exp.printStackTrace(); return null; } } } return null; } @SuppressWarnings("unchecked") public static <A> A fromXML(Class c, String filePath) { return (A)fromXML(c, new File(filePath)); } public static boolean toXML(Object object, File file) { XStream xStream = new XStream(); OutputStream outputStream = null; try { outputStream = new FileOutputStream(file); xStream.toXML(object, outputStream); } catch (Exception exp) { exp.printStackTrace(); return false; } finally { if (outputStream != null) { try { outputStream.close(); outputStream = null; } catch (java.io.IOException exp) { exp.printStackTrace(); return false; } } } return true; } public static boolean toXML(Object object, String filePath) { return toXML(object, new File(filePath)); } public static void main(String args[]) { String s = "\u6210\u4EA4\u91CF"; // print ??? System.out.println(s); // fine! show ??? JOptionPane.showMessageDialog(null, s); toXML(s, "C:\\A.XML"); String o = fromXML(String.class, "C:\\A.XML"); // show ??? JOptionPane.showMessageDialog(null, o); } } I run the following code through command prompt in Windows Vista. 1) May I know why System.out.println unable to print out Chinese Character in console? 2) I open up the xstream file. The saved value is <string>???</string> How can I make xstream save Chinese Character correctly? Thanks.

    Read the article

  • SSIS Null Value Questions

    - by Saobi
    I have a table with 5 string columns, all can be NULLs. After I read the data from this table, I want to convert any null values into empty strings. The reason is that I need to compare these columns with columns in another table of the same schema (using conditional split), and null values would cause the comparison to evaluate to NULL. Is there any functionality in SSIS that allows me to convert NULL's to empty strings, or just not having to deal with NULL's at all?

    Read the article

  • Replace always replacing null values

    - by Mike
    Why does left(FIELD, replace(nullif(charindex('-', FIELD), 0), null, len(FIELD))) always return null? The idea behind the query is that if charindex() returns 0, then convert the results into null, then convert the null into the length of the field. So if '-' does not exist, show the whole string. For some reason it makes every row equal null. Thank you.

    Read the article

  • Foreign keys and NULL in mySQL

    - by Industrial
    Hi everyone, Can I have a column in my values table (value) referenced as a foreign key to knownValues table, and let it be NULL whenever needed, like in the example: Table: values product type value freevalue 0 1 NULL 100 1 2 NULL 25 3 3 1 NULL Table: types id name prefix 0 length cm 1 weight kg 2 fruit NULL Table: knownValues id Type name 0 2 banana Note: The types in the table values & knownValues are of course referenced into the types table. Thanks!

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >