Search Results

Search found 3440 results on 138 pages for 'returning'.

Page 25/138 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • jquery .children() returning wrong size

    - by i need help
    Hi guys, I just found the children size not consistent. Below attach full code with alert, for easy reference. Is the way I get the data wrong? <body> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" valign="top"><strong>Header Title</strong></td> </tr> <tr> <td height="32" valign="top">Date : <strong>01/01/2010 </strong> <br><div><b></b></div><span></span></td> </tr> </table> </body> $("td").each(function() { alert($(this).children().size()); }); //first td showing 1 direct children- <strong> //second td showing 4 direct children- <strong> <br> <div> <span> ----- $("tr").each(function() { alert($(this).children().size()); }); //first tr showing 1 direct children - <td> //second tr showing 1 direct children - <td> ----- $("table").each(function() { alert($(this).children().size()); }); // ERROR // this table showing 1 direct children only.... something WRONG. // I thought there are 2 <tr> inside this table?

    Read the article

  • C++ error - returning a char array

    - by Yosy
    Consider the following code: char CeaserCrypt(char str[256],int key) { char encrypted[256],encryptedChar; int currentAsci; encrypted[0] = '\0'; for(int i = 0; i < strlen(str); i++) { currentAsci = (int)str[i]; encryptedChar = (char)(currentAsci+key); encrypted[i] = encryptedChar; } return encrypted; } Visual Studio 2010 gives an error because the function returns an array. What should I do? My friend told me to change the signature to void CeaserCrypt(char str[256], char encrypted[256], int key). But I don't think that is correct. How can I get rid of the compile error?

    Read the article

  • SharePoint Returning a 401.1 for a Specific User/Computer

    - by Joe Gennari
    We have a SharePoint Services 3.0 site set up supporting about 300 users right now. This report is isolated and has never been duplicated. We have one AD user who cannot log into the SharePoint site with his account from his machine and is subsequently returned a 401.1 error. If any other user tries to log on with their account from his machine, it works okay. If he moves to another machine and logs on, it works okay. The only solution to this point has been to install FireFox on the machine. When he authenticates with FF, everything is okay. Remedies tried so far: Cleared cookies/cache Turned off/on Integrated Windows Authentication in IE Downgraded IE 8 to IE 6 Removed site from Intranet Sites zone Renamed the machine Disjoined/Rejoined Domain

    Read the article

  • rake does not returning anything

    - by CHID
    Hi, I jus created a rails application. I created a model using ruby script/generate model Article next i edited the my articles.rb file by adding these lines in self.up method def self.up create_table :articles do |t| t.string :title t.text :body t.string :published_at t.timestamps end end Now i ran rake db:migrate . But migrate does not work, it simply does no print anything. Anyone knows where i am going wrong?

    Read the article

  • Method invoked but not returning anything

    - by or azran
    i am calling this method from a touch in UITableViewCell , -(void)PassTitleandiMageByindex:(NSString *)number{ NSLog(@"index : %d",number.intValue); NSArray *objectsinDictionary = [[[NSArray alloc]init]autorelease]; objectsinDictionary = [[DataManeger sharedInstance].sortedArray objectAtIndex:number.intValue]; if ([objectsinDictionary count] > 3) { ProductLabel = [objectsinDictionary objectAtIndex:3]; globaliMageRef = [objectsinDictionary objectAtIndex:2]; [self performSegueWithIdentifier:@"infoseg" sender:self]; }else{ mQid = [objectsinDictionary objectAtIndex:1]; globaliMageRef = [objectsinDictionary objectAtIndex:2]; [mIQEngines Result:mQid]; NSLog(@"mQid : %@ Global : %@",mQid,globaliMageRef); }} Problem:- i am trying to get the same functionality programmatically by calling [self PassTitleandiMageByindex:stringNumber]; when i am calling this programmatically i can see the debug log getting in the place it should be, but nothing happens (by pressing the UITableViewCellon the screen) here is how it turns on by touch, - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSString *st = [NSString stringWithFormat:@"%d",[indexPath row]]; [self PassTitleandiMageByindex:st];} I have also tried to call the table-view delegate by :[[Tview delegate] tableView:Tview didSelectRowAtIndexPath:selectedCellIndexPath]; but, nothing happened.

    Read the article

  • Returning all "positions" of a list

    - by Daymor
    I Have a list with "a" and "b" and the "b"'s are somewhat of a path and "a"'s are walls. Im writing a program to make a graph of all the possible moves. I got the code running to check the first "b" for possible moves, but i have NO Idea how im going to find all "b"'s , even less check them all without repeating. Major issue im having is getting the tuple coordinates of the "b"'s out of the list. Any pointers/tips?

    Read the article

  • Array returning Null values

    - by Nick Gibson
    Dunno why it is...heres the coding for it. http://pastebin.org/301343 I know theres a lot of repetitiveness in the coding...but its because the arrays were retuning null so I got tired of messing with them. Everything works until it reaches line 224, which returns null values.

    Read the article

  • Similar SQL queries returning different results...

    - by Pablo
    Here are the SQL Queries: $sql1 = "SELECT count(thread) AS total FROM comments WHERE thread=1 AND parent_id=0 "; $sql2 = "SELECT count(thread) AS total FROM comments, users WHERE thread=1 AND parent_id=0 AND users.user_id=comments.user_id "; $sql3 = "SELECT comments.*, users.username AS username FROM comments, users WHERE thread=1 AND parent_id=0 AND users.user_id=comments.user_id ORDER BY date LIMIT 10, 5 "; My question is why would $sql1 and $sql2 would return two different results? $sql1 returns 61 rows $sql2 returns 56 rows The 5th line in $sql2 is just for testing, is not required, is just a variation of $sql1 which gets the total rows for a pagination.

    Read the article

  • [Android] Returning to a ListView with a text filter

    - by sosiouxme
    I enabled text filtering on my ListView in the expected way; adding android:textFilterEnabled=”true” in resource definition and (as I'm using a SimpleCursorAdapter) setting a FilterQueryProvider that provides a filtered cursor like so: public Cursor runQuery(CharSequence constraint) { Cursor cur = mDba.fetchTrackers(mCurrentGroupId, constraint.toString()); startManagingCursor(cur); return cur; } My question is this: once the user selects a list item, goes off to another activity, and returns to this one, how can I control the state of the filter previously applied? What I'm seeing right now is that when I return to the activity, the cursor being used is the unfiltered one set on the filter at creation, but the filter text they typed is still shown (and typing keys causes the filter to be applied). What I'd like to do is either clear the filter, or keep the filtered cursor that the activity was left with.

    Read the article

  • POST request is returning response success but is not posting the data

    - by Vineeth
    I am making a POST request to the MOXTRA API and it should return me the following response : { "data": { "id": user_id, //some user id "revision": 5, "name": "My First Binder", "created_time": 1402384947587, "updated_time": 1402384947587 }, "code": "RESPONSE_SUCCESS" } And I am making this POST request using Java Script var d = { 'name': 'My First Binder' }; var bind = JSON.stringify(d); $.post('https://api.moxtra.com/user_id/binders?access_token=' + access_token+ '&callback=?', bind, function(response) { alert( response.data.id); },'json'); }) But the alert that i get for alert(response.data.id) is "undefined" and the alert if i write alert(response.code) is "RESPONSE_SUCCESS" What is wrong with the above code , how am i getting a response success and getting undefined at the same time

    Read the article

  • AJAX with jQuery not returning data

    - by James P
    This is my Javascript: $(document).ready(function() { $('#like').bind('keydown', function(e) { if(e.keyCode == 13) { var likeMsg = $('#like').val(); if(likeMsg) { // Send the AJAX request to like.php $.ajax({ url: 'like.php', success: function(data) { alert('Content: ' + data); } }); } } }); }); And this is my like.php file: <?php echo "It works! :)"; ?> When I press enter on the #like input, it seems the AJAX request is sent and an alert box comes up saying: Content:, but there's no data being sent back from like.php... I have checked if the file exists and if it's in the same directory and whatever and it is, so I'm pretty much clueless atm. Does anyone know what could be wrong here? Cheers.

    Read the article

  • Returning Null values with COUNT

    - by Randy B.
    With this query, I get a result that is two short of the table because they are not included in count, and I would like get the NULL values in the result. To do this, I am pretty sure I need to use a subquery of some kind, but I am not sure how, since the attribute in question is an aggregate. SELECT Equipment.SerialNo , Name, COUNT(Assignment.SerialNo) FROM Equipment INNER JOIN Assignment ON Assignment.SerialNo = Equipment.SerialNo GROUP BY Equipment.SerialNo, Name

    Read the article

  • Delphi static method of a class returning property value

    - by mitko.berbatov
    I'm making a Delphi VCL application. There is a class TStudent where I have two static functions: one which returns last name from an array of TStudent and another one which returns the first name of the student. Their code is something like: class function TStudent.FirstNameOf(aLastName: string): string; var i : integer; begin for i := 0 to Length(studentsArray) - 1 do begin if studentsArray[i].LastName = aLastName then begin result := studentsArray[i].FirstName; Exit; end; end; result := 'no match was found'; end; class function TStudent.LastNameOf(aFirstName: string): string; var i : integer; begin for i := 0 to Length(studentsArray) - 1 do begin if studentsArray[i].FirstName = aFirstName then begin result := studentsArray[i].LastName; Exit; end; end; result := 'no match was found'; end; My question is how can I avoid writing almost same code twice. Is there any way to pass the property as parameter of the functions.

    Read the article

  • mod_rewrite per-dir redirection returning a 400

    - by Eaterrust
    I moved my images directory to a different folder, and now I want to redirect all images requests from that folder to the new one. I do not have access to the main configuraion file, so I'm doing this in a .htaccess. I tried this, and it works:     RewriteCond %{REQUEST_URI} old_dir/.+.(jpg|png|gif)$     RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT] But since they have permanently moved, I want to do a proper redirect, so I added the [R] flag, like this:      %{REQUEST_URI} old_dir/.+.(jpg|png|gif)$     RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT,R] But the server gets confused, and returns a 400, so I looked at the log file, and this is what happens:     strip per-dir prefix: C:/wamp/www/natrazyle/old_dir/images/banner.jpg - old_dir/images/banner.jpg     applying pattern 'old_dir/(.+[^/]+..+)$' to uri 'old_dir/images/banner.jpg'     rewrite 'old_dir/images/banner.jpg' - 'images/banner.jpg'     add per-dir prefix: images/banner.jpg - C:/wamp/www/natrazyle/images/banner.jpg     explicitly forcing redirect with http://localhost/C:/wamp/www/natrazyle/images/banner.jpg As you can see, the full local path gets added after localhost I know I'm doing something wrong, I just can't figure it out myself. Any help would be greatly appreciated...

    Read the article

  • Returning the size of available virtual memory at run-time in C++

    - by Greenhouse Gases
    In C++ is there a predefined library function that will return the size of RAM currently available on a computer a program is being run on, at run-time? For instance, if an object is 4bytes, then can we divide the available virtual memory by 4 bytes to give an estimate of how many more objects could be stored by the program safely? I have used the sizeof() function to return the size of objects within my program. Thanks

    Read the article

  • Set argument pointer to point to new memory inside a function (without returning it) IN C

    - by user321605
    Hello, Hopefully my title was descriptive enough to attract the right help. I want to write a function that will return 1 thing, and modify a provided pointer in another. My current function declaration is . . . char * afterURL replaceURLS(char * body) What I want to do is copy all of body's data into a new string, and set body to point to this new data. I then want afterURL to point to a location within the new string. My issue is getting the actual pointer that is passed in to this function to point to the new data. Thanks in advance! Rob

    Read the article

  • Returning a lua table on SWIG call

    - by Tom J Nowell
    I have a class with a methodcalled GetEnemiesLua. I have bound this class to lua using SWIG, and I can call this method using my lua code. I am trying to get the method to return a lua table of objects. Here is my current code: void CSpringGame::GetEnemiesLua(){ std::vector<springai::Unit*> enemies = callback->GetEnemyUnits(); if( enemies.empty()){ lua_pushnil(ai->L); return; } else{ lua_newtable(ai->L); int top = lua_gettop(ai->L); int index = 1; for (std::vector<springai::Unit*>::iterator it = enemies.begin(); it != enemies.end(); ++it) { //key lua_pushinteger(ai->L,index);//lua_pushstring(L, key); //value CSpringUnit* unit = new CSpringUnit(callback,*it,this); ai->PushIUnit(unit); lua_settable(ai->L, -3); ++index; } ::lua_pushvalue(ai->L,-1); } } PushIUnit is as follows: void CTestAI::PushIUnit(IUnit* unit){ SWIG_NewPointerObj(L,unit,SWIGTYPE_p_IUnit,1); } To test this I have the following code: t = game:GetEnemiesLua() if t == nil then game:SendToConsole("t is nil! ") end The result is always 't is nil', despite this being incorrect. I have put breakpoints in the code and it is indeed going over the loop, rather than doing lua_pushnil. So how do I make my method return a table when called via lua?

    Read the article

  • GetLocalValueEnumerator() Not Returning All Properties

    - by a_hardin
    I am trying to perform validation in my WPF application using the solution in Detecting WPF Validation Errors. public static bool IsValid(DependencyObject parent) { // Validate all the bindings on the parent bool valid = true; LocalValueEnumerator localValues = parent.GetLocalValueEnumerator(); while (localValues.MoveNext()) { LocalValueEntry entry = localValues.Current; if (BindingOperations.IsDataBound(parent, entry.Property)) { Binding binding = BindingOperations.GetBinding(parent, entry.Property); foreach (ValidationRule rule in binding.ValidationRules) { ValidationResult result = rule.Validate(parent.GetValue(entry.Property), null); if (!result.IsValid) { BindingExpression expression = BindingOperations.GetBindingExpression(parent, entry.Property); System.Windows.Controls.Validation.MarkInvalid(expression, new ValidationError(rule, expression, result.ErrorContent, null)); valid = false; } } } } // Validate all the bindings on the children for (int i = 0; i != VisualTreeHelper.GetChildrenCount(parent); ++i) { DependencyObject child = VisualTreeHelper.GetChild(parent, i); if (!IsValid(child)) { valid = false; } } return valid; } The problem I am running into is that when I step through the code for a TextBox, I'm not getting the Text property. The only properties I get are "PageHeight", "Instance", and "UndoManagerInstance". Therefore, I can not Validate the rules for the binding on the TextBox. Does anyone have any idea why I wouldn't be getting the correct properties? Is there another way to force validaton on controls in WPF? I haven't been able to find anyone else who has had this problem. Update: The TextBoxes I am trying to validate are within a DataTemplate. I found that if I copy one of the TextBoxes and place it directly in the Window, I am able to get the data. Using Woodstock, I saw that the data source for the TextBoxes in the template is "ParentTemplate", but it's "Local" for the TextBox outside of the template. So, the question now is, how can I get the DependencyProperties for controls inside a DataTemplate?

    Read the article

  • returning values from function or method multiple times by only calling the class once

    - by Sokhrat Sikar
    I have a members.php file that shows my websites members. I echo members name by using foreach method. A method of Members class returns an array, then I use foreach loop in the members.php file to echo the members. I am trying to aovid writing php code in my members.php file. Is there a way to avoid using foreach inside members.php file? For example, is it possible to return value from a method couple of times? (by only calling the object once). Just like how we normally call the functions? This question doesn't make sense, but I am just trying to see if there is a away around this issue?

    Read the article

  • returning aligned memory with new?

    - by Steve
    I currently allocate my memory for arrays using the MS specific mm_malloc. I align the memory, as I'm doing some heavy duty math and the vectorization takes advantage of the alignment. I was wondering if anyone knows how to overload the new operator to do the same thing, as I feel dirty malloc'ing everywhere (and would eventually like to also compile on Linux)? Thanks for any help

    Read the article

  • Returning objects with dynamic memory

    - by Caulibrot
    I'm having trouble figuring out a way to return an object (declared locally within the function) which has dynamic memory attached to it. The problem is the destructor, which runs and deletes the dynamic memory when the object goes out of scope, i.e. when I return it and want to use the data in the memory that has been deleted! I'm doing this for an overloaded addition operator. I'm trying to do something like: MyObj operator+( const MyObj& x, const MyObj& y ) { MyObj z; // code to add x and y and store in dynamic memory of z return z; } My destructor is simply: MyObj::~MyObj() { delete [] ptr; } Any suggestions would be much appreciated!

    Read the article

  • returning null or throwing an exception?

    - by MoKi
    I have the following types: typedef QPair < QTime , QTime > CalculatedTimeSlotRange; typedef QList < CalculatedTimeSlotRange > CalculatedTimeSlotRangeList; typedef QHash < quint8 , CalculatedTimeSlotRangeList > TimeSlotsTable; I have a function like the following: const CalculatedTimeSlotRangeList* TimeSlots::getCalculatedTimeSlotRangeList(const quint8 id) const { QHashIterator<quint8,CalculatedTimeSlotRangeList> it(mTimeSlotsTable); while (it.hasNext()) { it.next(); if(it.key() == id) { return &it.value(); } } return NULL; } as you can see my function returns a null if it fails to find a key that matches id. Is this correct? or should I just throw an exception if the key does not exist? how should i throw an exception for this situation?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >