counter

Program Counter's Increment Won't Work

[亡魂溺海] 提交于 2019-12-11 21:04:45
问题 Everything works but the increment function. It can increment from 0 to 1, 1 to 2, and then from 2 it goes to "1111111111". I'm stumped. Variables: D_IN: Data in PC_OE: Active high. Drives PC_TRI output. PC_LD: Active high synchronously loads D_IN into PC. PC_INC: Active high synchronously increments value in PC. RST: Active high asyncronous reset. PC_COUNT: Current value in PC. Address. PC_TRI: Current value in the PC under tri-state control. When PC_OE = '1', PC_TRI <= PC_COUNT, else high

Nstimer count wrong

我只是一个虾纸丫 提交于 2019-12-11 20:17:03
问题 I have a problem with NSTimer. I start and repeat it every 100ms and I have a counter to check if i runed 10s. The problem is it stoped in near 1 minute, not in 10s. Here is my code timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(checkTimer) userInfo:nil repeats:YES]; -(void)checkTimer { timerCount += 1; if(timerCount == 1) { NSLog(@"start"); } if(timerCount == 103) { NSLog(@"i got it"); } } here is the log: 2012-11-19 08:57:42.063 Karagram[11708:540b] start

Adding a counter to a java program with different methods

故事扮演 提交于 2019-12-11 18:59:52
问题 My program is a math game and will ask the user different questions in different levels. I would like to use a money rewards system that whenever they get one question right, $1000 will be added to their prize. I have tried to do this, however the money doesn't add when an answer is answered correctly. Help please on how I can go about fixing this. import javax.swing.*; import java.io.*; public class mathGame { public static void main (String [] args) throws IOException { BufferedReader

Add Ordinal Suffix to WordPress Counter

我的未来我决定 提交于 2019-12-11 17:54:14
问题 I am trying to add ordinal suffixes to a WordPress Post Counter that I am building for a ranking board. Here is the code I currently have. <?php if(have_posts()): $counter = 1; query_posts('post_type=rushmoor&meta_key=subaru_driver_best_lap&orderby=meta_value_num&order=asc'); while(have_posts()):the_post();?> <?php $driver_best_lap = get_post_meta( get_the_ID(), 'subaru_driver_best_lap', true );?> <li> <div class="name"><?php echo $counter;?> <?php the_title();?></div> <div class="lap-time"><

In Scheme language, how to assign a variable counter in an inner do-loop connected with the outer do-loop?

对着背影说爱祢 提交于 2019-12-11 17:35:34
问题 I want to read 10 case files in Ansys Fluent and for each case file there are 10 data files to be read. Ansys Fluent uses Scheme programming language. I have to managed to get some answers to individual problems in the code here (Evaluating a floating point variable in Scheme language) and here (How to increase counter in a do-loop within Scheme language?), but when collecting the individual answers I realized that I need a new code for the counter which is used to read the data files through

Count items in dictionary

只谈情不闲聊 提交于 2019-12-11 16:14:38
问题 I need to count the the different IDENTIFIERS and print a number count for the them. The information comes from a data stream that looks like this: IDENTIFIER 7756753.940 receivetest: m s 0x0000069a 8 00 00 00 00 00 e4 8a 9a 7756754.409 receivetest: m s 0x00000663 8 2f 00 62 02 00 e4 8a 9a 7756754.878 receivetest: m s 0x0000069e 8 00 1f 5e 28 34 83 59 1a 7756755.348 receivetest: m s 0x00000690 8 00 18 00 28 34 83 59 1a 7756853.908 receivetest: m s 0x0000069a 8 00 00 00 00 00 e4 8a 9a 7756854

How to increase counter in a do-loop within Scheme language?

倖福魔咒の 提交于 2019-12-11 14:15:30
问题 I want do a simple counter increase by one within a do-loop in Scheme language, but I'm not that familiar with the language and have tried many scripts without success. The code is going to be implemented in Ansys Fluent to read multiple case files: (define j 5) (Do ((i 10 (+ i 1))) ((>= i 20)) (ti-menu-load-string (format #f "/file/read-case \"C:/DataProcessing/Case~a-time~a-sec/test/Case~a-time~a-sec.cas\"" i j i j)) (set! j (+ j 1)) ) How to pass the new j value to the do-loop so that I

ASP.NET Visitors counter

社会主义新天地 提交于 2019-12-11 12:04:19
问题 I am creating a counter for my webpage. What wan't to achieve is that every time user visits my asp.net application, it stores his data into database. I am using Global.asax and event Application_Start. Here is my code . protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); WebpageCounter.SaveVisitor(new WebpageVisitor() { VisitorIP = HttpContext.Current.Request.UserHostAddress, VisitedOn = DateTime.Now }); } But it never stores anything

Counter variable does not persist when loading a new page

♀尐吖头ヾ 提交于 2019-12-11 09:47:54
问题 I want to use counter variable in javascript like static variable with timer. counter must decrease by 1 on every second. I m working on online exam. on answering a question new question comes on the same page. my problem starts when counter variable is initialized with new question(means new page). counter variable does not persists on new page...suggest any solution <script language="JavaScript"> function ExamTimer() { if ( typeof ExamTimer.counter == 'undefined' ) { ExamTimer.counter =

PHP - Number of times downloaded

点点圈 提交于 2019-12-11 09:03:39
问题 How can I display a counter that counts the number of times a file is downloaded? I've seen it before. "Downloaded 450 times". Thanks. 回答1: Don't let the user download a file directly, but trough a script like the following ... <?php $file = $_REQUEST['file']; $dldir = "downloads/"; if ( (file_exists($dldir.$file) && // file exists (strpos($file, "../") === false) && // prevent an attacker from switching to a parent directory ) { header('Content-type: '.mime_content_type($dldir.file)); header