w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Returning data from if statement
It's not clear which array you are refering to. The only array you're interacting with in the code is enemyDestroyer, which is immediately released from memory after the assignment. Perhaps you could expand you example so we can get a better understanding of what it is you're trying to do? Update To prevent enemyDestroyer from being instantly released youd have to move it to the appropriate scope. That would mean declaring it in the same scope it's going to be used. I suggest reading up on scopes and perhaps switching to an object oriented design.

Categories : C++

Web app returning data but too slow
Here is what I believe your issues are: Initial page load amounts to 13.1MB (easy, tiger!). Obviously this needs to be addressed. Run all of your PNGs and JPEGs through an optimizer. Here is one that is an add on for Visual Studio. In light of this, on many PCs, the RAM use of the browser process will hit the roof. Chrome hit 250MB for me and Opera 650MB usage. It's a heavy, heavy page with 171 requests on initial page load. That is really high. Consider using sprites for your images as well, consolidate as many as you can, the performance difference is stunning; the higher the number of requests the less efficient a page becomes. Do you really need to preload all those images? Definitely consider the lazy loader you mention or other image loader as appropriate. When the browse names is

Categories : Sql Server

RestSharp for PCL not returning data from ASP.NET Web API
You've triggered an asynchronous HTTP call and never seem to be waiting for it to complete. Try waiting or your unit test might finish much before the Web API is even hit by the request: client.ExecuteAsync<List<Product>>(request, response => { ... }).Result; But in a unit test you probably don't need to be complicated your life with asynchronous HTTP calls. Just use a standard synchronous call and assert on the results received.

Categories : Rest

MS SQL Where Like Clause Not Returning Data
The most likely reason is that there is some unseen character after the 08. One way this could occur is if the field is defined as a char; it would then be padded with spaces. One way to see if there are any such values is to append characters to delimit the value: select '|'+char_data+'|' . . . You have another problem in your query. You are using varchar without a length. Bad, bad, bad. In fact, the convert doesn't seem to be needed at all. You can just do: substring(char_data, 9, 16) LIKE '%BrightSide08' But this is equivalent to: left(char_data, 25) LIKE '%BrightSide08' Or, because you are looking for values at the end of the field: right(char_data, 12) = 'BrightSide08'

Categories : Sql Server

.data() not returning undefined
Use $(this) instead of $(event.target): var postID = $(this).data('postid'); Your code works good if there are not other elements in div. Also consider comparing the target.event with this: event.target The DOM element that initiated the event. read more this In jQuery, the element being acted upon is often passed to the function parameter of a jQuery function as this. It can be made into a jQuery element object by using $(this). read more Example Your code becomes: $(".like").click(function(event){ var postID = $(this).data('postid'); alert(postID); }); As HTML example can be the following: <div class="like" data-postid="903282304865jh"><i>A</i> Test</div> JSFIDDLE

Categories : Jquery

Gridview returning empty even when there is data. I want to use data in the gridview to update another database
Per my comment above you may want to do something like: List<string> _OrderIds = new List<string>(); DataTable table = gvOrderLines.DataSource as DataTable; foreach (GridViewRow gvr in table.Rows) { Label myOrderIDLablel = (Label)gvr.FindControl("lblOrderID"); //find control since it is a template field _OrderIds.Add(myOrderIDLablel.Text); } I hope this get you headed in the right direction.

Categories : C#

Returning data from SQL query into an array
The $aResult has it been retrieved using PDO? If so using which method? Have you used fetch? Or fetchAll if your using the method above with $aResult['item] you should use fetch if not and you have used fetchAll you would need $aResult[0]['item'] otherwise an empty array will be produced . This is my guess from the information given

Categories : PHP

SQL query returning not all data w.r.t to Territory Name
You must mean you want to know where Employees worked over time. As far as I can see in AdventureWorks2008 and AdventureWorks2008R2, Sales.SalesPerson is assigned a single TerritoryID, then in Sales.SalesTerritoryHistory there can be multiple TerritoryIDs per BusinessEntityID. For those DBs, use this: select p.FirstName ,p.LastName ,e.LoginID -- there is no EmployeeID in this version of AdventureWorks ,st.Name as [TerritoryName] from Sales.SalesPerson as sp join Person.Person as p on p.BusinessEntityID = sp.BusinessEntityID join HumanResources.Employee as e on e.BusinessEntityID = sp.BusinessEntityID join Sales.SalesTerritoryHistory as

Categories : Sql Server

Jquery returning all to much data I only want the table
The page you're calling is url: $(this).attr('href') and that's a web-page you're just on with all headers and stuff... You have to put your functions in a separate .php file that doesn't contain a whole web-page frame and only outputs the text you want. If that's not possible then create in your success callback function with document.createDocumentFragment(), pass the whole response inside the fragment and pull out your stuff you need with something like myHTML = docFrag.getElementsByTagName('div')[0] and then pass this with append to your form. You might also want to set something like contentType: "text/plain; charset=utf-8" in your ajax call. By the way: If you're not using the convenience of parsing variables inside strings you might want to use a different way (the other quotes)

Categories : Ajax

Returning data from within a Transaction in Laravel 4
You can assign the return values of the transaction closure in a variable like this: $paymentGatewayTransaction = $this->processTransaction($data); $var = DB::connection('new_db')->transaction(function () use ($paymentGatewayTransaction) { //Performing all DB transactions here to insert Order Information. if ($paymentGatewayTransaction['Status'] == "APPROVED") return Response::json(array('Status' => 'Success'), '200'); else return Response::json(array('Status' => 'Error'), '200'); }); return $var; Then you can use $var to return.

Categories : PHP

XMLElementnot returning data in Oracle 10g
Get it resolved by converting the output using .getClobVal(). Below is the query SELECT XMLElement("Emp", XMLElement("ID", e.emp_id), XMLElement("Name", e.emp_name))**.getClobVal()** AS "RESULT" FROM emp_metadata e;

Categories : SQL

MVC controller not returning JSON data?
You're missing the id? $.getJSON( "/SlimProductServices/JsonDetailsProduct", { 'id': 1 },... public ActionResult JsonDetailsProduct(int id) Take a look at getJson in the jquery docs. Where are you getting the ID from? If you just want to test the call without changing your jquery call, you could add a second Action method... public ActionResult JsonDetailsProduct() { Product pdt = NWDC.GetProduct(1); //hard code product Id that exists for testing.

Categories : Jquery

JTable is not returning data for all records
Some things suggested by your snippet: Don't mix model and view coordinates, convert them as required. Access your TableModel, not the data structure that was used to construct it.

Categories : Java

SQLite returning wrong data
Try this one select AUTHORS_ABSTRACT.ABSTRACTSITEM_ID, ABSTRACT_AFFILIATION.AFFILIATION_NUMBER, AUTHORS_AFFILIATE.ABSTRACTAUTHOR_ID from AUTHORS_ABSTRACT left join ABSTRACT_AFFILIATION on AUTHORS_ABSTRACT.ABSTRACTAUTHOR_ID = ABSTRACT_AFFILIATION._id left join AUTHORS_AFFILIATE on ABSTRACT_AFFILIATION._id=AUTHORS_AFFILIATE.ABSTRACTAFFILIATION_ID ORDER BY AUTHORS_ABSTRACT.ABSTRACTSITEM_ID ASC

Categories : Database

class data returning null after being set
You are creating two variables. One as attribute in BasicInfo_Assets_Fragment, the other as attribute in Option_ListFragment. They are completely different variables. If you have a reference to the BasicInfo_Assets_Fragment instance (lets call it biaf) in the Option_ListFragment, you can reference its view attribute as biaf.storeModel, and that will give what you want. Best practice is to make storeModel private and add a getStoreModel() method to the BasicInfo_Assets_Fragment. Also, try to follow Java naming conventions.

Categories : Java

jquery autocomplete not returning data
Use Firebug to debug you error (http://getfirebug.com/) This works for me header('content-type: application/json; charset=utf-8');<br> $arr = array( array('id' => 3453, 'label' => 'Producto1', 'value' => 'Producto1'), array('id' => 3454, 'label' => 'Producto2', 'value' => 'Producto2'), array('id' => 3455, 'label' => 'Producto3', 'value' => 'Producto3') ); echo json_encode($arr); <?php header('content-type: application/json; charset=utf-8'); $arr = array(); $con = mysql_connect("localhost","root","root"); if (!$con) { die('Todo mal.....: ' . mysql_error()); } mysql_select_db("test", $con); $result = mysql_query("SELECT id, nombre FROM productos where nombre like '%".$_GET["term"]."%'"); while($row = mysql_fetc

Categories : PHP

SQL Query - Returning specific data
I'm not certain what you mean, but is this what you're looking for? FULL OUTER JOIN A_ASSIGNMENT_TYPE A_ASSIGNMENT_TYPE ON (A_ASSIGNMENT_TYPE.ADMIN_SET_ID = PT_ASSIGNMENT.ADMIN_SET_ID) AND (A_ASSIGNMENT_TYPE.TYPE_ID = 'PCC' OR A_ASSIGNMENT_TYPE.TYPE_ID IS NULL)

Categories : SQL

SQL query not returning data from where clause
Try this: SELECT * FROM #PreModuleAllData WITH(NOLOCK) WHERE (@Country = 'DEFAULT' OR @Country = '' OR ([Language] = @Country )) AND (@UserType = 'DEFAULT' OR @UserType = '' OR ([UserType] = @UserType )) AND (@Group = 'DEFAULT' OR @Group = '' OR ([Company] = @Group )) AND (@CodeUsage = 'DEFAULT' OR @CodeUsage = '' OR ([User Code]= @CodeUsage ))

Categories : SQL

pymssql not returning result data
You can use this patch: diff --git a/mssqldbmodule.c b/mssqldbmodule.c index 151bc2c..7081715 100644 --- a/mssqldbmodule.c +++ b/mssqldbmodule.c @@ -1934,12 +1934,12 @@ PyObject *get_result(_mssql_connection *conn) { // find a result set that has at least one column conn->last_dbresults = SUCCEED; - while (conn->last_dbresults == SUCCEED && - (conn->num_columns = dbnumcols(conn->dbproc)) <= 0) { + do { Py_BEGIN_ALLOW_THREADS conn->last_dbresults = dbresults(conn->dbproc); Py_END_ALLOW_THREADS - } + } while (conn->last_dbresults == SUCCEED && + (conn->num_columns = dbnumcols(conn->dbproc)) <= 0); check_cancel_and_raise(conn->last_dbresults, conn); http://lists.ibiblio.org/piper

Categories : Python

Module factory is not returning data
When you call sites() it returns an empty object and initiates an AJAX request, which will populate the "sites" property on that object. I think you should use it like this: $scope.results = feedFetcher.sites(); console.log($scope.results.sites); // will be undefined as AJAX not complete Then in your html you can use the results and they will be filled in when AJAX completes, or watch for it: $scope.$watch('results.sites', function() { // this will be called twice, once initially // and again whenever it is changed, aka when AJAX completes console.log($scope.results.sites); };

Categories : Angularjs

Ajax query not returning data
The problem in your code is that you are serializing a DIV, what is incorrect. The solution would be to serialize only the FORM included in your DIV with a Javascript code like: ... $(function(){ $("#boxaddform").submit(function(){ var formdata = $('#BA_boxform').serialize(); $.ajax({ type: "POST", url: "/domain/admin/requests/boxes/boxesadd.php", data: formdata, dataType: 'json', success: function(msg){ ... } }); return false; }); .... Also, remember that serialize will only care for INPUT, SELECTand TEXTAREA controls as a normal FORM submit would do (http://api.jquery.com/serialize/).

Categories : PHP

Why is data("selectable") returning "undefined"?
If you notice this comment for the selected answer to the StackOverflow question you reference, it says that for later versions of the jQuery UI library, you should use .data("ui-selectable") instead of .data("selectable"). Hopefully that is the reason for the error you are getting because I see nothing else wrong with your code.

Categories : Jquery

Datastax c# driver not returning row data
You are trying to fetch the data twice. First when you call rows.Count() > 0 and then during iteration. Once executed and iterated the Rows pseudo-collection is invalid. Therefore the simplest solution for you is to copy all results into the list first. Try this, var rows = rowSet.GetRows().ToList(); And now iterate over the list.

Categories : C#

Returning array from function with data from file
Firstly, this: file >> length; Student students[length]; Is non-standard extension. Length of array should be known at compile-time. Secondly, you're returning pointer to the memory that will be released once array goes out of scope. You should use std::vector instead: #include <vector> // ... std::vector<Student> getFromFile(string filename) { // ... std::vector<Student> students(length); Also you no longer need to pass length by reference, since std::vector has size member function.

Categories : C++

Returning JSON data with ajax in wordpress
In your code get_posts('numberposts='.'&category=20'.$count); is wrong, but you can use wp_get_recent_posts function instead (though it uses get_posts anyway), for example function ajax_get_latest_posts($count) { $args = array( 'numberposts' => $count, 'order' => 'DESC','category' => 20 ); $post = wp_get_recent_posts( $args ); if( count($post) ) { return $post; } return false; } Then in your our_ajax-function you can use $output = ajax_get_latest_posts($_REQUEST['count']); // or $_GET['count'] if($output) { echo json_encode(array('success' => true, 'result' => $output)); } else { wp_send_json_error(); // {"success":false} // Similar to, echo json_encode(array("success" => false)); // or yo

Categories : Ajax

Play Framework WS: Returning JSON data as Int
What this message is telling you is that the JSON your providing is not parseable in the type you expect. The first one is about Some(data.value(0).as[JsArray].value(0).as[Int]). apparently data.value(0).as[JsArray].value(0) is not a Number, and therefore can't be converted to an Int. For the second one, val data = (response.json "data").as[JsArray] since the id does not exist, apparently the Json you get has no key 'data', or the value at that key is not an array (null ?). I suggest you log the value of r.json before parsing. You'll see exactly why it's failing. You should also avoid using as and use validate instead (http://www.playframework.com/documentation/2.1.2/ScalaJsonRequests).

Categories : Json

Backbone pushState is returning raw JSON data
This is not something Backbone can do (hense why pushState is disabled by default). You have to setup your server to redirect those requests to the root so that your HTML loads and Backbone can handle the route. This is stated in the Backbone documentation: Note that using real URLs requires your web server to be able to correctly render those pages, so back-end changes are required as well. For example, if you have a route of /documents/100, your web server must be able to serve that page, if the browser visits that URL directly. For full search-engine crawlability, it's best to have the server generate the complete HTML for the page ... but if it's a web application, just rendering the same content you would have for the root URL, and filling in the rest with Backbone Views and Java

Categories : Json

MVC unobtrusive AJAX, returning Json data, and IE
If you return the url like that, you are going to need to override the Success handler and check the result to see if it has the Url property and then putting the result into window.location. Personally, rather than returning a new Json result, I would send back a 302 which should make the ajax handler redirect you. This happens in the bowels of jQuery if memory serves, so you don't need to change anything. So rather than returning that json result on a successful login, try using a redirectToRoute result instead and send them to the page you want them to go to.

Categories : Ajax

pymongo returning different data than MongoDB Shell
What would be the output of the next code? from pymongo import MongoClient from bson.objectid import ObjectId client = MongoClient() db = client['dev_database'] print json.dumps(db.trials.find_one(ObjectId('522f975dc91e273451569942')))

Categories : Python

jQuery autocomplete UI with servlet is not returning any data
The servlet should return the autocomplete data as JSON. There a several options, I have opted for an array which contains an object with label/value properties: @WebServlet("/autocomplete/*") public class AutoCompleteServlet extends HttpServlet { @Override protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { final List<String> countryList = new ArrayList<String>(); countryList.add("USA"); countryList.add("Pakistan"); countryList.add("Britain"); countryList.add("India"); countryList.add("Italy"); countryList.add("Ireland"); countryList.add("Bangladesh"); countryList.add("Brazil"); countryL

Categories : Java

mySql stored proc not returning data
For one thing logic in your CASE statements is invalid. Instead of referring to input parameters logId and groupId you compare logInS and groupIdS to themselves respectively. Thus you always get NULLs as values in these variables. Here is SQLFiddle demo that shows that You most likely meant to have this SET logInS = CASE logId WHEN '-1' THEN '%' ELSE logId END; SET groupIdS = CASE groupId WHEN '-1' THEN '%' ELSE groupId END; Here is SQLFiddle demo. Also your choice of using VARCHAR for all parameters seems to be strange. Use appropriate data types (e.g. INT for logId and groupId and DATETIME, TIMESTAMP or INT for fromDate and toDate depending on what data type is used for logExceptions.completed column).

Categories : Mysql

json encode returning only partial data
You're looking at two different JSON data structures. One is an array, the other an object. Essentially, json_encode() will use the former where possible, and switch to objects if the data can't be represented by an array. Change json_encode($model_data); to json_encode($model_data, JSON_FORCE_OBJECT); to make json_encode() always return an object, which will have the keys you want. Further example: $data = array(34,26,25,23,6); echo json_encode($data); // [34,26,25,23,6] echo json_encode($data, JSON_FORCE_OBJECT); // {"0":34,"1":26,"2":25,"3":23,"4":6}

Categories : PHP

WCF Data Service not returning detailed errors
You might try adding this to your WCF service code at the startup on the host. It causes exception details to be included in faults that are thrown to, and caught by, the client. Without this, details of the exceptions are hidden. And make sure that, when you're catching those internal exceptions, that you throw a generic "fault" object to the client using the WCF System.ServiceModel.CommunicationObjectFaultedException object. Dot NET exceptions are Microsoft centric, so if you're throwing errors to non-MS devices like Android or iPhone, you need to use the CommunicationObjectFaultedException. ServiceDebugBehavior debug = ServiceHost.Description.Behaviors.Find<ServiceDebugBehavior>(); if (debug == null) { ServiceHost.Description.Behaviors.Add(new ServiceDebugBehavior { I

Categories : Wcf

Ajax webmethod, returning JSOn data
Try changing your success function to the following: var data = msg.d; alert(data["counter"]); alert(data); alert(typeof msg); var rows = []; for (var i = 0; i < data.length; i++) { rows.push([ data[i].counter, data[i].SessionID, data[i].MsgType, data[i].ValueDate, data[i].Sender ]); } var otable = $("#test").dataTable({ "aaData": rows });

Categories : C#

XSL template match returning unexpected data
I guess <xsl:apply-templates/> makes troubles... it is calling standard built-in templates. Try to remove it. Edit: For input xml <?xml version="1.0" encoding="UTF-8"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>2988</year> </cd> <cd> <title>Greatest Hits</title> <artist>Dolly Parton</artist> <country>USA</country> <company>RCA</company> <price>9.90</price> <year>1982</year> </cd> </ca

Categories : Xml

jQuery AJAX call not returning data
stlll, it seems a cross-domain issue: please try this library https://github.com/padolsey/jQuery-Plugins/blob/master/cross-domain-ajax/jquery.xdomainajax.js as a jsonp the result is already a callback function with a javascript object argument. Make sure that the returned function by the server is implemented: The server could return my_callback({...}). You need to implement my_callback function client-side. place some alerts/console.log on both success and error functions. Always make a little debug of your own before posting the issue. as posted in the comment: state the return code of the ajax call.

Categories : Javascript

Facebook Graph API Returning Empty Data Set
I was unaware that the ability to view my 'pages' from /me/account required that I have an additional 'page admin' access permission. Once the app owner granted me it within the app, I was able to see the data in the Graph Explorer.

Categories : Facebook

get the data-attribute using closest returning null
You need to use .siblings instead of .closest $(".DivImgEdit").click(function(){ alert($(this).siblings('.DivImgRun').data('internalid')); }); closest look's among parents, in your case, the desired element is sibling and not the parent Demo ---> http://jsfiddle.net/Rpazu/2/

Categories : Jquery

Array filter is returning data very slowly
May be this link here will help you.. Iterating through a list of users and pushing to an array in knockout This is how you would set up your viewmodel to enable paging. And this link here Make a WCF Service Accept JSON Data from jQuery.AJAX() would help you get your WCF service work. Of course, the data would be the paging data from the first link.

Categories : Arrays

SQL - Returning distinct row for data with Max created timestamp value
I'd recommend adding an auto-increment primary key field to the auditingTable to more easily identify records. For the following query I'll assume that you've added this column and named it auditRecordId. Assuming that you're identifying each message by the messageType then the following should work: SELECT A1.messageType, A1.message FROM auditingTable A1 INNER JOIN ( SELECT MAX(auditRecordId) auditRecordId, messageType FROM auditingTable GROUP BY messageType ) A2 ON A1.auditRecordId = A2.auditRecordId

Categories : SQL



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.