Search Results

Search found 17734 results on 710 pages for 'values'.

Page 37/710 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Having duplicate enumerator values

    - by whirlwin
    I'm creating a Tetris clone in C++, and I have an enum GameProperty, which is specified as follows: enum GameProperty { NUM_OF_TETROMINOES = 7, NUM_OF_TILES = 4, TETROMINO_ROTATIONS = 4 }; In my case, I only use these values when looping through a tetromino's tiles, e.g: for (int i = 0; i < TETROMINO_TILES; i++) { } Is it under any circumstance considered bad practice to have multiple enumerators with the same value?

    Read the article

  • Swap values for two rows in the same table in SQL Server

    - by AmRoSH
    I have table and I want to swap the values from two rows. I have the rows IDs of the two rows. Is there any query to do that? Here is an example. Before the query I have this: row1 : 1,2,3 row2 : 5,6,7 After the swap I want this: row1 : 5,6,7 row2 : 1,2,3 I don't want write it in .NET code because I think an SQL query is easier than that.

    Read the article

  • ValueError: Too Many Values to Unpack Aptana Studio 3

    - by GTyler
    I am working on exercise 13 from learnpythonthehardway.org. I should run this code: from sys import argv script, first, second, third = argv print "The script is called:", script print "Your first variable is:", first print "Your second variable is:", second print "Your third variable is:", third Then enter "python ex13.py first 2nd 3rd" on command line. However, I am using Aptana Studio 3 on Vista and I get the "ValueError: too many values to unpack" error. I am new to Python and Aptana so how can I enter the separate arguments here?

    Read the article

  • MySQL function to compare values in a db table against the previous

    - by Stuart
    Iam quite new to functions in SQL and I would like to create a function to compare values in a MySQL table against previous and I am not sure how to do this. For example (iId is the input value) DECLARE pVal INT(20); DECLARE val INT(20); SELECT price INTO pVal FROM products WHERE Id=iId; SELECT price FROM products; IF price == pVal THEN SET val = price; END IF; Thanks

    Read the article

  • how to generate primary key values while inserting data into table through pl/sql stored procedure

    - by thulasi policherla
    hi friends, I am trying to insert data into particular table through pl/sql stored procedure,my requirement is while inserting i should generate PRIMARY KEY values for particular column and also i should return that PRIMARY KEY value to output and one more thing is that for another column i should validate my string such that it should contain only characters not integers. please help me in writing code for the above requirement Thanks and regards thulasi policherla

    Read the article

  • MySQL - Add Values In Query And Return As Single Value

    - by Sjwdavies
    I'm trying to query a database, and return a set of values. Part of the data i'm trying to return is an insurance premium breakdown. Is it possible to run a query, that selects multiple fields, then adds then and returns them as a single value? I've seen SUM() but the examples i've seen show it as adding up the results of an entire field - where as i need it to add specific fields for each row returned. Any help is much appreciated.

    Read the article

  • Beautify Integer values for comparing as strings

    - by Zahra
    Hi. For some reason I need to enter my integer values to database as string, then I want to run a query on them and compare those integers as strings. Is there any way to beautify integer numbers (between 1 and 1 US billion as an example) so I can compare them as strings? Thanks in advance.

    Read the article

  • Converting html entities into their values in python

    - by tipu
    I use this regex on some input, [^a-zA-Z0-9@#] However this ends up removing lots of html special characters within the input, such as 227;, #1606;, #1588; (i had to remove the & prefix so that it wouldn't show up as the actual value..) is there a way that I can convert them to their values so that it will satisfy the regexp expression? I also have no idea why the text decided to be so big.

    Read the article

  • Different values for Time.now when using activerecord

    - by Josué Lima
    I have this weird situation: When I do on rails console Time.now or Time.zone.now I get the same values (suppose they run at the sime time: 2014-06-05 23:38:06 -0300) But when I use Time.now in a query like: Match.where("datetime = ?", Time.now) it returns the time 3 hours ahead! .to_sql output: SELECT `matches`.* FROM `matches` WHERE (datetime = '2014-06-06 02:38:06') any thoughts on that? Rails 4 Mysql 5.5

    Read the article

  • Extract two double Values from String using RegEx in Java

    - by tzippy
    I am reading a file by line and need to extract latitude and longitude from it. This how lines can looks: DE 83543 Rott am Inn Bayern BY Oberbayern Landkreis Rosenheim 47.983 12.1278 DE 21147 Hamburg Hamburg HH Kreisfreie Stadt Hamburg 53.55 10 What's for sure is, there are no dots surrounded by digits except for the ones representing the doubles. Unfortunately there are Values without a dot, so it's probably best to check for numbers from the end of the String. thanks for your help!

    Read the article

  • jquery drop down for selecting multiple values

    - by prince23
    Hi, i want to develop dropdown inside a check box . this url shows me how to do it. http://dropdown-check-list.googlecode.com/svn/trunk/demo.html but the code isnt given how to implement it in project. i need to bind my datatable to this dropdow. and once user selects a value and clicks on the button in .cs file i should be able to get all these values if any one knows how to slove this issue let me know thank you

    Read the article

  • C++ - 3 possible values in Variable?

    - by noryb009
    I need to store a 30 letter combination, but each letter can only be "0", "1" or "2". When I use sizeof(myString), it returns 32. I want to use this 30 letter combination to access a row of an array, so I'm wondering if it is possible to use a 3 value bool of some sort to store 1 of 3 values in.

    Read the article

  • Finding unique maximum values in a list using python

    - by mikip
    Hi I have a list of points as shown below points=[ [x0,y0,v0], [x1,y1,v1], [x2,y2,v2].......... [xn,yn,vn]] Some of the points have duplicate x,y values. What I want to do is to extract the unique maximum value x,y points For example, if I have points [1,2,5] [1,1,3] [1,2,7] [1,7,3] I would like to obtain the list [1,1,3] [1,2,7] [1,7,3] How can I do this in python Thanks

    Read the article

  • hibernate annotation- extending base class - values are not being set - strange error

    - by gt_ebuddy
    I was following Hibernate: Use a Base Class to Map Common Fields and openjpa inheritance tutorial to put common columns like ID, lastModifiedDate etc in base table. My annotated mappings are as follow : BaseTable : @MappedSuperclass public abstract class BaseTable { @Id @GeneratedValue @Column(name = "id") private int id; @Column(name = "lastmodifieddate") private Date lastModifiedDate; ... Person table - @Entity @Table(name = "Person ") public class Person extends BaseTable implements Serializable{ ... Create statement generated : create table Person (id integer not null auto_increment, lastmodifieddate datetime, name varchar(255), primary key (id)) ; After I save a Person object to db, Person p = new Person(); p.setName("Test"); p.setLastModifiedDate(new Date()); .. getSession().save(p); I am setting the date field but, it is saving the record with generated ID and LastModifiedDate = null, and Name="Test". Insert Statement : insert into Person (lastmodifieddate, name) values (?, ?) binding parameter [1] as [TIMESTAMP] - <null> binding parameter [2] as [VARCHAR] - Test Read by ID query : When I do hibernate query (get By ID) as below, It reads person by given ID. Criteria c = getSession().createCriteria(Person.class); c.add(Restrictions.eq("id", id)); Person person= c.list().get(0); //person has generated ID, LastModifiedDate is null select query select person0_.id as id8_, person0_.lastmodifieddate as lastmodi8_, person0_.name as person8_ from Person person0_ - Found [1] as column [id8_] - Found [null] as column [lastmodi8_] - Found [Test] as column [person8_] ReadAll query : //read all Query query = getSession().createQuery("from " + Person.class.getName()); List allPersons=query.list(); Corresponding SQL for read all select query select person0_.id as id8_, person0_.lastmodifieddate as lastmodi8_, person0_.name as person8_ from Person person0_ - Found [1] as column [id8_] - Found [null] as column [lastmodi8_] - Found [Test] as column [person8_] - Found [2] as column [id8_] - Found [null] as column [lastmodi8_] - Found [Test2] as column [person8_] But when I print out the list in console, its being more weird. it is selecting List of Person object with ID fields = all 0 (why all 0 ?) LastModifiedDate = null Name fields have valid values I don't know whats wrong here. Could you please look at it? FYI, My Hibernate-core version : 4.1.2, MySQL Connector version : 5.1.9 . In summary, There are two issues here Why I am getting All ID Fields =0 when using read all? Why the LastModifiedDate is not being inserted?

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >