Search Results

Search found 1235 results on 50 pages for 'interval'.

Page 8/50 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to calculate change in ANSI SQL

    - by morpheous
    I have a table that contains sales data. The data is stored in a table that looks like this: CREATE table sales_data ( sales_time timestamp , sales_amt double ) I need to write parameterized queries that will allow me to do the following: Return the change in sales_amt between times t2 and t1, where t2 and t1 are separated by a time interval (integer) of N. This query will allow for querying for weekly changes in sales (for example). Return the change in change of sales_amt between times t2 and t1, and time t3 and t4. Thats is to calculate the value (val(t2)-val(t1)) - (val(t4)-val(t3)). where t2 and t1 are separated by the same time interval (interval N) as the interval between t4 and t3. This query will allow for querying for changes in weekly changes in sales (for example).

    Read the article

  • Design Pattern for Server Emulator

    - by adisembiring
    I wanna build server socket emulator, but I want implement some design pattern there. I will described my case study that I have simplified like these: My Server Socket will always listen client socket. While some request message come from the client socket, the server emulator will response the client through the socket. the response is response code. '00' will describe request message processed successfully, and another response code expect '00' will describe there are some error while processing the message request. IN the server there are some UI, this UI contain check response parameter such as. response code timeout interval While the server want to response the client message, the response code taken from input parameter response form UI check the timeout interval, it will create sleep thread and the interval taken from timeout interval input from UI. I have implement the function, but I create it in one class. I feel it so sucks. Can you suggest me what class / interface that I must create to refactor my code.

    Read the article

  • Server Emulator Design Pattern

    - by adisembiring
    I wanna build server socket emulator, but I want implement some design pattern there. I will described my case study that I have simplified like these: My Server Socket will always listen client socket. While some request message come from the client socket, the server emulator will response the client through the socket. the response is response code. '00' will describe request message processed successfully, and another response code expect '00' will describe there are some error while processing the message request. IN the server there are some UI, this UI contain check response parameter such as. response code timeout interval While the server want to response the client message, the response code taken from input parameter response form UI check the timeout interval, it will create sleep thread and the interval taken from timeout interval input from UI. I have implement the function, but I create it in one class. I feel it so sucks. Can you suggest me what class / interface that I must create to refactor my code.

    Read the article

  • Add dynamic charts using ASP.NET CHART CONTROL, c#

    - by dhareni
    I wanted to add dynamic charts in the webpage. It goes like this... I get the start and end date from user and draw separate charts for each date bewteen the start and end date. I get the data from sql database and bind it with the chart like this: SqlConnection UsageLogConn = new SqlConnection(ConfigurationManager.ConnectionStrings["UsageConn"].ConnectionString); UsageLogConn.Open();//open connection string sql = "SELECT v.interval,dateadd(mi,(v.interval-1)*2,'" + startdate + " 00:00:00') as 'intervaltime',COUNT(Datediff(minute,'" + startdate + " 00:00:00',d.DateTime)/2) AS Total FROM usage_internet_intervals v left outer join (select * from Usage_Internet where " + name + " LIKE ('%" + value + "%') and DateTime BETWEEN '" + startdate + " 00:00:00' AND '" + enddate + " 23:59:59') d on v.interval = Datediff(minute,'" + startdate + " 00:00:00',d.DateTime)/2 GROUP BY v.interval,Datediff(minute,'" + startdate + " 00:00:00',d.DateTime)/2 ORDER BY Interval"; SqlCommand cmd = new SqlCommand(sql, UsageLogConn); SqlDataAdapter mySQLadapter = new SqlDataAdapter(cmd); Chart1.DataSource = cmd; // set series members names for the X and Y values Chart1.Series["Series 1"].XValueMember = "intervaltime"; Chart1.Series["Series 1"].YValueMembers = "Total"; UsageLogConn.Close(); // data bind to the selected data source Chart1.DataBind(); cmd.Dispose(); The above code adds only one chart for one date and I have added 'chart1' to design view and its not created dynamic. But I wanted to add more charts dynamic at runtime to the webpage. Can anyone help me with this? I am using VS 2008, ASP.NET 3.5 and the charting lib is: using System.Web.UI.DataVisualization.Charting;

    Read the article

  • mysql : Recieve data only per months

    - by Tristan
    Hello, few times ago, i asked how to do to display datas per month, i must told a bad explanation because i just figured out that it's not what i want : Here's what I got : $req1 = ... AND v.date > (DATE_SUB(CURDATE(), INTERVAL 2 MONTH)) AND v.date < (DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) $req2= ... AND v.date > (DATE_SUB(CURDATE(), INTERVAL 3 MONTH)) AND v.date < (DATE_SUB(CURDATE(), INTERVAL 2 MONTH)) But the problem, imagine that today you are the 10th june, it's going to calculate ALL the data between the 10 june to the 10 may then the 10 may until the 10 april... But what i want is data : from 1st may to 1 st june, from 1st june to 1st july... do you see what i mean ? thank you ;)

    Read the article

  • How to schedule an alarm so that the intent is broadcast everytime the date changes?

    - by rogerstone
    I want to schedule an alarm which throws an intent when the date changes. I know that this would do this the job alarms.setRepeating(AlarmManager.RTC_WAKEUP,triggerAtTime, interval,alarmIntent); But what is confusing me is what to put in the triggerAtTime and the interval.It says System.currentTimeMillis() timebase. I might be installing the app on any day so the TriggerAtTime should be midnight of that day and the interval would be 24 hours from there on. How can I acheive this.Can someone tell me what to put in TriggerAtTime and interval in the required format. Thanks

    Read the article

  • In C# is there a function that correlates sequential values on a IEnumerable

    - by Mike Q
    Hi all, I have a IEnumerable. I have a custom Interval class which just has two DateTimes inside it. I want to convert the IEnumerable to IEnumerable where n DateTimes would enumerate to n-1 Intervals. So if I had 1st Jan, 1st Feb and 1st Mar as the DateTime then I want two intervals out, 1st Jan/1st Feb and 1st Feb/1st March. Is there an existing C# Linq function that does this. Something like the below Correlate... IEnumerable<Interval> intervals = dttms.Correlate<DateTime, Interval>((dttm1, dttm2) => new Interval(dttm1, dttm2)); If not I'll just roll my own.

    Read the article

  • Wrong logic in If Statement?

    - by Charles
    $repeat_times = mysql_real_escape_string($repeat_times); $result = mysql_query("SELECT `code`,`datetime` FROM `fc` ORDER by datetime desc LIMIT 25") or die(mysql_error()); $output .=""; $seconds = time() - strtotime($fetch_array["datetime"]); if($seconds < 60) $interval = "$seconds seconds"; else if($seconds < 3600) $interval = floor($seconds / 60) . " minutes"; else if($seconds < 86400) $interval = floor($seconds / 3600) . " hours"; else $interval = floor($seconds / 86400) . " days"; while ($fetch_array = mysql_fetch_array($result)) { $fetch_array["code"] = htmlentities($fetch_array["code"]); $output .= "<li><a href=\"http://www.***.com/code=" . htmlspecialchars(urlencode($fetch_array["code"])) . "\" target=\"_blank\">" . htmlspecialchars($fetch_array["code"]) . "</a> (" . $interval . ") ago.</li>"; } $output .=""; return $output; Why is this returning janice (14461 days) instead of janice (15 minutes ago) The datetime function table has the DATETIME type in my table so it's returning a full string for the date.

    Read the article

  • How can I compare two dates, return a number of days.

    - by Dans Eduardo
    Hi, how can I compare two dates return number of days. Ex: Missing X days of the Cup. look my code. NSDateFormatter *df = [[NSDateFormatter alloc]init]; [df setDateFormat:@"d MMMM,yyyy"]; NSDate *date1 = [df dateFromString:@"11-05-2010"]; NSDate *date2 = [df dateFromString:@"11-06-2010"]; NSTimeInterval interval = [date2 timeIntervalSinceDate:date1]; //int days = (int)interval / 30; //int months = (interval - (months/30)) / 30; NSString *timeDiff = [NSString stringWithFormat:@"%dMissing%d days of the Cup",date1,date2, fabs(interval)]; label.text = timeDiff; // output (Missing X days of the Cup)

    Read the article

  • Mysql ADDDATE() or DATE_ADD() with table columns?

    - by John
    How do I do something like the following SELECT ADDDATE(t_invoice.last_bill_date, INTERVAL t_invoice.interval t_invoice.interval_unit) FROM t_invoice ...where the column t_invoice.last_bill_date is a date, t_invoice.interval is an integer and t_invoice.interval_unit is a string. Basically, I want to determine a person's next bill date based on his desired billing frequency. Is there a better way to achieve this?

    Read the article

  • StreamInsight and Reactive Framework Challenge

    In his blogpost Roman from the StreamInsight team asked if we could create a Reactive Framework version of what he had done in the post using StreamInsight.  For those who don’t know, the Reactive Framework or Rx to its friends is a library for composing asynchronous and event-based programs using observable collections in the .Net framework.  Yes, there is some overlap between StreamInsight and the Reactive Extensions but StreamInsight has more flexibility and power in its temporal algebra (Windowing, Alteration of event headers) Well here are two alternate ways of doing what Roman did. The first example is a mix of StreamInsight and Rx var rnd = new Random(); var RandomValue = 0; var interval = Observable.Interval(TimeSpan.FromMilliseconds((Int32)rnd.Next(500,3000))) .Select(i => { RandomValue = rnd.Next(300); return RandomValue; }); Server s = Server.Create("Default"); Microsoft.ComplexEventProcessing.Application a = s.CreateApplication("Rx SI Mischung"); var inputStream = interval.ToPointStream(a, evt => PointEvent.CreateInsert( System.DateTime.Now.ToLocalTime(), new { RandomValue = evt}), AdvanceTimeSettings.IncreasingStartTime, "Rx Sample"); var r = from evt in inputStream select new { runningVal = evt.RandomValue }; foreach (var x in r.ToPointEnumerable().Where(e => e.EventKind != EventKind.Cti)) { Console.WriteLine(x.Payload.ToString()); } This next version though uses the Reactive Extensions Only   var rnd = new Random(); var RandomValue = 0; Observable.Interval(TimeSpan.FromMilliseconds((Int32)rnd.Next(500, 3000))) .Select(i => { RandomValue = rnd.Next(300); return RandomValue; }).Subscribe(Console.WriteLine, () => Console.WriteLine("Completed")); Console.ReadKey();   These are very simple examples but both technologies allow us to do a lot more.  The ICEPObservable() design pattern was reintroduced in StreamInsight 1.1 and the more I use it the more I like it.  It is a very useful pattern when wanting to show StreamInsight samples as is the IEnumerable() pattern.

    Read the article

  • MySQL: Pacemaker cannot start the failed master as a new slave?

    - by quanta
    I'm going to setup failover for MySQL replication (1 master and 1 slave) follow this guide: https://github.com/jayjanssen/Percona-Pacemaker-Resource-Agents/blob/master/doc/PRM-setup-guide.rst Here're the output of crm configure show: node serving-6192 \ attributes p_mysql_mysql_master_IP="192.168.6.192" node svr184R-638.localdomain \ attributes p_mysql_mysql_master_IP="192.168.6.38" primitive p_mysql ocf:percona:mysql \ params config="/etc/my.cnf" pid="/var/run/mysqld/mysqld.pid" socket="/var/lib/mysql/mysql.sock" replication_user="repl" replication_passwd="x" test_user="test_user" test_passwd="x" \ op monitor interval="5s" role="Master" OCF_CHECK_LEVEL="1" \ op monitor interval="2s" role="Slave" timeout="30s" OCF_CHECK_LEVEL="1" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" primitive writer_vip ocf:heartbeat:IPaddr2 \ params ip="192.168.6.8" cidr_netmask="32" \ op monitor interval="10s" \ meta is-managed="true" ms ms_MySQL p_mysql \ meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" globally-unique="false" target-role="Master" is-managed="true" colocation writer_vip_on_master inf: writer_vip ms_MySQL:Master order ms_MySQL_promote_before_vip inf: ms_MySQL:promote writer_vip:start property $id="cib-bootstrap-options" \ dc-version="1.0.12-unknown" \ cluster-infrastructure="openais" \ expected-quorum-votes="2" \ no-quorum-policy="ignore" \ stonith-enabled="false" \ last-lrm-refresh="1341801689" property $id="mysql_replication" \ p_mysql_REPL_INFO="192.168.6.192|mysql-bin.000006|338" crm_mon: Last updated: Mon Jul 9 10:30:01 2012 Stack: openais Current DC: serving-6192 - partition with quorum Version: 1.0.12-unknown 2 Nodes configured, 2 expected votes 2 Resources configured. ============ Online: [ serving-6192 svr184R-638.localdomain ] Master/Slave Set: ms_MySQL Masters: [ serving-6192 ] Slaves: [ svr184R-638.localdomain ] writer_vip (ocf::heartbeat:IPaddr2): Started serving-6192 Editing /etc/my.cnf on the serving-6192 of wrong syntax to test failover and it's working fine: svr184R-638.localdomain being promoted to become the master writer_vip switch to svr184R-638.localdomain Current state: Last updated: Mon Jul 9 10:35:57 2012 Stack: openais Current DC: serving-6192 - partition with quorum Version: 1.0.12-unknown 2 Nodes configured, 2 expected votes 2 Resources configured. ============ Online: [ serving-6192 svr184R-638.localdomain ] Master/Slave Set: ms_MySQL Masters: [ svr184R-638.localdomain ] Stopped: [ p_mysql:0 ] writer_vip (ocf::heartbeat:IPaddr2): Started svr184R-638.localdomain Failed actions: p_mysql:0_monitor_5000 (node=serving-6192, call=15, rc=7, status=complete): not running p_mysql:0_demote_0 (node=serving-6192, call=22, rc=7, status=complete): not running p_mysql:0_start_0 (node=serving-6192, call=26, rc=-2, status=Timed Out): unknown exec error Remove the wrong syntax from /etc/my.cnf on serving-6192, and restart corosync, what I would like to see is serving-6192 was started as a new slave but it doesn't: Failed actions: p_mysql:0_start_0 (node=serving-6192, call=4, rc=1, status=complete): unknown error Here're snippet of the logs which I'm suspecting: Jul 09 10:46:32 serving-6192 lrmd: [7321]: info: rsc:p_mysql:0:4: start Jul 09 10:46:32 serving-6192 lrmd: [7321]: info: RA output: (p_mysql:0:start:stderr) Error performing operation: The object/attribute does not exist Jul 09 10:46:32 serving-6192 crm_attribute: [7420]: info: Invoked: /usr/sbin/crm_attribute -N serving-6192 -l reboot --name readable -v 0 The full logs: http://fpaste.org/AyOZ/ The strange thing is I can starting it manually: export OCF_ROOT=/usr/lib/ocf export OCF_RESKEY_config="/etc/my.cnf" export OCF_RESKEY_pid="/var/run/mysqld/mysqld.pid" export OCF_RESKEY_socket="/var/lib/mysql/mysql.sock" export OCF_RESKEY_replication_user="repl" export OCF_RESKEY_replication_passwd="x" export OCF_RESKEY_test_user="test_user" export OCF_RESKEY_test_passwd="x" sh -x /usr/lib/ocf/resource.d/percona/mysql start: http://fpaste.org/RVGh/ Did I make something wrong?

    Read the article

  • Increase application performance

    - by Prayos
    I'm writing a program for a company that will generate a daily report for them. All of the data that they use for this report is stored in a local SQLite database. For this report, the utilize pretty much every bit of the information in the database. So currently, when I query the datbase, I retrieve everything, and store the information in lists. Here's what I've got: using (var dataReader = _connection.Select(query)) { if (dataReader.HasRows) { while (dataReader.Read()) { _date.Add(Convert.ToDateTime(dataReader["date"])); _measured.Add(Convert.ToDouble(dataReader["measured_dist"])); _bit.Add(Convert.ToDouble(dataReader["bit_loc"])); _psi.Add(Convert.ToDouble(dataReader["pump_press"])); _time.Add(Convert.ToDateTime(dataReader["timestamp"])); _fob.Add(Convert.ToDouble(dataReader["force_on_bit"])); _torque.Add(Convert.ToDouble(dataReader["torque"])); _rpm.Add(Convert.ToDouble(dataReader["rpm"])); _pumpOneSpm.Add(Convert.ToDouble(dataReader["pump_1_strokes_pm"])); _pumpTwoSpm.Add(Convert.ToDouble(dataReader["pump_2_strokes_pm"])); _pullForce.Add(Convert.ToDouble(dataReader["pull_force"])); _gpm.Add(Convert.ToDouble(dataReader["flow"])); } } } I then utilize these lists for the calculations. Obviously, the more information that is in this database, the longer the initial query will take. I'm curious if there is a way to increase the performance of the query at all? Thanks for any and all help. EDIT One of the report rows is called Daily Drilling Hours. For this calculation, I use this method: // Retrieves the timestamps where measured depth == bit depth and PSI >= 50 public double CalculateDailyProjectDrillingHours(DateTime date) { var dailyTimeStamps = _time.Where((t, i) => _date[i].Equals(date) && _measured[i].Equals(_bit[i]) && _psi[i] >= 50).ToList(); return _dailyDrillingHours = Convert.ToDouble(Math.Round(TimeCalculations(dailyTimeStamps).TotalHours, 2, MidpointRounding.AwayFromZero)); } // Checks that the interval is less than 10, then adds the interval to the total time private static TimeSpan TimeCalculations(IList<DateTime> timeStamps) { var interval = new TimeSpan(0, 0, 10); var totalTime = new TimeSpan(); TimeSpan timeDifference; for (var j = 0; j < timeStamps.Count - 1; j++) { if (timeStamps[j + 1].Subtract(timeStamps[j]) <= interval) { timeDifference = timeStamps[j + 1].Subtract(timeStamps[j]); totalTime = totalTime.Add(timeDifference); } } return totalTime; }

    Read the article

  • What's Bringing SharePoint 2007 Server to a hault?

    - by juanlarios
    I've been having issues with my teste environment and I'm hoping someone has run into this problem and can point me in the right direction. I noticed: SharePoint Server Memory is through the roof at times and so is the CPU usage. Most of CPU usage is a sql proccess. Running out of disk space all the time. I looked in the Logs located in the 12 hive and sure enough I have 1G log files that are hard to open because of the size. The following are the 3 error messages that are flooding my SharePoint logs:   04/05/2010 16:02:36.99     OWSTIMER.EXE (0x0B94)                       0x0BA4    Windows SharePoint Services       Timer                             5uuf    Monitorable    The previous instance of the timer job 'Variations Propagate Page Job Definition', id '{F9A73EB4-90FE-4574-AD99-B4034056F915}' for service '{F89169F9-707B-4588-9ED0-E6D399FE5E3D}' is still running, so the current instance will be skipped.  Consider increasing the interval between jobs.    04/05/2010 15:59:51.51     OWSTIMER.EXE (0x0B94)                       0x0BA4    Windows SharePoint Services       Timer                             5uuf    Monitorable    The previous instance of the timer job 'Profile Synchronization', id '{A05E3439-8DCD-449A-9D9E-46D601CACAA2}' for service '{F89169F9-707B-4588-9ED0-E6D399FE5E3D}' is still running, so the current instance will be skipped.  Consider increasing the interval between jobs.     04/05/2010 15:56:25.53     OWSTIMER.EXE (0x0B94)                       0x0BA4    Windows SharePoint Services       Timer                             5uuf    Monitorable    The previous instance of the timer job 'Scheduled Unpublish', id '{6298F93F-388D-46B9-809E-CEDBB8659661}' for service '{F89169F9-707B-4588-9ED0-E6D399FE5E3D}' is still running, so the current instance will be skipped.  Consider increasing the interval between jobs.     04/05/2010 15:54:14.73     OWSTIMER.EXE (0x0B94)                       0x0BA4    Windows SharePoint Services       Timer                             5uuf    Monitorable    The previous instance of the timer job 'Config Refresh', id '{C42DA970-3DA3-4AA2-94E5-8499C5B80A3E}' for service '{7F6D2CBE-8071-4A30-B313-7C9989FC2D87}' is still running, so the current instance will be skipped.  Consider increasing the interval between jobs.       I'm googling around but haven't found much. I know one other person posted something about this back in 2008, but no answers were reached. I have already checked the databases to see if any of them have gone offline for whatever reason, but from SQL everything is fine. I recently re-created an SSP and deleted an old ssp. So I thought maybe that was causing it, and who knows? maybe that causes some of the problems or maybe all. I'm running configuration wizard and see if anything changes. Please if someone has had similar issues let me know.

    Read the article

  • Iterative and Incremental Principle Series 2: Finding Focus

    - by llowitz
    Welcome back to the second blog in a five part series where I recount my personal experience with applying the Iterative and Incremental principle to my daily life.  As you recall from part one of the series, a conversation with my son prompted me to think about practical applications of the Iterative and Incremental approach and I realized I had incorporated this principle in my exercise regime.    I have been a runner since college but about a year ago, I sustained an injury that prevented me from exercising.  When I was sufficiently healed, I decided to pick it up again.  Knowing it was unrealistic to pick up where I left off, I set a goal of running 3 miles or approximately for 30 minutes.    I was excited to get back into running and determined to meet my goal.  Unfortunately, after what felt like a lifetime, I looked at my watch and realized that I had 27 agonizing minutes to go!  My determination waned and my positive “I can do it” attitude was overridden by thoughts of “This is impossible”.   My initial focus and excitement was not sustained so I never met my goal.   Understanding that the 30 minute run was simply too much for me mentally, I changed my approach.   I decided to try interval training.  For each interval, I planned to walk for 3 minutes, then jog for 2 minutes, and finally sprint for 1 minute, and I planned to repeat this pattern 5 times.  I found that each interval set was challenging, yet achievable, leaving me excited and invigorated for my next interval.  I easily completed five intervals – or 30 minutes!!  My sense of accomplishment soared. What does this have to do with OUM?  Have you heard the saying -- “How do you eat an elephant?  One bite at a time!”?  This adage certainly applies in my example and in an OUM systems implementation.  It is easier to manage, track progress and maintain team focus for weeks at a time, rather than for months at a time.   With shorter milestones, the project team focuses on the iteration goal.  Once the iteration goal is met, a sense of accomplishment is experience and the team can be re-focused on a fresh, yet achievable new challenge.  Join me tomorrow as I expand the concept of Iterative and incremental by taking a step back to explore the recommended approach for planning your iterations.

    Read the article

  • What should I do to make sure that IIS does not recycle my application?

    - by AngryHacker
    I have a WCF service app hosted in IIS. On startup, it goes and fetches a really expensive (in terms of time and cpu) resource to use as local cache. Unfortunately, IIS seems to recycle the process on a fairly regular basis. So I am trying to change the settings on the Application Pool to make sure that IIS does not recycle the application. So far, I've change the following: Limit Interval under CPU from 5 to 0. Idle Time-out under Process Model from 20 to 0. Regular Time Interval under Recycling from 1740 to 0. Will this be enough? And I have specific questions about the items I changed: What specifically does Limit Interval setting under CPU mean? Does it mean that if a certain CPU usage is exceeded, the application pool will be recycled? What exactly does "recycled" mean? Is the application completely torn down and started up again? What is the difference between "Worker Process shutdown" and "Application Pool recycling"? The documentation for the Idle Time-out under Process Model talks about shutting down the worker process. While the docs for Regular Time Interval under Recycling talk about application pool recycling. I don't quite grok the difference between the two. I thought the w3wp.exe is the worker process which runs the application pool. Can someone explain the difference to the application between the two? The reason for having IIS7 and IIS7.5 tags is because the app will run in both and hope the answers are the same between the versions. Image for reference:

    Read the article

  • Why does this rsnapshot exclude not work?

    - by bstpierre
    Rsnapshot passes excludes directly to rsync, but rsync's behavior appears inconsistent. I've simplified my rsnapshot backup test to the following directory tree (this tree will be backed up): gorilla:~# find /tmp/snaptest -exec file {} \; /tmp/snaptest: directory /tmp/snaptest/SKIPTHIS: directory /tmp/snaptest/SKIPTHIS/xyz: directory /tmp/snaptest/SKIPTHIS/xyz/testing: ASCII text /tmp/snaptest/SKIPTHIS/bar: ASCII text /tmp/snaptest/SKIPTHIS/foo: ASCII text /tmp/snaptest/SKIPTHIS.txt: ASCII text My config file: config_version 1.2 snapshot_root /tmp/backup-media no_create_root 1 cmd_cp /bin/cp cmd_rm /bin/rm cmd_rsync /usr/bin/rsync cmd_ssh /usr/bin/ssh cmd_logger /usr/bin/logger cmd_du /usr/bin/du interval hourly 6 interval daily 7 interval weekly 4 interval monthly 3 verbose 3 loglevel 3 logfile /media/maxtor-one-touch/rsnapshot.log lockfile /media/maxtor-one-touch/backups/.rsnapshot.pid rsync_short_args -a rsync_long_args --delete --numeric-ids --relative --delete-excluded exclude "SKIPTHIS/**" link_dest 1 backup /tmp/snaptest snaptest The result: gorilla:~# rsnapshot -c /tmp/snaptest.conf hourly echo 12638 > /media/maxtor-one-touch/backups/.rsnapshot.pid mkdir -m 0755 -p /tmp/backup-media/hourly.0/ /usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \ --exclude="SKIPTHIS/**" /tmp/snaptest \ /tmp/backup-media/hourly.0/snaptest touch /tmp/backup-media/hourly.0/ rm -f /media/maxtor-one-touch/backups/.rsnapshot.pid gorilla:~# find /tmp/backup-media/ -exec file {} \; /tmp/backup-media/: directory /tmp/backup-media/hourly.0: directory /tmp/backup-media/hourly.0/snaptest: directory /tmp/backup-media/hourly.0/snaptest/tmp: sticky directory /tmp/backup-media/hourly.0/snaptest/tmp/snaptest: directory /tmp/backup-media/hourly.0/snaptest/tmp/snaptest/SKIPTHIS: directory /tmp/backup-media/hourly.0/snaptest/tmp/snaptest/SKIPTHIS/xyz: directory /tmp/backup-media/hourly.0/snaptest/tmp/snaptest/SKIPTHIS/xyz/testing: ASCII text /tmp/backup-media/hourly.0/snaptest/tmp/snaptest/SKIPTHIS/bar: ASCII text /tmp/backup-media/hourly.0/snaptest/tmp/snaptest/SKIPTHIS/foo: ASCII text /tmp/backup-media/hourly.0/snaptest/tmp/snaptest/SKIPTHIS.txt: ASCII text My confusion stems from the fact that if I copy-paste the rsync command echoed by rsnapshot, the SKIPTHIS directory is excluded! (I've tested with various other SKIPTHIS patterns with the same results.) Any idea what's going on?

    Read the article

  • ADFS 2.0 Farm - How do I perform an immediate sync

    - by Matt
    Hi, We're using ADFS 2.0 on a windows 2008 server, it's in a farm and has the default polling interval of 5 minutes. We're making a change tonight and would rather sync immediately than wait for the other guy to update, especially as we might be making multiple changes. This Technet article mentions that I can change the polling interval or do an immediate sync between my servers: http://technet.microsoft.com/en-us/library/ee913581%28WS.10%29.aspx I checked the powershell commandlets for ADFS and I can only seem to find one that let's me set the polling interval, but not perform a 1 time immediate sync Searched the usual suspects, but just can't find a ADFS-SyncMyStuffNow command... Anyone?

    Read the article

  • Problem with the dateformatter's in Iphone sdk.

    - by monish
    Hi guys, Here I had a problem with the date formatters actually I had an option to search events based on the date.for this Im comparing the date with the date store in the database and getting the event based on the date for this I wrote the code as follows: -(NSMutableArray*)getSearchAllLists:(EventsList*)aEvent { [searchList removeAllObjects]; EventsList *searchEvent = nil; const char* sql; NSString *conditionStr = @" where "; if([aEvent.eventName length] > 0) { NSString *str = @"'%"; str = [str stringByAppendingString:aEvent.eventName]; str = [str stringByAppendingString:@"%'"]; conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" eventName like %s",[str UTF8String]]]; } if([aEvent.eventWineName length]>0) { NSString *str = @"'%"; str = [str stringByAppendingString:aEvent.eventWineName]; str = [str stringByAppendingString:@"%'"]; if([aEvent.eventName length]>0) { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" and (wineName like %s)",[str UTF8String]]]; } else { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@"wineName like %s",[str UTF8String]]]; } } if([aEvent.eventVariety length]>0) { NSString *str = @"'%"; str = [str stringByAppendingString:aEvent.eventVariety]; str = [str stringByAppendingString:@"%'"]; if([aEvent.eventName length]>0 || [aEvent.eventWineName length]>0) { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" and (variety like %s)",[str UTF8String]]]; } else { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@"variety like %s" ,[str UTF8String]]]; } } if([aEvent.eventWinery length]>0) { NSString *str = @"'%"; str = [str stringByAppendingString:aEvent.eventWinery]; str = [str stringByAppendingString:@"%'"]; if([aEvent.eventName length]>0 || [aEvent.eventWineName length]>0 || [aEvent.eventVariety length]>0) { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" and (winery like %s)",[str UTF8String]]]; } else { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@"winery like %s" ,[str UTF8String]]]; } } if(aEvent.eventRatings >0) { if([aEvent.eventName length]>0 || [aEvent.eventWineName length]>0 || [aEvent.eventWinery length]>0 || [aEvent.eventVariety length]>0) { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" and ratings = %d",aEvent.eventRatings]]; } else { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" ratings = %d",aEvent.eventRatings]]; } } if(aEvent.eventDate >0) { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:@"dd-MMM-yy 23:59:59"]; NSString *dateStr = [dateFormatter stringFromDate:aEvent.eventDate]; NSDate *date = [dateFormatter dateFromString:dateStr]; [dateFormatter release]; NSTimeInterval interval = [date timeIntervalSinceReferenceDate]; printf("\n Interval in advance search:%f",interval); if([aEvent.eventName length]>0 || [aEvent.eventWineName length]>0 || [aEvent.eventWinery length]>0 || aEvent.eventRatings>0 || [aEvent.eventVariety length]>0) { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" and eventDate = %f",interval]]; } else { conditionStr = [conditionStr stringByAppendingString:[NSString stringWithFormat:@" eventDate = %f",interval]]; } } NSString* queryString= @" select * from event"; queryString = [queryString stringByAppendingString:conditionStr]; sqlite3_stmt* statement; sql = (char*)[queryString UTF8String]; if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) != SQLITE_OK) { NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database)); } sqlite3_bind_text(statement, 1, [aEvent.eventName UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 2, [aEvent.eventWineName UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 3, [aEvent.eventVariety UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 4, [aEvent.eventWinery UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_int(statement, 5,aEvent.eventRatings); sqlite3_bind_double(statement,6, [[aEvent eventDate] timeIntervalSinceReferenceDate]); while (sqlite3_step(statement) == SQLITE_ROW) { primaryKey = sqlite3_column_int(statement, 0); searchEvent = [[EventsList alloc] initWithPrimaryKey:primaryKey database:database]; [searchList addObject:searchEvent]; [searchEvent release]; } sqlite3_finalize(statement); return searchList; } Here I compared the interval value in the database and the date we are searching and Im getting the different values and results were not found. Guy's help me to get rid of this. Anyone's help will be much appreciated. Thank you Monish Calapatapu.

    Read the article

  • Data structure for pattern matching.

    - by alvonellos
    Let's say you have an input file with many entries like these: date, ticker, open, high, low, close, <and some other values> And you want to execute a pattern matching routine on the entries(rows) in that file, using a candlestick pattern, for example. (See, Doji) And that pattern can appear on any uniform time interval (let t = 1s, 5s, 10s, 1d, 7d, 2w, 2y, and so on...). Say a pattern matching routine can take an arbitrary number of rows to perform an analysis and contain an arbitrary number of subpatterns. In other words, some patterns may require 4 entries to operate on. Say also that the routine (may) later have to find and classify extrema (local and global maxima and minima as well as inflection points) for the ticker over a closed interval, for example, you could say that a cubic function (x^3) has the extrema on the interval [-1, 1]. (See link) What would be the most natural choice in terms of a data structure? What about an interface that conforms a Ticker object containing one row of data to a collection of Ticker so that an arbitrary pattern can be applied to the data. What's the first thing that comes to mind? I chose a doubly-linked circular linked list that has the following methods: push_front() push_back() pop_front() pop_back() [] //overloaded, can be used with negative parameters But that data structure seems very clumsy, since so much pushing and popping is going on, I have to make a deep copy of the data structure before running an analysis on it. So, I don't know if I made my question very clear -- but the main points are: What kind of data structures should be considered when analyzing sequential data points to conform to a pattern that does NOT require random access? What kind of data structures should be considered when classifying extrema of a set of data points?

    Read the article

  • Dell xps 15z fan issue in ubuntu 12.04

    - by Paxinum
    I just updated to ubuntu 12.04 on my Dell laptop xps 15z. The trouble is that I hear a slight ticking sound every 3rd second, probably from a fan. This is a new issue in this ubuntu version. I use the recommended boot options for grub, i.e. acpi_backlight=vendor, but I do not use any acpi=off or acpi=noirq. Is there a way to fix this issue from ubuntu, by maybe controlling the fans somehow? EDIT: Notice, the sound goes away as the fan speeds up, (when doing calculations or such), so it is really a fan issue. EDIT2: I have located the issue: If I use conky 1.9, together with the command execpi for a python application, then the sound appears, and the noise syncs with the update interval for conky (NOT for the update interval for execpi!). The noise seems to be proportional to the complexity of the drawing that is needed. This is very strange, as this issue was not in the prev. version of conky I used. The solution was to increase the update interval for conky from 0.5 to 3, i.e. update every 3rd second instead of twice a second.

    Read the article

  • the correct way to deal with gtk_events_pending and gtk_main_iteration

    - by abd alsalam
    I have program that send files and i want to make a progress bar for it, but that progress bar just updated after the transferring complete,so i putted a gtk_events_pending() and gtk_main_iteration() functions in the sending loop to go back to the gtk main loop to update the progress bar but also it seems to not work here is a EDIT: the send function is in a separated thread snippet from my code float Percent = 0.0 ; float Interval = 0.0 ; the sending function gint SendTheFile ( ) { char FileBlockBuffer[512]; bzero(FileBlockBuffer, 512); int FileBlockSize ; FILE * FilePointer ; int filesize = 0 ; FilePointer = fopen(LocalFileName , "r"); struct stat st; stat(LocalFileName, &st); filesize = st.st_size; Interval = (512 / (float)filesize) ; while((FileBlockSize = fread(FileBlockBuffer,sizeof(char),512,FilePointer))>0) { send(SocketDiscriptor , FileBlockBuffer , FileBlockSize,0); bzero(FileBlockBuffer, 512); Percent = Percent + Interval ; if (Percent > 1.0)Percent = 0.0; while(gtk_events_pending() ) { gtk_main_iteration(); } } update progress bar function gint UpdateProgressBar(gpointer data) { gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(data),Percent); } updating progress bar in the main function g_timeout_add(50,(GSourceFunc)UpdateProgressBar,SendFileProgressBar);

    Read the article

  • Is there a scheduling algorithm that optimizes for "maker's schedules"?

    - by John Feminella
    You may be familiar with Paul Graham's essay, "Maker's Schedule, Manager's Schedule". The crux of the essay is that for creative and technical professionals, meetings are anathema to productivity, because they tend to lead to "schedule fragmentation", breaking up free time into chunks that are too small to acquire the focus needed to solve difficult problems. In my firm we've seen significant benefits by minimizing the amount of disruption caused, but the brute-force algorithm we use to decide schedules is not sophisticated enough to handle scheduling large groups of people well. (*) What I'm looking for is if there's are any well-known algorithms which minimize this productivity disruption, among a group of N makers and managers. In our model, There are N people. Each person pi is either a maker (Mk) or a manager (Mg). Each person has a schedule si. Everyone's schedule is H hours long. A schedule consists of a series of non-overlapping intervals si = [h1, ..., hj]. An interval is either free or busy. Two adjacent free intervals are equivalent to a single free interval that spans both. A maker's productivity is maximized when the number of free intervals is minimized. A manager's productivity is maximized when the total length of free intervals is maximized. Notice that if there are no meetings, both the makers and the managers experience optimum productivity. If meetings must be scheduled, then makers prefer that meetings happen back-to-back, while managers don't care where the meeting goes. Note that because all disruptions are treated as equally harmful to makers, there's no difference between a meeting that lasts 1 second and a meeting that lasts 3 hours if it segments the available free time. The problem is to decide how to schedule M different meetings involving arbitrary numbers of the N people, where each person in a given meeting must place a busy interval into their schedule such that it doesn't overlap with any other busy interval. For each meeting Mt the start time for the busy interval must be the same for all parties. Does an algorithm exist to solve this problem or one similar to it? My first thought was that this looks really similar to defragmentation (minimize number of distinct chunks), and there are a lot of algorithms about that. But defragmentation doesn't have much to do with scheduling. Thoughts? (*) Practically speaking this is not really a problem, because it's rare that we have meetings with more than ~5 people at once, so the space of possibilities is small.

    Read the article

  • Having issues with JQuery progress bar

    - by Roland
    I'm busy creating a poll but am experiencing issues creating a progress bar for a poll using jquery, thus I have a couple of options and then when the page loads the div tags should increase in width, but it's not doing anything only if I have on option in the poll code <?php foreach($votes as $v): ?> <div><?php echo $v['name'].':'; ?></div> <div> <?php echo 'Votes: '.$v['num'].' | '.$v['percent'].'%'; ?> </div> <script type="text/javascript"> load(<?=$v['name']?>,<?=$v['percent']?>); </script> <div style="width:100%; height:10px; background-color:#effdff;"><div id="<?=$v['name']?>" style=" height:10px; background-color:#ff0000;"></div></div> <br /> <?php endforeach; ?> <?php if(!empty($loginMsg)): ?> <?php echo $loginMsg; ?><br /> <?php endif; ?> Votes: <?php echo $totalVotes+$totalComments; ?> | Comments: <?php echo $totalComments ?> <script type="text/javascript"> var interval=''; var progress = 0; function load(id,val){ alert(id); if (interval=="") { interval=window.setInterval("display('"+id+"','"+val+"')",200); } } function display(id,val) { progress += 1; if(progress == val){ window.clearInterval(interval) interval = ''; progress = 0; } $("#"+id).css("width",progress+'%'); } </script>

    Read the article

  • Year split in Quarters using basic jQuery

    - by Alexander Corotchi
    Hi, I have a interesting question: I want to split the year into 4 quarters. What is the idea, A quarter can be different: The HTML Code: <div class="quarterBody"> <span>04-29-2010</span> <span>06-29-2010</span> <span>08-29-2010</span> </div> jQuery (javascript) is total wrong, I hope that w: $(document).ready(function(){ var quarter1 = to make interval (01-01-2010 to 03-31-2010); var quarter2 = to make interval (03-01-2010 to 06-31-2010); var quarter3 = to make interval (06-01-2010 to 09-31-2010); var quarter4 = to make interval (09-01-2010 to 12-31-2010); ... $(".quarterBody span").each(function(){ var date = Date.parse($(this).text()); //to apply some magic code $(this).addClass(quarterNumber); }); }); OUTPUT: <div class="quarterBody"> <span class="Quarter1">02-29-2010</span> <span class="Quarter2">04-29-2010</span> <span class="Quarter3">08-29-2010</span> ... </div> I know right now it is a stupid way, but I hope that somebody can help me, or suggest an idea how to do that in a better way!! Thanks!

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >