Search Results

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

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

  • Sliding through divs at interval - jQuery

    - by phil
    Hey, I have a list of around 30 divs (see below.) and would like to hear any suggestions on the best way to rotate through them by sliding in one at the top and removing one from the bottom at a set time. Something like every 5-10 seconds. Also even though there are 30 on the page I would only like to show a list of 10 and have the rest show as mentioned. A great example would be www.foursquare.com and their recent activity section. I would like to do the same except with a predetermined amount of divs instead of real-time using ajax. Any suggestions or a bit of help pointing me in the right direction would be greatly appreciated. <div class="recent-questions"> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> <div class="recent-question"></div> </div> Thanks in advance for any help or thoughts!

    Read the article

  • Counting number of values between interval

    - by calccrypto
    Is there any efficient way in python to count the times an array of numbers is between certain intervals? the number of intervals i will be using may get quite large like: mylist = [4,4,1,18,2,15,6,14,2,16,2,17,12,3,12,4,15,5,17] some function(mylist, startpoints): # startpoints = [0,10,20] count values in range [0,9] count values in range [10-19] output = [9,10]

    Read the article

  • how to pass time Interval in list pref option

    - by user1748932
    <ListPreference android:entries="@array/listOptions2" android:entryValues="@array/listValues2" android:key="listprefrefresh" android:summary="set Refresh The Applciation" android:title="Set TIme Intervale" /> <item>10 </item> <item>30</item> </integer-array> <integer-array name="listValues2"> <item>10000</item> <item>30000</item> </integer-array> public static final String PREF_BEER_SIZE2 = "listprefrefresh"; Preference beerPref2 = (Preference) findPreference(PREF_BEER_SIZE2); beerPref2 .setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { public boolean onPreferenceChange(Preference preference, Object newValue) { // TODO Auto-generated method stub final ListPreference listrefresh = (ListPreference) preference; final int idx = listrefresh .findIndexOfValue((String) newValue); if (idx == 0 ) { handler.post(timedTask); // } else if (idx == 1) { // System.out.println("2"); } return true; } }); This is my code i want Pass Time how can i implement right now? I am passing Integr value.please tell me

    Read the article

  • Roundoff Timespan to 15 min interval

    - by s-a-n
    I have a property in my code where users can enter a timespan in HH:mm like 10:32 10:44 15:45 I want to round off in my property to the nearest 15mins but i dont have datetime here. I only need to do it with Timespan 10:32 to 10:30 10:44 to 10:45 15:45 to 15:45 01:02 to 01:00 02:11 to 02:15 03:22 to 03:25 23:52 to 00:00 Tried all these solutions but they involve Datetime in them How can I round up the time to the nearest X minutes? Is there a simple function for rounding a DateTime down to the nearest 30 minutes, in C#? DotNet Roundoff datetime to last 15 minutes

    Read the article

  • [jscript] Good (better) substition for setInterval or setTimeout

    - by riffnl
    I've got a masterpage with some nice UI (jQuery) features. One of these options is interefering with my embedded YouTube (or other alike-) objects. On each, in this case, setInterval event the embedded video stops displaying new frames (for like a second). More detail: I've got a "polaroid" gallery (in the header) with only 5 100x100 images in it (test: preloading has no effect on performance) and my gallery will show or hide them (fade-in / fade-out) after a period of time. (test: non-animated display:hide or display:block has no effect on performance). After some testing and I've come to the conclusion that it isn't the "animated" showing or hiding of the pictures, but it's the interval itself (- since altering to display:hide or block had the same result). Perhaps it is my "gallery" "function" on itself ... function poladroid() { if (!galleryHasFocus) { if (galleryMax >= 0) { galleryCurrent++; if (galleryCurrent > galleryMax) { galleryCurrent = 0; showPictures = !showPictures; } if (showPictures) { $('#pic-' + galleryCurrent.toString()).show("slow"); } else { $('#pic-' + galleryCurrent.toString()).hide("slow"); } } } if (!intervalSet) { window.setInterval("poladroid()", 3000); intervalSet = true; } } It's not like my function is doing really awkward stuff is it? So, I was thinking I needed a more "loose" interval function.. but is there an option for it?

    Read the article

  • Php - divide time period into equal intervals

    - by experc
    Hi! I am working on my php course project and for the past few days I have stucked at the point where I have to create php function which gets 5 parameters which represents information about the working time of some department - when the work starts/ends, when the lunchtime (or any other break) starts/ends and integer representing minutes into how small piecies we should divide time period. Besides - it's possible that there are not any breaks in the working time. The function should return all intervals from working time. function split_time_into_intervals($work_starts,$work_ends,$break_starts=null; $break_ends=null,$minutes_per_interval=60){ $intervals=array(); //all of the function code return $intervals; } So if I have the following parameters for the function function split_time_into_intervals("8:30","14:50","11:45"; "12:25"){ .. } I would like to retrieve the following array: $intervals[0]['starts']="8:30"; $intervals[0]['ends']="9:30"; $intervals[1]['starts']="9:30"; $intervals[1]['ends']="10:30"; $intervals[2]['starts']="10:30"; $intervals[2]['ends']="11:30"; $intervals[3]['starts']="11:30"; $intervals[3]['ends']="11:45"; //this interval was smaller than 60 minutes - because of the break (which starts at 11:45) $intervals[4]['starts']="12:25";//starts when the break ends $intervals[4]['ends']="13:25"; // interval is again 60 minutes $intervals[5]['starts']="13:25"; $intervals[5]['ends']="14:25"; $intervals[6]['starts']="14:25"; $intervals[6]['ends']="14:50"; //this period is shorter than 60 minutes - because work ends Any advises? I would apriciate any php (or C#) code regarding to this problem!

    Read the article

  • Conditionally colour data points outside of confidence bands in R

    - by D W
    I need to colour datapoints that are outside of the the confidence bands on the plot below differently from those within the bands. Should I add a separate column to my dataset to record whether the data points are within the confidence bands? Can you provide an example please? Example dataset: ## Dataset from http://www.apsnet.org/education/advancedplantpath/topics/RModules/doc1/04_Linear_regression.html ## Disease severity as a function of temperature # Response variable, disease severity diseasesev<-c(1.9,3.1,3.3,4.8,5.3,6.1,6.4,7.6,9.8,12.4) # Predictor variable, (Centigrade) temperature<-c(2,1,5,5,20,20,23,10,30,25) ## For convenience, the data may be formatted into a dataframe severity <- as.data.frame(cbind(diseasesev,temperature)) ## Fit a linear model for the data and summarize the output from function lm() severity.lm <- lm(diseasesev~temperature,data=severity) jpeg('~/Desktop/test1.jpg') # Take a look at the data plot( diseasesev~temperature, data=severity, xlab="Temperature", ylab="% Disease Severity", pch=16, pty="s", xlim=c(0,30), ylim=c(0,30) ) title(main="Graph of % Disease Severity vs Temperature") par(new=TRUE) # don't start a new plot ## Get datapoints predicted by best fit line and confidence bands ## at every 0.01 interval xRange=data.frame(temperature=seq(min(temperature),max(temperature),0.01)) pred4plot <- predict( lm(diseasesev~temperature), xRange, level=0.95, interval="confidence" ) ## Plot lines derrived from best fit line and confidence band datapoints matplot( xRange, pred4plot, lty=c(1,2,2), #vector of line types and widths type="l", #type of plot for each column of y xlim=c(0,30), ylim=c(0,30), xlab="", ylab="" )

    Read the article

  • PHP Missing Function In Older Version

    - by Umair Ashraf
    My this PHP function converts a datetime string into more readable way to represent passed date and time. This is working perfect in PHP version 5.3.0 but on the server side it is PHP version 5.2.17 which lacks this function. Is there a way I can fix this efficiently? This is not only a function which needs this "diff" function but there are many more. public function ago($dt1) { $interval = date_create('now')->diff(date_create($dt1)); $suffix = ($interval->invert ? ' ago' : '-'); if ($v = $interval->y >= 1) return $this->pluralize($interval->y, 'year') . $suffix; if ($v = $interval->m >= 1) return $this->pluralize($interval->m, 'month') . $suffix; if ($v = $interval->d >= 1) return $this->pluralize($interval->d, 'day') . $suffix; if ($v = $interval->h >= 1) return $this->pluralize($interval->h, 'hour') . $suffix; if ($v = $interval->i >= 1) return $this->pluralize($interval->i, 'minute') . $suffix; return $this->pluralize($interval->s, 'second') . $suffix; }

    Read the article

  • C# Executing timed commands with varying times

    - by Gio Borje
    I have a timer control and a grid with a List of coordinates for the grid. I was wondering how I could use the timer control or any other control in order to execute code in the interval, coordinate.Time as it varies for each coordinate. Also, thread.sleep(time) is not an option for me. foreach (Coordinate coordinate in this.Macro) { coordinate.Time; coordinate.Initial; coordinate.Final; ... executecode @ coordinate.Time. }

    Read the article

  • Optimal two variable linear regression SQL statement (censoring outliers)

    - by Dave Jarvis
    Problem Am looking to apply the y = mx + b equation (where m is SLOPE, b is INTERCEPT) to a data set, which is retrieved as shown in the SQL code. The values from the (MySQL) query are: SLOPE = 0.0276653965651912 INTERCEPT = -57.2338357550468 SQL Code SELECT ((sum(t.YEAR) * sum(t.AMOUNT)) - (count(1) * sum(t.YEAR * t.AMOUNT))) / (power(sum(t.YEAR), 2) - count(1) * sum(power(t.YEAR, 2))) as SLOPE, ((sum( t.YEAR ) * sum( t.YEAR * t.AMOUNT )) - (sum( t.AMOUNT ) * sum(power(t.YEAR, 2)))) / (power(sum(t.YEAR), 2) - count(1) * sum(power(t.YEAR, 2))) as INTERCEPT FROM (SELECT D.AMOUNT, Y.YEAR FROM CITY C, STATION S, YEAR_REF Y, MONTH_REF M, DAILY D WHERE -- For a specific city ... -- C.ID = 8590 AND -- Find all the stations within a 15 unit radius ... -- SQRT( POW( C.LATITUDE - S.LATITUDE, 2 ) + POW( C.LONGITUDE - S.LONGITUDE, 2 ) ) <15 AND -- Gather all known years for that station ... -- S.STATION_DISTRICT_ID = Y.STATION_DISTRICT_ID AND -- The data before 1900 is shaky; insufficient after 2009. -- Y.YEAR BETWEEN 1900 AND 2009 AND -- Filtered by all known months ... -- M.YEAR_REF_ID = Y.ID AND -- Whittled down by category ... -- M.CATEGORY_ID = '001' AND -- Into the valid daily climate data. -- M.ID = D.MONTH_REF_ID AND D.DAILY_FLAG_ID <> 'M' GROUP BY Y.YEAR ORDER BY Y.YEAR ) t Data The data is visualized here (with five outliers highlighted): Questions How do I return the y value against all rows without repeating the same query to collect and collate the data? That is, how do I "reuse" the list of t values? How would you change the query to eliminate outliers (at an 85% confidence interval)? The following results (to calculate the start and end points of the line) appear incorrect. Why are the results off by ~10 degrees (e.g., outliers skewing the data)? (1900 * 0.0276653965651912) + (-57.2338357550468) = -4.66958228 (2009 * 0.0276653965651912) + (-57.2338357550468) = -1.65405406 I would have expected the 1900 result to be around 10 (not -4.67) and the 2009 result to be around 11.50 (not -1.65). Thank you!

    Read the article

  • Optimal two variable linear regression SQL statement

    - by Dave Jarvis
    Problem Am looking to apply the y = mx + b equation (where m is SLOPE, b is INTERCEPT) to a data set, which is retrieved as shown in the SQL code. The values from the (MySQL) query are: SLOPE = 0.0276653965651912 INTERCEPT = -57.2338357550468 SQL Code SELECT ((sum(t.YEAR) * sum(t.AMOUNT)) - (count(1) * sum(t.YEAR * t.AMOUNT))) / (power(sum(t.YEAR), 2) - count(1) * sum(power(t.YEAR, 2))) as SLOPE, ((sum( t.YEAR ) * sum( t.YEAR * t.AMOUNT )) - (sum( t.AMOUNT ) * sum(power(t.YEAR, 2)))) / (power(sum(t.YEAR), 2) - count(1) * sum(power(t.YEAR, 2))) as INTERCEPT FROM (SELECT D.AMOUNT, Y.YEAR FROM CITY C, STATION S, YEAR_REF Y, MONTH_REF M, DAILY D WHERE -- For a specific city ... -- C.ID = 8590 AND -- Find all the stations within a 5 unit radius ... -- SQRT( POW( C.LATITUDE - S.LATITUDE, 2 ) + POW( C.LONGITUDE - S.LONGITUDE, 2 ) ) <15 AND -- Gather all known years for that station ... -- S.STATION_DISTRICT_ID = Y.STATION_DISTRICT_ID AND -- The data before 1900 is shaky; and insufficient after 2009. -- Y.YEAR BETWEEN 1900 AND 2009 AND -- Filtered by all known months ... -- M.YEAR_REF_ID = Y.ID AND -- Whittled down by category ... -- M.CATEGORY_ID = '001' AND -- Into the valid daily climate data. -- M.ID = D.MONTH_REF_ID AND D.DAILY_FLAG_ID <> 'M' GROUP BY Y.YEAR ORDER BY Y.YEAR ) t Data The data is visualized here: Questions How do I return the y value against all rows without repeating the same query to collect and collate the data? That is, how do I "reuse" the list of t values? How would you change the query to eliminate outliers (at an 85% confidence interval)? The following results (to calculate the start and end points of the line) appear incorrect. Why are the results off by ~10 degrees (e.g., outliers skewing the data)? (1900 * 0.0276653965651912) + (-57.2338357550468) = -4.66958228 (2009 * 0.0276653965651912) + (-57.2338357550468) = -1.65405406 I would have expected the 1900 result to be around 10 (not -4.67) and the 2009 result to be around 11.50 (not -1.65). Thank you!

    Read the article

  • Linux Experts Riddle: Network output of 10MB/s on 10GB/s NIC

    - by user150324
    I have two CentOS 6 servers. I am trying to transfer files between them. Source server has 10GB/s NIC nd destination server has 1GB/s NIC. Regardless to the command used nor the protocol, the transfer speed is ~1 Mega byte per second. The goal is at least couple dozens MB per second. I have tried: rsync (also with various encryptions), scp, wget, aftp, nc. Here's some testing results with iperf: [root@serv ~]# iperf -c XXX.XXX.XXX.XXX -i 1 ------------------------------------------------------------ Client connecting to XXX.XXX.XXX.XXX, TCP port 5001 TCP window size: 64.0 KByte (default) ------------------------------------------------------------ [ 3] local XXX.XXX.XXX.XXX port 33180 connected with XXX.XXX.XXX.XXX port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0- 1.0 sec 1.30 MBytes 10.9 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 1.0- 2.0 sec 1.28 MBytes 10.7 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 2.0- 3.0 sec 1.34 MBytes 11.3 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 3.0- 4.0 sec 1.53 MBytes 12.8 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 4.0- 5.0 sec 1.65 MBytes 13.8 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 5.0- 6.0 sec 1.79 MBytes 15.0 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 6.0- 7.0 sec 1.95 MBytes 16.3 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 7.0- 8.0 sec 1.98 MBytes 16.6 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 8.0- 9.0 sec 1.91 MBytes 16.0 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 9.0-10.0 sec 2.05 MBytes 17.2 Mbits/sec [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.0 sec 1.68 MBytes 14.0 Mbits/sec I guess HD is not the bottleneck here.

    Read the article

  • What are the pros and cons of a non-fixed-interval update loop?

    - by akonsu
    I am studying various approaches to implementing a game loop and I have found this article. In the article the author implements a loop which, if the processing falls behind in time, skips frame renderings and just updates the game in a loop (the last variant called "Constant Game Speed independent of Variable FPS"). I do not understand why it is acceptable to call update_game() in a loop without making sure the update function is called at a particular interval. I do not see any value in doing this. I would think that in my game I want to be sure the game is updated periodically with a known period. So maybe it is worthwhile to have two threads, one would call update periodically, and the other one would redraw the game, also periodically? Would this be a good and practical approach? Of course I would need to synchronise the threads.

    Read the article

  • Is it okay for an application to check for automatic updates in less than 20 hour interval?

    - by FlameStream
    I have a desktop application that has the ability to automatically update itself on the next restart (without the user's consent - but this is another issue altogether). Assuming that the user would never notice anything related to application updating (such as a progress bar, or pop-up requiring restart), and that our server would support the request spam load, is there any reason why it should not check for updates in less than 20 hour interval? The reason I'm asking this is because all applications that I know that have auto-update capability check for update every 20 to 24 hours and at startup. I was just wondering if there was an ethical rule about it, or simply because of the risk of overloading the server.

    Read the article

  • Consecutive absences in MySQL

    - by pepersview
    Hi, I have 2 tables in my db: students and absences. In students: id_student, s_name; and in absences: id_student, date, day(the day of the week as number-it's not so important); I would like to get the students that were absent for more than 2 days consecutive and the dates. At the moment I have the next query: /*To control when the days are in the same week*/ SELECT id_student, date, dayname(date),date_add(date, INTERVAL 1 DAY) AS a, dayname(date_add(date, INTERVAL 1 DAY)) AS an, date_add(date, INTERVAL 2 DAY) AS b, dayname(date_add(date, INTERVAL 2 DAY)) AS bn FROM absences AS a WHERE id_student IN (SELECT id_student FROM absences WHERE id_student = a.id_student AND date = date_add(a.date, INTERVAL 1 DAY) ) AND id_student IN (SELECT id_student FROM absences WHERE id_student = a.id_student AND date = date_add(a.date,INTERVAL 2 DAY) ) UNION /*To control when the days jump to the next week*/ SELECT id_student, date, dayname(date),date_add(date, INTERVAL 3 DAY) AS a, dayname(date_add(date, INTERVAL 3 DAY)) AS an, date_add(date, INTERVAL 4 DAY) AS b, dayname(date_add(date, INTERVAL 4 DAY)) AS bn FROM absences AS a WHERE id_student IN (SELECT id_student FROM absences WHERE id_student = a.id_student AND date = date_add(a.date, INTERVAL 3 DAY) ) AND id_student IN (SELECT id_student FROM absences WHERE id_student = a.id_student AND date = date_add(a.date,INTERVAL 4 DAY) ) /* To avoid the case (Monday-Thursday-Friday) to be consider as consecutive days*/ AND WEEKDAY(date) !=0 Thanks

    Read the article

  • How to add markers on Google Maps polylines based on distance along the line?

    - by mikl
    I am trying to create a Google Map where the user can plot the route he walked/ran/bicycled and see how long he ran. The GPolyline class with it’s getLength() method is very helpful in this regard (at least for Google Maps API V2), but I wanted to add markers based on distance, for example a marker for 1 km, 5 km, 10 km, etc., but it seems that there is no obvious way to find a point on a polyline based on how far along the line it is. Any suggestions?

    Read the article

  • Update count every second causing massive memory problems

    - by Josh
    Just on my local machine, trying the run the following script causes my computer to crash... What am I doing wrong? (function($) { var count = '6824756980'; while (count > 0) { setInterval(function() { $('#showcount').html(Math.floor(count-1)); count--; }, 1000 ); } })(jQuery); All I need to do is subtract one from the var "count" and update/display it's value every second.

    Read the article

  • Calculating confidence intervals for a non-normal distribution

    - by Josiah
    Hi all, First, I should specify that my knowledge of statistics is fairly limited, so please forgive me if my question seems trivial or perhaps doesn't even make sense. I have data that doesn't appear to be normally distributed. Typically, when I plot confidence intervals, I would use the mean +- 2 standard deviations, but I don't think that is acceptible for a non-uniform distribution. My sample size is currently set to 1000 samples, which would seem like enough to determine if it was a normal distribution or not. I use Matlab for all my processing, so are there any functions in Matlab that would make it easy to calculate the confidence intervals (say 95%)? I know there are the 'quantile' and 'prctile' functions, but I'm not sure if that's what I need to use. The function 'mle' also returns confidence intervals for normally distributed data, although you can also supply your own pdf. Could I use ksdensity to create a pdf for my data, then feed that pdf into the mle function to give me confidence intervals? Also, how would I go about determining if my data is normally distributed. I mean I can currently tell just by looking at the histogram or pdf from ksdensity, but is there a way to quantitatively measure it? Thanks!

    Read the article

  • JavaScript apparently waits for each AJAX call before sending another in a loop

    - by itako
    Hello. Straight to the point: I have this javascript: for(item=1;item<5;item++) { xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET",'zzz.php', true); xmlhttp.send(); } And in PHP file something like this: usleep(5);die('ok'); Now the problem is javascript seems to be waiting for each ajax call to be completed before sending another one. So the first response gets back after approx. 5 seconds, next after 10 seconds and so on. That's a very simplified version of what I do, since the real script involves using cURL in PHP and jQuery as JS lib. But the problem remains the same. Why do responses come back in 5 second intervals?

    Read the article

  • (iphone) can i give different intervals between images when animating?

    - by Eugene
    Hi, I'm animating several image as follows. UIImageView* animationView = [[UIImageView alloc] initWithFrame: self.animationViewContainer.bounds]; animationView.animationImages = animationArray; animationView.animationDuration = 0.5; animationView.animationRepeatCount = 5; [animationView startAnimating]; What I'd like to do is, controlling duration between animationImages. For instance, show image1 for 0.3 sec image2 for 0.5 sec.. There must be some way to do this, but hard to find an answer. I've asked the same question here before, but wording of the question wasn't so clear. Thank you

    Read the article

  • How To Run A Shell Script Again And Again Having X Interval Of Time?

    - by Muhammad Hassan
    I have a shell script in my Ubuntu Server 14.04 LTS at ./ShellScript.sh. I setup /etc/rc.local to run the shell script after boot but before login using below code. Run this: sudo nano /etc/rc.local then add following and save. #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. #!/bin/bash ./ShellScript.sh exit 0 Now I want to run/execute this shell script again and again having 15min of time interval between every run after boot but before login. So Can I do it? Update 1:) When I run crontab -e then I got the following. Now What to do? no crontab for root - using an empty one Select an editor. To change later, run 'select-editor'. 1. /bin/ed 2. /bin/nano <---- easiest 3. /usr/bin/vim.basic 4. /usr/bin/vim.tiny Choose 1-4 [2]: After selecting 2, I got crontab: "/usr/bin/sensible-editor" exited with status 2 UPDATE 2:) Update ShellScript.sh like below... #!/bin/bash # Testing ShellScript... while true do echo "ShellScript Start Running..." ********************************** All My Shell Script Codes/Script/Commands ********************************** echo "ShellScript End Running..." exit 0 sleep 900 done Then Run this: sudo nano /etc/rc.local then add following and save. #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. sh ./ShellScript.sh & exit 0

    Read the article

  • Corosync :: Restarting some resources after Lan connectivity issue

    - by moebius_eye
    I am currently looking into corosync to build a two-node cluster. So, I've got it working fine, and it does what I want to do, which is: Lost connectivity between the two nodes gives the first node '10node' both Failover Wan IPs. (aka resources WanCluster100 and WanCluster101 ) '11node' does nothing. He "thinks" he still has his Failover Wan IP. (aka WanCluster101) But it doesn't do this: '11node' should restart the WanCluster101 resource when the connectivity with the other node is back. This is to prevent a condition where node10 simply dies (and thus does not get 11node's Failover Wan IP), resulting in a situation where none of the nodes have 10node's failover IP because 10node is down 11node has "given back" his failover Wan IP. Here's the current configuration I'm working on. node 10sch \ attributes standby="off" node 11sch \ attributes standby="off" primitive LanCluster100 ocf:heartbeat:IPaddr2 \ params ip="172.25.0.100" cidr_netmask="32" nic="eth3" \ op monitor interval="10s" \ meta is-managed="true" target-role="Started" primitive LanCluster101 ocf:heartbeat:IPaddr2 \ params ip="172.25.0.101" cidr_netmask="32" nic="eth3" \ op monitor interval="10s" \ meta is-managed="true" target-role="Started" primitive Ping100 ocf:pacemaker:ping \ params host_list="192.0.2.1" multiplier="500" dampen="15s" \ op monitor interval="5s" \ meta target-role="Started" primitive Ping101 ocf:pacemaker:ping \ params host_list="192.0.2.1" multiplier="500" dampen="15s" \ op monitor interval="5s" \ meta target-role="Started" primitive WanCluster100 ocf:heartbeat:IPaddr2 \ params ip="192.0.2.100" cidr_netmask="32" nic="eth2" \ op monitor interval="10s" \ meta target-role="Started" primitive WanCluster101 ocf:heartbeat:IPaddr2 \ params ip="192.0.2.101" cidr_netmask="32" nic="eth2" \ op monitor interval="10s" \ meta target-role="Started" primitive Website0 ocf:heartbeat:apache \ params configfile="/etc/apache2/apache2.conf" options="-DSSL" \ operations $id="Website-one" \ op start interval="0" timeout="40" \ op stop interval="0" timeout="60" \ op monitor interval="10" timeout="120" start-delay="0" statusurl="http://127.0.0.1/server-status/" \ meta target-role="Started" primitive Website1 ocf:heartbeat:apache \ params configfile="/etc/apache2/apache2.conf.1" options="-DSSL" \ operations $id="Website-two" \ op start interval="0" timeout="40" \ op stop interval="0" timeout="60" \ op monitor interval="10" timeout="120" start-delay="0" statusurl="http://127.0.0.1/server-status/" \ meta target-role="Started" group All100 WanCluster100 LanCluster100 group All101 WanCluster101 LanCluster101 location AlwaysPing100WithNode10 Ping100 \ rule $id="AlWaysPing100WithNode10-rule" inf: #uname eq 10sch location AlwaysPing101WithNode11 Ping101 \ rule $id="AlWaysPing101WithNode11-rule" inf: #uname eq 11sch location NeverLan100WithNode11 LanCluster100 \ rule $id="RAND1083308" -inf: #uname eq 11sch location NeverPing100WithNode11 Ping100 \ rule $id="NeverPing100WithNode11-rule" -inf: #uname eq 11sch location NeverPing101WithNode10 Ping101 \ rule $id="NeverPing101WithNode10-rule" -inf: #uname eq 10sch location Website0NeedsConnectivity Website0 \ rule $id="Website0NeedsConnectivity-rule" -inf: not_defined pingd or pingd lte 0 location Website1NeedsConnectivity Website1 \ rule $id="Website1NeedsConnectivity-rule" -inf: not_defined pingd or pingd lte 0 colocation Never -inf: LanCluster101 LanCluster100 colocation Never2 -inf: WanCluster100 LanCluster101 colocation NeverBothWebsitesTogether -inf: Website0 Website1 property $id="cib-bootstrap-options" \ dc-version="1.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff" \ cluster-infrastructure="openais" \ expected-quorum-votes="2" \ no-quorum-policy="ignore" \ stonith-enabled="false" \ last-lrm-refresh="1408954702" \ maintenance-mode="false" rsc_defaults $id="rsc-options" \ resource-stickiness="100" \ migration-threshold="3" I also have a less important question concerning this line: colocation NeverBothLans -inf: LanCluster101 LanCluster100 How do I tell it that this collocation only applies to '11node'.

    Read the article

  • SQL SERVER – Capturing Wait Types and Wait Stats Information at Interval – Wait Type – Day 5 of 28

    - by pinaldave
    Earlier, I have tried to cover some important points about wait stats in detail. Here are some points that we had covered earlier. DMV related to wait stats reset when we reset SQL Server services DMV related to wait stats reset when we manually reset the wait types However, at times, there is a need of making this data persistent so that we can take a look at them later on. Sometimes, performance tuning experts do some modifications to the server and try to measure the wait stats at that point of time and after some duration. I use the following method to measure the wait stats over the time. -- Create Table CREATE TABLE [MyWaitStatTable]( [wait_type] [nvarchar](60) NOT NULL, [waiting_tasks_count] [bigint] NOT NULL, [wait_time_ms] [bigint] NOT NULL, [max_wait_time_ms] [bigint] NOT NULL, [signal_wait_time_ms] [bigint] NOT NULL, [CurrentDateTime] DATETIME NOT NULL, [Flag] INT ) GO -- Populate Table at Time 1 INSERT INTO MyWaitStatTable ([wait_type],[waiting_tasks_count],[wait_time_ms],[max_wait_time_ms],[signal_wait_time_ms], [CurrentDateTime],[Flag]) SELECT [wait_type],[waiting_tasks_count],[wait_time_ms],[max_wait_time_ms],[signal_wait_time_ms], GETDATE(), 1 FROM sys.dm_os_wait_stats GO ----- Desired Delay (for one hour) WAITFOR DELAY '01:00:00' -- Populate Table at Time 2 INSERT INTO MyWaitStatTable ([wait_type],[waiting_tasks_count],[wait_time_ms],[max_wait_time_ms],[signal_wait_time_ms], [CurrentDateTime],[Flag]) SELECT [wait_type],[waiting_tasks_count],[wait_time_ms],[max_wait_time_ms],[signal_wait_time_ms], GETDATE(), 2 FROM sys.dm_os_wait_stats GO -- Check the difference between Time 1 and Time 2 SELECT T1.wait_type, T1.wait_time_ms Original_WaitTime, T2.wait_time_ms LaterWaitTime, (T2.wait_time_ms - T1.wait_time_ms) DiffenceWaitTime FROM MyWaitStatTable T1 INNER JOIN MyWaitStatTable T2 ON T1.wait_type = T2.wait_type WHERE T2.wait_time_ms > T1.wait_time_ms AND T1.Flag = 1 AND T2.Flag = 2 ORDER BY DiffenceWaitTime DESC GO -- Clean up DROP TABLE MyWaitStatTable GO If you notice the script, I have used an additional column called flag. I use it to find out when I have captured the wait stats and then use it in my SELECT query to SELECT wait stats related to that time group. Many times, I select more than 5 or 6 different set of wait stats and I find this method very convenient to find the difference between wait stats. In a future blog post, we will talk about specific wait stats. Read all the post in the Wait Types and Queue series. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL DMV, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQL Wait Stats, SQL Wait Types, T SQL, Technology

    Read the article

  • Jasmine testing coffeescript expect(setTimeout).toHaveBeenCalledWith

    - by Lee Quarella
    In the process of learning Jasmine, I've come to this issue. I want a basic function to run, then set a timeout to call itself again... simple stuff. class @LoopObj constructor: -> loop: (interval) -> #do some stuff setTimeout((=>@loop(interval)), interval) But I want to test to make sure the setTimeout was called with the proper args describe "loop", -> xit "does nifty things", -> it "loops at a given interval", -> my_nifty_loop = new LoopObj interval = 10 spyOn(window, "setTimeout") my_nifty_loop.loop(interval) expect(setTimeout).toHaveBeenCalledWith((-> my_nifty_loop.loop(interval)), interval) I get this error: Expected spy setTimeout to have been called with [ Function, 10 ] but was called with [ [ Function, 10 ] ] Is this because the (-> my_nifty_loop.loop(interval)) function does not equal the (=>@loop(interval)) function? Or does it have something to do with the extra square brackets around the second [ [ Function, 10 ] ]? Something else altogther? Where have I gone wrong?

    Read the article

  • Excel, Pivot Calculated formula: SUM(Field1)/AVG(Field2)

    - by Bas
    I've a simple table with some amount and interval in sec by date and product name. Month | Product | Amount | Interval in sec ------------------------------------------ 05-'12| Prod A | 10 | 5 05-'12| Prod A | 3 | 5 05-'12| Prod B | 4 | 5 05-'12| Prod C | 13 | 5 05-'12| Prod C | 5 | 5 From this table I've derived a Pivot table with SUM(Amount), AVERAGE(Interval in sec) by Month and Product. Month | Product | SUM of Amount | AVG of Interval in sec -------------------------------------------------------- 05-'12| Prod A | 13 | 5 05-'12| Prod B | 4 | 5 05-'12| Prod C | 18 | 5 So far So good... Now i want to add and extra column to my Pivot table with gives me the outcome of SUM of Amount / AVG of Interval in sec Adding a calculated value =SUM(Amount)/AVERAGE(Interval) is not giving me the right values. Exel gives me. Month | Product | SUM of Amount | AVG of Interval in sec | Amount per sec ------------------------------------------------------------------------- 05-'12| Prod A | 13 | 5 | 1.3 05-'12| Prod B | 4 | 5 | 0.8 05-'12| Prod C | 18 | 5 | 1.8 What it actually is doing is =SUM(Amount)/SUM(Interval in sec) for every Month and Product based on the values in the first table... But I'm looking for Month | Product | SUM of Amount | AVG of Interval in sec | Amount per sec ------------------------------------------------------------------------- 05-'12| Prod A | 13 | 5 | 2.6 05-'12| Prod B | 4 | 5 | 0.8 05-'12| Prod C | 18 | 5 | 3.6 So litterly devide pivot field 'Sum of Amount' by pivot field 'AVG of Interval in sec' How to achieve this? Thank you in advanced

    Read the article

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