Search Results

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

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

  • Is null a class in java?

    - by Somerandomeguy
    According to, http://www.freshvanilla.org:8080/display/www/Java+Interview+Questions Under, Which class is the superclass of every class? null seems to be the answer. I found that new Object().getClass().getSuperClass() verifies the answer as correct. But can null be considered a class? I see all primitive data types are represented as Class objects from java[dot]sun.com/j2se/1.4.2/docs/api/java/lang/Class.html

    Read the article

  • Android ListView: getTag() returns null

    - by TianDong
    Hallo all, I have a ListView which contains a Button in each line. The following code is part of the getView() Method public View getView(final int position, View convertView, ViewGroup parent) { View row = convertView; TextView tv; Button saveA_button; EditText edittext; FITB_ViewWrapper wrapper; if (row == null) { LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (ChooseMode_Act.modeInfo.equalsIgnoreCase("Training")) { row = li.inflate(R.layout.exercise_for_training_fitb,parent, false); }else { row = li.inflate(R.layout.exercise_for_exam_fitb,parent, false); } wrapper=new FITB_ViewWrapper(row); row.setTag(wrapper); if (ChooseMode_Act.modeInfo.equalsIgnoreCase("Exam")) { saveA_button=wrapper.getSaveAnswer_Button(); OnClickListener l=new OnClickListener() { @Override public void onClick(View v) { Integer mp=(Integer)v.getTag(); Log.i("mp","my Position is: "+mp); } }; saveA_button.setOnClickListener(l); } }else { wrapper=(FITB_ViewWrapper) row.getTag(); } For my App i need to known to which item the Button belongs to, so i try to detect it. The code Log.i("mp","my Position is: "+mp); puts out a message: mp myPosition is: null I can't understand, why do i get a "null" but not an Integer? How can i find out the Position of an Item in a ListView? Thanks a lot.

    Read the article

  • Erlang ODBC parameter query with null parameters

    - by Schlomer
    Is it possible to pass null values to parameter queries? For example Sql = "insert into TableX values (?,?)". Params = [{sql_integer, [Val1]}, {sql_float, [Val2]}]. % Val2 may be a float, or it may be the atom, undefined odbc:param_query(OdbcRef, Sql, Params). Now, of course odbc:param_query/3 is going to complain if Val2 is undefined when trying to match to a sql_float, but my question is... Is it possible to use a parameterized query, such as: Sql = "insert into TableY values (?,?,?,?,?,?,?,?,?)". with any null parameters? I have a use case where I am dumping a large number of real-time data into a database by either inserting or updating. Some of the tables I am updating have a dozen or so nullable fields, and I do not have a guarantee that all of the data will be there. Concatenating a SQL together for each query, checking for null values seems complex, and the wrong way to do it. Having a parameterized query for each permutation is simply not an option. Any thoughts or ideas would be fantastic! Thank you!

    Read the article

  • wave.getState() returns null

    - by RMorrisey
    When trying to call wave.getState() in my Google Wave gadget, I get back null (no state object). How can I initialize the Wave state object? I am working in the Wave Sandbox. My ModulePrefs contains the following: <Require feature="wave" /> <Require feature="rpc"/> I got the "rpc" feature from some google groups post when searching for a fix, but it doesn't seem to be any help. The gadget contains a jQuery plugin, which defines the classes I use (not shown), attaches an event handler to the link that shows up in edit mode, and sets up the callback methods with the google wave gadget initializer: $.fn.extend({ $.gork.InitPass.newButtonClick = function newButtonClick() { var jer = new $.gork.InitPass.Player('Jeremias', 12, 2); var delta = {}; delta[jer.name] = jer.serialize(); wave.getState().submitDelta(delta); }; $.gork.InitPass.modeCallback = function modeCallback() { var state = wave.getState(); var mode = wave.getMode(); $.gork.InitPass.getContainer().ipCombatState(state, (mode == wave.Mode.EDIT)); }; $.gork.InitPass.stateCallback = function stateCallback() { $.gork.InitPass.getContainer().ipCombatState( wave.getState(), (wave.getMode() == wave.Mode.EDIT)); alert('state'); }; $.gork.InitPass.init = function init() { if (wave && wave.isInWaveContainer()) { var mode = wave.getMode(); $('.gork-ip-container').ipCombatState(null, (mode == wave.Mode.EDIT)); wave.setModeCallback($.gork.InitPass.modeCallback); wave.setStateCallback($.gork.InitPass.stateCallback); } }; })(jQuery); gadgets.util.registerOnLoadHandler($.gork.InitPass.init); $(function ready() { $.gork.InitPass.getContainer().find('.gork-ip-edit .addSection a.newButton').click( $.gork.InitPass.newButtonClick); }); So there are two main pieces of functionality here: When the mode changes, ipCombatState(...) is called. This changes the visual appearance of the gadget when the user puts the gadget in Edit mode (CTRL+E), by hiding the view DIV and displaying the edit DIV. The newButtonClick callback (which is attached to the link "a.newButton" in the edit container) is supposed to add Jeremias (Nate's Shadowrun character) to the gadget state, so that he'll be appear as a table row in edit mode. I have verified that the initializer method is called, and the view/edit mode switch works just fine (except the state is null). When I click on the new button link (the link at the bottom in edit mode), and trigger the newButtonClick handler, I get an error because wave.getState() also returns null. How can I initialize the wave state so that I can work with it? The purpose of my gadget will be to keep track of combat initiative order in a Shadowrun tabletop game (4th Ed). You can test it out in Wave and see what I have so far: http://gorkwobble.herobo.com/wave/init-pass.xml The actual javascript code is externalized to: http://gorkwobble.herobo.com/wave/init-pass.js P.S. If any Shadowrun players read this, and want to hear about it when I get the gadget working, leave a comment and I'll wave you.

    Read the article

  • Character encoding issues when generating MD5 hash cross-platform

    - by rogueprocess
    This is a general question about character encoding when using MD5 libraries in various languages. My concern is: suppose I generate an MD5 hash using a native Python string object, like this: message = "hello world" m = md5() m.update(message) Then I take a hex version of that MD5 hash using: m.hexdigest() and send the message & MD5 hash via a network, let's say, a JMS message or a HTTP request. Now I get this message in a Java program in the form of a native Java string, along with the checksum. Then I generate an MD5 hash using Java, like this (using the Commons Codec library): String md5 = org.apache.commons.codec.digest.DigestUtils.DigestUtils.md5Hex(s) My feeling is that this is wrong because I have not specified character encodng at either end. So the original hash will be based on the bytes of the Python version of the string; the Java one will be based on the bytes of the Java version of the string , these two byte sequences will often not be the same - is that right? So really I need to specify "UTF-8" or whatever at both ends right? (I am actually getting an intermittent error in my code where the MD5 checksum fails, and I suspect this is the reason - but because it's intermittent, it's difficult to say if changing this fixes it or not. ) Thank you!

    Read the article

  • Character Encoding: â??

    - by akaphenom
    I am trying to piece together the mysterious string of characters â?? I am seeing quite a bit of in our database - I am fairly sure this is a result of conversion between character encodings, but I am not completely positive. The users are able to enter text (or cut and paste) into a Ext-Js rich text editor. The data is posted to a severlet which persists it to the database, and when I view it in the database i see those strange characters... is there any way to decode these back to their original meaning, if I was able to discover the correct encoding - or is there a loss of bits or bytes that has occured through the conversion process? Users are cutting and pasting from multiple versions of MS Word and PDF. Does the encoding follow where the user copied from? Thank you website is UTF-8 We are using ms sql server 2005; SELECT serverproperty('Collation') -- Server default collation. Latin1_General_CI_AS SELECT databasepropertyex('xxxx', 'Collation') -- Database default SQL_Latin1_General_CP1_CI_AS and the column: Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation text varchar no -1 yes no yes SQL_Latin1_General_CP1_CI_AS The non-Unicode equivalents of the nchar, nvarchar, and ntext data types in SQL Server 2000 are listed below. When Unicode data is inserted into one of these non-Unicode data type columns through a command string (otherwise known as a "language event"), SQL Server converts the data to the data type using the code page associated with the collation of the column. When a character cannot be represented on a code page, it is replaced by a question mark (?), indicating the data has been lost. Appearance of unexpected characters or question marks in your data indicates your data has been converted from Unicode to non-Unicode at some layer, and this conversion resulted in lost characters. So this may be the root cause of the problem... and not an easy one to solve on our end.

    Read the article

  • Weird character at start of json content type

    - by Nek
    Hi, I'm trying to return json content read from MySQL server. This is supposed to be easy but, there is a 'weird' character that keeps appearing at start of the content. I have two pages for returning content: kcb433.sytes.net/as/test.php?json=true&limit=6&input=d this test.php is from a script written by Timothy Groves, which converts an array to json output http://kcb433.sytes.net/k.php?k=4 this one is supposed to do the same I tried to validate it here jsonformatter.curiousconcept.com but just page 1 gets validated, page 2 says that it does not contain JSON data. If accessed directly both pages has no problems. Then what is the difference, why both don't get validated? Then I found this page jsonformat.com and tried the same thing. Page 1 was ok and page 2 wasn't but, surprisingly the data could be read. At a glance, {"a":"b"} may look good but there is a character in front. According to a hex editor online, this is the value of the string above (instead of 9 values, there are 10): -- 7B 22 61 22 3A 22 62 22 7D The code to echo json in page 2 is: header("Content-Type: application/json"); echo "{\"a\":\"b\"}";

    Read the article

  • In MySQL how can I tell what character set a particular table is using?

    - by muudscope
    I have a large mysql table that I think might be using the wrong character set. If so I'll need to change it using ALTER TABLE mytable CONVERT TO CHARACTER SET utf8 But since this is a very large table, I'd rather not run this command unless I have to. So my question is, how can I ask mysql what the character set is on a particular table? I can call status in mysql to see the database's character set, but that doesn't necessarily mean all the tables have the same character set, right?

    Read the article

  • Can I use a genetic algorithm for balancing character builds?

    - by Renan Malke Stigliani
    I'm starting to build a online PVP (duel like, one-on-one) game, where there is leveling, skill points, special attacks and all the common stuff. Since I have never done anything like this, I'm still thinking about the math behind the levels/skills/specials balance. So I thought a good way of testing the best builds/combos, would be to implement a Genetic Algorithm. It'd be like this: Generate a big group of random characters Make them fight, level them up accordingly to their victories(more XP)/losses(less XP) Mate the winners, crossing their builds, to try and make even better characters Add some more random chars, emulating new players Repeat the process for some time, or util I find some chars who can beat everyone's butt I could then play with the math and try to find better balances to make sure that the top x% of chars would be a mix of various build types. So, is it a good idea, or is there some other, easier method to do the balancing?

    Read the article

  • Silverlight 4 HttpWebRequest user agent string is null

    - by Dan B
    The problem I have a page with a silverlight object. It attempts to retrieve XML from the page. But I am struggling with a security exception. I have this code working brilliantly in WPF. When using a website hosting a silverlight application with the same code, the user agent string of the HttpRequest object is null (and seemingly cannot be set). In fact there is no header information at all - this causes a security exception when attempting to make my asynchronous call. The question Why is the user-agent string (and header information) null in my silverlight 4 application when making an asynchronous call using HttpWebRequest? Thanks in advance!

    Read the article

  • MVC null model problem

    - by femi
    hello, i have created two create actions..one to call the create view and the other to process the create view using httppost. when i call the create view, it gets published correctly , dropdowns and all. the problem is that when i fill out the create form and click on the submit button, i get an error; Object reference not set to an instance of an object. My first thoughts are that i am passing a null model to the httppost create action.. How can i check to see if i am passing in a null model to the httppost create action? thanks

    Read the article

  • NULL value when using NSDateFormatter

    - by David A Gibson
    Hello, I am using the following code to try and display in a time in a table cell. TimeSlot *timeSlot = [timeSlots objectAtIndex:indexPath.row]; NSDateFormatter *timeFormat = [[NSDateFormatter alloc] init]; [timeFormat setDateFormat:@"%1m/%1d/%Y"]; NSLog(@"Time: %@", timeSlot.time); NSDate *mydate = timeSlot.time; NSLog(@"Time: %@", mydate); NSString *theTime = [timeFormat stringFromDate:mydate]; NSLog(@"Time: %@", theTime); The log output is this: 2010-04-14 10:23:54.626 MyApp[1080:207] Time: 2010-04-14T10:23:54 2010-04-14 10:23:54.627 MyApp[1080:207] Time: 2010-04-14T10:23:54 2010-04-14 10:23:54.627 MyApp[1080:207] Time: (null) I am new to developing for the iPhone and as it all compiles with no errors or warnings I am at a loss as to why I am getting NULL in the log. Is there anything wrong with this code? Thanks

    Read the article

  • Order by null/not null with ICriteria

    - by Kristoffer
    I'd like to sort my result like this: First I want all rows/objects where a column/property is not null, then all where the colmn/property is null. Then I want to sort by another column/property. How can I do this with ICriteria? Do I have to create my own Order class, or can it be done with existing code? ICriteria criteria = Session.CreateCriteria<MyClass>() .AddOrder(Order.Desc("NullableProperty")) // What do I do here? IProjection? Custom Order class? .AddOrder(Order.Asc("OtherProperty"));

    Read the article

  • PHP fopen returning null on files that work fine with include and get_file_contents

    - by brad allred
    Hi, I have XAMPP installed on a windows 2000 server. everything is working great except the PHP fopen function. I can neither create nor open files with it. the strange thing is that i can include/require/file_get_contents/other file related functions; also fopen does not generate any errors or notices it just returns NULL. I have gone as far as to grant full control of the file and all enclosing folders to everybody but i still get NULL instead of a file pointer. I have tried this on php 5.2.9, 5.2.13, and 5.3.1 with the same effect. i have gone through the php.ini file looking for something that is breaking it; i have even tried deleting and using the basic ini file from a linux box where fopen is working and still nothing. I know i have to restart apache after changing my ini and all that and have been (I have even restarted the server) so thats not it. I am at this poing assuming it is an apache configuration issue somehow, tomorrow im going to run a test through php-cli to make sure. I really don't want to bruise my head anymore over this can some apache/php wizard come to my aid? Hi guys, thanks for the responses. you are right is is not any config problem. the problem has to be with one of my dlls or one of my included files. I just tried the same code that isn't working in a new file without any include and i disabled my custom libraries and it worked. for the record here is what I was doing that wasn't working: $test_file = 'c:\\test.csv';//everybody has full control. is very large. if(file_exists($test_file) && is_readable($test_file)){ $fp = fopen($test_file, 'r'); echo var_export($fp, true);//outputs NULL. on my linux box this is a number. if($fp !== false){ //do the work fread($fp, 10);//throws the error that $fp is not a valid file handle } } something that i am including must be breaking fopen somehow. works as expected in new file with no includes.

    Read the article

  • JPA Cascading Delete: Setting child FK to NULL on a NOT NULL column

    - by JBristow
    I have two tables: t_promo_program and t_promo_program_param. They are represented by the following JPA entities: @Entity @Table(name = "t_promo_program") public class PromoProgram { @Id @Column(name = "promo_program_id") private Long id; @OneToMany(cascade = {CascadeType.REMOVE}) @JoinColumn(name = "promo_program_id") private List<PromoProgramParam> params; } @Entity @Table(name = "t_promo_program_param") public class PromoProgramParam { @Id @Column(name = "promo_program_param_id") private Long id; //@NotNull // This is a Hibernate annotation so that my test db gets created with the NOT NULL attribute, I'm not married to this annotation. @ManyToOne @JoinColumn(name = "PROMO_PROGRAM_ID", referencedColumnName = "promo_program_id") private PromoProgram promoProgram; } When I delete a PromoProgram, Hibernate hits my database with: update T_PROMO_PROGRAM_PARAM set promo_program_id=null where promo_program_id=? delete from t_promo_program where promo_program_id=? and last_change=? I'm at a loss for where to start looking for the source of the problem.

    Read the article

  • Zend database query result converts column values to null

    - by David Zapata
    Hi again. I am using the next instructions to get some registers from my Database. Create the needed models (from the params module): $obj_paramtype_model = new Params_Model_DbTable_Paramtype(); $obj_param_model = new Params_Model_DbTable_Param(); Getting the available locales from the database // This returns a Zend_Db_Table_Row_Abstract class object $obj_paramtype = $obj_paramtype_model->getParamtypeByValue('available_locales'); // This is a query used to add conditions to the next sentence. This is executed from the Params_Model_DbTable_Param instance class, that depends from Params_Model_DbTable_Paramtype class (reference map and dependentTables arrays are fine in both classes) $obj_select = $this->select()->where('deleted_at IS NULL')->order('name'); // Execute the next query, applying the select restrictions. This returns a Zend_Db_Table_Rowset_Abstract class object. This means "Find Params by Paramtype" $obj_params_rowset = $obj_paramtype->findDependentRowset('Params_Model_DbTable_Param', 'Paramtype', $obj_paramtype); // Here the firebug log displays the queries.... Zend_Registry::get('log')->debug($obj_params_rowset); I have a profiler for all my DB executions from Zend. At this point the log and profiler objects (that includes Firebug writers), shows the executed SQL Queries, and the last line displays the resulting Zend_Db_Table_Rowset_Abstract class object. If I execute the SQL Queries in some MySQL Client, the results are as expected. But the Zend Firebug log writer displays as NULL the column values with latin characters (ñ). In other words, the external SQL client shows es_CO | Español de Colombia and en_US | English of United States but the Query results from Zend displays (and returns) es_CO | null and en_US | English of United States. I've deleted the ñ character from Español de Colombia and the query results are just fine in my Zend Log Firebug screen, and in the final Zend Form element. The MySQL database, tables and columns are in UTF-8 - utf8_unicode_ci collation. All my zend framework pages are in UTF-8 charset. I'm using XAMPP 1.7.1 (PHP 5.2.9, Apache at port 90 and MySQL 5.1.33-community) running on Windows 7 Ultimate; Zend Framework 1.10.1. I'm sorry if there is so much information, but I don't really know why could that happen, so I tryed to provide as much related information as I could to help to find some answer.

    Read the article

  • SQL count NULL cells

    - by Giuseppe
    Dear All, I have the following problem. I have a table in a db, with many columns. I can do different kind of select queries, to show, for example, for each record that satisfies a condition: all cells from columns with names ending in _t0 all cells from columns with names ending in _t1 ... To get the column lists to form the queries I use the information schema. Now, the problem: each query returns a record with a subset of the columns of the big table. This means that I can get a row of (all!) NULLs. How can I ask my query to reject such rows without having to type in explicitely the column names (i.e. by saying where col_1 is not null, col_2 is not null...)? Is it possible? Thanks in advance!!! Sep

    Read the article

  • Binding UserControl to a NULL DataContext

    - by user634981
    I have a UserControl and am binding its DataContext to an object. I also bind the IsEnabled property of the UserControl to a boolean property of that object eg: <my:MyUserControl DataContext="{Binding Items.SelectedItem}" IsEnabled="{Binding Path=IsEditable}"/> This works fine provided Items.SelectedItem is not null. However, if it is null (which can happen sometimes if the Items collection is empty), the IsEnabled binding does not get evaluated and is set to true, which is not the desired behaviour. I've tried using a MultiBinding but without success because I don't know if it's possible to bind to the DataContext. I've also tried using a DataTrigger, but again without success. Would somebody kindly point me in the right direction as to the correct way I should be doing this. Thanks!

    Read the article

  • Copying non null-terminated unsigned char array to std::string

    - by karlphillip
    If the array was null-terminated this would be pretty straight forward: unsigned char u_array[4] = { 'a', 's', 'd', '\0' }; std::string str = reinterpret_cast<char*>(u_array); std::cout << "-> " << str << std::endl; However, I wonder what is the most appropriate way to copy a non null-terminated unsigned char array, like the following: unsigned char u_array[4] = { 'a', 's', 'd', 'f' }; into a std::string. Is there any way to do it without iterating over the unsigned char array? Thank you all.

    Read the article

  • Javascript / jQuery Exec turns up Null

    - by Matrym
    How do I skip over this next line if it turns out to be null? Currently, it (sometimes) "breaks" and prevents the script from continuing. var title = (/(.*?)<\/title/m).exec(response)[1]; $.get(url, function(response){ var title = (/<title>(.*?)<\/title>/m).exec(response)[1]; if (title == null || title == undefined){ return false; } var words = title.split(' '); $.each(words, function(index, value){ $link.highlight(value + " "); $link.highlight(" " + value); }); });

    Read the article

  • NULL In a Class Destructor

    - by Hyper-DarkStar
    Simple question; Is it pointless to set a pointer( which allocates heap memory ) to NULL in the destructor? class SampleClass { public: SampleClass( int Init = 0 ) { Value = new int( Init ); } ~SampleClass( void ) { delete Value; Value = NULL; // Is this pointless? } int *Value; }; While on the subject of classes, when should I use the explicit keyword? Thanks.

    Read the article

  • special character in UNIX

    - by Happy Mittal
    I want to add backspace character literally in my file named junk. So I did following $ ed a my name is happy\b (here b means I typed backspace so \ gets disapperaed and cursor sits sfter y) . w junk q But when I do $ od -cb junk it doesn't show backspace.

    Read the article

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