Search Results

Search found 58499 results on 2340 pages for 'temporal data'.

Page 235/2340 | < Previous Page | 231 232 233 234 235 236 237 238 239 240 241 242  | Next Page >

  • XMLHttpRequest POST Data Size

    - by usurper
    Hi, Is there a size limit to a XHR POST request? I am using the POST method for saving textdata into MySQL using PHP script and the data is cut off. Firebug sends me the following message: ... Firebug request size limit has been reached by Firebug. ... This is my code for sending the data: function makeXHR(recordData) { xmlhttp = createXHR(); var body = "q=" + encodeURIComponent(recordData); xmlhttp.open("POST", "insertRowData.php", true); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", body.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { //alert(xmlhttp.responseText); alert("Records were saved successfully!"); } } xmlhttp.send(body); } The only solution I can think of is splitting the data and making a queue of XHR requests but I don't like it. Is there another way?

    Read the article

  • DataReader is not returning results from a MySQL Stored Proc

    - by Glenn Slaven
    I have a stored proc in MySQL (5.5) that I'm calling from a C# application (using MySQL.Data v6.4.4.0). I have a bunch of other procs that work fine, but this is not returning any results, the data reader says the result set is empty. The proc does a couple of inserts & an update inside a transaction then selects 2 local variables to return. The inserts & update are happening, but the select is not returning. When I run the proc manually it works, gives a single row with the two fields, but the data reader is empty. This is the proc: CREATE DEFINER=`root`@`localhost` PROCEDURE `File_UpdateFile`(IN siteId INT, IN fileId INT, IN description VARCHAR(100), IN folderId INT, IN fileSize INT, IN filePath VARCHAR(100), IN userId INT) BEGIN START TRANSACTION; SELECT MAX(v.versionNumber) + 1 INTO @versionNumber FROM `file_version` v JOIN `file` f ON (v.fileId = f.fileId) WHERE v.fileId = fileId AND f.siteId = siteId; INSERT INTO `file_version` (fileId, versionNumber, description, fileSize, filePath, uploadedOn, uploadedBy, fileVersionState) VALUES (fileId, @versionNumber, description, fileSize, filePath, NOW(), userId, 0); INSERT INTO filehistory (fileId, `action`, userId, createdOn) VALUES (fileId, 'UPDATE', userId, NOW()); UPDATE `file` f SET f.checkedOutBy = NULL WHERE f.fileId = fileId; COMMIT; SELECT fileId, @versionNumber `versionNumber`; END$$ I'm calling the proc using Dapper, but I've debugged into the SqlMapper class and I can see that the reader is not returning anything.

    Read the article

  • Screenscraping and reverse engineering health based web tool

    - by ArbInv
    Hi There is a publicly available free tool which has been built to help people understand the impact of various risk factors on their health / life expectancy. I am interested in understanding the data that sits behind the tool. To get this out it would require putting in a range of different socio-demographic factors and analyzing the resulting outputs. This would need to be done across many thousand different individual profiles. The tool was probably built on some standard BI platorm. I have no interest in how the tool was built but do want to get to the data within it. The site has a Terms of Use Agreement which includes: Not copying, distribute, adapt, create derivative works of, translate, or otherwise modify the said tool Not decompile, disassemble, reverse assemble, or otherwise reverse engineer the tool. The said institution retains all rights, title and interest in and to the Tool, and any and all modifications thereof, including all copyright, copyright registrations, trade secrets, trademarks, goodwill and confidential and proprietary information related thereto. Would i be in effect breaking the law if i were to point a screen scraping tool which downloaded the data that sits behind the tool in question?? Any advice welcomed? THANKS

    Read the article

  • Exporting and reformatting data out of MS Excel

    - by Matt H
    I have a huge Excel spreadsheet containing telephone calling rates to a number of different countries. The format of the columns is: Country, RateLocality, Prefixes, Rate, Wholesale e.g. Afganistan, Default, 93;930;931;9321;9322;9323;9324;9325;9326;9327;9328;9329;9331;9332;9333;9334;9335;9336;9337;9338;9339;9341;9342;9343;9344;9345;9346;9347;9348;9349;9351;9352;9353;9354;9355;9356;9357;9358;9359;9361;9362;9363;9364;9365;9366;9367;9368;9369;9371;9372;9373;9374;9376;938;939; $ 1.023, $0.455 These rates change every so often and I need to get them into another system that can import them using CSV. The eventual format is: LD PREPEND CODE ie. 00 or 011,CountryCode,Area Code,Comment,Connect Cost,Included Seconds,Per Minute Cost,Pricelist,Increment So to convert that above line I'd have 00,"Afganistan",93,"Default",1.023,60,1.023,10 00,"Afganistan",931,"Default",1.023,60,1.023,10 ... 00,"Afganistan",939,"Default",1.023,60,1.023,10 Where 00, 60 and 10 are hard coded and merged with the other data from excel. How can I export this data into the required format given that I need to reformat it as it goes. Should I export to XML and use XSLT or some other process to massage the data into CSV? If that is the case, how do I do it simply and quickly.

    Read the article

  • Best way to sign data in web form with user certificate

    - by salgiza
    We have a C# web app where users will connect using a digital certificate stored in their browsers. From the examples that we have seen, verifying their identity will be easy once we enable SSL, as we can access the fields in the certificate, using Request.ClientCertificate, to check the user's name. We have also been requested, however, to sign the data sent by the user (a few simple fields and a binary file) so that we can prove, without doubt, which user entered each record in our database. Our first thought was creating a small text signature including the fields (and, if possible, the md5 of the file) and encrypt it with the private key of the certificate, but... As far as I know we can't access the private key of the certificate to sign the data, and I don't know if there is any way to sign the fields in the browser, or we have no other option than using a Java applet. And if it's the latter, how we would do it (Is there any open source applet we can use? Would it be better if we create one ourselves?) Of course, it would be better if there was any way to "sign" the fields received in the server, using the data that we can access from the user's certificate. But if not, any info on the best way to solve the problem would be appreciated.

    Read the article

  • how to get data from another file?

    - by Ronnie Chester Lynwood
    hey guys i got this jquery codes: jQuery(function ($) { var OSX = { container: null, init: function () { $("input.osx, a.osx").click(function (e) { e.preventDefault(); $("#osx-modal-content").modal({ overlayId: 'osx-overlay', containerId: 'osx-container', closeHTML: null, minHeight: 80, opacity: 65, position: ['0',], overlayClose: true, onOpen: OSX.open, onClose: OSX.close }); }); }, open: function (d) { var self = this; self.container = d.container[0]; d.overlay.fadeIn('slow', function () { $("#osx-modal-content", self.container).show(); var title = $("#osx-modal-title", self.container); title.show(); d.container.slideDown('slow', function () { setTimeout(function () { var h = $("#osx-modal-data", self.container).height() + title.height() + 20; // padding d.container.animate( {height: h}, 200, function () { $("div.close", self.container).show(); $("#osx-modal-data", self.container).show(); } ); }, 300); }); }) }, close: function (d) { var self = this; // this = SimpleModal object d.container.animate( {top:"-" + (d.container.height() + 20)}, 500, function () { self.close(); // or $.modal.close(); } ); } }; OSX.init(); }); this js is gets #osx-modal-content,#osx-modal-title,#osx-modal-data from index.php. how can i get divs from another page? thanks

    Read the article

  • Which way to store this data is effective?

    - by Tattat
    I am writing a game, which need a map, and I want to store the map. The first thing I can think of, is using a 2D-array. But the problem is what data should I store in the 2D-array. The player can tap different place to have different reaction. So, I am thinking store a 2D-array with objects, when player click some position, and I find it in the array, and use the object in that array to execute a cmd. But I have a concern that storing lots of object may use lots of memory. So, I am think storing char/int only. But it seems that not enough for me. I want to store the data like that: { Type:1 Color:Green } No matter what color is, if they are all type 1, the have same reactions in logic, but the visual effect is based on the color. So, it is not easy to store using a prue char/int data, unless I make something like this: 1-5 --> all type 1. 1=color green , 2=color red, 3 = color yellow.... ... 6-10 --> all type 2. 2 = color green, 2 = color red ... ... So, do you have any ideas on how to minimize the ram use, but also easy for me to read... ...thx

    Read the article

  • Black Magic in Grails Data Binding!?

    - by Tiago Alves
    As described in http://n4.nabble.com/Grails-Data-Binding-for-One-To-Many-Relationships-with-REST-tp1754571p1754571.html i'm trying to automatically bind my REST data. I understand now that for one-to-many associations the map that is required for the data binding must have a list of ids of the many side such as: [propName: propValue, manyAssoc: [1, 2]] However, I'm getting this exception Executing action [save] of controller [com.example.DomainName] caused exception: org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.example.DomainName.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.example.DomainName.id However, even weirder is the update action that is generated for the controller. There we have the databinding like this: domainObjectInstance.properties = params['domainObject'] But, and this is the really weird thing, params['domainObject'] is null! It is null because all the domainObject fields are passed directly in the params map itself. If I change the above line to domainObjectInstance.properties = null the domainObject is still updated! Why is this happening and more important, how can I bind my incoming XML automatically if it comes in this format (the problem is the one-to-many associations): <product> <name>Table</name> <brand id="1" /> <categories> <category id="1" /> <category id="2" /> </categories> </product>

    Read the article

  • user enter data to different arrays

    - by user2900469
    This is fragment of my code (arrays as you can see): double[] Price; String[] names; int[] Quantity; Price = new double[5]; names = new String[5]; Quantity = new int[5]; Price[1] = 3.10; Price[2] = 7.80; Price[3] = 0.20; names[1] = "Ballpen"; names[2] = "Notebook"; names[3] = "Envelope"; Quantity[1] = 20; Quantity[2] = 5; Quantity[3] = 140; I enter data to arrays by myself in this case. Now i want to change my code so that my program asks user for names, price and quantity (using the Scanner class). After user enter data, program keep this in three different arrays. I dont know how to transfer data from user to arrays. I would be grateful for some example code or any help.

    Read the article

  • Efficient (basic) regular expression implementation for streaming data

    - by Brendan Dolan-Gavitt
    I'm looking for an implementation of regular expression matching that operates on a stream of data -- i.e., it has an API that allows a user to pass in one character at a time and report when a match is found on the stream of characters seen so far. Only very basic (classic) regular expressions are needed, so a DFA/NFA based implementation seems like it would be well-suited to the problem. Based on the fact that it's possible to do regular expression matching using a DFA/NFA in a single linear sweep, it seems like a streaming implementation should be possible. Requirements: The library should try to wait until the full string has been read before performing the match. The data I have really is streaming; there is no way to know how much data will arrive, it's not possible to seek forward or backward. Implementing specific stream matching for a couple special cases is not an option, as I don't know in advance what patterns a user might want to look for. For the curious, my use case is the following: I have a system which intercepts memory writes inside a full system emulator, and I would like to have a way to identify memory writes that match a regular expression (e.g., one could use this to find the point in the system where a URL is written to memory). I have found (links de-linkified because I don't have enough reputation): stackoverflow.com/questions/1962220/apply-a-regex-on-stream stackoverflow.com/questions/716927/applying-a-regular-expression-to-a-java-i-o-stream www.codeguru.com/csharp/csharp/cs_data/searching/article.php/c14689/Building-a-Regular-Expression-Stream-Search-with-the-NET-Framework.htm But all of these attempt to convert the stream to a string first and then use a stock regular expression library. Another thought I had was to modify the RE2 library, but according to the author it is architected around the assumption that the entire string is in memory at the same time. If nothing's available, then I can start down the unhappy path of reinventing this wheel to fit my own needs, but I'd really rather not if I can avoid it. Any help would be greatly appreciated!

    Read the article

  • Sending data back to Controller Spring-MVC

    - by Umesh Awasthi
    I am not sure if this is a complex problem but as a starting person this seems a bit complex to me. I have an object based on which i need to show some values on the UI and let user select some of them, i need to send data back to another controller when user click on the submit button.Here is the structure of my data object public class PrsData{ private Map<String, List<PrsCDData>> prsCDData; } public class PrsCDData{ private Map<String, Collection<ConfiguredDesignData>> configuredDesignData; } public ConfiguredDesignData{ // simple fields } I have set the object in model before showing the view like model.addAttribute("prsData", productData.getPrData()); In the form i have following settings <form:form method="post" commandName="prsData" action="${addProductToCartAction}" > <form:hidden path="prsCDData['${prsCDDataMap.key}'] [${status.index}].configuredDesignData['${configuredDesignDataMap.key}'] [${configuredDesignDataStatus.index}].code"/> <form:hidden path="prsCDData['${prsCDDataMap.key}'] [${status.index}].configuredDesignData['${configuredDesignDataMap.key}'] [${configuredDesignDataStatus.index}].description"/> </form:form> This is what i have at AddProductToCartController public String addToCart(@RequestParam("productCodePost") final String code, @ModelAttribute("prsData") final PrsData prsData, final Model model, @RequestParam(value = "qty", required = false, defaultValue = "1") final long qty) On submitting the form i am getting following exception org.springframework.beans.NullValueInNestedPathException: Invalid property 'prsCDData[Forced][0]' of bean class [com.product.data.PrsData]: Cannot access indexed value of property referenced in indexed property path 'prsCDData[Forced][0]': returned null It seems like its trying to access the values on this controller while i am trying to send value to that controller and trying to create same object with selected values Can any one tell me where i am doing wrong and what i need to take care of

    Read the article

  • SQLITE crash when no data present in table

    - by johnblack45
    Hey, Im having a problem with my app that causes it to crash when no data is present in the table when using a table view. I have tested my code and it works fine as long as there is data present but i need it to work when there is no data present. -(void)initialiseTableData { NSMutableArray *array = [[NSMutableArray alloc]init]; sqlite3 *db = [iCaddyAppDelegate getNewDBConnection]; sqlite3_stmt *statement; const char *sql = "select courseId, courseName, totalPar, totalyardage, holePars, holeYardages, holeStrokeIndexs from Course"; if(sqlite3_prepare_v2(db, sql, -1, &statement, NULL)!= SQLITE_OK) { NSAssert1(0,@"Error preparing statement",sqlite3_errmsg(db)); sqlite3_close(db); } else { while (sqlite3_step(statement) == SQLITE_ROW) { Course *temp = [[Course alloc]init]; temp.courseId = sqlite3_column_int(statement,0); temp.courseName = [NSString stringWithFormat:@"%s",(char*)sqlite3_column_text(statement,1)]; temp.totalPar =sqlite3_column_int(statement,2); temp.totalYardage =sqlite3_column_int(statement,3); NSString tempHolePars = [NSString stringWithFormat:@"%s",(char)sqlite3_column_text(statement,4)]; NSString tempHoleYardages = [NSString stringWithFormat:@"%s",(char)sqlite3_column_text(statement,5)]; NSString tempHoleStrokeIndexes = [NSString stringWithFormat:@"%s",(char)sqlite3_column_text(statement,6)]; NSArray *temp1 = [tempHolePars componentsSeparatedByString:@":"]; NSArray *temp2 = [tempHoleYardages componentsSeparatedByString:@":"]; NSArray *temp3 = [tempHoleStrokeIndexes componentsSeparatedByString:@":"]; for(int i = 0; i<=17; i++) { NSString *temp1String = [temp1 objectAtIndex:i]; [temp.holePars insertObject:temp1String atIndex:i]; NSString *temp2String = [temp2 objectAtIndex:i]; [temp.holeYardages insertObject:temp2String atIndex:i]; NSString *temp3String = [temp3 objectAtIndex:i]; [temp.holeStrokeIndexes insertObject:temp3String atIndex:i]; } [array addObject:temp]; } self.list = array; [self.table reloadData]; } }

    Read the article

  • Dimension Reduction in Categorical Data with missing values

    - by user227290
    I have a regression model in which the dependent variable is continuous but ninety percent of the independent variables are categorical(both ordered and unordered) and around thirty percent of the records have missing values(to make matters worse they are missing randomly without any pattern, that is, more that forty five percent of the data hava at least one missing value). There is no a priori theory to choose the specification of the model so one of the key tasks is dimension reduction before running the regression. While I am aware of several methods for dimension reduction for continuous variables I am not aware of a similar statical literature for categorical data (except, perhaps, as a part of correspondence analysis which is basically a variation of principal component analysis on frequency table). Let me also add that the dataset is of moderate size 500000 observations with 200 variables. I have two questions. Is there a good statistical reference out there for dimension reduction for categorical data along with robust imputation (I think the first issue is imputation and then dimension reduction)? This is linked to implementation of above problem. I have used R extensively earlier and tend to use transcan and impute function heavily for continuous variables and use a variation of tree method to impute categorical values. I have a working knowledge of Python so if something is nice out there for this purpose then I will use it. Any implementation pointers in python or R will be of great help. Thank you.

    Read the article

  • Pointer inside a struct / thread

    - by bruno
    Hi! I have this warning "warning: assignment from incompatible pointer type " in this line: data1->transformed_block[l] = &transformed_block[l]; - void print_message_function ( void *ptr ) { dt *data; data = (dt *) ptr; printf("Dentro da thread Numero0: %ld\n", data->L_norm_NewBlock); pthread_exit(0); } typedef struct data_thread { long L_norm_NewBlock; int Bsize_X; int Bsize_Y; int *transformed_block[MAX_LEVEL]; long L_norm_OrigBlock; } dt; void function() { int *transformed_block[MAX_LEVEL]; pthread_t thread1; dt *data1; pthread_attr_t attr; pthread_attr_init(&attr); //Fills structure data1 = (dt *) malloc(sizeof(dt)); data1->transformed_block[l] = &transformed_block[l]; data1->L_norm_NewBlock=0; data1->Bsize_Y = Bsize_Y; data1->Bsize_X = Bsize_X; pthread_create(&thread1, &attr, (void *) &print_message_function, (void *) &data1); } I want to get rid of that warning, and the values i get inside the thread are wrong. For example data1-L_norm_NewBlock=0; in the thread guives me a differente value (not 0 like it should be).

    Read the article

  • Reading lines of data from text files using java

    - by razshan
    I have a text file with x amount of lines. each line holds a integer number. When the user clicks a button, an action is performed via actionlistener where it should list all the values as displayed on the text file. However, right now I have linenum set to 10 implying I already told the code that just work with 10 lines of the text file. So, if my text file has only 3 rows/lines of data...it will list those lines and for rest of the other 7 lines, it will spit out "null". I recall there is a way to use ellipsis to let the program know that you don't know the exact value but at the end it calculates it based on the given information. Where my given information will the number of lines with numbers(data). Below is part of the code. private class thehandler implements ActionListener{ public void actionPerformed(ActionEvent event){ BufferedReader inputFile=null; try { FileReader freader =new FileReader("Data.txt"); inputFile = new BufferedReader(freader); String MAP = ""; int linenum=10; while(linenum > 0) { linenum=linenum-1; MAP = inputFile.readLine();//read the next line until the specfic line is found System.out.println(MAP); } } catch( Exception y ) { y.printStackTrace(); } }}

    Read the article

  • jtable update data not visible

    - by Thomas n
    I am running into a problem similar to what I have read here about inserted data and added data not showing up on jtable. I have tried repaint() and revalidate(), but to no avail. Basically, I have two classes say A and B. A calls a function in class B to add a row of data to the table. Here is the code.(By the way I am using Netbeans 7.1.2 to add a table and then add some code to handle the update.) public void callUpdateTable(){ DefaultTableModel myModel = (DefaultTableModel)jTable1.getModel(); DateFormat dateFormate = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Object[] str = new Object[3]; Date date = new Date(); str[0] = dateFormate.format(date); str[1] = "Robot"; str[2] = "hello"; // myModel.addRow(str); myModel.insertRow(1, str); myModel.setValueAt("Hello", 1, 2); System.out.println("count = " + myModel.getValueAt(1, 2)); jTable1.repaint(); } The funny thing is on system print it prints out the value at the cell(1,2) I set the value, but doesn't show up on the table. Thank you for your help.

    Read the article

  • How to limit TCP writes to particular size and then block untlil the data is read

    - by ustulation
    {Qt 4.7.0 , VS 2010} I have a Server written in Qt and a 3rd party client executable. Qt based server uses QTcpServer and QTcpSocket facilities (non-blocking). Going through the articles on TCP I understand the following: the original implementation of TCP mentioned the negotiable window size to be a 16-bit value, thus maximum being 65535 bytes. But implementations often used the RFC window-scale-extension that allows the sliding window size to be scalable by bit-shifting to yield a maximum of 1 gigabyte. This is implementation defined. This could have resulted in majorly different window sizes on receiver and sender end as the server uses Qt facilities without hardcoding any window size limit. Client 1st asks for all information it can based on the previous messages from the server before handling the new (accumulating) incoming messages. So at some point Server receives a lot of messages each asking for data of several MB's. This the server processes and puts it into the sender buffer. Client however is unable to handle the messages at the same pace and it seems that client’s receiver buffer is far smaller (65535 bytes maybe) than sender’s transmit window size. The messages thus get accumulated at sender’s end until the sender’s buffer is full too after which the TCP writes on sender would block. This however does not happen as sender buffer is much larger. Hence this manifests as increase in memory consumption on the sender’s end. To prevent this from happening, I used Qt’s socket’s waitForBytesWritten() with timeout set to -1 for infinite waiting period. This as I see from the behaviour blocks the thread writing TCP data until the data has actually been sensed by the receiver’s window (which will happen when earlier messages have been processed by the client at application level). This has caused memory consumption at Server end to be almost negligible. is there a better alternative to this (in Qt) if i want to restrict the memory consumption at server end to say x MB's? Also please point out if any of my understandings is incorrect.

    Read the article

  • Navigating sorted XML data (XSLT)

    - by Andrew Parisi
    I have an XML file with company data in it, for 30 companies across 8 industries, on a portfolio page. The user has the option to sort this data by Industry, and this XML file will be added to constantly. This sorting is done in my XSL file using <xsl:choose>. Example: <xsl:when test="(invest[@investid='con'])"> <xsl:for-each select="$invest-port/portfolio/company[@industry='Communications']"> <xsl:sort select="name" /> <div class="invest-port-thumb"> <a> <xsl:attribute name="href"> <xsl:value-of select="link" /> </xsl:attribute> </a> </div> </xsl:for-each> </xsl:when> When navigating to an individual company's page, there are "previous" and "next" buttons at the bottom of the window. My issue is that I need these to dynamically link to the previous and next elements from within the XML data that has been sorted. Is this possible? Or is there an easier way to do this? (such as place each company in industry-divided XML files instead of one) Any insight would be greatly appreciated!

    Read the article

  • How to lazy load a data structure (python)

    - by Anton Geraschenko
    I have some way of building a data structure (out of some file contents, say): def loadfile(FILE): return # some data structure created from the contents of FILE So I can do things like puppies = loadfile("puppies.csv") # wait for loadfile to work kitties = loadfile("kitties.csv") # wait some more print len(puppies) print puppies[32] In the above example, I wasted a bunch of time actually reading kitties.csv and creating a data structure that I never used. I'd like to avoid that waste without constantly checking if not kitties whenever I want to do something. I'd like to be able to do puppies = lazyload("puppies.csv") # instant kitties = lazyload("kitties.csv") # instant print len(puppies) # wait for loadfile print puppies[32] So if I don't ever try to do anything with kitties, loadfile("kitties.csv") never gets called. Is there some standard way to do this? After playing around with it for a bit, I produced the following solution, which appears to work correctly and is quite brief. Are there some alternatives? Are there drawbacks to using this approach that I should keep in mind? class lazyload: def __init__(self,FILE): self.FILE = FILE self.F = None def __getattr__(self,name): if not self.F: print "loading %s" % self.FILE self.F = loadfile(self.FILE) return object.__getattribute__(self.F, name) What might be even better is if something like this worked: class lazyload: def __init__(self,FILE): self.FILE = FILE def __getattr__(self,name): self = loadfile(self.FILE) # this never gets called again # since self is no longer a # lazyload instance return object.__getattribute__(self, name) But this doesn't work because self is local. It actually ends up calling loadfile every time you do anything.

    Read the article

  • Persist data when the table was not mapped (JPA EclipseLink)

    - by enrique
    Hi everybody I need some help in persisting data into a table that has not been mapped... The issue is that the database we have has a table which all of its columns are foreign keys so by mapping the whole database all of the tables are correctly mapped. However that table called "category" is not mapped. The way in which we can browse the data is by passing for the table I mentioned using the @jointable annotation which was set by the system in the other tables with which "category" has a relation. So we can go ahead and using the collections and perform a query. But the issue comes when I want to persist data into that table because there´s no any entity. We tried to persist through the collections but no luck. Then I have just tried by creating the entity with its PK and Facade all by hand. However when I try to persist using the Merge method the system tries to perform an Insert when it is supposed to perform an Update. So obviously it returns an error. Does anybody have an idea on this situation? Thanks.-

    Read the article

  • Codeigniter Inputting session data from model for a simple authentication system

    - by user1616244
    Trying to put together a simple login authentication. Been at this for quite sometime, and I can't find where I'm going wrong. Pretty new to Codeigniter and OOP PHP. I know there are authentication libraries out there, but I'm not interested in using those. Model: function login($username, $password){ if ($this->db->table_exists($username)){ $this->db->where('username', $username); $this->db->where('password', $password); $query = $this->db->get($username); if($query->num_rows >= 1) { return true; $data = array( 'username' => $this->input->post('username'), 'login' => true ); $this->session->set_userdata($data); } } } Controller function __construct(){ parent::__construct(); $this->logincheck(); } public function logincheck(){ if ($this->session->userdata('login')){ redirect('/members'); } } If I just echo from the controller: $this-session-all_userdata(); I get an empty array. So the problem seems to be that the $data array in the model isn't being stored in the session.

    Read the article

  • INSERT..ON DUPLICATE KEY UPDATE - but NOT using the duplicate key to compare.

    - by calumbrodie
    I am trying to solve a problem I have inherited with poor treatment of different data sources. I have a user table that contains BOTH good and evil users. create table `users`( `user_id` int(13) NOT NULL AUTO_INCREMENT , `email` varchar(255) , `name` varchar(255) , PRIMARY KEY (`user_id`) ); In this table the primary key is currently set to be user_id. I have another table ('users_evil') which contains ONLY the evil users (all the users from this table are included in the first table) - the user_id's on this table do NOT correspond to those in the first table. I want to have all my users in one table, and simply flag which are good and which are evil. What I want to do is alter the user table and add a column ('evil') which defaults to 0. I then want to dump the data from my 'users_evil') table and then run an INSERT..ON DUPLICATE KEY UPDATE with this data into the first table (setting 'evil'=1 where the emails match) The problem is that the 'PK' is set to the user_id and not the 'email'. Any suggestions, or even another strategy to successfully achive this. Can I run this statement but treat another column as PK only for the duration of the statement.

    Read the article

  • How can I [simply] consume JSON Data in a Line of Business Web Application

    - by Atomiton
    I usually use JSON with jQuery to just return a string with html. However, I want to start to use Javascript objects in my code. What's the simplest way to get started using json objects on my page? Here's a sample Ajax call ( after $(document).ready( { ... }) of course: $('#btn').click(function(event) { event.preventDefault(); var out = $('#result'); $.ajax({ url: "CustomerServices.asmx/GetCustomersByInvoiceCount", success: function(msg) { // // Iterate through the json results and spit them out to a page? // }, data: "{ 'invoiceCount' : 100 }" }); }); My WebMethod: [WebMethod(Description="Gets customers with more than n invoices")] public List<Customer> GetCustomersByInvoiceCount(int? invoiceCount) { using (dbDataContext db = new dbDataContext()) { return db.Customers.Where(c => c.InvoiceCount >= invoiceCount); } } What gets returned: {"d":[{"__type":"Customer","Account":"1116317","Name":"SOME COMPANY","Address":"UNit 1 , 392 JOHN ST. ","LastTransaction":"\/Date(1268294400000)\/","HighestBalance":13922.34},{"__type":"Customer","Account":"1116318","Name":"ANOTHER COMPANY","Address":"UNIT #345 , 392 JOHN ST. ","LastTransaction":"\/Date(1265097600000)\/","HighestBalance":549.42}]} What I'd LIKE to know, is what are people generally doing with this returned json? Do you iterate through the properties and create an html table on the fly? Is there way to "bind" JSON data using a javascript version of reflection ( something like the .Net GridView Control ) Do you throw this returned data into a Javascript Object and then do something with it? An example of what I want to achieve is to have an plain ol' html page ( on a mobile device )with a list of a Salesperson's Customers. When one of those customers are clicked, the customer id gets sent to a webservice which retrieves the customer details that are relevant to a sales person. I know the SO talent pool is quite deep so I figured you all here would be able to guide in the right direction and give me a few ideas on the best way to approach this.

    Read the article

  • Retrieving my own data via FaceBook API

    - by goggin13
    I am building a website for a comedy group which uses Facebook as one of their marketing platforms; one of the requirements for the new site is to display all of their Facebook events on a calendar. Currently, I am just trying to put together a Python script which can pull some data from my own Facebook account, like a list of all my friends. I presume once I can accomplish this I can move to pulling more complicated data out of my clients account (since they have given me access to their account). I have looked at many of the posts here, and also went through the Facebook API documentation, including Facebook Connect, but am really beating my head against the wall. Everything I have read seems like overkill, as it involves setting up a good deal of infrastructure to allow my app to set up connections to any arbitrary user's account (who authorizes me). Shouldn't it be much simpler, given I only ever need to access 1 account? I cannot find a way to retrieve data without having to display the Facebook login window. I have a script which will retrieve all my friends, but it includes a redirect where I have to physically log myself in to Facebook. Would appreciate any advice or links, I just feel like I must be missing something simple. Thank you!

    Read the article

  • Get info from multiple files, match it and then display to end user, what is fastest?

    - by Patrick
    Hi, I need to build a website where we display data that is refreshed every 5minutes in a text file with a | separator. I currently use Java to do this. What I do now: I grab the textfile for every request through the website and process it and then display the data to the end user, this works fine, since Java can go through like 5000 lines of data fast, and when I filter it it is still extremely fast. However now the management wants the following: They added 3 textfiles with the | separator to it, and now want me to also read those files and match the information on certain fields, and if there is a match also display that information to the end user. I think soon enough, although Java is fast, I will run into trouble when 10 people want that information and I have to run through 4 total files matching the information. What can I do to make this process super fast? My Creative solutions so far: -Leave it this way, since Java is fast and end users can wait (probably less then 1second) -Have a background process that dumps new data into a MySQL database every 5minutes, since databases are extremely good at getting the same data from multiple tables. Thank you!

    Read the article

< Previous Page | 231 232 233 234 235 236 237 238 239 240 241 242  | Next Page >