Search Results

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

Page 51/296 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • ANSI SQL question - how to insert or update a record if it already exists?

    - by morpheous
    Although I am using mySQL (for now), I dont want any DB specific SQL. I am trying to insert a record if it doesn't exist, and update a field if it does exist. I want to use ANSI SQL. The table looks something like this: create table test_table (id int, name varchar(16), weight double) ; //test data insert into test_table (id, name, weight) values(1,'homer', 900); insert into test_table (id, name, weight) values(2,'marge', 85); insert into test_table (id, name, weight) values(3,'bart', 25); insert into test_table (id, name, weight) values(4,'lisa', 15); If the record exists, I want to update the weight (increase by say 10)

    Read the article

  • How active record is automatically setting up the autoincremental value of ID?

    - by piemesons
    Here this is what we are doing:-- an_order = Order.new an_order.name = "Dave Thomas" an_order.email = "[email protected]" an_order.address = "123 Main St" an_order.pay_type = "check" an_order.save Now it will insert a new row in orders table right. I m having a ID column in that table. Now suppose after inserting this record the value of the ID corresponding to this record is 100. Now how this 100 value came to know? Does the previous value of ID ie 99 (Suppose) is stored somewhere in some variable/file in the ORM layer or before inserting this value a query was fired to know about the last inserted value or database is itself doing that or anything else???

    Read the article

  • What is the effect on record size of reordering columns in PostgreSQL?

    - by Summer
    Since Postgres can only add columns at the end of tables, I end up re-ordering by adding new columns at the end of the table, setting them equal to existing columns, and then dropping the original columns. So, what does PostgreSQL do with the memory that's freed by dropped columns? Does it automatically re-use the memory, so a single record consumes the same amount of space as it did before? But that would require a re-write of the whole table, so to avoid that, does it just keep a bunch of blank space around in each record? Thanks! ~S

    Read the article

  • Limit user in sql plus to a single record in a table.

    - by BFK
    I have one employee table...this table has 5 coloumns (empname, empgsm, empsal, empaddr, empdep)...it has 10 records. i've created 10 users equivelent to the empnames coloumn in the table. When a user logs in with his empname aka username & password, he will be able to see only his record from the table. eg.Smith is an employee, a user called smith was created. when this user is in session, and types "Select * from Employee_table" he only gets the record that belongs to him, where empname is smith. how do i do this using privileges? thanks in advance

    Read the article

  • How to go through every record in sqllite db?

    - by Pavel
    Hi guys. I think it's kinda easy one but still I'm new to android programming so please have patience. I want to know how can I get the number of records (rows) in a specific table in my db. I need this so I can create a loop to go through every record and add each one of it to the specific Array and display it later on. This is the source: db.openDataBase(); // open connection with db Cursor c = db.getTitle(5); // loop here through db, right now I'm fetching only one record startManagingCursor(c); //adding areas to the list here Area o1 = new Area(); o1.setOrderName(c.getString(1) + c.getString(2)); m_areas.add(o1); db.close(); Does anyone can help me with this please? Thx in advance!

    Read the article

  • MYSQL - SQL query Getting single record for the similar records and populating other columns with which has more length

    - by Bujji
    Here is my case , I have a database table with below fields name place_code email phone address details estd others and example data if you look at the above example table First three records are talking about XYZ and place code 1020 . I want create a single record for these three records based on substring(name,1,4) place_code ( I am lucky here for all the similar records satisfies this condition and unique in the table .) For the other columns which record column length has max . For example again for the above 3 records email should be [email protected] , phone should be 657890 and details should be "testdetails" This should be done for all the table . (Some has single records and some has max 10 records ) Any help on query that helps me to get the desired result ? Thank You Regards Kiran

    Read the article

  • Change my MX record on my server to google MX?

    - by Dejan.S
    Hi. I got a windows server 2008 where I host a site, now I decided to have the email on google apps. I did add the MX records I get from them to my DNS settings on the server but with no luck. I recently started doing server stuff so I did like this. Server Manager / Roles / DNS Server / DNS / SERVERNAME / MYDOMAIN / Forward Lookup / New MX Host or child domain: What goes here? FQDN: here is my domain name, i think because I named the ns my domain? FQDN MX: here is the google MX record I got from them MSP: 10 I have no Idea where I go wrong but I thought I would ask you guys if any of you can maybe give me some tips on what to look for or any newbee mistake I do that you see from this little info. I really appreciate all help I could get on this.

    Read the article

  • Record demo and save as AVI for upload to YouTube?

    - by OverTheRainbow
    Hello I need to record the demo of a program in Windows, and save this into an AVI file so that I can upload it to YouTube. I tried Wink for this, but unless I overlooked it, it saves files as Flash (FLV), which YouTube refused. Is there an open-source alternative? I don't need something hardcore, just a tool that will let me save a demo, and insert a couple of slides where the demo stops to let the user read stuff and click on a button to resume watching. Thank you.

    Read the article

  • APIPA ip address in server 2003 dns for (same as parent folder record) can anyone suggest why this i

    - by dasko
    have a server 2003 domain controller i have installed active directory integrated dns under the forward lookup zone for domain_name.local i see an APIPA ip address that is set for (same as parent folder) with ip number 169.x.x.x looks like (same as parent folder) Host A 169.x.x.x (apipa subnet range) problem is, from other forums that i have read, that this is due to dual nics and one on that is not getting a dynamic or static ip address BUT... I only have one nic in this server? where could this be coming from and could it mess up other settings or not allowing the DC to be contacted? i am just wondering what symptoms could arise due to the record being there. any help would be greatly appreciated thanks.

    Read the article

  • My datacenter is unable to add PTR/rDNS record, then how can I prevent the mail outgoing from going to spam folder?

    - by gilzero
    I am having problem that mail sent out from my server all goes to recipient's spam folder. I am running Drupal sites on Linux server. CentOS w/ cPanel. Our users cannot receive email as the mail went to the spam folder. (such as registration email, contact form email) I was advised that I need to have PTR/rDNS record added for my host. I then contact my datacenter to add PTR/rDNS thing, unfortunately, the datacenter said they are unable to do it. So what can I do? Any other ways I can fix the problem? Thank you!

    Read the article

  • Does setting an A record for a root domain set it (automatically) for subdomains?

    - by Edan Maor
    I bought a domain from Dreamhost, but my servers are actually running on Amazon's AWS. I have an Elastic IP, say 1.1.1.1. In the Dreamhost panel, I've added an A record for my domain name, pointing it to 1.1.1.1. My question is, are all subdomains (e.g. www.mydomain.com, a.mydomain.com, etc.) automatically mapped to 1.1.1.1 as well, because the root is? Or do I have to add separate rules for each subdomain?

    Read the article

  • Why Windows Media Center (Vista 32-bit) unable to record TV Series?

    - by Alex R
    I can record individual shows just fine, but trying to setup the recording of a Series throws an error (something like, "unable to schedule, try restarting Media Center", pops up in the bottom right of the screen). Trying to access the "Other Showings" menu causes Media Center to crash ("check for a solution online" dialog comes up). The machine is a fresh reinstall of 32-bit Windows Vista from the HP recovery CDs, plus all Microsoft updates and service packs. Hardware: HP s3220n, AMD X2 5000+, 2GB RAM, 300GB free space on disk. Media Center came bundled. The "Media Center update for Vista" failed to install (it says, not appropriate for my computer). Any ideas? Thanks

    Read the article

  • Data Binding Error retrival

    - by saurabh
    Hello My scenarion is this 1- i have a Form which is dynamically generated with some XML configuration information. 2- i am attaching Data Binding for a textbox in Text_Loaded event a well as Validation Rules and i am attaching Validation.AddErrorHandler for showing message boxs 3- Data Source for the binding is a DataTable. 4- I am having record navigation buttons on the form generated in step 1 (Next,Last,First,Previous) 5- If user edits data with invalid values in record no 1 validation fires and it creats a red border 6-user press Next button to navigate to record no 2 but does not update error field in record no 1 i.e. she leaves record no 1 with some error not in my data source but on the form. 7- She came back to record no 1 , here my problem begins , Record no 1 is updated with old values and does not show error which she made. i know that ValidationRules will not allow wrong input to update my data source which is fine but i need to handle point no 7 , there is no direct way to handle this situation , any help is much appriciated

    Read the article

  • .save puts NULL in user_id field in Ruby on Rails

    - by mathee
    Here's the model file: class ProfileTag < ActiveRecord::Base def self.create_or_update(options = {}) id = options.delete(:id) record = find_by_id(id) || new record.id = id record.attributes = options puts "record.profile_id is" puts record.profile_id record.save! record end end This gives me the correct print out in my log. But it also says that there's a call to UPDATE that sets profile_id to NULL. I'm not sure I understand why the INSERT puts the value into profile_id properly, but then it sets it to NULL on an UPDATE. If you need more specifics, please let me know. I'm thinking that the save functionality does many things other than INSERTs into the database, but I don't know what I need to specify so that it will properly set profile_id.

    Read the article

  • Recording app sound in iphone

    - by user292127
    Hi, I am developing a music mixing app in iphone. It'll mix the music and user can compose a new music from it. I need to record this final music. I had used AVAudiorecorder to record this one. But no change. It can record sound from microphone but I need to record app sound. I had used audio queue call back function to record the audio. But when app runs I can hear the audio from my app and I couldn't hear any sound from recorded audio. There is no problem with recording since I can hear the audio recorded through microphone. But I need an offline recorder which can record the audio output of iphone, rather than the audio input through microphone. I need a recorder which can record audio using ipod touch (no microphone). Any help?

    Read the article

  • How do I record video to a local disk in AIR?

    - by Jim OHalloran
    I'm trying to record a webcam's video and audio to a FLV file stored on the users local hard disk. I have a version of this code working which uses NetConnection and NetStream to stream the video over a network to a FMS (Red5) server, but I'd like to be able to store the video locally for low bandwidth/flaky network situations. I'm using FLex 3.2 and AIR 1.5, so I don't believe there should be any sandbox restrictions which prevent this from occurring. Things I've seen: FileStream - Allows reading.writing local files but no .attachCamera and .attachAudio methids for creating a FLV. flvrecorder - Produces screen grabs from the web cam and creates it's own flv file. Doesn't support Audio. License prohibits commercial use. SimpleFLVWriter.as - Similar to flvrecorder without the wierd license. Doesn't support audio. This stackoverflow post - Which demonstrates the playback of a video from local disk using a NetConnection/NetStream. Given that I have a version already which uses NetStream to stream to the server I thought the last was most promising and went ahead and put together this demo application. The code compiles and runs without errors, but I don't have a FLV file on disk which the stop button is clicked. - <mx:Script> <![CDATA[ private var _diskStream:NetStream; private var _diskConn:NetConnection; private var _camera:Camera; private var _mic:Microphone; public function cmdStart_Click():void { _camera = Camera.getCamera(); _camera.setQuality(144000, 85); _camera.setMode(320, 240, 15); _camera.setKeyFrameInterval(60); _mic = Microphone.getMicrophone(); videoDisplay.attachCamera(_camera); _diskConn = new NetConnection(); _diskConn.connect(null); _diskStream = new NetStream(_diskConn); _diskStream.client = this; _diskStream.attachCamera(_camera); _diskStream.attachAudio(_mic); _diskStream.publish("file://c:/test.flv", "record"); } public function cmdStop_Click() { _diskStream.close(); videoDisplay.close(); } ]]> </mx:Script> <mx:VideoDisplay x="10" y="10" width="320" height="240" id="videoDisplay" /> <mx:Button x="10" y="258" label="Start" click="cmdStart_Click()" id="cmdStart"/> <mx:Button x="73" y="258" label="Stop" id="cmdStop" click="cmdStop_Click()"/> </mx:WindowedApplication> It seems to me that there's either something wrong with the above code which is preventing it from working, or NetStream just can't be abused in this wany to record video. What I'd like to know is, a) What (if anything) is wrong with the code above? b) If NetStream doesn't support recording to disk, are there any other alternatives which capture Audio AND Video to a file on the users local hard disk? Thanks in advance!

    Read the article

  • Java: opening and reading from a file without locking it.

    - by rogue780
    I need to be able to mimic 'tail -f' with Java. I'm trying to read a log file as it's being written by another process, but when I open the file to read it, it locks the file and the other process can't write to it anymore. Any help would be greatly appreciated! Here is the code that I'm using currently: public void read(){ Scanner fp = null; try{ fp = new Scanner(new FileReader(this.filename)); fp.useDelimiter("\n"); }catch(java.io.FileNotFoundException e){ System.out.println("java.io.FileNotFoundException e"); } while(true){ if(fp.hasNext()){ this.parse(fp.next()); } } }

    Read the article

  • How can I run Ruby specs and/or tests in MacVim without locking up MacVim?

    - by Henry
    About 6 months ago I switched from TextMate to MacVim for all of my development work, which primarily consists of coding in Ruby, Ruby on Rails and JavaScript. With TextMate, whenever I needed to run a spec or a test, I could just command+R on the test or spec file and another window would open and the results would be displayed with the 'pretty' format applied. If the spec or test was a lengthy one, I could just continue working with the codebase since the test/spec was running in a separate process/window. After the test ran, I could click through the results directly to the corresponding line in the spec file. Tim Pope's excellent rails.vim plugin comes very close to emulating this behavior within the MacVim environment. Running :Rake when the current buffer is a test or spec runs the file then splits the buffer to display the results. You can navigate through the results and key through to the corresponding spot in the file. The problem with the rails.vim approach is that it locks up the MacVim window while the test runs. This can be an issue with big apps that might have a lot of setup/teardown built into the tests. Also, the visual red/green html results that TextMate displays (via --format pretty, I'm assuming) is a bit easier to scan than the split window. This guy came close about 18 mos ago: http://cassiomarques.wordpress.com/2009/01/09/running-rspec-files-from-vim-showing-the-results-in-firefox/ The script he has worked with a bit of hacking, but the tests still ran within MacVim and locked up the current window. Any ideas on how to fully replicate the TextMate behavior described above in MacVim? Thanks!

    Read the article

  • algorithm q: Fuzzy matching of structured data

    - by user86432
    I have a fairly small corpus of structured records sitting in a database. Given a tiny fraction of the information contained in a single record, submitted via a web form (so structured in the same way as the table schema), (let us call it the test record) I need to quickly draw up a list of the records that are the most likely matches for the test record, as well as provide a confidence estimate of how closely the search terms match a record. The primary purpose of this search is to discover whether someone is attempting to input a record that is duplicate to one in the corpus. There is a reasonable chance that the test record will be a dupe, and a reasonable chance the test record will not be a dupe. The records are about 12000 bytes wide and the total count of records is about 150,000. There are 110 columns in the table schema and 95% of searches will be on the top 5% most commonly searched columns. The data is stuff like names, addresses, telephone numbers, and other industry specific numbers. In both the corpus and the test record it is entered by hand and is semistructured within an individual field. You might at first blush say "weight the columns by hand and match word tokens within them", but it's not so easy. I thought so too: if I get a telephone number I thought that would indicate a perfect match. The problem is that there isn't a single field in the form whose token frequency does not vary by orders of magnitude. A telephone number might appear 100 times in the corpus or 1 time in the corpus. The same goes for any other field. This makes weighting at the field level impractical. I need a more fine-grained approach to get decent matching. My initial plan was to create a hash of hashes, top level being the fieldname. Then I would select all of the information from the corpus for a given field, attempt to clean up the data contained in it, and tokenize the sanitized data, hashing the tokens at the second level, with the tokens as keys and frequency as value. I would use the frequency count as a weight: the higher the frequency of a token in the reference corpus, the less weight I attach to that token if it is found in the test record. My first question is for the statisticians in the room: how would I use the frequency as a weight? Is there a precise mathematical relationship between n, the number of records, f(t), the frequency with which a token t appeared in the corpus, the probability o that a record is an original and not a duplicate, and the probability p that the test record is really a record x given the test and x contain the same t in the same field? How about the relationship for multiple token matches across multiple fields? Since I sincerely doubt that there is, is there anything that gets me close but is better than a completely arbitrary hack full of magic factors? Barring that, has anyone got a way to do this? I'm especially keen on other suggestions that do not involve maintaining another table in the database, such as a token frequency lookup table :). This is my first post on StackOverflow, thanks in advance for any replies you may see fit to give.

    Read the article

  • What are some good ways to do intermachine locking?

    - by mike
    Our server cluster consists of 20 machines, each with 10 pids of 5 threads. We'd like some way to prevent any two threads, in any pid, on any machine, from modifying the same object at the same time. Our code's written in Python and runs on Linux, if that helps narrow things down. Also, it's a pretty rare case that two such threads want to do this, so we'd prefer something that optimizes the "only one thread needs this object" case to be really fast, even if it means that the "one thread has locked this object and another one needs it" case isn't great. What are some of the best practices?

    Read the article

  • The best JSF coding pattern for editing JPA entities using @RequestScoped only

    - by AlanObject
    I am in a project where I will write a lot of pages like this, so I want to use the most efficient (to write) coding pattern. Background: In the past I have used CODI's @ViewAccessScoped to preserve state between requests, and more recently I have started using flash scoped objects to save state. I can't use JSF @ViewScoped because I use CDI and they don't play well together. So I want to see if I can do this with only @RequestScoped backing beans. The page is designed like this (the p namespace is Primefaces): <f:metadata> <f:viewParam name="ID" value="#{backing.id}" /> </f:metadata> .... <h1>Edit Object Page</h1> <h:form id="formObj" rendered="#{backing.accessOK}"> <p:panelGrid columns="2"> <h:outputLabel value="Field #1:"/> <p:inputText value="#{backing.record.field1}" /> (more input fields) <h:outputLabel value="Action:" /> <h:panelGroup> <p:commandButton value="Save" action="#{backing.save}" /> <p:commandButton value="Cancel" action="backing.cancel" /> </h:panelGroup> </p:panelGrid> <p:messages showDetail="true" showSummary="true" /> </h:form> If the page is requested, the method accessOK() has the ability to keep the h:form from being rendered. Instead, the p:messages is shown with whatever FacesMessage(s) the accessOK() method cares to set. The pattern for the bean backing looks like this: @Named @RequestScoped public class Backing { private long id; private SomeJPAEntity record; private Boolean accessOK; public long getId() { return id; } public void setId(long value) { id = value; } public boolean accessOK() { if (accessOK != null) return accessOK; if (getRecord() == null) { // add a FacesMessage that explains the record // does not exist return accessOK = false; // note single = } // do any other access checks, such as write permissions return accessOK = true; } public SomeJPAEntity getRecord() { if (record != null) return record; if (getId() > 0) record = // get the record from DB else record = new SomeJPAEntity(); return record; } public String execute() { if (!accessOK()) return null; // bad edit // do other integrity checks here. If fail, set FacesMessages // and return null; if (getId() > 0) // merge the record back into the data base else // persist the record } } Here is what goes wrong with this model. When the Save button is clicked, a new instance of Backing is built, and then there are a lot of calls to the getRecord() getter before the setID() setter is called. So the logic in getRecord() breaks because it cannot rely on the id property being valid when it is called. When this was a @ViewAccessScoped (or ViewScoped) backing bean, then both the id and record properties are already set when the form is processed with the commandButton. Alternatively you can save those properties in flash storage but that has its own problems I want to avoid. So is there a way to make this programming model work within the specification?

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >