This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncore | |
| import socket | |
| import json | |
| state = {} | |
| class UpdateMsg(object): | |
| def __init__(self, data): | |
| sdata = data.strip().split(' ') | |
| self.player = sdata[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class VINLookupForm(Form): | |
| """ | |
| Lookup a VIN form | |
| """ | |
| vin = TextField(u'Enter VIN', | |
| validators=[validators.Required(u'VIN is required for lookup.')]) | |
| def validate_vin(self, field): | |
| """ | |
| Validate a VIN against the 9th position checksum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main(int argc, char * argv[]) { | |
| float accumulator = 0.0; | |
| int num_of_times = 0; | |
| int ii = 1; | |
| float average = 0.0; | |
| // Ask until we have a valid input | |
| while (1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main(int agrv, char * argc[]) | |
| { | |
| float N = 0; | |
| printf("Enter a number?"); | |
| scanf("%f", &N); | |
| { | |
| double num = N; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| // Define functions | |
| void display_average(float); | |
| int main(int argc, char * argv[]) { | |
| float accumulator = 0.0; | |
| int num_of_times = 0; | |
| int ii = 1; | |
| float average = 0.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| // Define functions | |
| void display_average(float); | |
| int get_user_input(int); | |
| float get_user_inputs(int); | |
| float calculate_average(float, int); | |
| int main(int argc, char * argv[]) { | |
| float accumulator = 0.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int foo(int, int, int, int, int, int); | |
| int main(int argc, char * argv[]) | |
| { | |
| // Scoped to 'main' | |
| int a, b, c = 0; | |
| int x = 10; | |
| int d, e = 0; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int foo(int, int, int, int, int, int); | |
| // Globally scoped | |
| int a, b, c = 0; | |
| int x = 10; | |
| int d, e = 0; | |
| int main(int argc, char * argv[]) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print "Blocking Channel:" | |
| print type(ch) | |
| print dir(ch) | |
| # Works | |
| ch.basic_reject( | |
| delivery_tag=method.delivery_tag, | |
| requeue=True, | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print "Blocking Channel:" | |
| print type(ch) | |
| print dir(ch) | |
| Output: | |
| Blocking Channel: | |
| <class 'pika.adapters.blocking_connection.BlockingChannel'> | |
| ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_close', '_consumers', '_on_basic_deliver', '_on_basic_get', '_on_basic_get_empty', '_on_basic_get_ok', '_on_cancel_ok', '_on_channel_flow_ok', '_on_confirm_select_ok', '_on_flow_ok_callback', '_on_get_ok_callback', '_on_open_callback', '_on_remote_close', '_open', '_pending', 'add_callback', 'add_on_close_callback', 'add_on_return_callback', 'basic_ack', 'basic_cancel', 'basic_consume', 'basic_get', 'basic_get_', 'basic_publish', 'basic_qos', 'basic_recover', 'basic_recover_async', 'basic_reject', 'callbacks', 'channel_number', 'close', 'closing', 'confirm_delivery', 'consumer_tags', 'exchange_declare', 'exchange_delet |
OlderNewer