Search Results

Search found 17945 results on 718 pages for 'last fm'.

Page 15/718 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Resize Array By Last and not by First in C#

    - by Leen15
    Hi all! I have an Array of Class elements, and by an int variable i need to resize this array to the last X elements. So for example i have an array with: Array[0] = Msg1 Array[1] = Msg2 Array[2] = Msg3 Array[3] = Msg4 Array[4] = Msg5 Array[5] = Msg6 Array[6] = Msg7 Array[7] = Msg8 Array[8] = Msg9 Array[9] = Msg10 and i need to have only the last 8 elements in the array. i cannot use the Array.Resize function because the result would be: Array[0] = Msg1 Array[1] = Msg2 Array[2] = Msg3 Array[3] = Msg4 Array[4] = Msg5 Array[5] = Msg6 Array[6] = Msg7 Array[7] = Msg8 and i need something like this: Array[0] = Msg3 Array[1] = Msg4 Array[2] = Msg5 Array[3] = Msg6 Array[4] = Msg7 Array[5] = Msg8 Array[6] = Msg9 Array[7] = Msg10 How can i do this? i hope my problem is clear. Thanks.

    Read the article

  • PHP Magento get customers last order total

    - by simian
    I am working outside of magento store root folder (1.4) and I would like to get customers order totals, and date of last order. I have started with this: $customer = Mage::getModel('customer/customer')->load($entity_id); $customerTotals =Mage::getResourceModel('sales/sale_collection') ->setCustomerFilter($customer) ->load() ->getTotals(); echo $customerTotals->getNumOrders(); echo money_format('$%i',$customerTotals->getLifetime()); This seems to be giving me totals from the wrong customer... Also, can't quite figure out how to get customers last order day. any help would be appreciated.

    Read the article

  • How to remember last state with Jquery?

    - by AR
    I have a menu with submenus that can be toggled (hide/show type deal). Is there a relatively easy way to remember last state of the menu? (I hide/show submenu when clicking on a header and change a style of the header so the background arrow will change (up/down)). It works fine, but I'd like it to remember last state, so when user goes to another page on the site and gets back, the menu shows the same way as user left it. I'm not really good with cookies so any help will be appreciated. Yeah, menu is generated dynamically from the db using PHP. There are now only 2 headers with submenus, but there will be more so I'd need some method that's "scalable" for any number of submenus. There is also no need to remember it for longer then one visit. Current url is this: http://valleyofgeysers.com/geysers.php

    Read the article

  • Setting style on first and last visible TabItem of TabControl

    - by Donnelle
    I want to set a style on the first and last TabItems in a TabControl, and have them updated as the visibility of the TabItems is changed. I can't see a way to do so with triggers. What we're after looks like this: | | And the visibility of TabItems are determined by binding. I do have it working in code. On TabItem visibility changed, enumerate through TabItems until you find the first visible one. Set the style on that one. For all other visible TabItems, set them to the pointy style (so that the previously first visible one is now pointy). Then start from the end until you find a visible TabItem and set the last style on that one. (This also lets us address an issue with TabControl where it will display the content of a non-visible TabItem if none of the visible TabItems are selected.) There's undoubtably improvements I could make to my method, but I'm not convinced that it IS the right approach. How would you approach this?

    Read the article

  • Creating Lotus Notes documents with specific created/modified/last accessed dates for testing

    - by Xolstice
    I'm currently writing an application that moves Notes documents between databases based on the amount of days that have elapsed from the creation/modified/last accessed dates. I would just like to get ideas on a simple and convenient way to create documents with specific dates, without having to change the time on the Domino server, so that I could test out my application. The best way I found so far was to create a local replica and change the system clock to the date I want. Unfortunately there are problems associated with this method. It does not work on the modified date - I'm not sure how it is getting the modified date information when the location is set to Island (Disconnected) - and it also changes the modified and last accessed dates when the documents are replicated to the server replica. Someone suggested trying to create a DXL of the document, modify the date time in the DXL file, then import it back into the database as a Notes document; but that does not work. It just takes on the date-time that it was created. Can anyone offer any other suggestions?

    Read the article

  • adding header row to gridview won't allow you to save the last item row

    - by Lex
    I've modified my GridView to have an extra Header row, however that extra row has caused my grid view row count to be incorrect. Basically, when I want to save the Gridview now, it doesn't recognize the last item line. In my current test I have 5 Item Lines, however only 4 of them are being saved. My code for creating the additional header Line: protected void gvStatusReport_RowDataBound(object sender, GridViewRowEventArgs e) { // This grid has multiple rows, fake the top row. if (e.Row.RowType == DataControlRowType.Header) { SortedList FormatCells = new SortedList(); FormatCells.Add("1", ",6,1"); FormatCells.Add("2", "Time Spent,7,1"); FormatCells.Add("3", "Total,2,1"); FormatCells.Add("4", ",6,1"); GetMultiRowHeader(e, FormatCells); } } The function to create a new row: public void GetMultiRowHeader(GridViewRowEventArgs e, SortedList GetCels) { GridViewRow row; IDictionaryEnumerator enumCels = GetCels.GetEnumerator(); row = new GridViewRow(-1, -1, DataControlRowType.Header, DataControlRowState.Normal); while (enumCels.MoveNext()) { string[] count = enumCels.Value.ToString().Split(Convert.ToChar(",")); TableCell cell = new TableCell(); cell.RowSpan = Convert.ToInt16(count[2].ToString()); cell.ColumnSpan = Convert.ToInt16(count[1].ToString()); cell.Controls.Add(new LiteralControl(count[0].ToString())); cell.HorizontalAlign = HorizontalAlign.Center; row.Cells.Add(cell); } e.Row.Parent.Controls.AddAt(0, row); } Then when I'm going to save, I loop through the rows: int totalRows = gvStatusReport.Rows.Count; for (int rowNumber = 0; rowNumber < totalRows; rowNumber++) { However the first line doesn't seem to have any of the columns that the item row has, and the last line doesn't even show up. My problem is that I do need the extra header line, but what is the best way to fix this?

    Read the article

  • Database Backup History From MSDB in a pivot table

    - by steveh99999
    I knocked up a nice little query to display backup history for each database in a pivot table format.I wanted to display the most recent full, differential, and transaction log backup for each database. Here's the SQL :-WITH backupCTE AS (SELECT name, recovery_model_desc, d AS 'Last Full Backup', i AS 'Last Differential Backup', l AS 'Last Tlog Backup' FROM ( SELECT db.name, db.recovery_model_desc,type, backup_finish_date FROM master.sys.databases db LEFT OUTER JOIN msdb.dbo.backupset a ON a.database_name = db.name WHERE db.state_desc = 'ONLINE' ) AS Sourcetable   PIVOT (MAX (backup_finish_date) FOR type IN (D,I,L) ) AS MostRecentBackup ) SELECT * FROM backupCTE Gives output such as this :-  With this query, I can then build up some straightforward queries to ensure backups are scheduled and running as expected -For example, the following logic can be used ;-  - WHERE [Last Full Backup] IS NULL) - ie database has never been backed up.. - WHERE [Last Tlog Backup] < DATEDIFF(mm,GETDATE(),-60) AND recovery_model_desc <> 'SIMPLE') - transction log not backed up in last 60 minutes. - WHERE [Last Full Backup] < DATEDIFF(dd,GETDATE(),-1) AND [Last Differential Backup] < [Last Full Backup]) -- no backup in last day.- WHERE [Last Differential Backup] < DATEDIFF(dd,GETDATE(),-1) AND [Last Full Backup] < DATEDIFF(dd,GETDATE(),-8) ) -- no differential backup in last day when last full backup is over 8 days old.   

    Read the article

  • Spring aop multiple pointcuts & advice but only the last one is working

    - by Jarle Hansen
    I have created two Spring AOP pointcuts that are completely separate and will be woven in for different parts of the system. The pointcuts are used in two different around advices, these around-advices will point to the same Java method. How the xml-file looks: <aop:config> <aop:pointcut expression="execution(......)" id="pointcutOne" /> <aop:pointcut expression="execution(.....)" id="pointcurTwo" /> <aop:aspect id="..." ref="springBean"> <aop:around pointcut-ref="pointcutOne" method="commonMethod" /> <aop:aroung pointcut-ref="pointcutTwo" method="commonMethod" /> </aop:aspect> </aop:config> The problem is that only the last pointcut works (if I change the order "pointcutOne" works because it is last). I have gotten it to work by creating one big pointcut, but I would like to have them separate. Any suggestions to why only one of the pointcuts works at a time?

    Read the article

  • Boost Asio UDP retrieve last packet in socket buffer

    - by Alberto Toglia
    I have been messing around Boost Asio for some days now but I got stuck with this weird behavior. Please let me explain. Computer A is sending continuos udp packets every 500 ms to computer B, computer B desires to read A's packets with it own velocity but only wants A's last packet, obviously the most updated one. It has come to my attention that when I do a: mSocket.receive_from(boost::asio::buffer(mBuffer), mEndPoint); I can get OLD packets that were not processed (almost everytime). Does this make any sense? A friend of mine told me that sockets maintain a buffer of packets and therefore If I read with a lower frequency than the sender this could happen. ¡? So, the first question is how is it possible to receive the last packet and discard the ones I missed? Later I tried using the async example of the Boost documentation but found it did not do what I wanted. http://www.boost.org/doc/libs/1_36_0/doc/html/boost_asio/tutorial/tutdaytime6.html From what I could tell the async_receive_from should call the method "handle_receive" when a packet arrives, and that works for the first packet after the service was "run". If I wanted to keep listening the port I should call the async_receive_from again in the handle code. right? BUT what I found is that I start an infinite loop, it doesn't wait till the next packet, it just enters "handle_receive" again and again. I'm not doing a server application, a lot of things are going on (its a game), so my second question is, do I have to use threads to use the async receive method properly, is there some example with threads and async receive? Thanks for you attention.

    Read the article

  • While loop not reading in the last item

    - by Gandalf StormCrow
    I'm trying to read in a multi line string then split it then print it .. here is the string : 1T1b5T!1T2b1T1b2T!1T1b1T2b2T!1T3b1T1b1T!3T3b1T!1T3b1T1b1T!5T1*1T 11X21b1X 4X1b1X When I split the string with ! I get this without the last line string : 1T1b5T 1T1b5T1T2b1T1b2T 1T2b1T1b2T1T1b1T2b2T 1T1b1T2b2T1T3b1T1b1T 1T3b1T1b1T3T3b1T 3T3b1T1T3b1T1b1T 1T3b1T1b1T5T1*1T 5T1*1T11X21b1X 11X21b1X Here is my code : import java.io.BufferedInputStream; import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner stdin = new Scanner(new BufferedInputStream(System.in)); while (stdin.hasNext()) { for (String line : stdin.next().split("!")) { System.out.println(line); for (int i = 0; i < line.length(); i++) { System.out.print(line.charAt(i)); } } } } } Where did I make the mistake, why is not reading in the last line? After I read in all lines properly I should go trough each line if I encounter number I should print the next char the n times the number I just read, but that is long way ahead first I need help with this. Thank you UPDATE : Here is how the output should look like : 1T1b5T 1T2b1T1b2T 1T1b1T2b2T 1T3b1T1b1T 3T3b1T 1T3b1T1b1T 5T1*1T 11X21b1X 4X1b1X Here is a solution in C(my friend solved it not me), but I'd stil wanted to do it in JAVA : #include <stdio.h> int main (void) { char row[134]; for (;fgets (row,134,stdin)!=NULL;) { int i,j=0; for (i=0;row[i]!='\0';i++) { if (row[i]<='9'&&row[i]>='1') j+=(row[i]-'0'); else if ((row[i]<='Z'&&row[i]>='A')||row[i]=='*') for (;j;j--) printf ("%c",row[i]); else if (row[i]=='b') for (;j;j--) printf (" "); else if (row[i]=='!'||row[i]=='\n') printf ("\n"); } } return 0; }

    Read the article

  • count of last item of the day

    - by frenchie
    I have a query in which one of the fields contains the count of status. The status can change several times a day and the count should be based on the final status of the day. For instance, this is what I have for Status1. CountStatus1 = (from status in MyDataContext.StatusHistories where status.UserID == TheUserID where status.StatusDateTime.Month == TheMonth.Month where status.StatusDateTime.Year == TheMonth.Year where status.NewStatus == 1 // where the LAST STATUS OF THE DAY == 1 select status.StatusID).Count() The problem is that I want to select the last status of the day to be equal to 1, and count those. The status for a day can change from 1 to 4 to 2 to 5 to 3 and then to finally to 1; if I write the query like this, the count will include 2 1's and then the 4,2,5 and 3 will also be counted in CountStatus4, CountStatus3, CountStatus"n". The return data is a monthly report grouped by day, where each day is a row. The structure of the query looks like this: var OutputStatusReport = from w in MyDataContext.WorkHistory where w.UserID == TheUserID where w.WorkDatetime.Month == TheMonth.Month where w.WorkDatetime.Year == TheMonth.Year group w by w.Datetime.Date into daygroups select new MyObjectModel { CountStatus1 = ...., CountStatus2 = ...., CountStatus3 =...... }; So I need the day of the count to match the day of daygroups. I'm struggling to figure this one out and any help is very welcome. Thanks.

    Read the article

  • Adding a first and last class to Wordpress' widget contents

    - by user571188
    In Wordpress, I'm looking for some way to add a "last" and a "first" class to list items inside Wordpress widgets. The HTML could look like this: <div class="widget-area"> <ul > <li class="widget_recent_comments"> <h3 class="widget-title">Recent comments</h3> <ul id="recentcomments"> <li class="recentcomments">Comment 1</li> <li class="recentcomments">Comment 2</li> <li class="recentcomments">Comment 3</li> <li class="recentcomments">Comment 4</li> </ul> </li> <li class="widget_my_links"> <h3 class="widget-title">My links</h3> <ul id="my-links"> <li class="item">Link 1</li> <li class="item">Link 2</li> <li class="item">Link 3</li> <li class="item">Link 4</li> <li class="item">Link 5</li> </ul> </li> </ul></div> In this example above i'd like to have first/last classes added to the li with "Comment 1", "Comment 4", "Link 1" and "Link 5". Is there an easy workaround for this? (I don't want to do this with javascript) Thank you.

    Read the article

  • For each loop not reading in the last item

    - by Gandalf StormCrow
    I'm trying to read in a multi line string then split it then print it .. here is the string : 1T1b5T!1T2b1T1b2T!1T1b1T2b2T!1T3b1T1b1T!3T3b1T!1T3b1T1b1T!5T1*1T 11X21b1X 4X1b1X When I split the string with ! I get this without the last line string : 1T1b5T 1T1b5T1T2b1T1b2T 1T2b1T1b2T1T1b1T2b2T 1T1b1T2b2T1T3b1T1b1T 1T3b1T1b1T3T3b1T 3T3b1T1T3b1T1b1T 1T3b1T1b1T5T1*1T 5T1*1T11X21b1X 11X21b1X Here is my code : import java.io.BufferedInputStream; import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner stdin = new Scanner(new BufferedInputStream(System.in)); while (stdin.hasNext()) { for (String line : stdin.next().split("!")) { System.out.println(line); for (int i = 0; i < line.length(); i++) { System.out.print(line.charAt(i)); } } } } } Where did I make the mistake, why is not reading in the last line? After I read in all lines properly I should go trough each line if I encounter number I should print the next char the n times the number I just read, but that is long way ahead first I need help with this. Thank you

    Read the article

  • Simple search only searching last word of record

    - by bennett_an
    I set up a simple search as instructed in part of railscast #240. in controller @reports = Report.search(params[:search]).order('created_at DESC').paginate(:page => params[:page], :per_page => 5) in model def self.search(search) if search where('apparatus LIKE ?', "%#{search}") else scoped end end in view <%= form_tag reports_path, :method => :get do %> <p> <%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", :name => nil %> </p> <% end %> it all works... but... I have a few records for example, one with "another time test" and another with "last test of time" if i search "test" the first comes up but the second doesn't, and if i search "time" the second comes up but not the first. It is only seeing the last word of the record. what gives?

    Read the article

  • Filemaker XSL Select Column By Name

    - by Kevin Sylvestre
    I am looking to export from Filemaker using column names (instead of positions). Currently I export the following XSL stylesheet that exports by position with: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" > <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <people> <xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW"> <person> <name> <xsl:value-of select="fm:COL[01]/fm:DATA"/> </name> <location> <xsl:value-of select="fm:COL[02]/fm:DATA"/> </location> </person> </xsl:for-each> </people> </xsl:template> </xsl:stylesheet> Any ideas? Thanks.

    Read the article

  • Eclipse Error: Processing Java changes since last activation

    - by Sean Ochoa
    I'm running Ubuntu 10.04 and I'm getting this error on startup of Eclipse: An internal error occurred during: Processing Java changes since last activation org.eclipse.core.resources.IWorkspace.addSaveParticipant(Ljava/lang/String;Lorg/eclipse/core/resources/ISaveParticipant;)Lorg/eclipse/core/resources/ISavedState; I pasted my full eclipse configuration here: http://pastebin.com/NtzN0HRG. And, here's a basic synopsis of what I have installed so far: EPIC (for Perl), Aptana (for web), Subversion connectors (with JavaHL), and PyDev. Any ideas?

    Read the article

  • SQL last day in moth select

    - by Saif Khan
    I have the following table which is basically the summary of daily transactions and is loaded nightly. +++++++++++++++++++++++ + DateCreated + Sale + +++++++++++++++++++++++ + 20100101 + 1000 + + 20100131 + 2000 + + 20100210 + 2000 + + 20100331 + 4000 + +++++++++++++++++++++++ I need to display the sale by month, but only for the last day in each month. eg JAN 2000 FEB 0 MAR 4000 I could probably accomplish this with CASE in my select, but is this efficient? This is SQL Server 2000.

    Read the article

  • Regex: Filter out text before last occurrence

    - by StreamT
    TEXT: R:\Everybody\OlegB\DiskCleaner\1\NewsFeed\Regional\Bray People_2010-04-14_v3.zip REGEX: (?<titleid>.*)_(?<issuedate>(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01]))_v(?<layoutver>[0-9]*) I need apply REGEX to the following part of TEXT: Bray People_2010-04-14_v3.zip How can I filter out all text before last occurrence of slash and apply expression to the reminded part.

    Read the article

  • Stored Procedures last access time?

    - by Ardman
    Is it possible to find out when a Stored Procedure was last accessed? I tried the following: SELECT * FROM sys.dm_db_index_usage_stats WHERE [database_id] = DB_ID() AND [object_id] = OBJECT_ID('stored procedure name') and it returns a blank resultset.

    Read the article

  • Bash edit file and keep last 500 lines

    - by Lizard
    I am looking to create a cron job that opens a directory loops through all the logs i have created and deletes all lines but keep the last 500 for example. I was thinking of something along the lines of tail -n 500 filename > filename Would this work? I also not sure how to loop through a directory in bash Thanks in advance.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >