Search Results

Search found 18329 results on 734 pages for 'interpret order'.

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

  • JavaScript: How to reverse order=[] arrays from last to first?

    - by Binyamin
    My js code does POST order.php?order[]=1&order[]=2&order[]=3&order[]=4&order[]=5&&action=update How to reverse it to order.php?order[]=5&order[]=4&order[]=3&order[]=2&order[]=1&&action=update ? JavaScript: order=[]; //var reversed = $(this).sortable("serialize").split("&").reverse().join("&"); //var order = reversed + '&action=update'; //unfortunately it does not work so $('#list ul').children('li').each(function(idx, elm) { order.push(elm.id.split('-')[1]) }); $.post('order.php', {'order[]': order, action: 'update'}); HTML: <ul> <li id="oreder-5">5</li> <li id="oreder-4">4</li> <li id="oreder-3">3</li> <li id="oreder-2">2</li> <li id="oreder-1">1</li> <ul>

    Read the article

  • How to interpret number of URL errors in Google webmaster tools

    - by user359650
    Recently Google has made some changes to Webmaster tools which are explained below: http://googlewebmastercentral.blogspot.com/2012/03/crawl-errors-next-generation.html One thing I could not find out is how to interpret the number of errors over time. At the end of February we've recently migrated our website and didn't implement redirect rules for some pages (quite a few actually). Here is what we're getting from the Crawl errors: What I don't know is if the number of errors is cumulative over time or not (i.e. if Google bots crawl your website on 2 different days and find 1 separate issue on each day, whether they will report 1 error for each day, or 1 for the 1st, and 2 for the 2nd). Based on the Crawl stats we can see that the number of requests made by Google bots doesn't increase: Therefore I believe the number of errors reported is cumulative and that an error detected on 1 day is taken into account and reported on the subsequent days until the underlying problem is fixed and the page it's crawled again (or if you manually Mark as fixed the error) because if you don't make more requests to a website, there is no way you can check new pages and old pages at the same time. Q: Am I interpreting the number of errors correctly?

    Read the article

  • Advantage Database Server ORDER BY behaviour

    - by ie
    I'm using ADS v10 beta. I'm trying to numerate ordered resultset. 1) ORDER BY in nested queries. I need to use nested SELECT for some calculations: SELECT Name, Value, ROWNUM() FROM (SELECT * FROM MainTable WHERE Value > 0 ORDER BY Value) a And I'm getting Expected lexical element not found: ) There was a problem parsing the table names after the FROM keyword in your SELECT statement. Everything is working well when the ORDER BY is removed. Although, I found the sample in the Help, it looks like my query (more complex, indeed): SELECT * FROM (SELECT TOP 10 empid, fullname FROM branch1 ORDER BY empid) a UNION SELECT empid, fullname FROM branch2 ORDER BY empid 2) ORDER BY + ROWNUM(). I used the nested query in the example above, to numerate ordered rows. Is there are any chance to avoid nested query? In the SQL Server I can do something like this: SELECT Name, Value, ROW_NUMBER() OVER(ORDER BY Value) FROM MainTable WHERE Value > 1 ORDER BY Value Please advice. Thanks.

    Read the article

  • Selecting data in clustered index order without ORDER BY

    - by kcrumley
    I know there is no guarantee without an ORDER BY clause, but are there any techniques to tune SQL Server tables so they're more likely to return rows in clustered index order, without having to specify ORDER BY every single time I want to run a super-quick ad hoc query? For example, would rebuilding my clustered index or updating statistics help? I'm aware that I can't count on a query like: select * from AuditLog where UserId = 992 to return records in the order of the clustered index, so I would never build code into an application based on this assumption. But for simple ad hoc queries, on almost all of my tables, the data consistently comes out in clustered index order, and I've gotten used to being able to expect the most recent results to be at the bottom. Out of all the many tables we use, I've only noticed two ever giving me results in an unpredicted order. This is really just an annoyance, but it would be nice to be able to minimize it. In case this is relevant because of page boundary issues or something like that, I should mention that one of the tables that has inconsistent ordering, the AuditLog table, is the longest table we have that has a clustered index on an identity column. Also, this database has recently been moved from SQL 2005 to SQL 2008, and we've seen no noticeable change in this behavior.

    Read the article

  • What is a good way to assign order #s to ordered rows in a table in Sybase

    - by DVK
    I have a table T (structure below) which initially contains all-NULL values in an integer order column: col1 varchar(30), col2 varchar(30), order int NULL I also have a way to order the "colN" columns, e.g. SELECT * FROM T ORDER BY some_expression_involving_col1_and_col2 What's the best way to assign - IN SQL - numeric order values 1-N to the order table, so that the order values match the order of rows returned by the above ORDER BY? In other words, I would like a single query (Sybase SQL syntax so no Oracle's rowcount) which assigns order values so that SELECT * FROM T ORDER BY order returns 100% same order of rows as the query above. The query does NOT necessarily need to update the table T in place, I'm OK with creating a copy of the table T2 if that'll make the query simpler. NOTE1: A solution must be real query or a set of queries, not involving a loop or a cursor. NOTE2: Assume that the data is uniquely orderable according to the order by above - no need to worry about situation when 2 rows can be assigned the same order at random. NOTE3: I would prefer a generic solution, but if you wish a specific example of ordering expression, let's say: SELECT * FROM T ORDER BY CASE WHEN col1="" THEN "AAAAAA" ELSE col1 END, ISNULL(col2, "ZZZ")

    Read the article

  • Column order can matter

    - by Dave Ballantyne
    Ordinarily, column order of a SQL statement does not matter. Select a,b,c from table will produce the same execution plan as   Select c,b,a from table However, sometimes it can make a difference.   Consider this statement (maxdop is used to make a simpler plan and has no impact to the main point):   select SalesOrderID, CustomerID, OrderDate, ROW_NUMBER() over (Partition By CustomerId order by OrderDate asc) as RownAsc, ROW_NUMBER() over (Partition By CustomerId order by OrderDate Desc) as RownDesc from sales.SalesOrderHeader order by CustomerID,OrderDateoption(maxdop 1) If you look at the execution plan, you will see similar to this That is three sorts.  One for RownAsc,  one for RownDesc and the final one for the ‘Order by’ clause.  Sorting is an expensive operation and one that should be avoided if possible.  So with this in mind, it may come as some surprise that the optimizer does not re-order operations to group them together when the incoming data is in a similar (if not exactly the same) sorted sequence.  A simple change to swap the RownAsc and RownDesc columns to produce this statement : select SalesOrderID, CustomerID, OrderDate, ROW_NUMBER() over (Partition By CustomerId order by OrderDate Desc) as RownDesc , ROW_NUMBER() over (Partition By CustomerId order by OrderDate asc) as RownAsc from Sales.SalesOrderHeader order by CustomerID,OrderDateoption(maxdop 1) Will result a different and more efficient query plan with one less sort. The optimizer, although unable to automatically re-order operations, HAS taken advantage of the data ordering if it is as required.  This is well worth taking advantage of if you have different sorting requirements in one statement. Try grouping the functions that require the same order together and save yourself a few extra sorts.

    Read the article

  • Convert a post-order binary tree traversal index to an level-order (breadth-first) index

    - by strfry
    Assuming a complete binary tree, each node can be adressed with the position it appears in a given tree traversal algorithm. For example, the node indices of a simple complete tree with height 3 would look like this: breadth first (aka level-order): 0 / \ 1 2 / \ / \ 3 4 5 6 post-order dept first: 6 / \ 2 5 / \ / \ 0 1 3 4 The height of the tree and an index in the post-order traversal is given. How can i calculate the breadth first index from this information?

    Read the article

  • Need to preserve order of elements sent in JSON from Java

    - by Kush
    I'm using JSON.org APIs for Java to use JSON in my JSP webapp, I know JSONObject doesn't preserve order of elements the way they are put into it and one has to use JSONArray for that but I don't know how to use it since I need to send key and value both as received from the database, and here I'm sending data to jQuery via JSON where I need the order of data to be maintained. Following is my servlet code, where I'm getting results from the database using ORDER BY and hence I want the order to be exact as returned from the database. Also this JSON object requested using $.post method of jQuery and is used to populate dropdown on reciever page. ResultSet rs = st.executeQuery("SELECT * FROM tbl_state order by state_name"); JSONObject options = new JSONObject(); while(rs.next()) options.put(rs.getString("state_id"),rs.getString("state_name")); response.setContentType("application/json"); response.setCharacterEncoding("UTF-8"); response.getWriter().write(options); Thanks.

    Read the article

  • Nhibernate criteria query inserts an extra order by expression when using JoinType.LeftOuterJoin and Projections

    - by Aaron Palmer
    Why would this nhibernate criteria query produce the sql query below? return Session.CreateCriteria(typeof(FundingCategory), "fc") .CreateCriteria("FundingPrograms", "fp") .CreateCriteria("Projects", "p", JoinType.LeftOuterJoin) .Add(Restrictions.Disjunction() .Add(Restrictions.Eq("fp.Recipient.Id", recipientId)) .Add(Restrictions.Eq("p.Recipient.Id", recipientId)) ) .SetProjection(Projections.ProjectionList() .Add(Projections.GroupProperty("fc.Name"), "fcn") .Add(Projections.Sum("fp.ObligatedAmount"), "fpo") .Add(Projections.Sum("p.ObligatedAmount"), "po") ) .AddOrder(Order.Desc("fpo")) .AddOrder(Order.Desc("po")) .AddOrder(Order.Asc("fcn")) .List<object[]>(); SELECT this_.Name as y0_, sum(fp1_.ObligatedAmount) as y1_, sum(p2_.ObligatedAmount) as y2_ FROM fundingCategories this_ inner join fundingPrograms fp1_ on this_.fundingCategoryId = fp1_.fundingCategoryId left outer join projects p2_ on fp1_.fundingProgramId = p2_.fundingProgramId WHERE (fp1_.recipientId = 6 /* @p0 */ or p2_.recipientId = 6 /* @p1 */) GROUP BY this_.Name ORDER BY p2_.name asc, y1_ desc, y2_ desc, y0_ asc It is incorrectly putting the p2_name asc into the ORDER BY statement, and causing it to crash. This only happens when I use JoinType.LeftOuterJoin on my Projects criteria. Is this a known nhibernate bug? I'm using nhibernate 2.0.1.4000. Thanks for any insight.

    Read the article

  • Creating an Order Column for encrypted data

    - by SetiSeeker
    I am saving encrypted data to a database. Is there a way I can create a "hashcode" or fingerprint or checksum of the plain text data, that if I sort / order by on the "hashcode" the order would be the same as if I had saved the plain text data and perform the same sort / order by operation on it? I basically need a SOUNDEX() type function that will give me a value that will maintain the order of the plain text data. I would then save both encrypted data and the "hashcode" and when querying the data order by the "hashcode" field. I need to perform this in the application and preferably not in the SQL DB if at all possible. I am using Entity Framework and SQL 2008 and C# 4.0.

    Read the article

  • Numeric Order By In Transact SQL (Ordering As String Instead Of Int)

    - by Pyronaut
    I have an issue where I am trying to order a result set by what I believe to be a numberic column in my database. However when I get the result set, It has sorted the column as if it was a string (So alphabetically), instead of sorting it as an int. As an example. I have these numbers, 1 , 2, 3, 4, 5, 10, 11 When I order by in Transact SQL, I get back : 1, 10, 11, 2, 3, 4, 5 I had the same issue with Datagridview's a while back, And the issue was because of the sorting being done as if it was a string. I assume the same thing is happening here. My full SQL code is : SELECT TOP (12) DATEPART(YEAR, [OrderDate]) AS 'Year', DATEPART(MONTH, [OrderDate]) AS 'Month' , COUNT(OrderRef) AS 'OrderCount' FROM [Order] WHERE [Status] LIKE('PaymentReceived') OR [Status] LIKE ('Shipped') GROUP BY DATEPART(MONTH, [OrderDate]), DATEPART(YEAR, [OrderDate]) ORDER BY DATEPART(YEAR, OrderDate) DESC, DATEPART(MONTH, OrderDate) desc DO NOTE The wrong sorting only happens when I cam calling the function from Visual Studio. As in my code is : using (SqlConnection conn = GetConnection()) { string query = @"SELECT TOP (12) DATEPART(YEAR, [OrderDate]) AS 'Year', DATEPART(MONTH, [OrderDate]) AS 'Month' , COUNT(OrderRef) AS 'OrderCount' FROM [Order] WHERE [Status] LIKE('PaymentReceived') OR [Status] LIKE ('Shipped') GROUP BY DATEPART(MONTH, [OrderDate]), DATEPART(YEAR, [OrderDate]) ORDER BY DATEPART(YEAR, OrderDate) DESC, DATEPART(MONTH, OrderDate) desc"; SqlCommand command = new SqlCommand(query, conn); command.CommandType = CommandType.Text; using (SqlDataReader reader = command.ExecuteReader()) etc. When I run the statement in MSSQL server, there is no issues. I am currently using MSSQL 2005 express edition, And Visual Studio 2005. I have tried numerous things that are strewn across the web. Including using Convert() and ABS() to no avail. Any help would be much appreciated.

    Read the article

  • ORDER BY in a Sql Server 2008 view

    - by eidylon
    Hi all... we have a view in our database which has an ORDER BY in it. Now, I realize views generally don't order, because different people may use it for different things, and want it differently ordered. This view however is used for a VERY SPECIFIC use-case which demands a certain order. (It is team standings for a soccer league.) The database is Sql Server 2008 Express, v.10.0.1763.0 on a Windows Server 2003 R2 box. The view is defined as such: CREATE VIEW season.CurrentStandingsOrdered AS SELECT TOP 100 PERCENT *, season.GetRanking(TEAMID) RANKING FROM season.CurrentStandings ORDER BY GENDER, TEAMYEAR, CODE, POINTS DESC, FORFEITS, GOALS_AGAINST, GOALS_FOR DESC, DIFFERENTIAL, RANKING It returns: GENDER, TEAMYEAR, CODE, TEAMID, CLUB, NAME, WINS, LOSSES, TIES, GOALS_FOR, GOALS_AGAINST, DIFFERENTIAL, POINTS, FORFEITS, RANKING Now, when I run a SELECT against the view, it orders the results by GENDER, TEAMYEAR, CODE, TEAMID. Notice that it is ordering by TEAMID instead of POINTS as the order by clause specifies. However, if I copy the SQL statement and run it exactly as is in a new query window, it orders correctly as specified by the ORDER BY clause.

    Read the article

  • How to interpret this crontab command?

    - by Bakhtiyor
    I know that if I wrote in crontab -e following command 01 04 * * * somecommand then it will run somecommand at 4:01am on every day of every month. What happens if I wrote * * * * * somecommand? Will it run somecommand every single minute? Will this syntax work also? And it is possible to use special strings like @reboot, @daily, etc as it is explained here. At what time of the day somecommand will be executed if I write @daily somecommand command?

    Read the article

  • Webcast on Monday, July 22 - Discover the Key to Profitable Order Fulfillment

    - by Pam Petropoulos
    When it comes to order fulfillment, organizations are challenged by the increasing complexity of global supply chains and an explosion of order and delivery channels. Attend this webcast on Monday, July 22 and hear Steve Banker, Service Director for Supply Chain Management at ARC Advisory Group, discuss how distributed order management solutions can help companies transform their fulfillment operations to gain greater supply chain visibility, improve order profitability, and increase customer service levels and satisfaction.  Hear too from Oracle executives who will showcase examples of customers successfully using Oracle Distributed Order Orchestration. Date: Monday, July 22, 2013 Time:  1:00 p.m. EST Click here to Register Download a free copy of the ARC Advisory Research Brief on Oracle’s Distributed Order Orchestration solution and discover how Boeing, the world’s leading aerospace company, is leveraging the solution to automate their proposal and order management processes and achieve an expected 30% reduction in order cycle times. 

    Read the article

  • Order by null/not null with ICriteria

    - by Kristoffer
    I'd like to sort my result like this: First I want all rows/objects where a column/property is not null, then all where the colmn/property is null. Then I want to sort by another column/property. How can I do this with ICriteria? Do I have to create my own Order class, or can it be done with existing code? ICriteria criteria = Session.CreateCriteria<MyClass>() .AddOrder(Order.Desc("NullableProperty")) // What do I do here? IProjection? Custom Order class? .AddOrder(Order.Asc("OtherProperty"));

    Read the article

  • How to specify the order of XmlAttributes, using XmlSerializer

    - by demoncodemonkey
    XmlElement has an "Order" attribute which you can use to specify the precise order of your properties (in relation to each other anyway) when serializing using XmlSerializer. Is there a similar thing for XmlAttribute? I just want to set the order of the attributes from something like <MyType end="bob" start="joe" /> to <MyType start="joe" end="bob" /> This is just for readability, my own benefit really.

    Read the article

  • Finding C++ static initialization order problems

    - by Fred Larson
    We've run into some problems with the static initialization order fiasco, and I'm looking for ways to comb through a whole lot of code to find possible occurrences. Any suggestions on how to do this efficiently? Edit: I'm getting some good answers on how to SOLVE the static initialization order problem, but that's not really my question. I'd like to know how to FIND objects that are subject to this problem. Evan's answer seems to be the best so far in this regard; I don't think we can use valgrind, but we may have memory analysis tools that could perform a similar function. That would catch problems only where the initialization order is wrong for a given build, and the order can change with each build. Perhaps there's a static analysis tool that would catch this. Our platform is IBM XLC/C++ compiler running on AIX.

    Read the article

  • MySQL: Changing order of auto-incremented primary keys?

    - by Tom
    Hi, I have a table with a auto-incremented primary key: user_id. For a currently theoretical reason, I might need to change a user_id to be something else than it was when originally created through auto-incrementation. This means there's a possibility that the keys will not be in incremental order anymore: PK: 1 2 3 952 // changed key 4 5 6 7 I'm wondering whether this will cause problems, and whether MySQL reads something special to the incremental order of the keys, given that they should have come to existence in incremental order (which persists even when some rows are deleted). Assuming there are no associated foreignkey issues, or that these are under control, is there a problem with "messing with" the order of MySQL's autoincremented keys? Thank you.

    Read the article

  • SQL: select rows with the same order as IN clause

    - by Andrea3000
    I know that this question has been asked several times and I've read all the answer but none of them seem to completely solve my problem. I'm switching from a mySQL database to a MS Access database with MS SQL. In both of the case I use a php script to connect to the database and perform SQL queries. I need to find a suitable replacement for a query I used to perform on mySQL. I want to: perform a first query and order records alphabetically based on one of the columns construct a list of IDs which reflects the previous alphabetical order perform a second query with the IN clause applied with the IDs' list and ordered by this list. In mySQL I used to perform the last query this way: SELECT name FROM users WHERE id IN ($name_ids) ORDER BY FIND_IN_SET(id,'$name_ids') Since FIND_IN_SET is available only in mySQL and CHARINDEX and PATINDEX are not available from my php script, how can I achieve this? I know that I could write something like: SELECT name FROM users WHERE id IN ($name_ids) ORDER BY CASE id WHEN ... THEN 1 WHEN ... THEN 2 WHEN ... THEN 3 WHEN ... THEN 4 END but you have to consider that: IDs' list has variable length and elements because it depends on the first query that list can easily contains thousands of elements Have you got any hint on this? Is there a way to programmatically construct the ORDER BY CASE ... WHEN ... statement? Is there a better approach since my list of IDs can be big?

    Read the article

  • Row insertion order entity framework

    - by Wouter
    I'm using a transaction to insert multiple rows in multiple tables. For these rows I would like to add these rows in order. Upon calling SaveChanges all the rows are inserted out of order. When not using a transaction and saving changes after each insertion does keep order, but I really need a transaction for all entries.

    Read the article

  • Sqlite3 and PDO problem with ORDER BY

    - by Maenny
    Hi, I try to use the SQL statement SELECT * FROM table ORDER BY column via an PDO-Object in PHP. Problem is, that I always get an error (Call to a member function fetchall() on a non-object - that means, the query did not return a PDO-object) when using the names of all columnname EXCEPT for ID. When I query SELECT * FROM table ORDER BY ID it works. ID is the PRIMARY INTEGER KEY, all other columns are TEXT or NUMERIC, neither of them would works with the ORDER BY clause. Any ideas?

    Read the article

  • mysql ORDER BY date_time field not sorting as expected

    - by undefined
    I have a field in my database that stores the datetime that an item was added to the database. If I want to sort the items in reverse chronological order I would expect that doing ORDER by date_added DESC would do the trick. But this seems not to work. I also tried ORDER by UNIX_TIMESTAMP(date_added) but this still did not sort the results as I would expect. I also have an auto-increment field that I can use to sort items so I will use this, but I am curious as to why ORDER by datetime was not behaving as expected. any ideas?

    Read the article

  • XmlDocument SelectNodes(Xpath): Order of result

    - by crauscher
    This is an example xml from MSDN <?xml version="1.0"?> <!-- A fragment of a book store inventory database --> <bookstore xmlns:bk="urn:samples"> <book genre="novel" publicationdate="1997" bk:ISBN="1-861001-57-8"> <title>Pride And Prejudice</title> </book> <book genre="novel" publicationdate="1992" bk:ISBN="1-861002-30-1"> <title>The Handmaid's Tale</title> </book> <book genre="novel" publicationdate="1991" bk:ISBN="1-861001-57-6"> <title>Emma</title> </book> <book genre="novel" publicationdate="1982" bk:ISBN="1-861001-45-3"> <title>Sense and Sensibility</title> </book> </bookstore> When I select all book nodes using the following code, which order will these nodes have? XmlDocument doc = new XmlDocument(); doc.Load("booksort.xml"); var nodeList =doc.SelectNodes("bookstore/book"); Will the order of the items in the nodelist be the same as the order in the xml? Is this order guaranteed?

    Read the article

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