Search Results

Search found 6399 results on 256 pages for 'a record'.

Page 3/256 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Proper response for a REST insert - full new record, or just the record id value?

    - by Keith Palmer
    I'm building a REST API which allows inserts (POST, not idempotent) and updates (PUT, idempotent) requests to add/update database to our application. I'm wondering if there are any standards or best practices regarding what data we send back to the client in the response for a POST (insert) operation. We need to send back at least a record ID value (e.g. your new record is record #1234). Should we respond with the full object? (e.g. essentially the same response they'd get back from a "GET /object_type/1234" request) Should we respond with only the new ID value? (e.g. "{ id: 1234 }", which means that if they want to fetch the whole record they need to do an additional HTTP GET request to grab the full record) A redirect header pointing them to the URL for the full object? Something else entirely?

    Read the article

  • F# Optional Record Field

    - by akaphenom
    I have a F# record type and want one of the fields to be optional: type legComponents = { shares : int<share> ; price : float<dollar / share> ; totalInvestment : float<dollar> ; } type tradeLeg = { id : int ; tradeId : int ; legActivity : LegActivityType ; actedOn : DateTime ; estimates : legComponents ; ?actuals : legComponents ; } in the tradeLeg type I owuld like the the actuals field to be optional. I cant seem to figure it out nor can I seem to find a reliable example on the web. It seem like this sohuld be easy like let ?t : int = None but i realy can't seem to get this to work. Ugh - thank you T

    Read the article

  • Detect and record a sound with python

    - by Jean-Pierre
    I'm using this program to record a sound in python: import pyaudio import wave import sys chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format = FORMAT, channels = CHANNELS, rate = RATE, input = True, frames_per_buffer = chunk) print "* recording" all = [] for i in range(0, RATE / chunk * RECORD_SECONDS): data = stream.read(chunk) all.append(data) print "* done recording" stream.close() p.terminate() write data to WAVE file data = ''.join(all) wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb') wf.setnchannels(CHANNELS) wf.setsampwidth(p.get_sample_size(FORMAT)) wf.setframerate(RATE) wf.writeframes(data) wf.close() I want to change the program to start recording when sound is detected by the sound card input. Probably should compare the input sound level in Chunk, but how do this?

    Read the article

  • How to generate Doctrine models/classes that extend a custom record class

    - by Shane O'Grady
    When I use Doctrine to generate classes from Yaml/db each Base class (which includes the table definition) extends the Doctrine_Record class. Since my app uses a master and (multiple) slave db servers I need to be able to make the Base classes extend my custom record class to force writes to go to the master db server (as described here). However if I change the base class manually I lose it again when I regenerate my classes from Yaml/db using Doctrine. I need to find a way of telling Doctrine to extend my own Base class, or find a different solution to a master/slave db setup using Doctrine. Example generated model: abstract class My_Base_User extends Doctrine_Record { However I need it to be automatically generated as: abstract class My_Base_User extends My_Record { I am using Doctrine 1.2.1 in a new Zend Framework 1.9.6 application if it makes any difference.

    Read the article

  • SQL Server adding a record record manually to a view

    - by SelectDistinct
    I have a view which contains the data seen in the image below. The view is showing me how many working days are available in each month for the current financial year taking away any school/bank holidays. As the month of August has zero days available it has excluded this month from the view. As the total number of days available will always be zero for the month of August, then it seems acceptable to hardcode the SQL to always have 0 for August, and also an April-August record which will be the same as April-July. What would be the best way to add these 2 records, and where about in the code should it be placed see example of code layout: see link (answered question) for layout of code: SQL populate total working days per month minus bank holidays for current financial year

    Read the article

  • C# - Getting record from a row using DataRow

    - by pinkcupcake
    I'm trying to get record of a row using DataRow. Here's what I've done so far: uID = int.Parse(Request.QueryString["id"]); PhotoDataSetTableAdapters.MembersTableAdapter mem = new PhotoDataSetTableAdapters.MembersTableAdapter(); PhotoDataSet.MembersDataTable memTable = mem.GetMemberByID(uID); DataRow[] dr = memTable.Select("userID = uID"); string uName = dr["username"].ToString(); Then I got the error: Cannot implicitly convert type 'string' to 'int' The error points to "username". I don't know what's wrong because I'm just trying to assign a string variable to a string value. Anyone figures out the reason of the error? Please help and thanks.

    Read the article

  • Gwt-ext. Bean to record and record to bean.

    - by den bardadym
    I write a RIA application and my JPA beans must be decoded to push it in Store. My decisions are: Brute Force. If I have property 'aProp' in bean (and getter/setter for it) i create RecordDef, then Record, then Recrod.set('aProp', bean.getAProp()) and so on.. (it is terrible) I can write generator for creating a Factory of Records (it is my desision and i write it). For example: RecordFactory<User> factory = GWT.create(User.class); //User is entity I now that i need a reflection, BUT GWT have no implementation of reflection (some libraries emulates this, but they builds on generators) Exists the best way? Thanks, Den Bardadym.

    Read the article

  • Record 8 separate Line IN Channels from M-Audio Delta 1010 Card

    - by Peter Hoffmann
    I want to record the 8 separate Line IN Channels from my M-Audio Delta 1010 Card. The card is recogniced nicely and a can record a single channel via arecord -d 10 -f cd -t wav -D channel1 out2.wav. I've set up the different channels in ~/.asoundrc. Now if I want to record a second channel in parallel (arecord -d 10 -f cd -t wav -D channel2 out2.wav) I get the error arecord: main:564: audio open error: Device or resource busy As I understand the delta 1010 is a single Access Card, so only one application can access it at a time. Is this correct? The next step was to configure a dual channel input in .asoundrc # envy24 channel 1+2 only pcm.test { type plug ttable.0.0 1 ttable.0.1 1 slave.pcm ice1712 } Which works ok when I do a arecord -d 10 -f cd -t wav -D test -c 2 out.wav (BTW can anyone point me to a tool to split a multi channel wav into a file per channel?) But when I want to record the channels separately with (-I option) arecord -d 10 -f cd -t wav -D test -c 2 -I channel1.wav channel2.wav I get no recordings. Did I miss something with the configuration or what are my options to record all 8 channels via arecord. I've no experience with jackd. Is it an option to install jackd and record the line ins via jackd?

    Read the article

  • How do I use an include statement in a TXT record?

    - by Aglystas
    We have a client that is using an email service that requires a TXT domain key reocrd that is over 127 characters long. I'm pretty sure BIND allows this, however we run djbdns with tinydns and it looks as though it only supports txt records up to 127 characters. And the rest is being truncated. I was thinking I can do an include combining them, but I'm not really sure how. I was thinking of setting the value to somthing like... v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2GWCNaDTuC3include:bdk2._domainkey.mail.cutlerymania.com My thought is, will this grab the actual value located at that domain which only has one record which is a TXT record and simply append that information so the entire key record gets sent correctly?

    Read the article

  • DNS A vs NS record

    - by Tiddo
    I'm trying to understand DNS a bit better, but I still don't get A and NS records completely. As far as I understood, the A record tells which IP-address belongs to a (sub) domain, so far it was still clear to me. But as I understood, the NS record tells which nameserver points belongs to a (sub) domain, and that nameserver should tell which IP-address belongs to a (sub) domain. But that was already specified in the A record in the same DNS file. So can someone explain to me what the NS records and nameservers exactly do, because probably I understood something wrong. edit: As I understand you correctly, a NS record tells you were to find the DNS server with the A record for a certain domain, and the A record tells you which ip-address belongs to a domain. But what is the use of putting an A and an NS record in the same DNS file? If there is already an A record for a certain domain, then why do you need to point to another DNS server, which would probably give you the same information?

    Read the article

  • Paging with Find using Active Record

    - by Brian Rizzo
    I can't seem to find an answer to this question or a good example of how to accomplish what I am trying to do. I'm sure it's been posted or explained somewhere, but I am having trouble finding the exact solution I need. I am using ActiveRecord in Subsonic 3.0.0.3. When I do something like recordset = VehicleModel.Find(x => x.Model.StartsWith(SearchText)); I get back an IList of VehicleModel objects (or more simply a recordset), this is fine until I return too many records. I also cannot order the returned set of records (my grid will do this fine, but i'm sure it will be too slow if i have too many records). Being that Find is returning an IList there isn't much that I can run directly against this (again I may be overlooking something simple so please don't kill me). My question is can someone explain how to find data like i am above, sort it and get a page of data where a page is of size n? Am I going about this wrong? Am I even close to being on the right track?

    Read the article

  • Simple MySQL Query taking 45 seconds (Gets a record and its "latest" child record)

    - by Brian Lacy
    I have a query which gets a customer and the latest transaction for that customer. Currently this query takes over 45 seconds for 1000 records. This is especially problematic because the script itself may need to be executed as frequently as once per minute! I believe using subqueries may be the answer, but I've had trouble constructing it to actually give me the results I need. SELECT customer.CustID, customer.leadid, customer.Email, customer.FirstName, customer.LastName, transaction.*, MAX(transaction.TransDate) AS LastTransDate FROM customer INNER JOIN transaction ON transaction.CustID = customer.CustID WHERE customer.Email = '".$email."' GROUP BY customer.CustID ORDER BY LastTransDate LIMIT 1000 I really need to get this figured out ASAP. Any help would be greatly appreciated!

    Read the article

  • Core Data table record count

    - by user339633
    I have an entity called Person and it has a relationship called participatingGames, to another entity called GameParticipant. I (apparently) can retrieve the number of matches in the GameParticipant entity using this simple code in the Person object I created from the entity in the model: [self.participatingGames count]; However, I'd just like to retrieve the number of Person records and one might guess the syntax for this is just as simple. I have lots of books including those by Jeff LaMarche, but those sources and what I find around here make me wonder if I need to set up a fetchedResultsController just to know the count of some entity. My background is in SQL, so of course it seems odd that what would take 15 seconds to code in any other environment seems like such a well-guarded secret in Core Data. I'm using iPhone SDK 3.1.4 under OSX 10.5.8 Suggestions?

    Read the article

  • Can't insert a record in a oracle database using C#

    - by Gya
    try { int val4 = Convert.ToInt32(tbGrupa.Text); string MyConString = "Data Source=**;User ID=******;Password=*****"; OracleConnection conexiune = new OracleConnection(MyConString); OracleCommand comanda = new OracleCommand(); comanda.Connection = conexiune; conexiune.Open(); comanda.Transaction = conexiune.BeginTransaction(); int id_stud = Convert.ToInt16(tbCodStud.Text); string nume = tbNume.Text; string prenume = tbPrenume.Text; string initiala_tatalui = tbInitiala.Text; string email = tbEmail.Text; string facultate = tbFac.Text; int grupa = Convert.ToInt16(tbGrupa.Text); string serie = tbSeria.Text; string forma_de_inv = tbFormaInvatamant.Text; DateTime data_acceptare_coordonare = dateTimePicker1.Value; DateTime data_sustinere_licenta = dateTimePicker2.Value; string sustinere = tbSustinereLicenta.Text; string parola_acces = tbParola.Text; try { comanda.Parameters.AddWithValue("id_stud", id_stud); comanda.Parameters.AddWithValue("nume", nume); comanda.Parameters.AddWithValue("prenume", prenume); comanda.Parameters.AddWithValue("initiala_tatalui", initiala_tatalui); comanda.Parameters.AddWithValue("facultate", facultate); comanda.Parameters.AddWithValue("email", email); comanda.Parameters.AddWithValue("seria", serie); comanda.Parameters.AddWithValue("grupa", grupa); comanda.Parameters.AddWithValue("forma_de_inv", forma_de_inv); comanda.Parameters.AddWithValue("data_acceptare_coordonare", data_acceptare_coordonare); comanda.Parameters.AddWithValue("data_sustinere_licenta", data_sustinere_licenta); comanda.Parameters.AddWithValue("sustinere_licenta", sustinere); comanda.Parameters.AddWithValue("parola_acces", parola_acces); comanda.Transaction.Commit(); MessageBox.Show("Studentul " + tbNume.Text + " " + tbPrenume.Text + " a fost adaugat în baza de date!"); } catch (Exception er) { comanda.Transaction.Rollback(); MessageBox.Show("ER1.1:" + er.Message); MessageBox.Show("ER1.2:" + er.StackTrace); } finally { conexiune.Close(); } } catch (Exception ex) { MessageBox.Show("ER2.1:"+ex.Message); MessageBox.Show("ER2.2:"+ex.StackTrace); }

    Read the article

  • Building Active Record Conditions in an array - private method 'scan' called error

    - by Nick
    Hi, I'm attempting to build a set of conditions dynamically using an array as suggested in the first answer here: http://stackoverflow.com/questions/1658990/one-or-more-params-in-model-find-conditions-with-ruby-on-rails. However I seem to be doing something incorrectly and I'm not sure if what I'm trying is fundamentally unsound or if I'm simply botching my syntax. I'm simplifying down to a single condition here to try to illustrate the issue as I've tried to built a simple Proof of concept along these lines before layering on the 5 different condition styles I'm contending with. This works: excluded.push 12 excluded.push 30 @allsites = Site.all(:conditions => ["id not in (?)", excluded]) This results in a private method 'scan' called error: excluded.push 12 excluded.push 30 conditionsSet << ["id not in (?)", excluded] @allsites = Site.all(:conditions => conditionsSet) Thanks for any advice. I wasn't sure if the proper thing was to put this as a followup item to the related question/answers I noted at the top. Since I've got a problem not an answer. If there is a better way to post this related to the existing post please let me know.

    Read the article

  • Find record whose field 'name' not contained within any other record

    - by charlie
    I have a model Foo with a String bar and a String name. Some records' bar contain the name of other records in them. This is intentional. I want to find the "root Foo" records - that is, the ones where their name do not appear in the bar records of any other Foo records. Example: Foo id: 1 name: 'foo1' bar: 'something something' id: 2 name: 'foo2' bar: 'foo1 something' id: 3 name: 'foo3' bar: 'foo1, foo4' My method root_foos would return foo2 and foo3 since their names do not appear in any bar string. edit: I don't want to use a relation or foreign key here - just this method.

    Read the article

  • cloudflare's mx record should set cname or A records

    - by user7787
    The cloudflare offical support said https://support.cloudflare.com/hc/en-us/articles/200168876-My-email-or-mail-stopped-working-What-should-I-do- But traditionally mx record should not set as cname http://www.exchangepedia.com/blog/2006/12/should-mx-record-point-to-cname-records.html But cloudflare has a service called "cname Flattening" is it related for a reason to set cname as mx records? So should i set cloudflare's mx record as cname ?

    Read the article

  • How can I get SQL Server transactions to use record-level locks?

    - by Joe White
    We have an application that was originally written as a desktop app, lo these many years ago. It starts a transaction whenever you open an edit screen, and commits if you click OK, or rolls back if you click Cancel. This worked okay for a desktop app, but now we're trying to move to ADO.NET and SQL Server, and the long-running transactions are problematic. I found that we'll have a problem when multiple users are all trying to edit (different subsets of) the same table at the same time. In our old database, each user's transaction would acquire record-level locks to every record they modified during their transaction; since different users were editing different records, everyone gets their own locks and everything works. But in SQL Server, as soon as one user edits a record inside a transaction, SQL Server appears to get a lock on the entire table. When a second user tries to edit a different record in the same table, the second user's app simply locks up, because the SqlConnection blocks until the first user either commits or rolls back. I'm aware that long-running transactions are bad, and I know that the best solution would be to change these screens so that they no longer keep transactions open for a long time. But since that would mean some invasive and risky changes, I also want to research whether there's a way to get this code up and running as-is, just so I know what my options are. How can I get two different users' transactions in SQL Server to lock individual records instead of the entire table? Here's a quick-and-dirty console app that illustrates the issue. I've created a database called "test1", with one table called "Values" that just has ID (int) and Value (nvarchar) columns. If you run the app, it asks for an ID to modify, starts a transaction, modifies that record, and then leaves the transaction open until you press ENTER. I want to be able to start the program and tell it to update ID 1; let it get its transaction and modify the record; start a second copy of the program and tell it to update ID 2; have it able to update (and commit) while the first app's transaction is still open. Currently it freezes at step 4, until I go back to the first copy of the app and close it or press ENTER so it commits. The call to command.ExecuteNonQuery blocks until the first connection is closed. public static void Main() { Console.Write("ID to update: "); var id = int.Parse(Console.ReadLine()); Console.WriteLine("Starting transaction"); using (var scope = new TransactionScope()) using (var connection = new SqlConnection(@"Data Source=localhost\sqlexpress;Initial Catalog=test1;Integrated Security=True")) { connection.Open(); var command = connection.CreateCommand(); command.CommandText = "UPDATE [Values] SET Value = 'Value' WHERE ID = " + id; Console.WriteLine("Updating record"); command.ExecuteNonQuery(); Console.Write("Press ENTER to end transaction: "); Console.ReadLine(); scope.Complete(); } } Here are some things I've already tried, with no change in behavior: Changing the transaction isolation level to "read uncommitted" Specifying a "WITH (ROWLOCK)" on the UPDATE statement

    Read the article

  • Do we need Record Level Locking when we already have Transaction for online ordering? (of concert ti

    - by Jian Lin
    For online ordering of concert seat or airline ticket, do we need Record Level Locking or is Transaction good enough? For concert ticket (say, seat Number 20B), or airline ticket (even with overbooking, the limit is 210, for example), I think the website cannot lock any record or begin transaction when showing the ticket purchase screen. But after the user clicks "Confirm Purchase", then the server should Begin a Transaction, Purchase Seat Number 20B, and try to Commit. If another user already bought Seat 20B in a previous transaction, then it is the "Commit" part that the current transaction will fail? So... we don't need Record Level Locking? Do Transactions always go serialized (one after another), so that's why we can know for sure there is no "race condition"? In what situation is Record Level Locking needed then?

    Read the article

  • Unable to record sound from web browser (firefox / chromium ) using recordmydesktop

    - by thamurath
    I have to do some screencast tutorials and i am using recordmydesktop with gtk frontend to do it. I need to record also the sound and here is where i have found the problem. It took me some time, but now I can record the sound from almost every application in my desktop ... almost. I need to capture some sound from a web application using java, but when i load the page nothing appears in the playback tab of pavucontrol. I think this is the problem, because if there is no sound stream i think the recordmydesktop program thinks there is no sound to record ... the funny thing is that I can ear the sound in my speakers! I have tried with Firefox and Chromium with no success. Although I have been able to record youtube videos without problem, so it seems that java is the key here. Any suggestion or idea? P.S.: I am using Ubuntu 11.10 with this configuration. ( if more information is needed please let me know) sight i cannot post images ... so I have an audigy2 sound card using Analog Stereo Output profile. I have also an "Internal Audio" device, but i have it with the "Off" profile. In recordmydesktop-Advanced-Sound: Device = default

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >