Search Results

Search found 1486 results on 60 pages for 'counter'.

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

  • Facebook Share Button and Counter no longer displaying any Count

    - by donaldthe
    Is it just me or did the Facebook Share button that displays the count of shares and likes just stop working over the past few days? The sharing still works, the count of shares no longer displays. The link that is generated look like this http://www.facebook.com/sharer.php?u= and the JavaScript file on my page is this http://static.ak.fbcdn.net/connect.php/js/FB.Share I haven't changed anything and this has worked for years

    Read the article

  • Triggering State Changes with Health Counter

    - by Hairgami_Master
    I'm developing a game where the player changes states as their health decreases. Below 50, it should trigger animation1. Below 30, it should trigger animation2. The problem is, I only want to trigger animation1 once. But my game timer is checking every "frame", so it's triggering animation1 every cycle below 50. I only want it to trigger once, then not again until it's gone over 50 and then naturally decreased back to below 50. Are there any tried and true strategies for triggering state changes as a timer counts down (without the over-triggering problem)? I thought I could say: if (health == 50) animation1.play(); but sometimes, health never equals exactly 50, so it will skip right past that statement.

    Read the article

  • I've got to update a column in one SQL table with a counter stored in another table, and update that

    - by Bucket
    I'm using SQL server 2005 (for testing) & 2007 (for production). I have to add a unique record ID to all the records in my table, in an existing column, using a "last record ID" column from another table. So, I'm going to do some sort of UPDATE of my table, but I have to get the "last record ID" from the other table, increment it, update THAT table and then update my record. Can anyone give me an example of how to do this? Other users may be incrementing the counter also.

    Read the article

  • iOS - UISlider - How to make a slider to auto-move [closed]

    - by drodri420
    its me again. Coming back with another noobish question: This time its , can you make a UISlider move by itself??? I've implemented this on the .m ///This right here makes a slider move 1point from 1 to 100, once it reaches 100 it goes backwards and so on... - (IBAction)moveSlider:(UISlider *)sender { int flag=0, counter=1; while(flag == 0) { counter = counter + (.25 * round); if(counter == 100) { flag = 1; } if(counter < 100 && counter > 1) { slider.value = counter; } } while(flag == 1) { counter = counter - (.25 * round); if(counter == 1) { flag = 0; } if(counter < 100 && counter > 1) { slider.value = counter; } } } And Implemented this on another action: -(void)startNewRound { round+=1; targetValue = 1 + (arc4random() % 100); self.slider.value = currentValue; [self moveSlider:slider]; } I think I lost it along the way and Im just typing pure nonsense but If anyone could point me in the right direction on to which is it that Im doing wrong??

    Read the article

  • I can't figure out why this fps counter is inaccurate.

    - by rmetzger
    I'm trying to track frames per second in my game. I don't want the fps to show as an average. I want to see how the frame rate is affected when I push keys and add models etc. So I am using a variable to store the current time and previous time, and when they differ by 1 second, then I update the fps. My problem is that it is showing around 33fps but when I move the mouse around really fast, the fps jumps up to 49fps. Other times, if I change a simple line of code elsewhere not related to the frame counter, or close the project and open it later, the fps will be around 60. Vsync is on so I can't tell if the mouse is still effecting the fps. Here is my code which is in an update function that happens every frame: FrameCount++; currentTime = timeGetTime (); static unsigned long prevTime = currentTime; TimeDelta = (currentTime - prevTime) / 1000; if (TimeDelta > 1.0f) { fps = FrameCount / TimeDelta; prevTime = currentTime; FrameCount = 0; TimeDelta = 0; } Here are the variable declarations: int FrameCount; double fps, currentTime, prevTime, TimeDelta, TimeElapsed; Please let me know what is wrong here and how to fix it, or if you have a better way to count fps. Thanks!!!!!! I am using DirectX 9 btw but I doubt that is relevant, and I am using PeekMessage. Should I be using an if else statement instead? Here is my message processing loop: MSG msg; ZeroMemory (&msg, sizeof (MSG)); while (msg.message != WM_QUIT) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage (&msg); DispatchMessage (&msg); } Update (); RenderFrame (); }

    Read the article

  • iOS: click counter for row in tableview

    - by roger.arliner21
    I am developing and tableView in which in each row I have to display the click counter and row number.Each cell must have an initial click counter value of 0 when application is initialized. Then increment the click counter value within a cell whenever a user clicks on the cell. I have take 26 fixed rows. I have taken tableData.plist file as in the attached image. I am initializing the self.dataArray with the plist . Now I want to do implementation in the didSelectRowAtIndexPath delegate method,if any row is tapped that row's click counter should increment. - (void)viewDidLoad { [super viewDidLoad]; NSString *path = [[NSBundle mainBundle] pathForResource:@"tableData" ofType:@"plist"]; self.dataArray = [NSMutableArray arrayWithContentsOfFile:path];//array initialized with plist } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.dataArray count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *kCustomCellID = @"MyCellID"; UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(160.0f, 2.0f, 30.0f, 20.0f)]; UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(160.0f, 24.0f, 30.0f, 30.0f)]; label2.textColor = [UIColor grayColor]; UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:kCustomCellID]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:kCustomCellID] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } if([self.dataArray count]>indexPath.row) { label1.text = [[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"Lable1"]; label2.text =[[self.dataArray objectAtIndex:indexPath.row] objectForKey:@"Lable2"]; } else { label1.text = @""; label2.text =@""; } [cell.contentView addSubview:label1]; [cell.contentView addSubview:label2]; [label1 release]; [label2 release]; return cell; } #pragma mark - #pragma mark Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //implementation for row counter incrementer. }

    Read the article

  • working validation hint, working word counter but not working together

    - by Sriyani Rathnayaka
    I added a word counter to a my form's textarea... it is something like this... <div> <label>About you:</label> <textarea id="qualification" class="textarea hint_needed" rows="4" cols="30" ></textarea> <span class="hint">explain about you</span> <script type="text/javascript"> $("textarea").textareaCounter(); </script> </div> My problem is when I add textaracounter() like this my validation hint is not working.. when I remover the counter function validation hint is working... this is the jquery for hint message.. $(".hint").css({ "display":"none" }); $("input.hint_needed, select.hint_needed, textarea.hint_needed, radio.hint_needed").on("mouseenter", function() { $(this).next(".hint").css({ "display":"inline" }); }).on("mouseleave", function() { $(this).next(".hint").css({ "display":"none" }); }); this is for the word counter.. (function($){ $.fn.textareaCounter = function(options) { // setting the defaults // $("textarea").textareaCounter({ limit: 100 }); var defaults = { limit: 150 }; var options = $.extend(defaults, options); // and the plugin begins return this.each(function() { var obj, text, wordcount, limited; obj = $("#experience"); obj.after('<span style="font-weight: bold; color:#6a6a6a; clear: both; margin: 3px 0 0 150px; float: left; overflow: hidden;" id="counter-text">Max. '+options.limit+' words</span>'); obj.keyup(function() { text = obj.val(); if(text === "") { wordcount = 0; } else { wordcount = $.trim(text).split(" ").length; } if(wordcount > options.limit) { $("#counter-text").html('<span style="color: #DD0000;">0 words left</span>'); limited = $.trim(text).split(" ", options.limit); limited = limited.join(" "); $(this).val(limited); } else { $("#counter-text").html((options.limit - wordcount)+' words left'); } }); }); }; })(jQuery); can anybody tell me what is the problem there? Thank you..

    Read the article

  • jQuery API counter++ pause on hover and then resume

    - by Rory
    I need to have this counter pause {stay on current div) while mouseover or hover and resume counter when mouseout. I have tried many ways but still new to jQuery API. <div id="slide_holder"> <div id="slide1" class="hidden"> <img src="images/crane2.jpg" class="fill"> </div> <div id="slide2" class="hidden"> <img src="images/extend_boom.png" class="fill"> </div> <div id="slide3" class="hidden"> <img src="images/Transformers-Bumblebee.jpg" class="fill"> </div> <script> $(function () { var counter = 0, divs = $('#slide1, #slide2, #slide3'); function showDiv () { divs.hide() // hide all divs .filter(function (index) { return index == counter % 3; }) // figure out correct div to show .fadeIn('slow'); // and show it counter++; }; // function to loop through divs and show correct div showDiv(); // show first div setInterval(function () { showDiv(); // show next div }, 3 * 1000); // do this every 10 seconds }); </script>

    Read the article

  • Allowed memory size of 33554432 bytes exhausted (tried to allocate 93 bytes) error in php

    - by Chris
    I inserted the following code: $counter = 1; while($_POST['additional_contact1'] != '' || $_POST['additional_contact2'] != '' || $_POST['additional_contact3'] != '') { if($_POST['additional_contact' . $counter] != '') { $_SESSION['contact'][$counter]['additional_contact'] = $_POST['additional_contact' . $counter]; $_SESSION['contact'][$counter]['additional_int_prefix'] = $_POST['additional_int_prefix' . $counter]; $_SESSION['contact'][$counter]['additional_prefix'] = $_POST['additional_prefix' . $counter]; $_SESSION['contact'][$counter]['additional_first'] = $_POST['additional_first' . $counter]; $_SESSION['contact'][$counter]['additional_last'] = $_POST['additional_last' . $counter]; } else { $_SESSION['contact'][$counter]['additional_contact'] = null; $_SESSION['contact'][$counter]['additional_int_prefix'] = null; $_SESSION['contact'][$counter]['additional_prefix'] = null; $_SESSION['contact'][$counter]['additional_first'] = null; $_SESSION['contact'][$counter]['additional_last'] = null; } $counter++; } and I received this error: Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 93 bytes) I tried to increase the memory limit with ini_set(), but it still won't work at 96M. What am I doing wrong with my code to make it need so much memory? How can I solve this problem?

    Read the article

  • counter and displaylist AS3

    - by VideoDnd
    How can I connect my counter to my display list?I've got a counter and a displaylist working, but I need help with everything in between. Try to explain I finished a Snowflake tutorial. The snowballs are children that are called to the stage. When connected to a dynamic variable, they move around and look like snow. I want my counter to move numbers around. I've got a counter, and I've got a 'for loop' to add children to the stage. link to file http://sandboxfun.weebly.com/ actionscript-3 //DISPLAYLIST "puts stuff on stage" for (var i:int = 0; i < 9; i++) { var t:MovieClip = new Tee(); t.x = 105 + i * 111; addChild(t);100 } //ARRAY //var o:Object = new Object(); <br> //var TeeProps:Dictionary= new Dictionary(true); <br> //var Tees:Array = new Array(); <br> //TeeProps[t] = o; <br> //addChild(t); <br> //Tees.push(t); <br> //} <br> //COUNTER drop in "mytext" text field to see it work var timer:Timer = new Timer(10); var count:int = 0; //start at -1 if you want the first decimal to be 0 var fcount:int = 100; timer.addEventListener(TimerEvent.TIMER, incrementCounter); timer.start(); function incrementCounter(event:TimerEvent) { count++; fcount=int(count*count/1000);//starts out slow... then speeds up // mytext.text = formatCount(fcount); } function formatCount(i:int):String { var fraction:int = i % 100; var whole:int = i / 100; return ("0000000" + whole).substr(-7, 7) + "." + (fraction < 10 ? "0" + fraction : fraction); } I'm rebuilding a earlier version for learning purposes.

    Read the article

  • Perfmon: which counter identifies that threads are waiting?

    - by frankadelic
    While load testing an ASP.NET app, we find that the pages are taking 20-30 sec under heavy load. We suspect this is because the pages are waiting for database calls or web services. Is there a particular perfmon counter that can identify this sort of bottleneck on the web servers? CPU, Memory, and Disk are normal. Or must we use a tool other than perfmon to track down this bottleneck?

    Read the article

  • asp.net ajax progress counter

    - by xt_20
    Hi all, I have a small C# ASP.NET app, and want to include an Ajax progress counter. The architecture is currently like this: Web Application -- calls a class that does the upload For example, in default.aspx, I call : FileHelper fh = new FileHelper() fh.MoveFiles(file) I have an Ajax control that fires when the above is called. This is a control that resides on the website class/project. How do I update the progress counter from the Filehelper class? (I don't think calling the control directly would work as it would be a circular reference) Also how do I continuously update the counter? Thanks all

    Read the article

  • Cassandra performance slow down with counter column

    - by tubcvt
    I have a cluster (4 node ) and a node have 16 core and 24 gb ram: 192.168.23.114 datacenter1 rack1 Up Normal 44.48 GB 25.00% 192.168.23.115 datacenter1 rack1 Up Normal 44.51 GB 25.00% 192.168.23.116 datacenter1 rack1 Up Normal 44.51 GB 25.00% 192.168.23.117 datacenter1 rack1 Up Normal 44.51 GB 25.00% We use about 10 column family (counter column) to make some system statistic report. Problem on here is that When i set replication_factor of this keyspace from 1 to 2 (contain 10 counter column family ), all cpu of node increase from 10% ( when use replication factor=1) to --- 90%. :( :( who can help me work around that :( . why counter column consume too much cpu time :(. thanks all

    Read the article

  • global counter in application: bad practice?

    - by Martin
    In my C++ application I sometimes create different output files for troubleshooting purposes. Each file is created at a different step of our pipelined operation and it's hard to know file came before which other one (file timestamps all show the same date). I'm thinking of adding a global counter in my application, and a function (with multithreading protection) which increments and returns that global counter. Then I can use that counter as part of the filenames I create. Is this considered bad practice? Many different modules need to create files and they're not necessarily connected to each other.

    Read the article

  • Count the prime numbers from 2 to 100 with simpler code than this

    - by RufioLJ
    It has to be with just functions, variables, loops, etc (Basic stuff). I'm having trouble coming up with the code from scratch from what I've I learned so far(Should be able to do it). Makes me really mad :/. If you could give me step by step to make sure I understand I'd really really appreciated. Thanks a bunch in advanced. How could I get the same result with a simpler code than this one: var primes=4; for (var counter = 2; counter <= 100; counter = counter + 1) { var isPrime = 0; if(isPrime === 0){ if(counter === 2){console.log(counter);} else if(counter === 3){console.log(counter);} else if(counter === 5){console.log(counter);} else if(counter === 7){console.log(counter);} else if(counter % 2 === 0){isPrime=0;} else if(counter % 3 === 0){isPrime=0;} else if(counter % 5 === 0){isPrime=0;} else if(counter % 7 === 0){isPrime=0;} else { console.log(counter); primes = primes + 1; } } } console.log("Counted: "+primes+" primes");

    Read the article

  • How to access CSS generated content with JavaScript

    - by Boldewyn
    I generate the numbering of my headers and figures with CSS's counter and content properties: img.figure:after { counter-increment: figure; content: "Fig. " counter(section) "." counter(figure); } This (appropriate browser assumed) gives a nice labelling "Fig. 1.1", "Fig. 1.2" and so on following any image. Question: How can I access this from Javascript? The question is twofold in that I'd like to access either the current value of a certain counter (at a certain DOM node) or the value of the CSS generated content (at a certain DOM node) or, obviously, both information. Background: I'd like to append to links back-referencing to figures the appropriate number, like this: <a href="#fig1">see here</h> ------------------------^ " (Fig 1.1)" inserted via JS As far as I can see, it boils down to this problem: I could access content or counter via getComputedStyle: var fig_content = window.getComputedStyle( document.getElementById('fig-a'), ':after').content; However, this is not the live value, but the one declared in the stylesheet. I cannot find any interface to access the real live value.

    Read the article

  • General monitoring for SQL Server Analysis Services using Performance Monitor

    - by Testas
    A recent customer engagement required a setup of a monitoring solution for SSAS, due to the time restrictions placed upon this, native Windows Performance Monitor (Perfmon) and SQL Server Profiler Monitoring Tools was used as using a third party tool would have meant the customer providing an additional monitoring server that was not available.I wanted to outline the performance monitoring counters that was used to monitor the system on which SSAS was running. Due to the slow query performance that was occurring during certain scenarios, perfmon was used to establish if any pressure was being placed on the Disk, CPU or Memory subsystem when concurrent connections access the same query, and Profiler to pinpoint how the query was being managed within SSAS, profiler I will leave for another blogThis guide is not designed to provide a definitive list of what should be used when monitoring SSAS, different situations may require the addition or removal of counters as presented by the situation. However I hope that it serves as a good basis for starting your monitoring of SSAS. I would also like to acknowledge Chris Webb’s awesome chapters from “Expert Cube Development” that also helped shape my monitoring strategy:http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!6657.entrySimulating ConnectionsTo simulate the additional connections to the SSAS server whilst monitoring, I used ascmd to simulate multiple connections to the typical and worse performing queries that were identified by the customer. A similar sript can be downloaded from codeplex at http://www.codeplex.com/SQLSrvAnalysisSrvcs.     File name: ASCMD_StressTestingScripts.zip. Performance MonitorWithin performance monitor,  a counter log was created that contained the list of counters below. The important point to note when running the counter log is that the RUN AS property within the counter log properties should be changed to an account that has rights to the SSAS instance when monitoring MSAS counters. Failure to do so means that the counter log runs under the system account, no errors or warning are given while running the counter log, and it is not until you need to view the MSAS counters that they will not be displayed if run under the default account that has no right to SSAS. If your connection simulation takes hours, this could prove quite frustrating if not done beforehand JThe counters used……  Object Counter Instance Justification System Processor Queue legnth N/A Indicates how many threads are waiting for execution against the processor. If this counter is consistently higher than around 5 when processor utilization approaches 100%, then this is a good indication that there is more work (active threads) available (ready for execution) than the machine's processors are able to handle. System Context Switches/sec N/A Measures how frequently the processor has to switch from user- to kernel-mode to handle a request from a thread running in user mode. The heavier the workload running on your machine, the higher this counter will generally be, but over long term the value of this counter should remain fairly constant. If this counter suddenly starts increasing however, it may be an indicating of a malfunctioning device, especially if the Processor\Interrupts/sec\(_Total) counter on your machine shows a similar unexplained increase Process % Processor Time sqlservr Definately should be used if Processor\% Processor Time\(_Total) is maxing at 100% to assess the effect of the SQL Server process on the processor Process % Processor Time msmdsrv Definately should be used if Processor\% Processor Time\(_Total) is maxing at 100% to assess the effect of the SQL Server process on the processor Process Working Set sqlservr If the Memory\Available bytes counter is decreaing this counter can be run to indicate if the process is consuming larger and larger amounts of RAM. Process(instance)\Working Set measures the size of the working set for each process, which indicates the number of allocated pages the process can address without generating a page fault. Process Working Set msmdsrv If the Memory\Available bytes counter is decreaing this counter can be run to indicate if the process is consuming larger and larger amounts of RAM. Process(instance)\Working Set measures the size of the working set for each process, which indicates the number of allocated pages the process can address without generating a page fault. Processor % Processor Time _Total and individual cores measures the total utilization of your processor by all running processes. If multi-proc then be mindful only an average is provided Processor % Privileged Time _Total To see how the OS is handling basic IO requests. If kernel mode utilization is high, your machine is likely underpowered as it's too busy handling basic OS housekeeping functions to be able to effectively run other applications. Processor % User Time _Total To see how the applications is interacting from a processor perspective, a high percentage utilisation determine that the server is dealing with too many apps and may require increasing thje hardware or scaling out Processor Interrupts/sec _Total  The average rate, in incidents per second, at which the processor received and serviced hardware interrupts. Shoulr be consistant over time but a sudden unexplained increase could indicate a device malfunction which can be confirmed using the System\Context Switches/sec counter Memory Pages/sec N/A Indicates the rate at which pages are read from or written to disk to resolve hard page faults. This counter is a primary indicator of the kinds of faults that cause system-wide delays, this is the primary counter to watch for indication of possible insufficient RAM to meet your server's needs. A good idea here is to configure a perfmon alert that triggers when the number of pages per second exceeds 50 per paging disk on your system. May also want to see the configuration of the page file on the Server Memory Available Mbytes N/A is the amount of physical memory, in bytes, available to processes running on the computer. if this counter is greater than 10% of the actual RAM in your machine then you probably have more than enough RAM. monitor it regularly to see if any downward trend develops, and set an alert to trigger if it drops below 2% of the installed RAM. Physical Disk Disk Transfers/sec for each physical disk If it goes above 10 disk I/Os per second then you've got poor response time for your disk. Physical Disk Idle Time _total If Disk Transfers/sec is above  25 disk I/Os per second use this counter. which measures the percent time that your hard disk is idle during the measurement interval, and if you see this counter fall below 20% then you've likely got read/write requests queuing up for your disk which is unable to service these requests in a timely fashion. Physical Disk Disk queue legnth For the OLAP and SQL physical disk A value that is consistently less than 2 means that the disk system is handling the IO requests against the physical disk Network Interface Bytes Total/sec For the NIC Should be monitored over a period of time to see if there is anb increase/decrease in network utilisation Network Interface Current Bandwidth For the NIC is an estimate of the current bandwidth of the network interface in bits per second (BPS). MSAS 2005: Memory Memory Limit High KB N/A Shows (as a percentage) the high memory limit configured for SSAS in C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Config\msmdsrv.ini MSAS 2005: Memory Memory Limit Low KB N/A Shows (as a percentage) the low memory limit configured for SSAS in C:\Program Files\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Config\msmdsrv.ini MSAS 2005: Memory Memory Usage KB N/A Displays the memory usage of the server process. MSAS 2005: Memory File Store KB N/A Displays the amount of memory that is reserved for the Cache. Note if total memory limit in the msmdsrv.ini is set to 0, no memory is reserved for the cache MSAS 2005: Storage Engine Query Queries from Cache Direct / sec N/A Displays the rate of queries answered from the cache directly MSAS 2005: Storage Engine Query Queries from Cache Filtered / Sec N/A Displays the Rate of queries answered by filtering existing cache entry. MSAS 2005: Storage Engine Query Queries from File / Sec N/A Displays the Rate of queries answered from files. MSAS 2005: Storage Engine Query Average time /query N/A Displays the average time of a query MSAS 2005: Connection Current connections N/A Displays the number of connections against the SSAS instance MSAS 2005: Connection Requests / sec N/A Displays the rate of query requests per second MSAS 2005: Locks Current Lock Waits N/A Displays thhe number of connections waiting on a lock MSAS 2005: Threads Query Pool job queue Length N/A The number of queries in the job queue MSAS 2005:Proc Aggregations Temp file bytes written/sec N/A Shows the number of bytes of data processed in a temporary file MSAS 2005:Proc Aggregations Temp file rows written/sec N/A Shows the number of bytes of data processed in a temporary file 

    Read the article

  • performance counter

    - by Abruzzo Forte e Gentile
    Hi All I created a performance counter for my C# application. Its type is NumberOfItems32. I don't know why but the Performance Monitor is displaying me on the y-axis only as maximum value only 100 when my counter is much more bigger than this for sure. Do you know if this is the correct behavior or am I doing something wrong? Thanks all AFG

    Read the article

  • C# - Getting a RawFraction Performance Counter to show a persistant value

    - by jacko
    I've created a performance counter that shows a fraction of an incremeted value (RawFraction type) over a base value (RawBase). Unfortunately, when monitoring this value, it only shows the percentage when one of the counters is incremented. At all other times it it is sampled, it shows 0. Is there some way to tell the counter to hold onto the last value until the next time it needs to recalculate the fraction?

    Read the article

  • Hacking prevention, forensics, auditing and counter measures.

    - by tmow
    Recently (but it is also a recurrent question) we saw 3 interesting threads about hacking and security: My server's been hacked EMERGENCY. Finding how a hacked server was hacked File permissions question The last one isn't directly related, but it highlights how easy it is to mess up with a web server administration. As there are several things, that can be done, before something bad happens, I'd like to have your suggestions in terms of good practices to limit backside effects of an attack and how to react in the sad case will happen. It's not just a matter of securing the server and the code but also of auditing, logging and counter measures. Do you have any good practices list or do you prefer to rely on software or on experts that continuously analyze your web server(s) (or nothing at all)? If yes, can you share your list and your ideas/opinions?

    Read the article

  • Solaris kstat sdX disk nread counter value decreasing

    - by mykhal
    I get strange disk io nread (bytes read) counter values (from kstat) on Solaris. Example of collected nread value for sd6 disk collected in 30s interval (command kstat -n sd6): 768579416 768579416 768579416 768579416 768579416 768579416 768579416 768496080 768496080 768496080 768496080 768496080 768496080 768496080 768496080 768530896 768530896 768447560 768447560 768447560 One would suppose that the relative read bytes count can't be negative.. I wonder what can couse this situation and whether there is more reliable disk io data available. Some info about the system: machine:~ # uname -a SunOS machine 5.10 Generic_127112-11 i86pc i386 i86pc machine:~ # cat /etc/release Solaris 10 11/06 s10x_u3wos_10 X86 Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 14 November 2006

    Read the article

  • iphone app time counter

    - by Sam
    I would like to create a time counter in my app that shows the user how many minutes the app has been running the current session and total. How do I create such time counter and how do I save the value to the phone? I'm new to app developement.

    Read the article

  • help fixing pagination class

    - by michael
    here is my pagination class. the data in the construct is just an another class that does db queries and other stuff. the problem that i am having is that i cant seem to get the data output to match the pagination printing and i cant seem to get the mysql_fetch_assoc() to query the data and print it out. i get this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /phpdev/pagination/index.php on line 215 i know that can mean that the query isnt correct for it to fetch the data but i have entered it correctly. sorry for the script being a little long. i thank all in advance for any help. <?php include_once("class.db.php"); mysql_connect("host","login","password"); mysql_select_db("iadcart"); class Pagination { var $adjacents; var $limit; var $param; var $mPage; var $query; var $qData; var $printData; protected $db; function __construct() { $this->db = new MysqlDB; } function show() { $result = $this->db->query($this->query); $totalPages = $this->db->num_rows($result); $limit = $this->limit; /* ------------------------------------- Set Page ------------------------------------- */ if(isset($_GET['page'])) { $page = intval($_GET['page']); $start = ($page - 1) * $limit; } else { $start = 0; } /* ------------------------------------- Set Page Vars ------------------------------------- */ if($page == 0) { $page = 1; } $prev = $page - 1; $next = $page + 1; $lastPage = ceil($totalPages/$limit); $lpm1 = $lastPage - 1; $adjacents = $this->adjacents; $mPage = $this->mPage; //the magic $this->qData = $this->query . " LIMIT $start, $limit"; $this->printData = $this->db->query($this->qData); /* ------------------------------------- Draw Pagination Object ------------------------------------- */ $pagination = ""; if($lastPage > 1) { $pagination .= "<div class='pagination'>"; } /* ------------------------------------- Previous Link ------------------------------------- */ if($page > 1) { $pagination .= "<li><a href='$mPage?page=$prev'> previous </a></li>"; } else { $pagination .= "<li class='previous-off'> previous </li>"; } /* ------------------------------------- Page Numbers (not enough pages - just display active page) ------------------------------------- */ if($lastPage < 7 + ($adjacents * 2)) { for($counter = 1; $counter <= $lastPage; $counter++) { if($counter == $page) { $pagination .= "<li class='active'>$counter</li>"; } else { $pagination .= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } } /* ------------------------------------- Page Numbers (enough pages to paginate) ------------------------------------- */ elseif($lastPage > 5 + ($adjacents * 2)) { //close to beginning; only hide later pages if($page < 1 + ($adjacents * 2)) { for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($counter == $page) { $pagination.= "<li class='active'>$counter</li>"; } else { $pagination.= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } $pagination.= "..."; $pagination.= "<li><a href='$mPage?page=$lpm1'>$lpm1</a></li>"; $pagination.= "<li><a href='$mPage?page=$lastPage'>$lastPage</a></li>"; } elseif($lastPage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { $pagination.= "<li><a href='$mPage?page=1'>1</a></li>"; $pagination.= "<li><a href='$mPage?page=2'>2</a></li>"; $pagination.= "..."; for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { if ($counter == $page) { $pagination.= "<li class='active'>$counter</li>"; } else { $pagination.= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } $pagination.= "..."; $pagination.= "<li><a href='$mPage?page=$lpm1'>$lpm1</a></li>"; $pagination.= "<li><a href='$mPage?page=$lastPage'>$lastPage</a></li>"; } else { $pagination.= "<li><a href='$mPage?page=1'>1</a></li>"; $pagination.= "</li><a href='$mPage?page=2'>2</a></li>"; $pagination.= "..."; for ($counter = $lastPage - (2 + ($adjacents * 2)); $counter <= $lastPage; $counter++) { if ($counter == $page) { $pagination.= "<li class='active'>$counter</li>"; } else { $pagination.= "<li><a href='$mPage?page=$counter'>$counter</a></li>"; } } } } /* ------------------------------------- Next Link ------------------------------------- */ if ($page < $counter - 1) { $pagination.= "<li><a href='$mPage?page=$next'> Next </a></li>"; } else { $pagination.= "<li class='next-off'> Next </li>"; $pagination.= "</div>"; } print $pagination; } } ?> <html> <head> </head> <body> <table style="width:800px;"> <?php mysql_connect("localhost","root","games818"); mysql_select_db("iadcart"); $pagination = new pagination; $pagination->adjacents = 3; $pagination->limit = 10; $pagination->param = $_GET['page']; $pagination->mPage = "index.php"; $pagination->query = "select * from tbl_products where pVisible = 'yes'"; while($row = mysql_fetch_assoc($pagination->printData)) { print $row['pName']; } ?> </table> <br/><br/> <?php $pagination->show(); ?> </body> </html>

    Read the article

  • How to correctly use DERIVE or COUNTER in munin plugins

    - by Johan
    I'm using munin to monitor my server. I've been able to write plugins for it, but only if the graph type is GAUGE. When I try COUNTER or DERIVE, no data is logged or graphed. The plugin i'm currently stuck on is for monitoring bandwidth usage, and is as follows: /etc/munin/plugins/bandwidth2 #!/bin/sh if [ "$1" = "config" ]; then echo 'graph_title Bandwidth Usage 2' echo 'graph_vlabel Bandwidth' echo 'graph_scale no' echo 'graph_category network' echo 'graph_info Bandwidth usage.' echo 'used.label Used' echo 'used.info Bandwidth used so far this month.' echo 'used.type DERIVE' echo 'used.min 0' echo 'remain.label Remaining' echo 'remain.info Bandwidth remaining this month.' echo 'remain.type DERIVE' echo 'remain.min 0' exit 0 fi cat /var/log/zen.log The contents of /var/log/zen.log are: used.value 61.3251953125 remain.value 20.0146484375 And the resulting database is: <!-- Round Robin Database Dump --><rrd> <version> 0003 </version> <step> 300 </step> <!-- Seconds --> <lastupdate> 1269936605 </lastupdate> <!-- 2010-03-30 09:10:05 BST --> <ds> <name> 42 </name> <type> DERIVE </type> <minimal_heartbeat> 600 </minimal_heartbeat> <min> 0.0000000000e+00 </min> <max> NaN </max> <!-- PDP Status --> <last_ds> 61.3251953125 </last_ds> <value> NaN </value> <unknown_sec> 5 </unknown_sec> </ds> <!-- Round Robin Archives --> <rra> <cf> AVERAGE </cf> <pdp_per_row> 1 </pdp_per_row> <!-- 300 seconds --> <params> <xff> 5.0000000000e-01 </xff> </params> <cdp_prep> <ds> <primary_value> NaN </primary_value> <secondary_value> NaN </secondary_value> <value> NaN </value> <unknown_datapoints> 0 </unknown_datapoints> </ds> </cdp_prep> <database> <!-- 2010-03-28 09:15:00 BST / 1269764100 --> <row><v> NaN </v></row> <!-- 2010-03-28 09:20:00 BST / 1269764400 --> <row><v> NaN </v></row> <!-- 2010-03-28 09:25:00 BST / 1269764700 --> <row><v> NaN </v></row> <snip> The value for last_ds is correct, it just doesn't seem to make it into the actual database. If I change DERIVE to GAUGE, it works as expected. munin-run bandwidth2 outputs the contents of /var/log/zen.log I've been all over the (sparse) docs for munin plugins, and can't find my mistake. Modifying an existing plugin didn't work for me either.

    Read the article

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