Search Results

Search found 7 results on 1 pages for 'slartibartfast'.

Page 1/1 | 1 

  • Communication between state machines with hidden transitions

    - by slartibartfast
    The question emerged for me in embedded programming but I think it can be applied to quite a number of general networking situations e.g. when a communication partner fails. Assume we have an application logic (a program) running on a computer and a gadget connected to that computer via e.g. a serial interface like RS232. The gadget has a red/green/blue LED and a button which disables the LED. The LEDs color can be driven by software commands over the serial interface and the state (red/green/blue/off) is read back and causes a reaction in the application logic. Asynchronous behaviour of the application logic with regard to the LED color down to a certain delay (depending on the execution cycle of the application) is tolerated. What we essentially have is a resource (the LED) which can not be reserved and handled atomically by software because the (organic) user can at any time press the button to interfere/break the software attempt to switch the LED color. Stripping this example from its physical outfit I dare to say that we have two communicating state machines A (application logic) and G (gadget) where G executes state changes unbeknownst to A (and also the other way round, but this is not significant in our example) and only A can be modified at a reasonable price. A needs to see the reaction and state of G in one piece of information which may be (slightly) outdated but not inconsistent with respect to the short time window when this information was generated on the side of G. What I am looking for is a concise method to handle such a situation in embedded software (i.e. no layer/framework like CORBA etc. available). A programming technique which is able to map the complete behaviour of both participants on classical interfaces of a classical programming language (C in this case). To complicate matters (or rather, to generalize), a simple high frequency communication cycle of A to G and back (IOW: A is rapidly polling G) is out of focus because of technical restrictions (delay of serial com, A not always active, etc.). What I currently see as a general solution is: the application logic A as one thread of execution an adapter object (proxy) PG (presenting G inside the computer), together with the serial driver as another thread a communication object between the two (A and PG) which is transactionally safe to exchange The two execution contexts (threads) on the computer may be multi-core or just interrupt driven or tasks in an RTOS. The com object contains the following data: suspected state (written by A): effectively a member of the power set of states in G (in our case: red, green, blue, off, red_or_green, red_or_blue, red_or_off...etc.) command data (written by A): test_if_off, switch_to_red, switch_to_green, switch_to_blue operation status (written by PG): operation_pending, success, wrong_state, link_broken new state (written by PG): red, green, blue, off The idea of the com object is that A writes whichever (set of) state it thinks G is in, together with a command. (Example: suspected state="red_or_green", command: "switch_to_blue") Notice that the commands issued by A will not work if the user has switched off the LED and A needs to know this. PG will pick up such a com object and try to send the command to G, receive its answer (or a timeout) and set the operation status and new state accordingly. A will take back the oject once it is no longer at operation_pending and can react to the outcome. The com object could be separated of course (into two objects, one for each direction) but I think it is convenient in nearly all instances to have the command close to the result. I would like to have major flaws pointed out or hear an entirely different view on such a situation.

    Read the article

  • BIOS password and hardware clock problems

    - by Slartibartfast
    I have HP 6730b lap top. I've bought it used and installed (Gentoo) linux on it. BIOS is protected with password, and guy I bought it from said "I've tweaked BIOS from Windows program, it never asked me for password". I've tried to erase password by removing battery, but it's still there. What did get erased obviously is hw clock. This is what hapends: a) I can leave lap top in January 1980 and it works b) I can correct system time, but boot wil fail with "superblock mount time in future" from where I need to manually do fsck and continue boot c) I can correct system time and sync it with hwclock -w but than it will behave as b) and it will reset BIOS time to 1.1.1980 00:00 So I need either a way to bypass a BIOS password (wich after lot of googling seems impossible),a way to persist a clock, or a setup that will enable hw clock in eighties, system clock in present time and normal boot.

    Read the article

  • Is there a way to run CUDA applications with the CUDA device being a secondary adapter?

    - by Slartibartfast
    I've been trying to run a CUDA program on a remote computer which has Windows 7 installed. The GPU is GeForce GTX 480. One of the problems I've been facing is that, the computer has two adapters, 1) Standard VGA Adapter 2) NVIDIA GeForce GTX 480 Even though this shows in the device manager. The desktop uses the standard VGA Adapter. I'm assuming this is because the Standard VGA is the primary adapter. Also the device manager shows that the monitor is connected to the standard VGA Adapter. In this scenario if i try to run any CUDA application it fails to recognise a CUDA capable device. Is it necessary for the NVIDIA adapter to be the primary one? Or is there any way to use CUDA when the graphics card is a secondary adapter. I've seen a few posts in the NVIDIA forums on this before, one suggests using another low cost NVIDIA card as the primary adapter, but that is currently not an option. I couldn't find any other solutions. Thanks I tried running the deviceQuery test from the NVIDIA GPU Computing Samples. This was the result i obtained CUDA Device Query (Runtime API) version (CUDART static linking) cudaGetDeviceCount FAILED CUDA Driver and Runtime version may be mismatched FAILED The driver version I'm using is 263.06. The CUDA version is 3.2 I ran the same test on my desktop which also has windows 7 and a GeForce GTX 465. The CUDA toolkit version is 3.2. The driver version was the same and the test passed, although it failed with an older driver.

    Read the article

  • Strange Ubuntu linux boot behaviour

    - by Slartibartfast
    I've recently installed Ubuntu 9.10 on a desktop machine as the only OS. If put in a hibernate, it wakes up normally, but if turned of completely, after turning on there is no "beep" sound from BIOS and HD lamp blinks for a while then stops. When I hit reset in that state, it bots normally. What is going on and how could I fix it?

    Read the article

  • How to bind "rest" variables to list of values in macro in Scheme

    - by Slartibartfast
    I want to make a helper macro for writing match-extensions. I have something like this: (define-match-expander my-expander (? (stx) (let* ([dat (cdr (syntax-e stx))] [var1 (car dat))] [var2 (cadr dat)]) ;transformer goes here ))) So I wanted a macro that will do this let binding. I've started with something like this: (define-syntax-rule (define-my-expander (id vars ...) body) (define-match-expander id (? (stx) (match-let ([(vars ...) (cdr (syntax-e stx))]) body)))) but match-let isn't defined in transformation time. First question would be is there any other way of doing this (making this expanders, I mean)? Maybe there is already something similar in plt-scheme that I'm not aware of, or I'm doing it wrong in some way. Regardless of answer on the first question, if I ever want to bound list of variables to list of values inside of a macro, how should I do it? EDIT: In combination with Eli's answer macro now looks like this: (define-syntax-rule (define-my-expander (id vars ...) body) (define-match-expander id (? (stx) (syntax-case stx () [(_ vars ...) body]))))

    Read the article

  • Running single test class or group with Surefire and TestNG

    - by Slartibartfast
    I want to run single test class from command line using Maven and TestNG Things that doesn't work: mvn -Dtest=ClassName test I have defined groups in pom.xml, and this class isn't in one of those groups. So it got excluded on those grounds. mvn -Dgroups=skipped-group test mvn -Dsurefire.groups=skipped-group test when config is <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.7.1</version> <configuration> <groups>functest</groups> </configuration> </plugin> Parameters work fine in there are no groups defined in pom.xml. Similarly, when surefire is configured with <configuration> <includes> <include>**/*UnitTest.java</include> </includes> </configuration> I can add another test with -Dtest parameter, but cannot add group. In any combination, I can narrow down tests to be executed with groups, but not expand them. What's wrong with my configuration? Is there a way to run a single test or group outside of those defined in pom.xml? Tried on Ubuntu 10.04 with Maven 2.2.1, TestNG 5.14.6 and Surefire 2.7.1

    Read the article

  • Android RatingBar weirdness: Whenever I add a RatingBar to my layout, a bunch of the generated tags,

    - by Rben
    Whenever I use a RatingBar view in my layout, I suddenly get all kinds of compile errors. I'm using Android 2.0, but I've also tried 2.0.1, and 2.1, without joy. I also get a message: Shader 'android.graphics.BitmapShader' is not supported in Layout Editor, and an odd warning which may or maynot be related: warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. I've tried using the RatingBar both within a tablelayout and outside it, but it behaves the same way. This is very puzzling and frustrating. Please help if you can. Sincerely, Ray Here's the XML: <!-- Created By --> <TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:text="Created by: " android:id="@+id/gi_created_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" /> <TextView android:text="Slartibartfast" android:id="@+id/gi_created" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </TableRow> <!-- Verification --> <TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:id="@+id/gi_verification_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:text="@string/GameInfoVerificationLabelText" /> <TextView android:id="@+id/gi_verification" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="HonorSystem" /> </TableRow> <!-- Player Rating Label --> <TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:text="@string/GameInfoPlayerRatingLabel" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text=" " /> </TableRow> -- <!-- Times played --> <TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:id="@+id/gi_times_played_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:text="@string/GameInfoTimesPlayedLabel" /> <TextView android:id="@+id/gi_times_played" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="999" /> </TableRow> <!-- Total Players --> <TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:id="@+id/gi_total_players_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:text="@string/GameInfoTotalPlayerCountLabel" /> <TextView android:id="@+id/gi_total_players" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="999" /> </TableRow> <!-- Total Cancelations --> <TableRow android:layout_height="wrap_content" android:layout_width="fill_parent" > <TextView android:id="@+id/gi_total_cancelations_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:text="@string/GameInfoTotalCancelsLabel" /> <TextView android:id="@+id/gi_total_cancels" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="999" /> </TableRow> <RatingBar android:id="@+/gi_player_rating" style="?android:attr/ratingBarStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_span="2" android:isIndicator="true" android:numStars="5" android:rating="3" android:stepSize="1" android:layout_gravity="center_vertical" /> </TableRow>

    Read the article

1