Search Results

Search found 743 results on 30 pages for 'fetching'.

Page 19/30 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • CakePHP repeats same queries

    - by Rytis
    I have a model structure: Category hasMany Product hasMany Stockitem belongsTo Warehouse, Manufacturer. I fetch data with this code, using containable to be able to filter deeper in the associated models: $this->Category->find('all', array( 'conditions' => array('Category.id' => $category_id), 'contain' => array( 'Product' => array( 'Stockitem' => array( 'conditions' => array('Stockitem.warehouse_id' => $warehouse_id), 'Warehouse', 'Manufacturer', ) ) ), ) ); Data structure is returned just fine, however, I get multiple repeating queries like, sometimes hundreds of such queries in a row, based on dataset. SELECT `Warehouse`.`id`, `Warehouse`.`title` FROM `beta_warehouses` AS `Warehouse` WHERE `Warehouse`.`id` = 2 Basically, when building data structure Cake is fetching data from mysql over and over again, for each row. We have datasets of several thousand rows, and I have a feeling that it's going to impact performance. Is it possible to make it cache results and not repeat same queries?

    Read the article

  • parsing a xml to get some values

    - by Joan Silverstone
    Hello, i have this xml: http://www.managerleague.com/export_data.pl?data=transfers&output=xml&hide_header=0 These are player sales from a browser game. I want to save some fields from these sales. I am fetching that xml with curl and storing on my server. Then do the following: $xml_str = file_get_contents('salespage.xml'); $xml = new SimpleXMLElement($xml_str); $items = $xml->xpath('*/transfer'); print_r($items); foreach($items as $item) { echo $item['buyerTeamname'], ': ', $item['sellerTeamname'], "\n"; } The array is empty and i cant seem to get anything from it. What am i doing wrong?

    Read the article

  • RODBC string getting truncated

    - by sayan dasgupta
    Hi all, I am fetching data from MySql Server into R using RODBC. So in one column of the database is a character vector SELECT MAX(CHAR_LENGTH(column)) FROM reqtable; RETURNS 26566 Now I will show you an example how I am running into the problem `library(RODBC) con <- odbcConnect("mysqlcon") rslts <- as.numeric(sqlQuery(con, "SELECT CHAR_LENGTH(column) FROM reqtable LIMIT 10", as.is=TRUE)[,1]) ` returns > rslts [1] 62 31 17 103 30 741 28 73 25 357 where as rslts <- nchar(as.character(sqlQuery(con, "SELECT column FROM reqtable LIMIT 10", as.is=TRUE)[,1])) returns > rslts [1] 62 31 17 103 30 255 28 73 25 255 So strings with length 255 is getting truncated at 255. Is there a way I can get the full string. Thanks

    Read the article

  • Which is quicker? Memcache or file query? (using maxmind geoip.dat file)

    - by tomcritchlow
    Hi, I'm using Python on Appengine and am looking up the geolocation of an IP address like this: import pygeoip gi = pygeoip.GeoIP('GeoIP.dat') Location = gi.country_code_by_addr(self.request.remote_addr) (pygeoip can be found here: http://code.google.com/p/pygeoip/) I want to geolocate each page of my app for a user so currently I lookup the IP address once then store it in memcache. My question - which is quicker? Looking up the IP address each time from the .dat file or fetching it from memcache? Are there any other pros/cons I need to be aware of? For general queries like this, is there a good guide to teach me how to optimise my code and run speed tests myself? I'm new to python and coding in general so apologies if this is a basic concept. Thanks! Tom

    Read the article

  • How to call a php controller method using jquery?

    - by chandru_cp
    I am developing a web application and i am integrating jquery in it... Now looking for ajax calls with jquery to my controller function.... jquery.ajax() would be useful i think so... But how to call my controller method.... $.ajax({ type: "POST", url: "", data: "", contentType: "application/json; charset=utf-8", async: false, dataType: "json", success: function(jsonObj) { function loadbookdetails() { //Paging $college=$_SESSION['college']; $this->load->library('pagination'); $data['bookdetails'] = $this->librarymodel->selectbook($college); //$data['rackOptionData'] = $this->librarymodel->selectrack(); if(empty($data['bookdetails'])) { $data['comment'] = 'no record found!'; } $this->load->view('bookdetials',$data); } I am fetching this records here how to use it with jquery.ajax() function and how to convert $data to json and use it with jquery and iterate with a table...

    Read the article

  • How to slow down Uploadify plugin script voor jQuery

    - by Peter
    Now if that isn't a weird question, I don't know what is. But here is the problem: I have a function in my "onSelect" option that has to collect some data (through AJAX) and I have a function in my "onComplete" option that processes the just uploaded files based on the data "onSelect" collected. However, with very small files, the "onSelect" hasn't finished yet before the upload is complete and the "onComplete" fails because it lacks the necessary data. Bigger files work just fine. So, I'm looking for a way to stall the upload of the file. To let it start only after the function in onSelect completed fetching the necessary data. Any ideas? Here is an example of the function that the onSelect triggers: var foo = new Array(); function checkDB( event, queueID , fileObj ) { $.post( ajax_folder + 'fetchData' , { ref: "someValue" } , function( data ){ foo[ queueID ] = data.result; } , 'json' ); return true; }

    Read the article

  • Incorporation of YUI 3 in rails

    - by lorefnon
    I was wondering if any effort has been made towards integration of YUI3 with rails asset pipeline. By integration, I don't just mean a couple of helpers for including the library but rather a complete integration of YUI module loader. I'll elaborate the idea in detail: Currently, developers developing modules using YUI rely on Ant tasks for concatenating the module components and wrapping them up with some associated metadata and generating target files ( and optionally minifying and running jslint). Also, when fetching the modules, the YUI loader calculates the module dependencies and generates a single file comprising of all the dependencies which havent been included already in the page. I was wondering if the whole functionality could be seamlessly integrated into the Asset pipeline of rails.

    Read the article

  • Improve performance writing 10 million records to text file using windows service

    - by user1039583
    I'm fetching more than 10 millions of records from database and writing to a text file. It takes hours of time to complete this operation. Is there any option to use TPL features here? It would be great if someone could get me started implementing this with the TPL. using (FileStream fStream = new FileStream("d:\\file.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite)) { BufferedStream bStream = new BufferedStream(fStream); TextWriter writer = new StreamWriter(bStream); for (int i = 0; i < 100000000; i++) { writer.WriteLine(i); } bStream.Flush(); writer.Flush(); // empty buffer; fStream.Flush(); }

    Read the article

  • No Parameterless Constructor defined for - ViewModel with UOW

    - by TheVillageIdiot
    I have a view model class which uses UnitOfWork to some database operations like fetching of items to create select lists and IPrincipal for some auditing (like modified by etc.). It cannot work without this UOW. I have configured my web site to use Ninject to inject UOW into Controllers. From controller I pass this UOW when creating view model. But when performing POST operation I am getting No parameterless constructor defined for this object. I have few SelectList type of properties which I have excluded with Bind attribute. How can I overcome this problem? Can I configure Ninject to create the objects of this type and make ModelBinder use it?

    Read the article

  • As a Web Developer, how complicated is your average job? [closed]

    - by Daniel S
    Hey people, I'm 16 years old and I've recently started to do freelance jobs. I've been playing with PHP since I was 12 and I think that I can code reasonably well. So far, I've created a library for fetching info from LinkedIn profiles and some Wordpress plugins. Right now this client wants me to convert an HTML template into a Wordpress theme for using as a website. I feel this is a tad easy, so I wanted to ask, as professional web programmers, are most assignments harder than this?

    Read the article

  • problem in decreasing page's queries

    - by Mac Taylor
    hey guys i have a tag table in my php/mysql project that looks like this Table name : bt_tags Table fileds : tid,tag and for every story rows there is a filed named : tags Table name: stories table filed : tags that saved in this field as ids 1 5 6 space between them now problem : when using while loop to fetch all fields in story table , the page uses 1 query to show every stories' detail but for showing tag's names , i should query another table to find names , we have ids stored in story table now i used for loop between while loop to show tag names but im sure there is a better way to decrease page queries how can i improve this script and show tag's names without using *for loop ?* $result = $db->sql_query("SELECT * FROM ".STORY_TABLE." "); while ($row = $db->sql_fetchrow($result)) { //fetching other $vars ---- $tags_id = explode(" ",$row['tags']); $c = count($tags_id); for($i=1;$i<$c-1;$i++){ list($tag_name,$slug) = $db->sql_fetchrow($db->sql_query( 'SELECT `tag`,`slug` FROM `bt_tags` WHERE `tid` = "'.tags_id[$i].'" LIMIT 1' )); $sow_tags = '$tag_name,'; }

    Read the article

  • Are there cheat sheets for misc source code management tools?

    - by Alex_coder
    I'm looking for something similar to Pacman Rosetta, which explains how to achieve similar tasks using different source code management tools. Sometimes docs for a certain SCM contain examples comparing that particular SCM to a couple of others. But I'm looking for a central place that contains maximum available information. Example: one uses bzr and knows that 'bzr pull' syncs a local repo by fetching new content from a remote repo. One want to know how to do that with git. One finds the git command, he knows the keyword. Since the keyword is known, one can proceed straight to git docs, he knows what to read about, he doesn't have to waste time by searching the git docs. I understand this might be not the only way people use to learn a new SCM tool. If you use other approaches, please do tell.

    Read the article

  • How to Compare and fetch date in Cakephp ?

    - by delete me
    I am trying to make an availability calender and need to know how can I compare date when fetching it. My DB is id start_date end_date status Now suppose I want to fetch booking in next month, i.e. from 2010-03-01 to 2010-04-01. How should I fetch this data ? I did try comparing directly using an and condition but it didnt help. The format in DB is yyyy-mm-dd and I used the same to compare. But direct comparison does not work.

    Read the article

  • Testing on blackberry device - adding and removing app multiple times

    - by Kai
    It would be useful for many people to know how to completely remove an application from your device when testing. I have downloaded my app many times now, and likewise have deleted it many times. The problem is when deleting the app, it does not remove things like the persistent object related to my app, or the images downloaded through the app. So, when I download the next build, I have no idea if something broke that is related to building the persistent object or fetching the images since those elements already exist from the last build. I don't know if this is a cache thing. I don't know if this is expected and I have to use some utility to wipe this data after deleting the app. I can't really find much info through basic web searches. Any information would be appreciated. Blackberry Bold 9000. 4.6 OS. tested with both SD card and no SD card.

    Read the article

  • Modx: How to create a contact form with a dropdown of offices to cc the email to?

    - by code-zoop
    In the contact us template I want to have a dropdown with the list of offices (All offices articles are places under the same parent node, so getting the list should be fairly easy). I need a way to add the office email address (Template variable from the Office article) to the email generated by Modx's eForm. I don't want the email address to be visible in the contact us form, but a snippet fetching the article Template variable email address. I also want a link from each offices article to the contact us form with the office preselected in the dropdown. How should I implement this?

    Read the article

  • Calling a WCF WebService in PHP via wsHttpBinding.

    - by Justin Dearing
    I have a WCF webservice I can connect to it via basicHttp, but not wsHttp. I try to conenct to it via wshttp via the following: $service = new SoapClient ("http://service.companyname.local:6666/Service/?wsdl", array( "location" => "http://service.companyname.local:6666/Service/WCF", "trace" => true, 'soap_version' => SOAP_1_2 ) ); The call to the SoapClient constructor returns fine. When I try to call one using $client-FunctionName, the page just sits there loading for quite a while, and eventually returns the error "Error Fetching http headers". What exactly is this supposed to mean and how do I fix it? (Consuming the service from .Net client works perfectly.)

    Read the article

  • How can I use Perl to scrape a website that reveals its content with JavaScript?

    - by AmbroseChapel
    I need to write a Perl script to scrape a website. The website can only be scraped with JavaScript, and the user is on Windows. I got some way with Win32::IE::Mechanize on my work machine, which has IE6, but then I moved to my netbook which has IE8, and can't even get as far as fetching a simple page. Is Win32::IE::Mechanize up to date with the latest versions of IE? But, more to the point, given a recent WinXP machine, what's the quickest, easiest way to scrape a site which only reveals its content via JavaScript?

    Read the article

  • Android sending SOAP object over Https via ksoap2 2.5.8

    - by Jack-V
    My first time posting a question here so please do not mind my mistakes here. I'm currently making an android application fetching and sending information from a .asmx web service. Everything goes well with the ksoap2 library and am using HttpTransportSE to call the web service. So now what I'm trying to do is to use the HttpsTransportSE to call the web service over Https. I got java.security.cert.certpathvalidatorexception trustanchor for certpath not found exception. I have the server certificate in .pfx , .jks and .bks format. My questions is what do i do with it to make my HttpsTransportSE call to be success? I've read around with articles using custom SSLSocketFactory but am still not sure how to implement it in my application. Thanks in advance for any suggestion/advices

    Read the article

  • Push notification or thread with timer

    - by neha
    Hi all, In my application, I'm having functionality like twitter that when you have not refreshed your screen, and if there're new messages then you get this message that "You have n new messages" and a refresh button, which on press will refresh the screen. I'm basically fetching all the data from an xml with some url. In case of thread, I need to call a timer after some time period which might affect the app performance. Can anybody please suggest wheather what will be better to use push notifications or thread with timer? Thanx in advance.

    Read the article

  • Hibernate Many-To-One Foreign Key Default 0

    - by user573648
    I have a table where the the parent object has an optional many-to-one relationship. The problem is that the table is setup to default the fkey column to 0. When selecting, using fetch="join", etc-- the default of 0 on the fkey is being used to try over and over to select from another table for the ID 0. Of course this doesn't exist, but how can I tell Hibernate to treat a value of 0 to be the same as NULL-- to not cycle through 20+ times in fetching a relationship which doesn't exist? <many-to-one name="device" lazy="false" class="Device" not-null="true" access="field" cascade="none" not-found="ignore"> <column name="DEVICEID" default="0" not-null="false"/>

    Read the article

  • How to make a particular information to be accessible at masterpage, page and usercontrol

    - by Ismail S
    I'm fetching some settings out of the database based on a value passed from a query string. Out of these settings, a few will be used in master page, few on my Page and few in my user control (say login control which is a web user control). I've an entity class MySetting for it and there is a method in my data access layer which returns me an instance of MySetting when I pass the value I got in query string. I don't want to fetch settings from the database multiple times for one request. I'm using asp.net web forms with C# and sql server.

    Read the article

  • Read Call History from iPhone on iOS 5 and above

    - by Sandeep Dhama
    I am developing an application and need to read the users call history from iPhone.I have go though all the forums and google it and found that we can get the records from teh callHistory sqlite database by "private/var/root/Library/CallHistory/call_history.db". But this path is not working from iOS 5 and above. Seems like apple has changed all their database path and structure so that no one can accees it. I have also seen some of the application on iTunes who are capable of getting the users call history like:-https://itunes.apple.com/us/app/callog/id327883585?mt=8 I have also check a mac desktop utility called "WonderShare Dr.Fone" which will fetch all the data from your iPhone like call history messages, notes , etc.How this utility is fetching the call history records and other details? If their is any API or private APIs by which i can get the callHistory data path please let me know.

    Read the article

  • x86 and Memory Addressing

    - by IM
    I've been reading up on memory models in an assembly book I picked up and I have a question or two. Let's say that the address bus has 32 lines, the data bus has 32 lines and the CPU is 32-bit (for simplicity). Now if the CPU makes a read request and sends the 32bit address, but only needs 8 bits, all 32 bits come back anyway? Also, the addresses in memory are still addressed per byte correct? So fetching one byte would bring back 0000 0001 to address 0000 0004? Thanks in advance

    Read the article

  • How do I change the background image of my iPhone app?

    - by alJaree
    Hello I have looked around and found some code which so called chooses an image from an array of image objects, but cant find an explanation. I would like to make my app have a background image and the user can select next and previous buttons to scroll through some full screen images, setting them as the background image as they scroll. I know how to do this in java, but cant seem to do it for this app. How or what code is linked to a next button to grab the next image in the array and reverse for the back button? Then that needs to be displayed obviously. I have used a layered architecture with a MVC style approach but cant seem to put it together with Objective-C. Would the buttons call the appropriate methods of the so called delegates, which the delegates handle fetching and returning the Images? Would the buttons use the returned images and actually handle the redrawing? I would really appreciate the help. Regards Jarryd

    Read the article

  • MVC 1.0 + EF: Does db.EntitySet.where(something) still return all rows in table?

    - by Dale
    In a repository, I do this: public AgenciesDonor FindPrimary(Guid donorId) { return db.AgenciesDonorSet.Include("DonorPanels").Include("PriceAdjustments").Include("Donors").First(x => x.Donors.DonorId == donorId && x.IsPrimary); } then down in another method in the same repository, this: AgenciesDonor oldPrimary = this.FindPrimary(donorId); In the debugger, the resultsview shows all records in that table, but: oldPrimary.Count(); is 1 (which it should be). Why am I seeing all table entries retrieved, and not just 1? I thought row filtering was done in the DB. If db.EntitySet really does fetch everything to the client, what's the right way to keep the client data-lite using EF? Fetching all rows won't scale for what I'm doing.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >