Search Results

Search found 7391 results on 296 pages for 'record locking'.

Page 82/296 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • Searching for duplicate records within a text file where the duplicate is determined by only two fie

    - by plg
    First, Python Newbie; be patient/kind. Next, once a month I receive a large text file (think 7 Million records) to test for duplicate values. This is catalog information. I get 7 fields, but the two I'm interested in are a supplier code and a full orderable part number. To determine if the record is dupliacted, I compress all special characters from the part number (except . and #) and create a compressed part number. The test for duplicates becomes the supplier code and compressed part number combination. This part is fairly straight forward. Currently, I am just copying the original file with 2 new columns (compressed part and duplicate indicator). If the part is a duplicate, I put a "YES" in the last field. Now that this is done, I want to be able to go back (or better yet, at the same time) to get the previous record where there was a supplier code/compressed part number match. So far, my code looks like this: Compress Full Part to a Compressed Part and Check for Duplicates on Supplier Code and Compressed Part combination import sys import re import time ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ start=time.time() try: file1 = open("C:\Accounting\May Accounting\May.txt", "r") except IOError: print sys.stderr, "Cannot Open Read File" sys.exit(1) try: file2 = open(file1.name[0:len(file1.name)-4] + "_" + "COMPRESSPN.txt", "a") except IOError: print sys.stderr, "Cannot Open Write File" sys.exit(1) hdrList="CIGSUPPLIER|FULL_PART|PART_STATUS|ALIAS_FLAG|ACQUISITION_FLAG|COMPRESSED_PART|DUPLICATE_INDICATOR" file2.write(hdrList+chr(10)) lines_seen=set() affirm="YES" records = file1.readlines() for record in records: fields = record.split(chr(124)) if fields[0]=="CIGSupplier": continue #If incoming file has a header line, skip it file2.write(fields[0]+"|"), #Supplier Code file2.write(fields[1]+"|"), #Full_Part file2.write(fields[2]+"|"), #Part Status file2.write(fields[3]+"|"), #Alias Flag file2.write(re.sub("[$\r\n]", "", fields[4])+"|"), #Acquisition Flag file2.write(re.sub("[^0-9a-zA-Z.#]", "", fields[1])+"|"), #Compressed_Part dupechk=fields[0]+"|"+re.sub("[^0-9a-zA-Z.#]", "", fields[1]) if dupechk not in lines_seen: file2.write(chr(10)) lines_seen.add(dupechk) else: file2.write(affirm+chr(10)) print "it took", time.time() - start, "seconds." ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file2.close() file1.close() It runs in less than 6 minutes, so I am happy with this part, even if it is not elegant. Right now, when I get my results, I import the results into Access and do a self join to locate the duplicates. Loading/querying/exporting results in Access a file this size takes around an hour, so I would like to be able to export the matched duplicates to another text file or an Excel file. Confusing enough? Thanks.

    Read the article

  • postgresql insert value in table in serial value

    - by Jesse Siu
    my database using postgresql. the table pk is uing serial value.if i want to insert a record in table, do i need type pk or it will automatic contain id. Can you give me a example about how to insert a record in dataset CREATE TABLE dataset ( id serial NOT NULL, age integer NOT NULL, name character varying(32) NOT NULL, description text NOT NULL DEFAULT ''::text CONSTRAINT dataset_pkey PRIMARY KEY (id ) )

    Read the article

  • Are there free, low cost, or open source tools for matching name/address data?

    - by luiscolorado
    This question is related to Tools for matching name/address data. There is a number commercial tools provided by SAS, Oracle, Microsoft, etc., that allow to de-duplicate or merging names of individuals or companies coming from multiple sources. However, after reading the answers to the question mentioned before, I wondered why a seemingly interesting problem didn't receive any answers mentioning open source projects that could tackle the problem. Are you aware of any open source projects or algorithms to implement the so called "record linking", "record merging", or "clustering"?

    Read the article

  • nhibernate activerecord lazy collection with custom query

    - by George Polevoy
    What i'm trying to accomplish, is having a temporal soft delete table. table Project(ID int) table ProjectActual(ProjectID int, IsActual bit, ActualAt datetime) Now is it possible to map a collection of actual projects, where project is actual when there is no record in ProjectActual.ProjectID = ID, or the last record sorted by ActualAt descending has IsActual set to 1 (true)?

    Read the article

  • Which MySql line is faster:

    - by Camran
    I have a classified_id variable which matches one document in a MySql table. I am currently fetching the information about that one record like this: SELECT * FROM table WHERE table.classified_id = $classified_id I wonder if there is a faster approach, for example like this: SELECT 1 FROM table WHERE table.classified_id = $classified_id Wont the last one only select 1 record, which is exactly what I need, so that it doesn't have to scan the entire table but instead stops searching for records after 1 is found? Or am I dreaming this? Thanks

    Read the article

  • SQL Server 2005: Insert a row in a table and update the same row

    - by vikas
    eg:table pkey --guid annualpay datefrom dateto--if null means current record percentannualincrease percent annual increase will be calculated only if there is a difference in newly inserted and previously existing last differing value. percentannualincrease = ([newannualpay-just previous pay(if different from current)]/newannualpay)*100 eg newid(),5000,today,null,0--very first row newid(),5000,today+1,null(*),0 newid,5500,today+2,null(*),?????????????--> need to be calculated before insert *--insert will close the previous record by updating dateto=null to todays date How can I do this stuff in a trigger???

    Read the article

  • C# Flash ActiveX - Recording

    - by Dremation
    I wrote an application that monitors live streams from various sites. The application has done well but theres a feature that is highly requested. And that's the ability to record the stream. I'm current using the Adobe Flash ActiveX control to stream the videos from the various sites. IS there a way to record the stream? Whether it be with Flash ActiveX or another framework/control that you may know of.

    Read the article

  • Authenticating users in iPhone app

    - by Myron
    I'm developing an HTTP api for our web application. Initially, the primary consumer of the API will be an iPhone app we're developing, but I'm designing this with future uses in mind (such as mobile apps for other platforms). I'm trying to decide on the best way to authenticate users so they can access their accounts from the iPhone. I've got a design that I think works well, but I'm no security expert, so I figured it would be good to ask for feedback here. The design of the user authentication has 3 primary goals: Good user experience: We want to allow users to enter their credentials once, and remain logged in indefinitely, until they explicitly log out. I would have considered OAuth if not for the fact that the experience from an iPhone app is pretty awful, from what I've heard (i.e. it launches the login form in Safari, then tells the user to return to the app when authentication succeeds). No need to store the user creds with the app: I always hate the idea of having the user's password stored in either plain text or symmetrically encrypted anywhere, so I don't want the app to have to store the password to pass it to the API for future API requests. Security: We definitely don't need the intense security of a banking app, but I'd obviously like this to be secure. Overall, the API is REST-inspired (i.e. treating URLs as resources, and using the HTTP methods and status codes semantically). Each request to the API must include two custom HTTP headers: an API Key (unique to each client app) and a unique device ID. The API requires all requests to be made using HTTPS, so that the headers and body are encrypted. My plan is to have an api_sessions table in my database. It has a unique constraint on the API key and unique device ID (so that a device may only be logged into a single user account through a given app) as well as a foreign key to the users table. The API will have a login endpoint, which receives the username/password and, if they match an account, logs the user in, creating an api_sessions record for the given API key and device id. Future API requests will look up the api_session using the API key and device id, and, if a record is found, treat the request as being logged in under the user account referenced by the api_session record. There will also be a logout API endpoint, which deletes the record from the api_sessions table. Does anyone see any obvious security holes in this?

    Read the article

  • XSLT 2.0 Header Leaks into Transformed XML

    - by user1303797
    First, a thank you in advance. Second, this is my first post so apologies for any errors or wrongdoings. I am a noob w/ xml and xslt, and can't seem to figure this out. When I transform some xml using xslt 2.0, some of the headers from the xslt leaks into the new xml. It doesn't seem to do it in xslt 1.0 (granted the xslt is a little different). Here is the xml: <?xml version="1.0" encoding="ISO-8859-1" ?> <xml_content> <feed_name>feed</feed_name> <feed_info> <entry_1> <id>1</id> <pub_date>1320814800</pub_date> </entry_1> </feed_info> </xml_content> Here is the xslt: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/TR/xhtml1/strict"> <xsl:output method="xml" indent="yes" /> <xsl:template match="xml_content"> <Records> <xsl:for-each select="feed_info/entry_1"> <Record> <ID><xsl:value-of select="id" /></ID> <PublicationDate><xsl:value-of select='xs:dateTime("1970-01-01T00:00:00") + xs:integer(pub_date) * xs:dayTimeDuration("PT1S")'/></PublicationDate> </Record> </xsl:for-each> </Records> </xsl:template> </xsl:stylesheet> Here is the new xml. Look specifically at the first "Records" element. <?xml version="1.0" encoding="UTF-8"?> <Records xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/TR/xhtml1/strict"> <Record> <ID>1</ID> <PublicationDate>2011-11-09T05:00:00</PublicationDate> </Record> </Records>

    Read the article

  • Postgresql - Edit function signature

    - by drave
    POSTGRESQL 8.4.3 - i created a function with this signature CREATE OR REPLACE FUNCTION logcountforlasthour() RETURNS SETOF record AS realised i wanted to change it to this CREATE OR REPLACE FUNCTION logcountforlasthour() RETURNS TABLE(ip bigint, count bigint) record AS but when i apply that change in the query tool it isnt accepted or rather it is accepted, there is no syntax error, but the text of the function has not been changed. even if i run "DROP FUNCTION logcountforlasthour()" between edits the old syntax comes back if i edit the body of the function, thats fine, it changes but not the signature is there something i'm missing thanks

    Read the article

  • Rails controller not rendering correct view when form is force-submitted by Javascript

    - by whazzmaster
    I'm using Rails with jQuery, and I'm working on a page for a simple site that prints each record to a table. The only editable field for each record is a checkbox. My goal is that every time a checkbox is changed, an ajax request updates that boolean attribute for the record (i.e., no submit button). My view code: <td> <% form_remote_tag :url => admin_update_path, :html => { :id => "form#{lead.id}" } do %> <%= hidden_field :lead, :id, :value => lead.id %> <%= check_box :lead, :contacted, :id => "checkbox"+lead.id.to_s, :checked => lead.contacted, :onchange => "$('#form#{lead.id}').submit();" %> <% end %> </td> In my routes.rb, admin_update_path is defined by map.admin_update 'update', :controller => "admin", :action => "update", :method => :post I also have an RJS template to render back an update. The contents of this file is currently just for testing (I just wanted to see if it worked, this will not be the ultimate functionality on a successful save)... page << "$('#checkbox#{@lead.id}').hide();" When clicked, the ajax request is successfully sent, with the correct params, and the action on the controller can retrieve the record and update it just fine. The problem is that it doesn't send back the JS; it changes the page in the browser and renders the generated Javascript as plain text rather than executing it in-place. Rails does some behind-the-scenes stuff to figure out if the incoming request is an ajax call, and I can't figure out why it's interpreting the incoming request as a regular web request as opposed to an ajax request. I may be missing something extremely simple here, but I've kind-of burned myself out looking so I thought I'd ask for another pair of eyes. Thanks in advance for any info!

    Read the article

  • AWS for Android SDK host name error

    - by feelingtheblanks
    I'm trying to upload to AWS S3 by using thier AWS for Android SDK but both sample project within SDK and my project give the following error on devices while emulator runs without problem. So there's no problem with my AWS account. "Host name may not be null." Upload Code : s3Client.createBucket(Constants.getBucket()); PutObjectRequest por = new PutObjectRequest(Constants.getBucket(), record.getFile().getName(), record.getFile()); s3Client.putObject(por); Any help is appreciated.

    Read the article

  • Jquery datepicker icon hide

    - by Tony Borf
    I am using a Jquery dialog for both viewing a record and editing a record. When in edit mode the user can change the date using the datepicker. In viewmode I need to hide the datepicker icon and only show the date. Is there a way to toggle the datepicker icon on and off as needed?

    Read the article

  • asp.net mvc Records Based On other

    - by mazhar kaunain baig
    I want to create a listing view in which the record will be in this format(basically one record based on other, what approach i should follow) . My table Module1 Module1Feature Module1Feaure2 Module1Feature3 Module2 Module2Feature Module2Feature2 Module2Feature3 Basically Please Notice that the child records are based on the parent.

    Read the article

  • SQL Join Statement Issue

    - by coffeeaddict
    I'm tring to grab all fields from the latest Cash record, and then all fields from the related TransactionInfo record. I can't quite get this to work yet: select t.*, top 1 c.* from Cash c inner join TransactionInfo t on c.TransactionID = t.id order by createdOn desc

    Read the article

  • What does the below query explain?

    - by Parth
    What does the below query explain? SELECT * FROM `jos_menu` WHERE (id = 69 OR id = 72) I know its very silly question, but sometimes easy things creates mess in my skulls interpreter.. Pls help EDIT Its giving me record for both IDs, why is it doing so? It should five me the record for either 69 or 72....

    Read the article

  • Linq To Entities

    - by JkenshinN
    This has probably been answer already but I am trying to return the primary key after inserting a record to the database. Does anyone know how this is accomplish after the record has been created?

    Read the article

  • Any easy way to delete a user (having many to many relation with role) in acegi, grails?

    - by john
    Hi, In default acegi setting, person and authority have many to many relations. Thus, in addtion to people and authorities, there is a table authotiries-people. To delete a person (a user) I have to delete the related record in authotiries-people first....then come back to delete the record... the problem is: other people are still using this authority (ROLE) could some one enlighten me how to delete the user without deleting the authority? thanks.

    Read the article

  • Docmd.TransferText to update data

    - by every_answer_gets_a_point
    i am using Docmd.TransferText to import data from a text file into my access table. i would like it to do the following: if the record already exists, then update it if the record does not exist then add it how do i accomplish this? currently i have this line: DoCmd.TransferText acImportDelim, yesyes, "table3", "C:\requisition_data_dump.txt", True

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >