49 skills found · Page 1 of 2
valpackett / SystemstatRust library for getting system information | also on https://codeberg.org/valpackett/systemstat
mrmierzejewski / Hugo Theme ConsoleMinimal and responsive Hugo theme inspired by the system console, crafted for optimal performance with an average page load time of under one second.
molyswu / Hand Detectionusing Neural Networks (SSD) on Tensorflow. This repo documents steps and scripts used to train a hand detector using Tensorflow (Object Detection API). As with any DNN based task, the most expensive (and riskiest) part of the process has to do with finding or creating the right (annotated) dataset. I was interested mainly in detecting hands on a table (egocentric view point). I experimented first with the [Oxford Hands Dataset](http://www.robots.ox.ac.uk/~vgg/data/hands/) (the results were not good). I then tried the [Egohands Dataset](http://vision.soic.indiana.edu/projects/egohands/) which was a much better fit to my requirements. The goal of this repo/post is to demonstrate how neural networks can be applied to the (hard) problem of tracking hands (egocentric and other views). Better still, provide code that can be adapted to other uses cases. If you use this tutorial or models in your research or project, please cite [this](#citing-this-tutorial). Here is the detector in action. <img src="images/hand1.gif" width="33.3%"><img src="images/hand2.gif" width="33.3%"><img src="images/hand3.gif" width="33.3%"> Realtime detection on video stream from a webcam . <img src="images/chess1.gif" width="33.3%"><img src="images/chess2.gif" width="33.3%"><img src="images/chess3.gif" width="33.3%"> Detection on a Youtube video. Both examples above were run on a macbook pro **CPU** (i7, 2.5GHz, 16GB). Some fps numbers are: | FPS | Image Size | Device| Comments| | ------------- | ------------- | ------------- | ------------- | | 21 | 320 * 240 | Macbook pro (i7, 2.5GHz, 16GB) | Run without visualizing results| | 16 | 320 * 240 | Macbook pro (i7, 2.5GHz, 16GB) | Run while visualizing results (image above) | | 11 | 640 * 480 | Macbook pro (i7, 2.5GHz, 16GB) | Run while visualizing results (image above) | > Note: The code in this repo is written and tested with Tensorflow `1.4.0-rc0`. Using a different version may result in [some errors](https://github.com/tensorflow/models/issues/1581). You may need to [generate your own frozen model](https://pythonprogramming.net/testing-custom-object-detector-tensorflow-object-detection-api-tutorial/?completed=/training-custom-objects-tensorflow-object-detection-api-tutorial/) graph using the [model checkpoints](model-checkpoint) in the repo to fit your TF version. **Content of this document** - Motivation - Why Track/Detect hands with Neural Networks - Data preparation and network training in Tensorflow (Dataset, Import, Training) - Training the hand detection Model - Using the Detector to Detect/Track hands - Thoughts on Optimizations. > P.S if you are using or have used the models provided here, feel free to reach out on twitter ([@vykthur](https://twitter.com/vykthur)) and share your work! ## Motivation - Why Track/Detect hands with Neural Networks? There are several existing approaches to tracking hands in the computer vision domain. Incidentally, many of these approaches are rule based (e.g extracting background based on texture and boundary features, distinguishing between hands and background using color histograms and HOG classifiers,) making them not very robust. For example, these algorithms might get confused if the background is unusual or in situations where sharp changes in lighting conditions cause sharp changes in skin color or the tracked object becomes occluded.(see [here for a review](https://www.cse.unr.edu/~bebis/handposerev.pdf) paper on hand pose estimation from the HCI perspective) With sufficiently large datasets, neural networks provide opportunity to train models that perform well and address challenges of existing object tracking/detection algorithms - varied/poor lighting, noisy environments, diverse viewpoints and even occlusion. The main drawbacks to usage for real-time tracking/detection is that they can be complex, are relatively slow compared to tracking-only algorithms and it can be quite expensive to assemble a good dataset. But things are changing with advances in fast neural networks. Furthermore, this entire area of work has been made more approachable by deep learning frameworks (such as the tensorflow object detection api) that simplify the process of training a model for custom object detection. More importantly, the advent of fast neural network models like ssd, faster r-cnn, rfcn (see [here](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md#coco-trained-models-coco-models) ) etc make neural networks an attractive candidate for real-time detection (and tracking) applications. Hopefully, this repo demonstrates this. > If you are not interested in the process of training the detector, you can skip straight to applying the [pretrained model I provide in detecting hands](#detecting-hands). Training a model is a multi-stage process (assembling dataset, cleaning, splitting into training/test partitions and generating an inference graph). While I lightly touch on the details of these parts, there are a few other tutorials cover training a custom object detector using the tensorflow object detection api in more detail[ see [here](https://pythonprogramming.net/training-custom-objects-tensorflow-object-detection-api-tutorial/) and [here](https://towardsdatascience.com/how-to-train-your-own-object-detector-with-tensorflows-object-detector-api-bec72ecfe1d9) ]. I recommend you walk through those if interested in training a custom object detector from scratch. ## Data preparation and network training in Tensorflow (Dataset, Import, Training) **The Egohands Dataset** The hand detector model is built using data from the [Egohands Dataset](http://vision.soic.indiana.edu/projects/egohands/) dataset. This dataset works well for several reasons. It contains high quality, pixel level annotations (>15000 ground truth labels) where hands are located across 4800 images. All images are captured from an egocentric view (Google glass) across 48 different environments (indoor, outdoor) and activities (playing cards, chess, jenga, solving puzzles etc). <img src="images/egohandstrain.jpg" width="100%"> If you will be using the Egohands dataset, you can cite them as follows: > Bambach, Sven, et al. "Lending a hand: Detecting hands and recognizing activities in complex egocentric interactions." Proceedings of the IEEE International Conference on Computer Vision. 2015. The Egohands dataset (zip file with labelled data) contains 48 folders of locations where video data was collected (100 images per folder). ``` -- LOCATION_X -- frame_1.jpg -- frame_2.jpg ... -- frame_100.jpg -- polygons.mat // contains annotations for all 100 images in current folder -- LOCATION_Y -- frame_1.jpg -- frame_2.jpg ... -- frame_100.jpg -- polygons.mat // contains annotations for all 100 images in current folder ``` **Converting data to Tensorflow Format** Some initial work needs to be done to the Egohands dataset to transform it into the format (`tfrecord`) which Tensorflow needs to train a model. This repo contains `egohands_dataset_clean.py` a script that will help you generate these csv files. - Downloads the egohands datasets - Renames all files to include their directory names to ensure each filename is unique - Splits the dataset into train (80%), test (10%) and eval (10%) folders. - Reads in `polygons.mat` for each folder, generates bounding boxes and visualizes them to ensure correctness (see image above). - Once the script is done running, you should have an images folder containing three folders - train, test and eval. Each of these folders should also contain a csv label document each - `train_labels.csv`, `test_labels.csv` that can be used to generate `tfrecords` Note: While the egohands dataset provides four separate labels for hands (own left, own right, other left, and other right), for my purpose, I am only interested in the general `hand` class and label all training data as `hand`. You can modify the data prep script to generate `tfrecords` that support 4 labels. Next: convert your dataset + csv files to tfrecords. A helpful guide on this can be found [here](https://pythonprogramming.net/creating-tfrecord-files-tensorflow-object-detection-api-tutorial/).For each folder, you should be able to generate `train.record`, `test.record` required in the training process. ## Training the hand detection Model Now that the dataset has been assembled (and your tfrecords), the next task is to train a model based on this. With neural networks, it is possible to use a process called [transfer learning](https://www.tensorflow.org/tutorials/image_retraining) to shorten the amount of time needed to train the entire model. This means we can take an existing model (that has been trained well on a related domain (here image classification) and retrain its final layer(s) to detect hands for us. Sweet!. Given that neural networks sometimes have thousands or millions of parameters that can take weeks or months to train, transfer learning helps shorten training time to possibly hours. Tensorflow does offer a few models (in the tensorflow [model zoo](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md#coco-trained-models-coco-models)) and I chose to use the `ssd_mobilenet_v1_coco` model as my start point given it is currently (one of) the fastest models (read the SSD research [paper here](https://arxiv.org/pdf/1512.02325.pdf)). The training process can be done locally on your CPU machine which may take a while or better on a (cloud) GPU machine (which is what I did). For reference, training on my macbook pro (tensorflow compiled from source to take advantage of the mac's cpu architecture) the maximum speed I got was 5 seconds per step as opposed to the ~0.5 seconds per step I got with a GPU. For reference it would take about 12 days to run 200k steps on my mac (i7, 2.5GHz, 16GB) compared to ~5hrs on a GPU. > **Training on your own images**: Please use the [guide provided by Harrison from pythonprogramming](https://pythonprogramming.net/training-custom-objects-tensorflow-object-detection-api-tutorial/) on how to generate tfrecords given your label csv files and your images. The guide also covers how to start the training process if training locally. [see [here] (https://pythonprogramming.net/training-custom-objects-tensorflow-object-detection-api-tutorial/)]. If training in the cloud using a service like GCP, see the [guide here](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_on_cloud.md). As the training process progresses, the expectation is that total loss (errors) gets reduced to its possible minimum (about a value of 1 or thereabout). By observing the tensorboard graphs for total loss(see image below), it should be possible to get an idea of when the training process is complete (total loss does not decrease with further iterations/steps). I ran my training job for 200k steps (took about 5 hours) and stopped at a total Loss (errors) value of 2.575.(In retrospect, I could have stopped the training at about 50k steps and gotten a similar total loss value). With tensorflow, you can also run an evaluation concurrently that assesses your model to see how well it performs on the test data. A commonly used metric for performance is mean average precision (mAP) which is single number used to summarize the area under the precision-recall curve. mAP is a measure of how well the model generates a bounding box that has at least a 50% overlap with the ground truth bounding box in our test dataset. For the hand detector trained here, the mAP value was **0.9686@0.5IOU**. mAP values range from 0-1, the higher the better. <img src="images/accuracy.jpg" width="100%"> Once training is completed, the trained inference graph (`frozen_inference_graph.pb`) is then exported (see the earlier referenced guides for how to do this) and saved in the `hand_inference_graph` folder. Now its time to do some interesting detection. ## Using the Detector to Detect/Track hands If you have not done this yet, please following the guide on installing [Tensorflow and the Tensorflow object detection api](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md). This will walk you through setting up the tensorflow framework, cloning the tensorflow github repo and a guide on - Load the `frozen_inference_graph.pb` trained on the hands dataset as well as the corresponding label map. In this repo, this is done in the `utils/detector_utils.py` script by the `load_inference_graph` method. ```python detection_graph = tf.Graph() with detection_graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFile(PATH_TO_CKPT, 'rb') as fid: serialized_graph = fid.read() od_graph_def.ParseFromString(serialized_graph) tf.import_graph_def(od_graph_def, name='') sess = tf.Session(graph=detection_graph) print("> ====== Hand Inference graph loaded.") ``` - Detect hands. In this repo, this is done in the `utils/detector_utils.py` script by the `detect_objects` method. ```python (boxes, scores, classes, num) = sess.run( [detection_boxes, detection_scores, detection_classes, num_detections], feed_dict={image_tensor: image_np_expanded}) ``` - Visualize detected bounding detection_boxes. In this repo, this is done in the `utils/detector_utils.py` script by the `draw_box_on_image` method. This repo contains two scripts that tie all these steps together. - detect_multi_threaded.py : A threaded implementation for reading camera video input detection and detecting. Takes a set of command line flags to set parameters such as `--display` (visualize detections), image parameters `--width` and `--height`, videe `--source` (0 for camera) etc. - detect_single_threaded.py : Same as above, but single threaded. This script works for video files by setting the video source parameter videe `--source` (path to a video file). ```cmd # load and run detection on video at path "videos/chess.mov" python detect_single_threaded.py --source videos/chess.mov ``` > Update: If you do have errors loading the frozen inference graph in this repo, feel free to generate a new graph that fits your TF version from the model-checkpoint in this repo. Use the [export_inference_graph.py](https://github.com/tensorflow/models/blob/master/research/object_detection/export_inference_graph.py) script provided in the tensorflow object detection api repo. More guidance on this [here](https://pythonprogramming.net/testing-custom-object-detector-tensorflow-object-detection-api-tutorial/?completed=/training-custom-objects-tensorflow-object-detection-api-tutorial/). ## Thoughts on Optimization. A few things that led to noticeable performance increases. - Threading: Turns out that reading images from a webcam is a heavy I/O event and if run on the main application thread can slow down the program. I implemented some good ideas from [Adrian Rosebuck](https://www.pyimagesearch.com/2017/02/06/faster-video-file-fps-with-cv2-videocapture-and-opencv/) on parrallelizing image capture across multiple worker threads. This mostly led to an FPS increase of about 5 points. - For those new to Opencv, images from the `cv2.read()` method return images in [BGR format](https://www.learnopencv.com/why-does-opencv-use-bgr-color-format/). Ensure you convert to RGB before detection (accuracy will be much reduced if you dont). ```python cv2.cvtColor(image_np, cv2.COLOR_BGR2RGB) ``` - Keeping your input image small will increase fps without any significant accuracy drop.(I used about 320 x 240 compared to the 1280 x 720 which my webcam provides). - Model Quantization. Moving from the current 32 bit to 8 bit can achieve up to 4x reduction in memory required to load and store models. One way to further speed up this model is to explore the use of [8-bit fixed point quantization](https://heartbeat.fritz.ai/8-bit-quantization-and-tensorflow-lite-speeding-up-mobile-inference-with-low-precision-a882dfcafbbd). Performance can also be increased by a clever combination of tracking algorithms with the already decent detection and this is something I am still experimenting with. Have ideas for optimizing better, please share! <img src="images/general.jpg" width="100%"> Note: The detector does reflect some limitations associated with the training set. This includes non-egocentric viewpoints, very noisy backgrounds (e.g in a sea of hands) and sometimes skin tone. There is opportunity to improve these with additional data. ## Integrating Multiple DNNs. One way to make things more interesting is to integrate our new knowledge of where "hands" are with other detectors trained to recognize other objects. Unfortunately, while our hand detector can in fact detect hands, it cannot detect other objects (a factor or how it is trained). To create a detector that classifies multiple different objects would mean a long involved process of assembling datasets for each class and a lengthy training process. > Given the above, a potential strategy is to explore structures that allow us **efficiently** interleave output form multiple pretrained models for various object classes and have them detect multiple objects on a single image. An example of this is with my primary use case where I am interested in understanding the position of objects on a table with respect to hands on same table. I am currently doing some work on a threaded application that loads multiple detectors and outputs bounding boxes on a single image. More on this soon.
atarallo / TECMINT MONITORA Shell Script to Monitor Network, Disk Usage, Uptime, Load Average and RAM Usage in Linux. Originally published on http://www.tecmint.com
samoshkin / Tmux Plugin SysstatPrints CPU usage, memory & swap, load average, net I/O metrics in Tmux status bar
lindes / Ttyloadttyload -- "graphical" tracking of UNIX load average in a terminal ("tty")
victorjonsson / PHP BenchmarkEasy to use benchmark script for your PHP-application. Get information about average loading time, memory consumption and more...
Rastaman4e / 1NICEHASH PLATFORM TERMS OF USE AND NICEHASH MINING TERMS OF SERVICE PLEASE READ THESE NICEHASH PLATFORM TERMS OF USE AND NICEHASH MINING TERMS OF SERVICE (“Terms”) CAREFULLY BEFORE USING THE THE PLATFORM OR SERVICES DESCRIBED HEREIN. BY SELECTING “I AGREE”, ACCESSING THE PLATFORM, USING NICEHASH MINING SERVICES OR DOWNLOADING OR USING NICEHASH MINING SOFTWARE, YOU ARE ACKNOWLEDGING THAT YOU HAVE READ THESE TERMS, AS AMENDED FROM TIME TO TIME, AND YOU ARE AGREEING TO BE BOUND BY THEM. IF YOU DO NOT AGREE TO THESE TERMS, OR ANY SUBSEQUENT AMENDMENTS, CHANGES OR UPDATES, DO NOT ACCESS THE PLATFORM, USE NICEHASH MINING SERVICES OR USE THE NICEHASH MINING SOFTWARE. GENERAL These Terms apply to users of the NiceHash Platform (“Platform” and NiceHash Mining Services (“Services”) which are provided to you by NICEHASH Ltd, company organized and existing under the laws of the British Virgin Islands, with registered address at Intershore Chambers, Road Town, Tortola, British Virgin Islands, registration number: 2048669, hereinafter referred to as “NiceHash, as well as “we” or “us”. ELIGIBILITY By using the NiceHash platform and NiceHash Mining Services, you represent and warrant that you: are at least Minimum Age and have capacity to form a binding contract; have not previously been suspended or removed from the NiceHash Platform; have full power and authority to enter into this agreement and in doing so will not violate any other agreement to which you are a party; are not not furthering, performing, undertaking, engaging in, aiding, or abetting any unlawful activity through your relationship with us, through your use of NiceHash Platform or use of NiceHash Mining Services; will not use NiceHash Platform or NiceHash Mining Services if any applicable laws in your country prohibit you from doing so in accordance with these Terms. We reserve the right to terminate your access to the NiceHash Platform and Mining Services for any reason and in our sole and absolute discretion. Use of NiceHash Platform and Mining Services is void where prohibited by applicable law. Depending on your country of residence or incorporation or registered office, you may not be able to use all the functions of the NiceHash Platform or services provided therein. It is your responsibility to follow the rules and laws in your country of residence and/or country from which you access the NiceHash Platform. DEFINITIONS NiceHash Platform means a website located on the following web address: www.nicehash.com. NiceHash Mining Services mean all services provided by NiceHash, namely the provision of the NiceHash Platform, NiceHash Hashing power marketplace, NiceHash API, NiceHash OS, NiceHash Mining Software including licence for NiceHash Miner, NiceHash Private Endpoint, NiceHash Account, NiceHash mobile apps, and all other software products, applications and services associated with these products, except for the provision of NiceHash Exchange Services. NiceHash Exchange Service means a service which allows trading of digital assets in the form of digital tokens or cryptographic currency for our users by offering them a trading venue, helping them find a trading counterparty and providing the means for transaction execution. NiceHash Exchange Services are provided by NICEX Ltd and accessible at the NiceHash Platform under NiceHash Exchange Terms of Service. Hashing power marketplace means an infrastructure provided by the NiceHash which enables the Hashing power providers to point their rigs towards NiceHash stratum servers where Hashing power provided by different Hashing power providers is gathered and sold as generic Hashing power to the Hashing power buyers. Hashing power buyer means a legal entity or individual who buys the gathered and generic hashing power on the Hashing power marketplace from undefined Hashing power providers. Hashing power provider means a legal entity or individual who sells his hashing power on the Hashing power marketplace to undefined Hashing power buyers. NiceHash Mining Software means NiceHash Miner and any other software available via the NiceHash Platform. NiceHash Miner means a comprehensive software with graphical user interface and web interface, owned by NiceHash. NiceHash Miner is a process manager software which enables the Hashing power providers to point their rigs towards NiceHash stratum servers and sell their hashing power to the Hashing power buyers. NiceHash Miner also means any and all of its code, compilations, updates, upgrades, modifications, error corrections, patches and bug fixes and similar. NiceHash Miner does not mean third party software compatible with NiceHash Miner (Third Party Plugins and Miners). NiceHash QuickMiner means a software accessible at https://www.nicehash.com/quick-miner which enables Hashing power providers to point their PCs or rigs towards NiceHash stratum servers and sell their hashing power to the Hashing power buyers. NiceHash QuickMiner is intended as a tryout tool. Hashing power rig means all hardware which produces hashing power that represents computation power which is required to calculate the hash function of different type of cryptocurrency. Secondary account is an account managed by third party from which the Account holder deposits funds to his NiceHash Wallet or/and to which the Account holder withdraws funds from his NiceHash Wallet. Stratum is a lightweight mining protocol: https://slushpool.com/help/manual/stratum-protocol. NiceHash Account means an online account available on the NiceHash Platform and created by completing the registration procedure on the NiceHash Platform. Account holder means an individual or legal entity who completes the registration procedure and successfully creates the NiceHash Account. Minimum Age means 18 years old or older, if in order for NiceHash to lawfully provide the Services to you without parental consent (including using your personal data). NiceHash Wallet means a wallet created automatically for the Account holder and provided by the NiceHash Wallet provider. NiceHash does not hold funds on behalf of the Account holder but only transfers Account holder’s requests regarding the NiceHash Wallet transaction to the NiceHash Wallet provider who executes the requested transactions. In this respect NiceHash only processes and performs administrative services related to the payments regarding the NiceHash Mining Services and NiceHash Exchange Services, if applicable. NiceHash Wallet provider is a third party which on the behalf of the Account holder provides and manages the NiceHash Wallet, holds, stores and transfers funds and hosts NiceHash Wallet. For more information about the NiceHash Wallet provider, see the following website: https://www.bitgo.com/. Blockchain network is a distributed database that is used to maintain a continuously growing list of records, called blocks. Force Majeure Event means any governmental or relevant regulatory regulations, acts of God, war, riot, civil commotion, fire, flood, or any disaster or an industrial dispute of workers unrelated to you or NiceHash. Any act, event, omission, happening or non-happening will only be considered Force Majeure if it is not attributable to the wilful act, neglect or failure to take reasonable precautions of the affected party, its agents, employees, consultants, contractors and sub-contractors. SALE AND PURCHASE OF HASHING POWER Hashing power providers agree to sell and NiceHash agrees to proceed Hashing power buyers’ payments for the provided hashing power on the Hashing power marketplace, on the Terms set forth herein. According to the applicable principle get-paid-per-valid-share (pay as you go principle) Hashing power providers will be paid only for validated and accepted hashing power to their NiceHash Wallet or other wallet, as indicated in Account holder’s profile settings or in stratum connection username. In some cases, no Hashing power is sent to Hashing power buyers or is accepted by NiceHash Services, even if Hashing power is generated on the Hashing power rigs. These cases include usage of slower hardware as well as software, hardware or network errors. In these cases, Hashing power providers are not paid for such Hashing power. Hashing power buyers agree to purchase and NiceHash agrees to process the order and forward the purchased hashing power on the Hashing power marketplace, on the Terms set forth herein. According to the applicable principle pay-per-valid-share (pay as you go principle) Hashing power buyers will pay from their NiceHash Wallet only for the hashing power that was validated by our engine. When connection to the mining pool which is selected on the Hashing power order is lost or when an order is cancelled during its lifetime, Hashing power buyer pays for additional 10 seconds worth of hashing power. Hashing power order is charged for extra hashing power when mining pool which is selected on the Hashing power order, generates rapid mining work changes and/or rapid mining job switching. All payments including any fees will be processed in crypto currency and NiceHash does not provide an option to sale and purchase of the hashing power in fiat currency. RISK DISCLOSURE If you choose to use NiceHash Platform, Services and NiceHash Wallet, it is important that you remain aware of the risks involved, that you have adequate technical resources and knowledge to bear such risks and that you monitor your transactions carefully. General risk You understand that NiceHash Platform and Services, blockchain technology, Bitcoin, all other cryptocurrencies and cryptotokens, proof of work concept and other associated and related technologies are new and untested and outside of NiceHash’s control. You acknowledge that there are major risks associated with these technologies. In addition to the risks disclosed below, there are risks that NiceHash cannot foresee and it is unreasonable to believe that such risk could have been foreseeable. The performance of NiceHash’s obligation under these Terms will terminate if market or technology circumstances change to such an extent that (i) these Terms clearly no longer comply with NiceHash’s expectations, (ii) it would be unjust to enforce NiceHash’s obligations in the general opinion or (iii) NiceHash’s obligation becomes impossible. NiceHash Account abuse You acknowledge that there is risk associated with the NiceHash Account abuse and that you have been fully informed and warned about it. The funds stored in the NiceHash Wallet may be disposed by third party in case the third party obtains the Account holder’s login credentials. The Account holder shall protect his login credentials and his electronic devices where the login credentials are stored against unauthorized access. Regulatory risks You acknowledge that there is risk associated with future legislation which may restrict, limit or prohibit certain aspects of blockchain technology which may also result in restriction, limitation or prohibition of NiceHash Services and that you have been fully informed and warned about it. Risk of hacking You acknowledge that there is risk associated with hacking NiceHash Services and NiceHash Wallet and that you have been fully informed and warned about it. Hacker or other groups or organizations may attempt to interfere with NiceHash Services or NiceHash Wallet in any way, including without limitation denial of services attacks, Sybil attacks, spoofing, smurfing, malware attacks, mining attacks or consensus-based attacks. Cryptocurrency risk You acknowledge that there is risk associated with the cryptocurrencies which are used as payment method and that you have been fully informed and warned about it. Cryptocurrencies are prone to, but not limited to, value volatility, transaction costs and times uncertainty, lack of liquidity, availability, regulatory restrictions, policy changes and security risks. NiceHash Wallet risk You acknowledge that there is risk associated with funds held on the NiceHash Wallet and that you have been fully informed and warned about it. You acknowledge that NiceHash Wallet is provided by NiceHash Wallet provider and not NiceHash. You acknowledge and agree that NiceHash shall not be responsible for any NiceHash Wallet provider’s services, including their accuracy, completeness, timeliness, validity, copyright compliance, legality, decency, quality or any other aspect thereof. NiceHash does not assume and shall not have any liability or responsibility to you or any other person or entity for any Hash Wallet provider’s services. Hash Wallet provider’s services and links thereto are provided solely as a convenience to you and you access and use them entirely at your own risk and subject to NiceHash Wallet provider’s terms and conditions. Since the NiceHash Wallet is a cryptocurrency wallet all funds held on it are entirely uninsured in contrast to the funds held on the bank account or other financial institutions which are insured. Connection risk You acknowledge that there are risks associated with usage of NiceHash Services which are provided through the internet including, but not limited to, the failure of hardware, software, configuration and internet connections and that you have been fully informed and warned about it. You acknowledge that NiceHash will not be responsible for any configuration, connection or communication failures, disruptions, errors, distortions or delays you may experience when using NiceHash Services, however caused. Hashing power provision risk You acknowledge that there are risks associated with the provisions of the hashing power which is provided by the Hashing power providers through the Hashing power marketplace and that you have been fully informed and warned about it. You acknowledge that NiceHash does not provide the hashing power but only provides the Hashing power marketplace as a service. Hashing power providers’ Hashing power rigs are new and untested and outside of NiceHash’s control. There is a major risk that the Hashing power rigs (i) will stop providing hashing power, (ii) will provide hashing power in an unstable way, (iii) will be wrongly configured or (iv) provide insufficient speed of the hashing power. Hashing power rigs as hardware could be subject of damage, errors, electricity outage, misconfiguration, connection or communication failures and other malfunctions. NiceHash will not be responsible for operation of Hashing power rigs and its provision of hashing power. By submitting a Hashing power order you agree to Hashing power no-refund policy – all shares forwarded to mining pool, selected on the Hashing power order are final and non-refundable. Hashing power profitability risk You acknowledge that there is risk associated with the profitability of the hashing power provision and that you have been fully informed and warned about it. You acknowledge that all Hashing power rig’s earning estimates and profitability calculations on NiceHash Platform are only for informational purposes and were made based on the Hashing power rigs set up in the test environments. NiceHash does not warrant that your Hashing power rigs would achieve the same profitability or earnings as calculated on NiceHash Platform. There is risk that your Hashing power rig would not produce desired hashing power quantity and quality and that your produced hashing power would differentiate from the hashing power produced by our Hashing power rigs set up in the test environments. There is risk that your Hashing power rigs would not be as profitable as our Hashing power rigs set up in the test environments or would not be profitable at all. WARRANTIES NiceHash Platform and Mining Services are provided on the “AS IS” and “AS AVAILABLE” basis, including all faults and defects. To the maximum extent permitted by applicable law, NiceHash makes no representations and warranties and you waive all warranties of any kind. Particularly, without limiting the generality of the foregoing, the NiceHash makes no representations and warranties, whether express, implied, statutory or otherwise regarding NiceHash Platform and Mining Services or other services related to NiceHash Platform and provided by third parties, including any warranty that such services will be uninterrupted, harmless, secure or not corrupt or damaged, meet your requirements, achieve any intended results, be compatible or work with any other software, applications, systems or services, meet any performance or error free or that any errors or defects can or will be corrected. Additionally NiceHash makes no representations and warranties, whether express, implied, statutory or otherwise of merchantability, suitability, reliability, availability, timeliness, accuracy, satisfactory quality, fitness for a particular purpose or quality, title and non-infringement with respect to any of the Mining Services or other services related to NiceHash Platform and provided by third parties, or quiet enjoyment and any warranties arising out of any course of dealing, course of performance, trade practice or usage of NiceHash Platform and Mining Services including information, content and material contained therein. Especially NiceHash makes no representations and warranties, whether express, implied, statutory or otherwise regarding any payment services and systems, NiceHash Wallet which is provided by third party or any other financial services which might be related to the NiceHash Platform and Mining Services. You acknowledge that you do not rely on and have not been induced to accept the NiceHash Platform and Mining Services according to these Terms on the basis of any warranties, representations, covenants, undertakings or any other statement whatsoever, other than expressly set out in these Terms that neither the NiceHash nor any of its respective agents, officers, employees or advisers have given any such warranties, representations, covenants, undertakings or other statements. LIABILITY NiceHash and their respective officers, employees or agents will not be liable to you or anyone else, to the maximum extent permitted by applicable law, for any damages of any kind, including, but not limited to, direct, consequential, incidental, special or indirect damages (including but not limited to lost profits, trading losses or damages that result from use or loss of use of NiceHash Services or NiceHash Wallet), even if NiceHash has been advised of the possibility of such damages or losses, including, without limitation, from the use or attempted use of NiceHash Platform and Mining Services, NiceHash Wallet or other related websites or services. NiceHash does not assume any obligations to users in connection with the unlawful alienation of Bitcoins, which occurred on 6. 12. 2017 with NICEHASH, d. o. o., and has been fully reimbursed with the completion of the NiceHash Repayment Program. NiceHash will not be responsible for any compensation, reimbursement, or damages arising in connection with: (i) your inability to use the NiceHash Platform and Mining Services, including without limitation as a result of any termination or suspension of the NiceHash Platform or these Terms, power outages, maintenance, defects, system failures, mistakes, omissions, errors, defects, viruses, delays in operation or transmission or any failure of performance, (ii) the cost of procurement of substitute goods or services, (iii) any your investments, expenditures, or commitments in connection with these Terms or your use of or access to the NiceHash Platform and Mining Services, (iv) your reliance on any information obtained from NiceHash, (v) Force Majeure Event, communications failure, theft or other interruptions or (vi) any unauthorized access, alteration, deletion, destruction, damage, loss or failure to store any data, including records, private key or other credentials, associated with NiceHash Platform and Mining Services or NiceHash Wallet. Our aggregate liability (including our directors, members, employees and agents), whether in contract, warranty, tort (including negligence, whether active, passive or imputed), product liability, strict liability or other theory, arising out of or relating to the use of NiceHash Platform and Mining Services, or inability to use the Platform and Services under these Terms or under any other document or agreement executed and delivered in connection herewith or contemplated hereby, shall in any event not exceed 100 EUR per user. You will defend, indemnify, and hold NiceHash harmless and all respective employees, officers, directors, and representatives from and against any claims, demand, action, damages, loss, liabilities, costs and expenses (including reasonable attorney fees) arising out of or relating to (i) any third-party claim concerning these Terms, (ii) your use of, or conduct in connection with, NiceHash Platform and Mining Services, (iii) any feedback you provide, (iv) your violation of these Terms, (v) or your violation of any rights of any other person or entity. If you are obligated to indemnify us, we will have the right, in our sole discretion, to control any action or proceeding (at our expense) and determine whether we wish to settle it. If we are obligated to respond to a third-party subpoena or other compulsory legal order or process described above, you will also reimburse us for reasonable attorney fees, as well as our employees’ and contractors’ time and materials spent responding to the third-party subpoena or other compulsory legal order or process at reasonable hourly rates. The Services and the information, products, and services included in or available through the NiceHash Platform may include inaccuracies or typographical errors. Changes are periodically added to the information herein. Improvements or changes on the NiceHash Platform can be made at any time. NICEHASH ACCOUNT The registration of the NiceHash Account is made through the NiceHash Platform, where you are required to enter your email address and password in the registration form. After successful completion of registration, the confirmation email is sent to you. After you confirm your registration by clicking on the link in the confirmation email the NiceHash Account is created. NiceHash will send you proof of completed registration once the process is completed. When you create NiceHash Account, you agree to (i) create a strong password that you change frequently and do not use for any other website, (ii) implement reasonable and appropriate measures designed to secure access to any device which has access to your email address associated with your NiceHash Account and your username and password for your NiceHash Account, (iii) maintain the security of your NiceHash Account by protecting your password and by restricting access to your NiceHash Account; (iv) promptly notify us if you discover or otherwise suspect any security breaches related to your NiceHash Account so we can take all required and possible measures to secure your NiceHash Account and (v) take responsibility for all activities that occur under your NiceHash Account and accept all risks of any authorized or unauthorized access to your NiceHash Account, to the maximum extent permitted by law. Losing access to your email, registered at NiceHash Platform, may also mean losing access to your NiceHash Account. You may not be able to use the NiceHash Platform or Mining Services, execute withdrawals and other security sensitive operations until you regain access to your email address, registered at NiceHash Platform. If you wish to change the email address linked to your NiceHash Account, we may ask you to complete a KYC procedure for security purposes. This step serves solely for the purpose of identification in the process of regaining access to your NiceHash Account. Once the NiceHash Account is created a NiceHash Wallet is automatically created for the NiceHash Account when the request for the first deposit to the NiceHash Wallet is made by the user. Account holder’s NiceHash Wallet is generated by NiceHash Wallet provider. Account holder is strongly suggested to enhance the security of his NiceHash Account by adding an additional security step of Two-factor authentication (hereinafter “2FA”) when logging into his account, withdrawing funds from his NiceHash Wallet or placing a new order. Account holder can enable this security feature in the settings of his NiceHash Account. In the event of losing or changing 2FA code, we may ask the Account holder to complete a KYC procedure for security reasons. This step serves solely for the purpose of identification in the process of reactivating Account holders 2FA and it may be subject to an a In order to use certain functionalities of the NiceHash Platform, such as paying for the acquired hashing power, users must deposit funds to the NiceHash Wallet, as the payments for the hashing power could be made only through NiceHash Wallet. Hashing power providers have two options to get paid for the provided hashing power: (i) by using NiceHash Wallet to receive the payments or (ii) by providing other Bitcoin address where the payments shall be received to. Hashing power providers provide their Bitcoin address to NiceHash by providing such details via Account holder’s profile settings or in a form of a stratum username while connecting to NiceHash stratum servers. Account holder may load funds on his NiceHash Wallet from his Secondary account. Account holder may be charged fees by the Secondary account provider or by the blockchain network for such transaction. NiceHash is not responsible for any fees charged by Secondary account providers or by the blockchain network or for the management and security of the Secondary accounts. Account holder is solely responsible for his use of Secondary accounts and Account holder agrees to comply with all terms and conditions applicable to any Secondary accounts. The timing associated with a load transaction will depend in part upon the performance of Secondary accounts providers, the performance of blockchain network and performance of the NiceHash Wallet provider. NiceHash makes no guarantee regarding the amount of time it may take to load funds on to NiceHash Wallet. NiceHash Wallet shall not be used by Account holders to keep, save and hold funds for longer period and also not for executing other transactions which are not related to the transactions regarding the NiceHash Platform. The NiceHash Wallet shall be used exclusively and only for current and ongoing transactions regarding the NiceHash Platform. Account holders shall promptly withdraw any funds kept on the NiceHash Wallet that will not be used and are not intended for the reasons described earlier. Commission fees may be charged by the NiceHash Wallet provider, by the blockchain network or by NiceHash for any NiceHash Wallet transactions. Please refer to the NiceHash Platform, for more information about the commission fees for NiceHash Wallet transactions which are applicable at the time of the transaction. NiceHash reserves the right to change these commission fees according to the provisions to change these Terms at any time for any reason. You have the right to use the NiceHash Account only in compliance with these Terms and other commercial terms and principles published on the NiceHash Platform. In particular, you must observe all regulations aimed at ensuring the security of funds and financial transactions. Provided that the balance of funds in your NiceHash Wallet is greater than any minimum balance requirements needed to satisfy any of your open orders, you may withdraw from your NiceHash Wallet any amount of funds, up to the total amount of funds in your NiceHash Wallet in excess of such minimum balance requirements, to Secondary Account, less any applicable withdrawal fees charged by NiceHash or by the blockchain network for such transaction. Withdrawals are not processed instantly and may be grouped with other withdrawal requests. Some withdrawals may require additional verification information which you will have to provide in order to process the withdrawal. It may take up to 24 hours before withdrawal is fully processed and distributed to the Blockchain network. Please refer to the NiceHash Platform for more information about the withdrawal fees and withdrawal processing. NiceHash reserves the right to change these fees according to the provisions to change these Terms at any time for any reason. You have the right to close the NiceHash Account. In case you have funds on your NiceHash Wallet you should withdraw funds from your account prior to requesting NiceHash Account closure. After we receive your NiceHash Account closure request we will deactivate your NiceHash Account. You can read more about closing the NiceHash Account in our Privacy Policy. Your NiceHash Account may be deactivated due to your inactivity. Your NiceHash account may be locked and a mandatory KYC procedure is applied for security reasons, if it has been more than 6 month since your last login. NiceHash or any of its partners or affiliates are not responsible for the loss of the funds, stored on or transferred from the NiceHash Wallet, as well as for the erroneous implementation of the transactions made via NiceHash Wallet, where such loss or faulty implementation of the transaction are the result of a malfunction of the NiceHash Wallet and the malfunction was caused by you or the NiceHash Wallet provider. You are obliged to inform NiceHash in case of loss or theft, as well as in the case of any possible misuse of the access data to your NiceHash Account, without any delay, and demand change of access data or closure of your existing NiceHash Account and submit a request for new access data. NiceHash will execute the change of access data or closure of the NiceHash Account and the opening of new NiceHash Account as soon as technically possible and without any undue delay. All information pertaining to registration, including a registration form, generation of NiceHash Wallet and detailed instructions on the use of the NiceHash Account and NiceHash Wallet are available at NiceHash Platform. The registration form as well as the entire system is properly protected from unwanted interference by third parties. KYC PROCEDURE NiceHash is appropriately implementing AML/CTF and security measures to diligently detect and prevent any malicious or unlawful use of NiceHash Services or use, which is strictly prohibited by these Terms, which are deemed as your agreement to provide required personal information for identity verification. Security measures include a KYC procedure, which is aimed at determining the identity of an individual user or an organisation. We may ask you to complete this procedure before enabling some or all functionalities of the NiceHash platform and provide its services. A KYC procedure might be applied as a security measure when: changing the email address linked to your NiceHash Account, losing or changing your 2FA code; logging in to your NiceHash Account for the first time after the launch of the new NiceHash Platform in August 2019, gaining access to all or a portion of NiceHash Services, NiceHash Wallet and its related services or any portion thereof if they were disabled due to and activating your NiceHash Account if it has been deactivated due to its inactivity and/or security or other reasons. HASHING POWER TRANSACTIONS General NiceHash may, at any time and in our sole discretion, (i) refuse any order submitted or provided hashing power, (ii) cancel an order or part of the order before it is executed, (iii) impose limits on the order amount permitted or on provided hashing power or (iv) impose any other conditions or restrictions upon your use of the NiceHash Platform and Mining Services without prior notice. For example, but not limited to, NiceHash may limit the number of open orders that you may establish or limit the type of supported Hashing power rigs and mining algorithms or NiceHash may restrict submitting orders or providing hashing power from certain locations. Please refer to the NiceHash Platform, for more information about terminology, hashing power transactions’ definitions and descriptions, order types, order submission, order procedure, order rules and other restrictions and limitations of the hashing power transactions. NiceHash reserves the right to change any transaction, definitions, description, order types, procedure, rules, restrictions and limitations at any time for any reason. Orders, provision of hashing power, payments, deposits, withdrawals and other transactions are accepted only through the interface of the NiceHash Platform, NiceHash API and NiceHash Account and are fixed by the software and hardware tools of the NiceHash Platform. If you do not understand the meaning of any transaction option, NiceHash strongly encourages you not to utilize any of those options. Hashing Power Order In order to submit an Hashing Power Order via the NiceHash Account, the Hashing power buyer must have available funds in his NiceHash Wallet. Hashing power buyer submits a new order to buy hashing power via the NiceHash Platform or via the NiceHash API by setting the following parameters in the order form: NiceHash service server location, third-party mining pool, algorithm to use, order type, set amount he is willing to spend on this order, set price per hash he is willing to pay, optionally approximate limit maximum hashing power for his order and other parameters as requested and by confirming his order. Hashing power buyer may submit an order in maximum amount of funds available on his NiceHash Wallet at the time of order submission. Order run time is only approximate since order’s lifetime is based on the number of hashes that it delivers. Particularly during periods of high volume, illiquidity, fast movement or volatility in the marketplace for any digital assets or hashing power, the actual price per hash at which some of the orders are executed may be different from the prevailing price indicated on NiceHash Platform at the time of your order. You understand that NiceHash is not liable for any such price fluctuations. In the event of market disruption, NiceHash Services disruption, NiceHash Hashing Power Marketplace disruption or manipulation or Force Majeure Event, NiceHash may do one or more of the following: (i) suspend access to the NiceHash Account or NiceHash Platform, or (ii) prevent you from completing any actions in the NiceHash Account, including closing any open orders. Following any such event, when trading resumes, you acknowledge that prevailing market prices may differ significantly from the prices available prior to such event. When Hashing power buyer submits an order for purchasing of the Hashing power via NiceHash Platform or via the NiceHash API he authorizes NiceHash to execute the order on his behalf and for his account in accordance with such order. Hashing power buyer acknowledges and agrees that NiceHash is not acting as his broker, intermediary, agent or advisor or in any fiduciary capacity. NiceHash executes the order in set order amount minus NiceHash’s processing fee. Once the order is successfully submitted the order amount starts to decrease in real time according to the payments for the provided hashing power. Hashing power buyer agrees to pay applicable processing fee to NiceHash for provided services. The NiceHash’s fees are deducted from Hashing power buyer’s NiceHash Wallet once the whole order is exhausted and completed. Please refer to the NiceHash Platform, for more information about the fees which are applicable at the time of provision of services. NiceHash reserves the right to change these fees according to the provisions to change these Terms at any time for any reason. The changed fees will apply only for the NiceHash Services provided after the change of the fees. All orders submitted prior the fee change but not necessary completed prior the fee change will be charged according to the fees applicable at the time of the submission of the order. NiceHash will attempt, on a commercially reasonable basis, to execute the Hashing power buyer’s purchase of the hashing power on the Hashing power marketplace under these Terms according to the best-effort delivery approach. In this respect NiceHash does not guarantee that the hashing power will actually be delivered or verified and does not guarantee any quality of the NiceHash Services. Hashing power buyer may cancel a submitted order during order’s lifetime. If an order has been partially executed, Hashing power buyer may cancel the unexecuted remainder of the order. In this case the NiceHash’s processing fee will apply only for the partially executed order. NiceHash reserves the right to refuse any order cancellation request once the order has been submitted. Selling Hashing Power and the Provision of Hashing Power In order to submit the hashing power to the NiceHash stratum server the Hashing power provider must first point its Hashing power rig to the NiceHash stratum server. Hashing power provider is solely responsible for configuration of his Hashing power rig. The Hashing power provider gets paid by Hashing power buyers for all validated and accepted work that his Hashing power rig has produced. The provided hashing power is validated by NiceHash’s stratum engine and validator. Once the hashing power is validated the Hashing power provider is entitled to receive the payment for his work. NiceHash logs all validated hashing power which was submitted by the Hashing power provider. The Hashing power provider receives the payments of current globally weighted average price on to his NiceHash Wallet or his selected personal Bitcoin address. The payments are made periodically depending on the height of payments. NiceHash reserves the right to hold the payments any time and for any reason by indicating the reason, especially if the payments represent smaller values. Please refer to the NiceHash Platform, for more information about the height of payments for provided hashing power, how the current globally weighted average price is calculated, payment periods, payment conditions and conditions for detention of payments. NiceHash reserves the right to change this payment policy according to the provisions to change these Terms at any time for any reason. All Hashing power rig’s earnings and profitability calculations on NiceHash Platform are only for informational purposes. NiceHash does not warrant that your Hashing power rigs would achieve the same profitability or earnings as calculated on NiceHash Platform. You hereby acknowledge that it is possible that your Hashing power rigs would not be as profitable as indicated in our informational calculations or would not be profitable at all. Hashing power provider agrees to pay applicable processing fee to NiceHash for provided Services. The NiceHash’s fees are deducted from all the payments made to the Hashing power provider for his provided work. Please refer to the NiceHash Platform, for more information about the fees which are applicable at the time of provision of services. Hashing power provider which has not submitted any hashing power to the NiceHash stratum server for a period of 90 days agrees that a processing fee of 0.00001000 BTC or less, depending on the unpaid mining balance, will be deducted from his unpaid mining balance. NiceHash reserves the right to change these fees according to the provisions to change these Terms at any time for any reason. The changed fees will apply only for the NiceHash Services provided after the change of the fees. NiceHash will attempt, on a commercially reasonable basis, to execute the provision of Hashing power providers’ hashing power on the Hashing power marketplace under these Terms according to the best-effort delivery approach. In this respect NiceHash does not guarantee that the hashing power will actually be delivered or verified and does not guarantee any quality of the NiceHash Services. Hashing power provider may disconnect the Hashing power rig from the NiceHash stratum server any time. NiceHash reserves the right to refuse any Hashing power rig once the Hashing power rig has been pointed towards NiceHash stratum server. RESTRICTIONS When accessing the NiceHash Platform or using the Mining Services or NiceHash Wallet, you warrant and agree that you: will not use the Services for any purpose that is unlawful or prohibited by these Terms, will not violate any law, contract, intellectual property or other third-party right or commit a tort, are solely responsible for your conduct while accessing the NiceHash Platform or using the Mining Services or NiceHash Wallet, will not access the NiceHash Platform or use the Mining Services in any manner that could damage, disable, overburden, or impair the provision of the Services or interfere with any other party's use and enjoyment of the Services, will not misuse and/or maliciously use Hashing power rigs, you will particularly refrain from using network botnets or using NiceHash Platform or Mining Services with Hashing power rigs without the knowledge or awareness of Hashing power rig owner(s), will not perform or attempt to perform any kind of malicious attacks on blockchains with the use of the NiceHash Platform or Mining Services, intended to maliciously gain control of more than 50% of the network's mining hash rate, will not use the NiceHash Platform or Mining Services for any kind of market manipulation or disruption, such as but not limited to NiceHash Mining Services disruption and NiceHash Hashing Power Marketplace manipulation. In case of any of the above mentioned events, NiceHash reserves the right to immediately suspend your NiceHash Account, freeze or block the funds in the NiceHash Wallet, and suspend your access to NiceHash Platform, particularly if NiceHash believes that such NiceHash Account are in violation of these Terms or Privacy Policy, or any applicable laws and regulation. RIGHTS AND OBLIGATIONS In the event of disputes with you, NiceHash is obliged to prove that the NiceHash service which is the subject of the dispute was not influenced by technical or other failure. You will have possibility to check at any time, subject to technical availability, the transactions details, statistics and available balance of the funds held on the NiceHash Wallet, through access to the NiceHash Account. You may not obtain or attempt to obtain any materials or information through any means not intentionally made available or provided to you or public through the NiceHash Platform or Mining Services. We may, in our sole discretion, at any time, for any or no reason and without liability to you, with prior notice (i) terminate all rights and obligations between you and NiceHash derived from these Terms, (ii) suspend your access to all or a portion of NiceHash Services, NiceHash Wallet and its related services or any portion thereof and delete or deactivate your NiceHash Account and all related information and files in such account (iii) modify, suspend or discontinue, temporarily or permanently, any portion of NiceHash Platform or (iv) provide enhancements or improvements to the features and functionality of the NiceHash Platform, which may include patches, bug fixes, updates, upgrades and other modifications. Any such change may modify or delete certain portion, features or functionalities of the NiceHash Services. You agree that NiceHash has no obligation to (i) provide any updates, or (ii) continue to provide or enable any particular portion, features or functionalities of the NiceHash Services to you. You further agree that all changes will be (i) deemed to constitute an integral part of the NiceHash Platform, and (ii) subject to these Terms. In the event of your breach of these Terms, including but not limited to, for instance, in the event that you breach any term of these Terms, due to legal grounds originating in anti-money laundering and know your client regulation and procedures, or any other relevant applicable regulation, all right and obligations between you and NiceHash derived from these Terms terminate automatically if you fail to comply with these Terms within the notice period of 8 days after you have been warned by NiceHash about the breach and given 8 days period to cure the breaches. NiceHash reserves the right to keep these rights and obligations in force despite your breach of these Terms. In the event of termination, NiceHash will attempt to return you any funds stored on your NiceHash Wallet not otherwise owed to NiceHash, unless NiceHash believes you have committed fraud, negligence or other misconduct. You acknowledge that the NiceHash Services and NiceHash Wallet may be suspended for maintenance. Technical information about the hashing power transactions, including information about chosen server locations, algorithms used, selected mining pools, your business or activities, including all financial and technical information, specifications, technology together with all details of prices, current transaction performance and future business strategy represent confidential information and trade secrets. NiceHash shall, preserve the confidentiality of all before mentioned information and shall not disclose or cause or permit to be disclosed without your permission any of these information to any person save to the extent that such disclosure is strictly to enable you to perform or comply with any of your obligations under these Terms, or to the extent that there is an irresistible legal requirement on you or NiceHash to do so; or where the information has come into the public domain otherwise than through a breach of any of the terms of these Terms. NiceHash shall not be entitled to make use of any of these confidential information and trade secrets other than during the continuance of and pursuant to these Terms and then only for the purpose of carrying out its obligations pursuant to these Terms. NICEHASH MINER LICENSE (NICEHASH MINING SOFTWARE LICENSE) NiceHash Mining Software whether on disk, in read only memory, or any other media or in any other form is licensed, not sold, to you by NiceHash for use only under these Terms. NiceHash retains ownership of the NiceHash Mining Software itself and reserves all rights not expressly granted to you. Subject to these Terms, you are granted a limited, non-transferable, non-exclusive and a revocable license to download, install and use the NiceHash Mining Software. You may not distribute or make the NiceHash Mining Software available over a network where it could be used by multiple devices at the same time. You may not rent, lease, lend, sell, redistribute, assign, sublicense host, outsource, disclose or otherwise commercially exploit the NiceHash Mining Software or make it available to any third party. There is no license fee for the NiceHash Mining Software. NiceHash reserves the right to change the license fee policy according to the provisions to change these Terms any time and for any reason, including to decide to start charging the license fee for the NiceHash Mining Software. You are responsible for any and all applicable taxes. You may not, and you agree not to or enable others to, copy, decompile, reverse engineer, reverse compile, disassemble, attempt to derive the source code of, decrypt, modify, or create derivative works of the NiceHash Mining Software or any services provided by the NiceHash Mining Software, or any part thereof (except as and only to the extent any foregoing restriction is prohibited by applicable law or to the extent as may be permitted by the licensing terms governing use of open-sourced components included with the NiceHash Mining Software). If you choose to allow automatic updates, your device will periodically check with NiceHash for updates and upgrades to the NiceHash Mining Software and, if an update or upgrade is available, the update or upgrade will automatically download and install onto your device and, if applicable, your peripheral devices. You can turn off the automatic updates altogether at any time by changing the automatic updates settings found within the NiceHash Mining Software. You agree that NiceHash may collect and use technical and related information, including but not limited to technical information about your computer, system and application software, and peripherals, that is gathered periodically to facilitate the provision of software updates, product support and other services to you (if any) related to the NiceHash Mining Software and to verify compliance with these Terms. NiceHash may use this information, as long as it is in a form that does not personally identify you, to improve our NiceHash Services. NiceHash Mining Software contains features that rely upon information about your selected mining pools. You agree to our transmission, collection, maintenance, processing, and use of all information obtained from you about your selected mining pools. You can opt out at any time by going to settings in the NiceHash Mining Software. NiceHash may provide interest-based advertising to you. If you do not want to receive relevant ads in the NiceHash Mining Software, you can opt out at any time by going to settings in the NiceHash Mining Software. If you opt out, you will continue to receive the same number of ads, but they may be less relevant because they will not be based on your interest. NiceHash Mining Software license is effective until terminated. All provisions of these Terms regarding the termination apply also for the NiceHash Mining Software license. Upon the termination of NiceHash Mining Software license, you shall cease all use of the NiceHash Mining Software and destroy or delete all copies, full or partial, of the NiceHash Mining Software. THIRD PARTY MINERS AND PLUGINS Third Party Miners and Plugins are a third party software which enables the best and most efficient mining operations. NiceHash Miner integrates third party mining software using a third party miner plugin system. Third Party Mining Software is a closed source software which supports mining algorithms for cryptocurrencies and can be integrated into NiceHash Mining Software. Third Party Miner Plugin enables the connection between NiceHash Mining Software and Third Party Mining Software and it can be closed, as well as open sourced. NiceHash Mining Software user interface enables the user to manually select which available Third Party Miners and Plugins will be downloaded and integrated. Users can select or deselect Third Party Miners and Plugins found in the Plugin Manager window. Some of the available Third Party Miners and Plugins which are most common are preselected by NiceHash, but can be deselected, depending on users' needs. The details of the Third Party Miners and Plugins available for NiceHash Mining Software are accessible within the NiceHash Mining Software user interface. The details include, but not limited to, the author of the software and applicable license information, if applicable information about developer fee for Third Party Miners, software version etc. Developer fees may apply to the use of Third Party Miners and Plugins. NiceHash will not be liable, to the maximum extent permitted by applicable law, for any damages of any kind, including, but not limited to, direct, consequential, incidental, special or indirect damages, arising out of using Third Party Miners and Plugins. The latter includes, but is not limited to: i) any power outages, maintenance, defects, system failures, mistakes, omissions, errors, defects, viruses, delays in operation or transmission or any failure of performance; ii) any unauthorized access, alteration, deletion, destruction, damage, loss or failure to store any data, including records, private key or other credentials, associated with usage of Third Party Miners and Plugins and ii) Force Majeure Event, communications failure, theft or other interruptions. If you choose to allow automatic updates, your device will periodically check with NiceHash for updates and upgrades to the installed Third Party Miners and Plugins, if an update or upgrade is available, the update or upgrade will automatically download and install onto your device and, if applicable, your peripheral devices. You can turn off the automatic updates altogether at any time by changing the automatic updates settings found within the NiceHash Mining Software. NICEHASH QUICKMINER NiceHash QuickMiner is a software application that allows the visitors of the NiceHash Quick Miner web page, accessible athttps://www.nicehash.com/quick-miner, to connect their PC or a mining rig to the NiceHash Hashing Power Marketplace. Visitors of the NiceHash Quick Miner web page can try out and experience crypto currency mining without having to register on the NiceHash Platform and create a NiceHash Account. Users are encouraged to do so as soon as possible in order to collect the funds earned using NiceHash Quick Miner. Users can download NiceHash QuickMiner free of charge. In order to operate NiceHash QuickMiner software needs to automatically detect technical information about users' computer hardware. You agree that NiceHash may collect and use technical and related information. For more information please refer to NiceHash Privacy Policy. Funds arising from the usage of NiceHash QuickMiner are transferred to a dedicated cryptocurrency wallet owned and managed by NiceHash. NiceHash QuickMiner Users expressly agree and acknowledge that completing the registration process and creating a NiceHash Account is necessary in order to collect the funds arising from the usage of NiceHash QuickMiner. Users of NiceHash QuickMiner who do not successfully register a NiceHash Account will lose their right to claim funds arising from their usage of NiceHash QuickMiner. Those funds, in addition to the condition that the user has not been active on the NiceHash QuickMiner web page for consecutive 7 days, will be donated to the charity of choice. NICEHASH PRIVATE ENDPOINT NiceHash Private Endpoint is a network interface that connects users privately and securely to NiceHash Stratum servers. Private Endpoint uses a private IP address and avoids additional latency caused by DDOS protection. All NiceHash Private Mining Proxy servers are managed by NiceHash and kept up-to-date. Users can request a dedicated private access endpoint by filling in the form for NiceHash Private Endpoint Solution available at the NiceHash Platform. In the form the user specifies the email address, country, number of connections and locations and algorithms used. Based on the request NiceHash prepares an individualized offer based on the pricing stipulated on the NiceHash Platform, available at https://www.nicehash.com/private-endpoint-solution. NiceHash may request additional information from the users of the Private Endpoint Solution in order to determine whether we are obligated to collect VAT from you, including your VAT identification number. INTELLECTUAL PROPERTY NiceHash retains all copyright and other intellectual property rights, including inventions, discoveries, knowhow, processes, marks, methods, compositions, formulae, techniques, information and data, whether or not patentable, copyrightable or protectable in trademark, and any trademarks, copyrights or patents based thereon over all content and other materials contained on NiceHash Platform or provided in connection with the Services, including, without limitation, the NiceHash logo and all designs, text, graphics, pictures, information, data, software, source code, as well as the compilation thereof, sound files, other files and the selection and arrangement thereof. This material is protected by international copyright laws and other intellectual property right laws, namely trademark. These Terms shall not be understood and interpreted in a way that they would mean assignment of copyright or other intellectual property rights, unless it is explicitly defined so in these Terms. NiceHash hereby grants you a limited, nonexclusive and non-sublicensable license to access and use NiceHash’s copyrighted work and other intellectual property for your personal or internal business use. Such license is subject to these Terms and does not permit any resale, the distribution, public performance or public display, modifying or otherwise making any derivative uses, use, publishing, transmission, reverse engineering, participation in the transfer or sale, or any way exploit any of the copyrighted work and other intellectual property other than for their intended purposes. This granted license will automatically terminate if NiceHash suspends or terminates your access to the Services, NiceHash Wallet or closes your NiceHash Account. NiceHash will own exclusive rights, including all intellectual property rights, to any feedback including, but not limited to, suggestions, ideas or other information or materials regarding NiceHash Services or related products that you provide, whether by email, posting through our NiceHash Platform, NiceHash Account or otherwise and you irrevocably assign any and all intellectual property rights on such feedback unlimited in time, scope and territory. Any Feedback you submit is non-confidential and shall become the sole property of NiceHash. NiceHash will be entitled to the unrestricted use, modification or dissemination of such feedback for any purpose, commercial or otherwise, without acknowledgment or compensation to you. You waive any rights you may have to the feedback. We have the right to remove any posting you make on NiceHash Platform if, in our opinion, your post does not comply with the content standards defined by these Terms. PRIVACY POLICY Please refer to our NiceHash Platform and Mining Services Privacy Policy published on the NiceHash Platform for information about how we collect, use and share your information, as well as what options do you have with regards to your personal information. COMMUNICATION AND SUPPORT You agree and consent to receive electronically all communications, agreements, documents, receipts, notices and disclosures that NiceHash provides in connection with your NiceHash Account or use of the NiceHash Platform and Services. You agree that NiceHash may provide these communications to you by posting them via the NiceHash Account or by emailing them to you at the email address you provide. You should maintain copies of electronic communications by printing a paper copy or saving an electronic copy. It is your responsibility to keep your email address updated in the NiceHash Account so that NiceHash can communicate with you electronically. You understand and agree that if NiceHash sends you an electronic communication but you do not receive it because your email address is incorrect, out of date, blocked by your service provider, or you are otherwise unable to receive electronic communications, it will be deemed that you have been provided with the communication. You can update your NiceHash Account preferences at any time by logging into your NiceHash Account. If your email address becomes invalid such that electronic communications sent to you by NiceHash are returned, NiceHash may deem your account to be inactive and close it. You may give NiceHash a notice under these Terms by sending an email to support@nicehash.com or contact NiceHash through support located on the NiceHash Platform. All communication and notices pursuant to these Terms must be given in English language. FEES Please refer to the NiceHash Platform for more information about the fees or administrative costs which are applicable at the time of provision of services. NiceHash reserves the right to change these fees according to the provisions to change these Terms at any time for any reason. The changed fees will apply only for the Services provided after the change of the fees. You authorize us, or our designated payment processor, to charge or deduct your NiceHash Account for any applicable fees in connection with the transactions completed via the Services. TAX It is your responsibility to determine what, if any, taxes apply to the transactions you complete or services you provide via the NiceHash Platform, Mining Services and NiceHash Wallet, it is your responsibility to report and remit the correct tax to the appropriate tax authority and all your factual and potential tax obligations are your concern. You agree that NiceHash is not in any case and under no conditions responsible for determining whether taxes apply to your transactions or services or for collecting, reporting, withholding or remitting any taxes arising from any transactions or services. You also agree that NiceHash is not in any case and under no conditions bound to compensate for your tax obligation or give you any advice related to tax issues. All fees and charges payable by you to NiceHash are exclusive of any taxes, and shall certain taxes be applicable, they shall be added on top of the payable amounts. Upon our request, you will provide to us any information that we reasonably request to determine whether we are obligated to collect VAT from you, including your VAT identification number. If any deduction or withholding is required by law, you will notify NiceHash and will pay NiceHash any additional amounts necessary to ensure that the net amount received by NiceHash, after any deduction and withholding, equals the amount NiceHash would have received if no deduction or withholding had been required. Additionally, you will provide NiceHash with documentation showing that the withheld and deducted amounts have been paid to the relevant taxing authority. FINAL PROVISIONS Natural persons and legal entities that are not capable of holding legal rights and obligations are not allowed to create NiceHash Account and use NiceHash Platform or other related services. If NiceHash becomes aware that such natural person or legal entity has created the NiceHash Account or has used NiceHash Services, NiceHash will delete such NiceHash Account and disable any Services and block access to NiceHash Account and NiceHash Services to such natural person or legal entity. If you register to use the NiceHash Services on behalf of a legal entity, you represent and warrant that (i) such legal entity is duly organized and validly existing under the applicable laws of the jurisdiction of its organization; and (ii) you are duly authorized by such legal entity to act on its behalf. These Terms do not create any third-party beneficiary rights in any individual or entity. These Terms forms the entire agreement and understanding relating to the subject matter hereof and supersede any previous and contemporaneous agreements, arrangements or understandings relating to the subject matter hereof to the exclusion of any terms implied by law that may be excluded by contract. If at any time any provision of these Terms is or becomes illegal, invalid or unenforceable, the legality, validity and enforceability of every other provisions will not in any way be impaired. Such illegal, invalid or unenforceable provision of these Terms shall be deemed to be modified and replaced by such legal, valid and enforceable provision or arrangement, which corresponds as closely as possible to our and your will and business purpose pursued and reflected in these Terms. Headings of sections are for convenience only and shall not be used to limit or construe such sections. No failure to enforce nor delay in enforcing, on our side to the Terms, any right or legal remedy shall function as a waiver thereof, nor shall any individual or partial exercise of any right or legal remedy prevent any further or other enforcement of these rights or legal remedies or the enforcement of any other rights or legal remedies. NiceHash reserves the right to make changes, amendments, supplementations or modifications from time to time to these Terms including but not limited to changes of licence agreement for NiceHash Mining Software and of any fees and compensations policies, in its sole discretion and for any reason. We suggest that you review these Terms periodically for changes. If we make changes to these Terms, we will provide you with notice of such changes, such as by sending an email, providing notice on the NiceHash Platform, placing a popup window after login to the NiceHash Account or by posting the amended Terms on the NiceHash Platform and updating the date at the top of these Terms. The amended Terms will be deemed effective immediately upon posting for any new users of the NiceHash Services. In all other cases, the amended Terms will become effective for preexisting users upon the earlier of either: (i) the date users click or press a button to accept such changes in their NiceHash Account, or (ii) continued use of NiceHash Services 30 days after NiceHash provides notice of such changes. Any amended Terms will apply prospectively to use of the NiceHash Services after such changes become effective. The notice of change of these Terms is considered as notice of termination of all rights and obligations between you and NiceHash derived from these Terms with notice period of 30 days, if you do not accept the amended Terms. If you do not agree to any amended Terms, (i) the agreement between you and NiceHash is terminated by expiry of 30 days period which starts after NiceHash provides you a notice of change of these Terms, (ii) you must discontinue using NiceHash Services and (iii) you must inform us regarding your disagreement with the changes and request closure of your NiceHash Account. If you do not inform us regarding your disagreement and do not request closure of you NiceHash Account, we will deem that you agree with the changed Terms. You may not assign or transfer your rights or obligations under these Terms without the prior written consent of NiceHash. NiceHash may assign or transfer any or all of its rights under these Terms, in whole or in part, without obtaining your consent or approval. These Terms shall be governed by and construed and enforced in accordance with the Laws of the British Virgin Islands, and shall be interpreted in all respects as a British Virgin Islands contract. Any transaction, dispute, controversy, claim or action arising from or related to your access or use of the NiceHash Platform or these Terms of Service likewise shall be governed by the Laws of the British Virgin Islands, exclusive of choice-of-law principles. The rights and remedies conferred on NiceHash by, or pursuant to, these Terms are cumulative and are in addition, and without prejudice, to all other rights and remedies otherwise available to NiceHash at law. NiceHash may transfer its rights and obligations under these Terms to other entities which include, but are not limited to H-BIT, d.o.o. and NICEX Ltd, or any other firm or business entity that directly or indirectly acquires all or substantially all of the assets or business of NICEHASH Ltd. If you do not consent to any transfer, you may terminate this agreement and close your NiceHash Account. These Terms are not boilerplate. If you disagree with any of them, believe that any should not apply to you, or wish to negotiate these Terms, please contact NiceHash and immediately navigate away from the NiceHash Platform. Do not use the NiceHash Mining Services, NiceHash Wallet or other related services until you and NiceHash have agreed upon new terms of service. Last updated: March 1, 2021
HFTHaidra / Deep Reinforcement Learning For Automated Stock Trading StrategyStock trading strategies play a critical role in investment. However, it is challenging to design a profitable strategy in a complex and dynamic stock market. In this paper, we propose a deep ensemble reinforcement learning scheme that automatically learns a stock trading strategy by maximizing investment return. We train a deep reinforcement learning agent and obtain an ensemble trading strategy using the three actor-critic based algorithms: Proximal Policy Optimization (PPO), Advantage Actor Critic (A2C), and Deep Deterministic Policy Gradient (DDPG). The ensemble strategy inherits and integrates the best features of the three algorithms, thereby robustly adjusting to different market conditions. In order to avoid the large memory consumption in training networks with continuous action space, we employ a load-on-demand approach for processing very large data. We test our algorithms on the 30 Dow Jones stocks which have adequate liquidity. The performance of the trading agent with different reinforcement learning algorithms is evaluated and compared with both the Dow Jones Industrial Average index and the traditional min-variance portfolio allocation strategy. The proposed deep ensemble scheme is shown to outperform the three individual algorithms and the two baselines in terms of the risk-adjusted return measured by the Sharpe ratio.
zer0tonin / Crud BenchmarkAn average CRUD app and a client for load-testing
magiclen / M ProberThis program aims to collect Linux system information including hostname, kernel version, uptime, RTC time, load average, CPU, memory, network interfaces, block devices and processes. It can be used not only as a normal CLI tool, but also a web application with a front-end webpage and useful HTTP APIs.
Habilya / SSH Welcome ScreenThis screen is what the server administrator ever needs. CPU temperature, Load Average, Memory and Disk usage, Available system updates, etc.
Michelle-NYX / Traffic Simulator Q LearningWe propose a driver modeling process and its evaluation results of an intelligent autonomous driving policy, which is obtained through reinforcement learning techniques. Assuming a MDP decision making model, Q-learning method is applied to simple but descriptive state and action spaces, so that a policy is developed within limited computational load. The driver could perform reasonable maneuvers, like acceleration, deceleration or lane-changes, under usual traffic conditions on a multi-lane highway. A traffic simulator is also construed to evaluate a given policy in terms of collision rate, average travelling speed, and lane change times. Results show the policy gets well trained under reasonable time periods, where the driver acts interactively in the stochastic traffic environment, demonstrating low collision rate and obtaining higher travelling speed than the average of the environment. Sample traffic simulation videos are postedsit on YouTube.
pradykaushik / System Load GeneratorGenerate different kinds of system load.
Rushikesh8983 / MastersDataScience Deep Learning ProjectLanguage Translation In this project, you’re going to take a peek into the realm of neural network machine translation. You’ll be training a sequence to sequence model on a dataset of English and French sentences that can translate new sentences from English to French. Get the Data Since translating the whole language of English to French will take lots of time to train, we have provided you with a small portion of the English corpus. """ DON'T MODIFY ANYTHING IN THIS CELL """ import helper import problem_unittests as tests source_path = 'data/small_vocab_en' target_path = 'data/small_vocab_fr' source_text = helper.load_data(source_path) target_text = helper.load_data(target_path) Explore the Data Play around with view_sentence_range to view different parts of the data. view_sentence_range = (0, 10) """ DON'T MODIFY ANYTHING IN THIS CELL """ import numpy as np print('Dataset Stats') print('Roughly the number of unique words: {}'.format(len({word: None for word in source_text.split()}))) sentences = source_text.split('\n') word_counts = [len(sentence.split()) for sentence in sentences] print('Number of sentences: {}'.format(len(sentences))) print('Average number of words in a sentence: {}'.format(np.average(word_counts))) print() print('English sentences {} to {}:'.format(*view_sentence_range)) print('\n'.join(source_text.split('\n')[view_sentence_range[0]:view_sentence_range[1]])) print() print('French sentences {} to {}:'.format(*view_sentence_range)) print('\n'.join(target_text.split('\n')[view_sentence_range[0]:view_sentence_range[1]])) Dataset Stats Roughly the number of unique words: 227 Number of sentences: 137861 Average number of words in a sentence: 13.225277634719028 English sentences 0 to 10: new jersey is sometimes quiet during autumn , and it is snowy in april . the united states is usually chilly during july , and it is usually freezing in november . california is usually quiet during march , and it is usually hot in june . the united states is sometimes mild during june , and it is cold in september . your least liked fruit is the grape , but my least liked is the apple . his favorite fruit is the orange , but my favorite is the grape . paris is relaxing during december , but it is usually chilly in july . new jersey is busy during spring , and it is never hot in march . our least liked fruit is the lemon , but my least liked is the grape . the united states is sometimes busy during january , and it is sometimes warm in november . French sentences 0 to 10: new jersey est parfois calme pendant l' automne , et il est neigeux en avril . les états-unis est généralement froid en juillet , et il gèle habituellement en novembre . california est généralement calme en mars , et il est généralement chaud en juin . les états-unis est parfois légère en juin , et il fait froid en septembre . votre moins aimé fruit est le raisin , mais mon moins aimé est la pomme . son fruit préféré est l'orange , mais mon préféré est le raisin . paris est relaxant en décembre , mais il est généralement froid en juillet . new jersey est occupé au printemps , et il est jamais chaude en mars . notre fruit est moins aimé le citron , mais mon moins aimé est le raisin . les états-unis est parfois occupé en janvier , et il est parfois chaud en novembre . Implement Preprocessing Function Text to Word Ids As you did with other RNNs, you must turn the text into a number so the computer can understand it. In the function text_to_ids(), you'll turn source_text and target_text from words to ids. However, you need to add the <EOS> word id at the end of target_text. This will help the neural network predict when the sentence should end. You can get the <EOS> word id by doing: target_vocab_to_int['<EOS>'] You can get other word ids using source_vocab_to_int and target_vocab_to_int. def text_to_ids(source_text, target_text, source_vocab_to_int, target_vocab_to_int): """ Convert source and target text to proper word ids :param source_text: String that contains all the source text. :param target_text: String that contains all the target text. :param source_vocab_to_int: Dictionary to go from the source words to an id :param target_vocab_to_int: Dictionary to go from the target words to an id :return: A tuple of lists (source_id_text, target_id_text) """ # TODO: Implement Function source_id_text = [[source_vocab_to_int[word] for word in sentence.split()] \ for sentence in source_text.split('\n')] target_id_text = [[target_vocab_to_int[word] for word in sentence.split()] + [target_vocab_to_int['<EOS>']] \ for sentence in target_text.split('\n')] return source_id_text, target_id_text """ DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ tests.test_text_to_ids(text_to_ids) Tests Passed Preprocess all the data and save it Running the code cell below will preprocess all the data and save it to file. """ DON'T MODIFY ANYTHING IN THIS CELL """ helper.preprocess_and_save_data(source_path, target_path, text_to_ids) Check Point This is your first checkpoint. If you ever decide to come back to this notebook or have to restart the notebook, you can start from here. The preprocessed data has been saved to disk. import problem_unittests as tests """ DON'T MODIFY ANYTHING IN THIS CELL """ import numpy as np import helper (source_int_text, target_int_text), (source_vocab_to_int, target_vocab_to_int), _ = helper.load_preprocess() Check the Version of TensorFlow and Access to GPU This will check to make sure you have the correct version of TensorFlow and access to a GPU """ DON'T MODIFY ANYTHING IN THIS CELL """ from distutils.version import LooseVersion import warnings import tensorflow as tf from tensorflow.python.layers.core import Dense # Check TensorFlow Version assert LooseVersion(tf.__version__) >= LooseVersion('1.1'), 'Please use TensorFlow version 1.1 or newer' print('TensorFlow Version: {}'.format(tf.__version__)) # Check for a GPU if not tf.test.gpu_device_name(): warnings.warn('No GPU found. Please use a GPU to train your neural network.') else: print('Default GPU Device: {}'.format(tf.test.gpu_device_name())) TensorFlow Version: 1.1.0 Default GPU Device: /gpu:0 Build the Neural Network You'll build the components necessary to build a Sequence-to-Sequence model by implementing the following functions below: model_inputs process_decoder_input encoding_layer decoding_layer_train decoding_layer_infer decoding_layer seq2seq_model Input Implement the model_inputs() function to create TF Placeholders for the Neural Network. It should create the following placeholders: Input text placeholder named "input" using the TF Placeholder name parameter with rank 2. Targets placeholder with rank 2. Learning rate placeholder with rank 0. Keep probability placeholder named "keep_prob" using the TF Placeholder name parameter with rank 0. Target sequence length placeholder named "target_sequence_length" with rank 1 Max target sequence length tensor named "max_target_len" getting its value from applying tf.reduce_max on the target_sequence_length placeholder. Rank 0. Source sequence length placeholder named "source_sequence_length" with rank 1 Return the placeholders in the following the tuple (input, targets, learning rate, keep probability, target sequence length, max target sequence length, source sequence length) def model_inputs(): """ Create TF Placeholders for input, targets, learning rate, and lengths of source and target sequences. :return: Tuple (input, targets, learning rate, keep probability, target sequence length, max target sequence length, source sequence length) """ # TODO: Implement Function inputs = tf.placeholder(tf.int32, [None, None], 'input') targets = tf.placeholder(tf.int32, [None, None]) learning_rate = tf.placeholder(tf.float32, []) keep_prob = tf.placeholder(tf.float32, [], 'keep_prob') target_sequence_length = tf.placeholder(tf.int32, [None], 'target_sequence_length') max_target_len = tf.reduce_max(target_sequence_length) source_sequence_length = tf.placeholder(tf.int32, [None], 'source_sequence_length') return inputs, targets, learning_rate, keep_prob, target_sequence_length, max_target_len, source_sequence_length """ DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ tests.test_model_inputs(model_inputs) Tests Passed Process Decoder Input Implement process_decoder_input by removing the last word id from each batch in target_data and concat the GO ID to the begining of each batch. def process_decoder_input(target_data, target_vocab_to_int, batch_size): """ Preprocess target data for encoding :param target_data: Target Placehoder :param target_vocab_to_int: Dictionary to go from the target words to an id :param batch_size: Batch Size :return: Preprocessed target data """ # TODO: Implement Function go = tf.constant([[target_vocab_to_int['<GO>']]]*batch_size) # end = tf.slice(target_data, [0, 0], [-1, batch_size]) end = tf.strided_slice(target_data, [0, 0], [batch_size, -1], [1, 1]) return tf.concat([go, end], 1) """ DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ tests.test_process_encoding_input(process_decoder_input) Tests Passed Encoding Implement encoding_layer() to create a Encoder RNN layer: Embed the encoder input using tf.contrib.layers.embed_sequence Construct a stacked tf.contrib.rnn.LSTMCell wrapped in a tf.contrib.rnn.DropoutWrapper Pass cell and embedded input to tf.nn.dynamic_rnn() from imp import reload reload(tests) def encoding_layer(rnn_inputs, rnn_size, num_layers, keep_prob, source_sequence_length, source_vocab_size, encoding_embedding_size): """ Create encoding layer :param rnn_inputs: Inputs for the RNN :param rnn_size: RNN Size :param num_layers: Number of layers :param keep_prob: Dropout keep probability :param source_sequence_length: a list of the lengths of each sequence in the batch :param source_vocab_size: vocabulary size of source data :param encoding_embedding_size: embedding size of source data :return: tuple (RNN output, RNN state) """ # TODO: Implement Function embed = tf.contrib.layers.embed_sequence(rnn_inputs, source_vocab_size, encoding_embedding_size) def lstm_cell(): lstm = tf.contrib.rnn.BasicLSTMCell(rnn_size) return tf.contrib.rnn.DropoutWrapper(lstm, keep_prob) stacked_lstm = tf.contrib.rnn.MultiRNNCell([lstm_cell() for _ in range(num_layers)]) # initial_state = stacked_lstm.zero_state(source_sequence_length, tf.float32) return tf.nn.dynamic_rnn(stacked_lstm, embed, source_sequence_length, dtype=tf.float32) # initial_state=initial_state) """ DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ tests.test_encoding_layer(encoding_layer) Tests Passed Decoding - Training Create a training decoding layer: Create a tf.contrib.seq2seq.TrainingHelper Create a tf.contrib.seq2seq.BasicDecoder Obtain the decoder outputs from tf.contrib.seq2seq.dynamic_decode def decoding_layer_train(encoder_state, dec_cell, dec_embed_input, target_sequence_length, max_summary_length, output_layer, keep_prob): """ Create a decoding layer for training :param encoder_state: Encoder State :param dec_cell: Decoder RNN Cell :param dec_embed_input: Decoder embedded input :param target_sequence_length: The lengths of each sequence in the target batch :param max_summary_length: The length of the longest sequence in the batch :param output_layer: Function to apply the output layer :param keep_prob: Dropout keep probability :return: BasicDecoderOutput containing training logits and sample_id """ # TODO: Implement Function helper = tf.contrib.seq2seq.TrainingHelper(dec_embed_input, target_sequence_length) decoder = tf.contrib.seq2seq.BasicDecoder(dec_cell, helper, encoder_state, output_layer) dec_train_logits, _ = tf.contrib.seq2seq.dynamic_decode(decoder, maximum_iterations=max_summary_length) # for tensorflow 1.2: # dec_train_logits, _, _ = tf.contrib.seq2seq.dynamic_decode(decoder, maximum_iterations=max_summary_length) return dec_train_logits # keep_prob/dropout not used? """ DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ tests.test_decoding_layer_train(decoding_layer_train) Tests Passed Decoding - Inference Create inference decoder: Create a tf.contrib.seq2seq.GreedyEmbeddingHelper Create a tf.contrib.seq2seq.BasicDecoder Obtain the decoder outputs from tf.contrib.seq2seq.dynamic_decode def decoding_layer_infer(encoder_state, dec_cell, dec_embeddings, start_of_sequence_id, end_of_sequence_id, max_target_sequence_length, vocab_size, output_layer, batch_size, keep_prob): """ Create a decoding layer for inference :param encoder_state: Encoder state :param dec_cell: Decoder RNN Cell :param dec_embeddings: Decoder embeddings :param start_of_sequence_id: GO ID :param end_of_sequence_id: EOS Id :param max_target_sequence_length: Maximum length of target sequences :param vocab_size: Size of decoder/target vocabulary :param decoding_scope: TenorFlow Variable Scope for decoding :param output_layer: Function to apply the output layer :param batch_size: Batch size :param keep_prob: Dropout keep probability :return: BasicDecoderOutput containing inference logits and sample_id """ # TODO: Implement Function start_tokens = tf.constant([start_of_sequence_id]*batch_size) helper = tf.contrib.seq2seq.GreedyEmbeddingHelper(dec_embeddings, start_tokens, end_of_sequence_id) decoder = tf.contrib.seq2seq.BasicDecoder(dec_cell, helper, encoder_state, output_layer) dec_infer_logits, _ = tf.contrib.seq2seq.dynamic_decode(decoder, maximum_iterations=max_target_sequence_length) # for tensorflow 1.2: # dec_infer_logits, _, _ = tf.contrib.seq2seq.dynamic_decode(decoder, maximum_iterations=max_target_sequence_length) return dec_infer_logits """ DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE """ tests.test_decoding_layer_infer(decoding_layer_infer)
heru299 / Script Copy-? Print this help message and exit -alertnotify=<cmd> Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) -assumevalid=<hex> If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72, testnet: 000000000000006433d1efec504c53ca332b64963c425395515b01977bd7b3b0, signet: 0000002a1de0f46379358c1fd09906f7ac59adf3712323ed90eb59e4c183c020) -blockfilterindex=<type> Maintain an index of compact filters by block (default: 0, values: basic). If <type> is not supplied or if <type> = 1, indexes for all known types are enabled. -blocknotify=<cmd> Execute command when the best block changes (%s in cmd is replaced by block hash) -blockreconstructionextratxn=<n> Extra transactions to keep in memory for compact block reconstructions (default: 100) -blocksdir=<dir> Specify directory to hold blocks subdirectory for *.dat files (default: <datadir>) -blocksonly Whether to reject transactions from network peers. Automatic broadcast and rebroadcast of any transactions from inbound peers is disabled, unless the peer has the 'forcerelay' permission. RPC transactions are not affected. (default: 0) -conf=<file> Specify path to read-only configuration file. Relative paths will be prefixed by datadir location. (default: bitcoin.conf) -daemon Run in the background as a daemon and accept commands -datadir=<dir> Specify data directory -dbcache=<n> Maximum database cache size <n> MiB (4 to 16384, default: 450). In addition, unused mempool memory is shared for this cache (see -maxmempool). -debuglogfile=<file> Specify location of debug log file. Relative paths will be prefixed by a net-specific datadir location. (-nodebuglogfile to disable; default: debug.log) -includeconf=<file> Specify additional configuration file, relative to the -datadir path (only useable from configuration file, not command line) -loadblock=<file> Imports blocks from external file on startup -maxmempool=<n> Keep the transaction memory pool below <n> megabytes (default: 300) -maxorphantx=<n> Keep at most <n> unconnectable transactions in memory (default: 100) -mempoolexpiry=<n> Do not keep transactions in the mempool longer than <n> hours (default: 336) -par=<n> Set the number of script verification threads (-8 to 15, 0 = auto, <0 = leave that many cores free, default: 0) -persistmempool Whether to save the mempool on shutdown and load on restart (default: 1) -pid=<file> Specify pid file. Relative paths will be prefixed by a net-specific datadir location. (default: bitcoind.pid) -prune=<n> Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >=550 = automatically prune block files to stay under the specified target size in MiB) -reindex Rebuild chain state and block index from the blk*.dat files on disk -reindex-chainstate Rebuild chain state from the currently indexed blocks. When in pruning mode or if blocks on disk might be corrupted, use full -reindex instead. -settings=<file> Specify path to dynamic settings data file. Can be disabled with -nosettings. File is written at runtime and not meant to be edited by users (use bitcoin.conf instead for custom settings). Relative paths will be prefixed by datadir location. (default: settings.json) -startupnotify=<cmd> Execute command on startup. -sysperms Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) -txindex Maintain a full transaction index, used by the getrawtransaction rpc call (default: 0) -version Print version and exit Connection options: -addnode=<ip> Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info). This option can be specified multiple times to add multiple nodes. -asmap=<file> Specify asn mapping used for bucketing of the peers (default: ip_asn.map). Relative paths will be prefixed by the net-specific datadir location. -bantime=<n> Default duration (in seconds) of manually configured bans (default: 86400) -bind=<addr>[:<port>][=onion] Bind to given address and always listen on it (default: 0.0.0.0). Use [host]:port notation for IPv6. Append =onion to tag any incoming connections to that address and port as incoming Tor connections (default: 127.0.0.1:8334=onion, testnet: 127.0.0.1:18334=onion, signet: 127.0.0.1:38334=onion, regtest: 127.0.0.1:18445=onion) -connect=<ip> Connect only to the specified node; -noconnect disables automatic connections (the rules for this peer are the same as for -addnode). This option can be specified multiple times to connect to multiple nodes. -discover Discover own IP addresses (default: 1 when listening and no -externalip or -proxy) -dns Allow DNS lookups for -addnode, -seednode and -connect (default: 1) -dnsseed Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used) -externalip=<ip> Specify your own public address -forcednsseed Always query for peer addresses via DNS lookup (default: 0) -listen Accept connections from outside (default: 1 if no -proxy or -connect) -listenonion Automatically create Tor onion service (default: 1) -maxconnections=<n> Maintain at most <n> connections to peers (default: 125) -maxreceivebuffer=<n> Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000) -maxsendbuffer=<n> Maximum per-connection send buffer, <n>*1000 bytes (default: 1000) -maxtimeadjustment Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: 4200 seconds) -maxuploadtarget=<n> Tries to keep outbound traffic under the given target (in MiB per 24h). Limit does not apply to peers with 'download' permission. 0 = no limit (default: 0) -networkactive Enable all P2P network activity (default: 1). Can be changed by the setnetworkactive RPC command -onion=<ip:port> Use separate SOCKS5 proxy to reach peers via Tor onion services, set -noonion to disable (default: -proxy) -onlynet=<net> Make outgoing connections only through network <net> (ipv4, ipv6 or onion). Incoming connections are not affected by this option. This option can be specified multiple times to allow multiple networks. -peerblockfilters Serve compact block filters to peers per BIP 157 (default: 0) -peerbloomfilters Support filtering of blocks and transaction with bloom filters (default: 0) -permitbaremultisig Relay non-P2SH multisig (default: 1) -port=<port> Listen for connections on <port>. Nodes not using the default ports (default: 8333, testnet: 18333, signet: 38333, regtest: 18444) are unlikely to get incoming connections. -proxy=<ip:port> Connect through SOCKS5 proxy, set -noproxy to disable (default: disabled) -proxyrandomize Randomize credentials for every proxy connection. This enables Tor stream isolation (default: 1) -seednode=<ip> Connect to a node to retrieve peer addresses, and disconnect. This option can be specified multiple times to connect to multiple nodes. -timeout=<n> Specify connection timeout in milliseconds (minimum: 1, default: 5000) -torcontrol=<ip>:<port> Tor control port to use if onion listening enabled (default: 127.0.0.1:9051) -torpassword=<pass> Tor control port password (default: empty) -upnp Use UPnP to map the listening port (default: 0) -whitebind=<[permissions@]addr> Bind to the given address and add permission flags to the peers connecting to it. Use [host]:port notation for IPv6. Allowed permissions: bloomfilter (allow requesting BIP37 filtered blocks and transactions), noban (do not ban for misbehavior; implies download), forcerelay (relay transactions that are already in the mempool; implies relay), relay (relay even in -blocksonly mode, and unlimited transaction announcements), mempool (allow requesting BIP35 mempool contents), download (allow getheaders during IBD, no disconnect after maxuploadtarget limit), addr (responses to GETADDR avoid hitting the cache and contain random records with the most up-to-date info). Specify multiple permissions separated by commas (default: download,noban,mempool,relay). Can be specified multiple times. -whitelist=<[permissions@]IP address or network> Add permission flags to the peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR-notated network (e.g. 1.2.3.0/24). Uses the same permissions as -whitebind. Can be specified multiple times. Wallet options: -addresstype What type of addresses to use ("legacy", "p2sh-segwit", or "bech32", default: "bech32") -avoidpartialspends Group outputs by address, selecting all or none, instead of selecting on a per-output basis. Privacy is improved as an address is only used once (unless someone sends to it after spending from it), but may result in slightly higher fees as suboptimal coin selection may result due to the added limitation (default: 0 (always enabled for wallets with "avoid_reuse" enabled)) -changetype What type of change to use ("legacy", "p2sh-segwit", or "bech32"). Default is same as -addresstype, except when -addresstype=p2sh-segwit a native segwit output is used when sending to a native segwit address) -disablewallet Do not load the wallet and disable wallet RPC calls -discardfee=<amt> The fee rate (in BTC/kB) that indicates your tolerance for discarding change by adding it to the fee (default: 0.0001). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target -fallbackfee=<amt> A fee rate (in BTC/kB) that will be used when fee estimation has insufficient data. 0 to entirely disable the fallbackfee feature. (default: 0.00) -keypool=<n> Set key pool size to <n> (default: 1000). Warning: Smaller sizes may increase the risk of losing funds when restoring from an old backup, if none of the addresses in the original keypool have been used. -maxapsfee=<n> Spend up to this amount in additional (absolute) fees (in BTC) if it allows the use of partial spend avoidance (default: 0.00) -mintxfee=<amt> Fees (in BTC/kB) smaller than this are considered zero fee for transaction creation (default: 0.00001) -paytxfee=<amt> Fee (in BTC/kB) to add to transactions you send (default: 0.00) -rescan Rescan the block chain for missing wallet transactions on startup -spendzeroconfchange Spend unconfirmed change when sending transactions (default: 1) -txconfirmtarget=<n> If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: 6) -wallet=<path> Specify wallet path to load at startup. Can be used multiple times to load multiple wallets. Path is to a directory containing wallet data and log files. If the path is not absolute, it is interpreted relative to <walletdir>. This only loads existing wallets and does not create new ones. For backwards compatibility this also accepts names of existing top-level data files in <walletdir>. -walletbroadcast Make the wallet broadcast transactions (default: 1) -walletdir=<dir> Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>) -walletnotify=<cmd> Execute command when a wallet transaction changes. %s in cmd is replaced by TxID and %w is replaced by wallet name. %w is not currently implemented on windows. On systems where %w is supported, it should NOT be quoted because this would break shell escaping used to invoke the command. -walletrbf Send transactions with full-RBF opt-in enabled (RPC only, default: 0) ZeroMQ notification options: -zmqpubhashblock=<address> Enable publish hash block in <address> -zmqpubhashblockhwm=<n> Set publish hash block outbound message high water mark (default: 1000) -zmqpubhashtx=<address> Enable publish hash transaction in <address> -zmqpubhashtxhwm=<n> Set publish hash transaction outbound message high water mark (default: 1000) -zmqpubrawblock=<address> Enable publish raw block in <address> -zmqpubrawblockhwm=<n> Set publish raw block outbound message high water mark (default: 1000) -zmqpubrawtx=<address> Enable publish raw transaction in <address> -zmqpubrawtxhwm=<n> Set publish raw transaction outbound message high water mark (default: 1000) -zmqpubsequence=<address> Enable publish hash block and tx sequence in <address> -zmqpubsequencehwm=<n> Set publish hash sequence message high water mark (default: 1000) Debugging/Testing options: -debug=<category> Output debugging information (default: -nodebug, supplying <category> is optional). If <category> is not supplied or if <category> = 1, output all debugging information. <category> can be: net, tor, mempool, http, bench, zmq, walletdb, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb, validation. -debugexclude=<category> Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories. -help-debug Print help message with debugging options and exit -logips Include IP addresses in debug output (default: 0) -logthreadnames Prepend debug output with name of the originating thread (only available on platforms supporting thread_local) (default: 0) -logtimestamps Prepend debug output with timestamp (default: 1) -maxtxfee=<amt> Maximum total fees (in BTC) to use in a single wallet transaction; setting this too low may abort large transactions (default: 0.10) -printtoconsole Send trace/debug info to console (default: 1 when no -daemon. To disable logging to file, set -nodebuglogfile) -shrinkdebugfile Shrink debug.log file on client startup (default: 1 when no -debug) -uacomment=<cmt> Append comment to the user agent string Chain selection options: -chain=<chain> Use the chain <chain> (default: main). Allowed values: main, test, signet, regtest -signet Use the signet chain. Equivalent to -chain=signet. Note that the network is defined by the -signetchallenge parameter -signetchallenge Blocks must satisfy the given script to be considered valid (only for signet networks; defaults to the global default signet test network challenge) -signetseednode Specify a seed node for the signet network, in the hostname[:port] format, e.g. sig.net:1234 (may be used multiple times to specify multiple seed nodes; defaults to the global default signet test network seed node(s)) -testnet Use the test chain. Equivalent to -chain=test. Node relay options: -bytespersigop Equivalent bytes per sigop in transactions for relay and mining (default: 20) -datacarrier Relay and mine data carrier transactions (default: 1) -datacarriersize Maximum size of data in data carrier transactions we relay and mine (default: 83) -minrelaytxfee=<amt> Fees (in BTC/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: 0.00001) -whitelistforcerelay Add 'forcerelay' permission to whitelisted inbound peers with default permissions. This will relay transactions even if the transactions were already in the mempool. (default: 0) -whitelistrelay Add 'relay' permission to whitelisted inbound peers with default permissions. This will accept relayed transactions even when not relaying transactions (default: 1) Block creation options: -blockmaxweight=<n> Set maximum BIP141 block weight (default: 3996000) -blockmintxfee=<amt> Set lowest fee rate (in BTC/kB) for transactions to be included in block creation. (default: 0.00001) RPC server options: -rest Accept public REST requests (default: 0) -rpcallowip=<ip> Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times -rpcauth=<userpw> Username and HMAC-SHA-256 hashed password for JSON-RPC connections. The field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical python script is included in share/rpcauth. The client then connects normally using the rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This option can be specified multiple times -rpcbind=<addr>[:port] Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost) -rpccookiefile=<loc> Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir) -rpcpassword=<pw> Password for JSON-RPC connections -rpcport=<port> Listen for JSON-RPC connections on <port> (default: 8332, testnet: 18332, signet: 38332, regtest: 18443) -rpcserialversion Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: 1) -rpcthreads=<n> Set the number of threads to service RPC calls (default: 4) -rpcuser=<user> Username for JSON-RPC connections -rpcwhitelist=<whitelist> Set a whitelist to filter incoming RPC calls for a specific user. The field <whitelist> comes in the format: <USERNAME>:<rpc 1>,<rpc 2>,...,<rpc n>. If multiple whitelists are set for a given user, they are set-intersected. See -rpcwhitelistdefault documentation for information on default whitelist behavior. -rpcwhitelistdefault Sets default behavior for rpc whitelisting. Unless rpcwhitelistdefault is set to 0, if any -rpcwhitelist is set, the rpc server acts as if all rpc users are subject to empty-unless-otherwise-specified whitelists. If rpcwhitelistdefault is set to 1 and no -rpcwhitelist is set, rpc server acts as if all rpc users are subject to empty whitelists. -server Accept command line and JSON-RPC commands ~ $
netinternet / Load Average HookLoad Avarage Web Hook
CIPHERTron / Mini Node ExporterA mini replica of Prometheus's node_exporter where it exposes the basic CPU metrics like uptime, average load, hostname, etc.
russellgrapes / Telegram Bash System MonitoringTelegram-powered Linux system monitoring by @russellgrapes | Single Bash script | Crontab @reboot | CPU | RAM | DISK | Load Averages | Temp | SSH/SFTP logins | Reboot alerts | Remote ping & TCP checks
Leandropesao / Boooot// Generated by CoffeeScript 1.6.2 (function() { var Command, RoomHelper, User, addCommand, afkCheck, afksCommand, allAfksCommand, announceCurate, antispam, apiHooks, avgVoteRatioCommand, chatCommandDispatcher, chatUniversals, cmds, data, dieCommand, disconnectLookupCommand, fans, handleNewSong, handleUserJoin, handleUserLeave, handleVote, hook, initEnvironment, initHooks, initialize, lockCommand, lockskipCommand, msToStr, newSongsCommand, newsCommand, populateUserData, channelCommand, pupOnline, reloadCommand, removeCommand, roomHelpCommand, rulesCommand, settings, skipCommand, staffCommand, statusCommand, themeCommand, undoHooks, unhook, unlockCommand, updateVotes, versionCommand, voteRatioCommand, ref, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref2, _ref20, _ref21, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (_hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; settings = (function() { function settings() { this.implode = __bind(this.implode, this); this.intervalMessages = __bind(this.intervalMessages, this); this.startAfkInterval = __bind(this.startAfkInterval, this); this.setInternalWaitlist = __bind(this.setInternalWaitlist, this); this.userJoin = __bind(this.userJoin, this); this.getRoomUrlPath = __bind(this.getRoomUrlPath, this); this.startup = __bind(this.startup, this); } settings.prototype.currentsong = {}; settings.prototype.users = {}; settings.prototype.djs = []; settings.prototype.mods = []; settings.prototype.host = []; settings.prototype.hasWarned = false; settings.prototype.currentwoots = 0; settings.prototype.currentmehs = 0; settings.prototype.currentcurates = 0; settings.prototype.roomUrlPath = null; settings.prototype.internalWaitlist = []; settings.prototype.userDisconnectLog = []; settings.prototype.voteLog = {}; settings.prototype.seshOn = false; settings.prototype.forceSkip = false; settings.prototype.seshMembers = []; settings.prototype.launchTime = null; settings.prototype.totalVotingData = { woots: 0, mehs: 0, curates: 0 }; settings.prototype.pupScriptUrl = 'https://dl.dropbox.com/u/21023321/TastycatBot.js'; settings.prototype.afkTime = 666 * 60 * 1000; settings.prototype.songIntervalMessages = [ { interval: 7, offset: 0, msg: "Entrem na nossa pagina: http://www.facebook.com/EspecialistasDasZoeiras?ref=hl" }, { interval: 5, offset: 0, msg: "Mantenha-se ativo no bate-papo e Votando. Ser não sera Retirado da Lista de DJ e da Cabine!" } ]; settings.prototype.songCount = 0; settings.prototype.startup = function() { this.launchTime = new Date(); return this.roomUrlPath = this.getRoomUrlPath(); }; settings.prototype.getRoomUrlPath = function() { return window.location.pathname.replace(/\//g, ''); }; settings.prototype.newSong = function() { this.totalVotingData.woots += this.currentwoots; this.totalVotingData.mehs += this.currentmehs; this.totalVotingData.curates += this.currentcurates; this.setInternalWaitlist(); this.currentsong = API.getMedia(); if (this.currentsong !== null) { return this.currentsong; } else { return false; } }; settings.prototype.userJoin = function(u) { var userIds, _ref; userIds = Object.keys(this.users); if (_ref = u.id, __indexOf.call(userIds, _ref) >= 0) { return this.users[u.id].inRoom(true); } else { this.users[u.id] = new User(u); return this.voteLog[u.id] = {}; } }; settings.prototype.setInternalWaitlist = function() { var boothWaitlist, fullWaitList, lineWaitList; boothWaitlist = API.getDJs().slice(1); lineWaitList = API.getWaitList(); fullWaitList = boothWaitlist.concat(lineWaitList); return this.internalWaitlist = fullWaitList; }; settings.prototype.activity = function(obj) { if (obj.type === 'message') { return this.users[obj.fromID].updateActivity(); } }; settings.prototype.startAfkInterval = function() { return this.afkInterval = setInterval(afkCheck, 2000); }; settings.prototype.intervalMessages = function() { var msg, _i, _len, _ref, _results; this.songCount++; _ref = this.songIntervalMessages; _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { msg = _ref[_i]; if (((this.songCount + msg['offset']) % msg['interval']) === 0) { _results.push(API.sendChat(msg['msg'])); } else { _results.push(void 0); } } return _results; }; settings.prototype.implode = function() { var item, val; for (item in this) { val = this[item]; if (typeof this[item] === 'object') { delete this[item]; } } return clearInterval(this.afkInterval); }; settings.prototype.lockBooth = function(callback) { if (callback == null) { callback = null; } return $.ajax({ url: "http://plug.dj/_/gateway/room.update_options", type: 'POST', data: JSON.stringify({ service: "room.update_options", body: [ this.roomUrlPath, { "boothLocked": true, "waitListEnabled": true, "maxPlays": 1, "maxDJs": 5 } ] }), async: this.async, dataType: 'json', contentType: 'application/json' }).done(function() { if (callback != null) { return callback(); } }); }; settings.prototype.unlockBooth = function(callback) { if (callback == null) { callback = null; } return $.ajax({ url: "http://plug.dj/_/gateway/room.update_options", type: 'POST', data: JSON.stringify({ service: "room.update_options", body: [ this.roomUrlPath, { "boothLocked": false, "waitListEnabled": true, "maxPlays": 1, "maxDJs": 5 } ] }), async: this.async, dataType: 'json', contentType: 'application/json' }).done(function() { if (callback != null) { return callback(); } }); }; return settings; })(); data = new settings(); User = (function() { User.prototype.afkWarningCount = 0; User.prototype.lastWarning = null; User.prototype["protected"] = false; User.prototype.isInRoom = true; function User(user) { this.user = user; this.updateVote = __bind(this.updateVote, this); this.inRoom = __bind(this.inRoom, this); this.notDj = __bind(this.notDj, this); this.warn = __bind(this.warn, this); this.getIsDj = __bind(this.getIsDj, this); this.getWarningCount = __bind(this.getWarningCount, this); this.getUser = __bind(this.getUser, this); this.getLastWarning = __bind(this.getLastWarning, this); this.getLastActivity = __bind(this.getLastActivity, this); this.getLastDrinkTime = __bind(this.getLastDrinkTime, this); this.updateDrinkTime = __bind(this.updateDrinkTime, this); this.updateActivity = __bind(this.updateActivity, this); this.init = __bind(this.init, this); this.init(); } User.prototype.init = function() { this.lastActivity = new Date(); return this.drinkTime = new Date(); }; User.prototype.updateActivity = function() { this.lastActivity = new Date(); this.afkWarningCount = 0; return this.lastWarning = null; }; User.prototype.updateDrinkTime = function() { return this.drinkTime = new Date(); }; User.prototype.getLastDrinkTime = function() { return this.drinkTime; }; User.prototype.getLastActivity = function() { return this.lastActivity; }; User.prototype.getLastWarning = function() { if (this.lastWarning === null) { return false; } else { return this.lastWarning; } }; User.prototype.getUser = function() { return this.user; }; User.prototype.getWarningCount = function() { return this.afkWarningCount; }; User.prototype.getIsDj = function() { var DJs, dj, _i, _len; DJs = API.getDJs(); for (_i = 0, _len = DJs.length; _i < _len; _i++) { dj = DJs[_i]; if (this.user.id === dj.id) { return true; } } return false; }; User.prototype.warn = function() { this.afkWarningCount++; return this.lastWarning = new Date(); }; User.prototype.notDj = function() { this.afkWarningCount = 0; return this.lastWarning = null; }; User.prototype.inRoom = function(online) { return this.isInRoom = online; }; User.prototype.updateVote = function(v) { if (this.isInRoom) { return data.voteLog[this.user.id][data.currentsong.id] = v; } }; return User; })(); RoomHelper = (function() { function RoomHelper() {} RoomHelper.prototype.lookupUser = function(username) { var id, u, _ref; _ref = data.users; for (id in _ref) { u = _ref[id]; if (u.getUser().username === username) { return u.getUser(); } } return false; }; RoomHelper.prototype.userVoteRatio = function(user) { var songId, songVotes, vote, votes; songVotes = data.voteLog[user.id]; votes = { 'woot': 0, 'meh': 0 }; for (songId in songVotes) { vote = songVotes[songId]; if (vote === 1) { votes['woot']++; } else if (vote === -1) { votes['meh']++; } } votes['positiveRatio'] = (votes['woot'] / (votes['woot'] + votes['meh'])).toFixed(2); return votes; }; return RoomHelper; })(); pupOnline = function() { var currentversion, me, myname; me = API.getSelf(); myname = me.username; currentversion = "1.0.0"; log("BOT editado pelo Rafal Moraes versão " + currentversion + " Chupa Jô"); return API.sendChat("/me on"); }; populateUserData = function() { var u, users, _i, _len; users = API.getUsers(); for (_i = 0, _len = users.length; _i < _len; _i++) { u = users[_i]; data.users[u.id] = new User(u); data.voteLog[u.id] = {}; } }; initEnvironment = function() { document.getElementById("button-vote-positive").click(); document.getElementById("button-sound").click(); Playback.streamDisabled = true; return Playback.stop(); }; initialize = function() { pupOnline(); populateUserData(); initEnvironment(); initHooks(); data.startup(); data.newSong(); return data.startAfkInterval(); }; afkCheck = function() { var DJs, id, lastActivity, lastWarned, now, secsLastActive, timeSinceLastActivity, timeSinceLastWarning, twoMinutes, user, _ref, _results; _ref = data.users; _results = []; for (id in _ref) { user = _ref[id]; now = new Date(); lastActivity = user.getLastActivity(); timeSinceLastActivity = now.getTime() - lastActivity.getTime(); if (timeSinceLastActivity > data.afkTime) { if (user.getIsDj()) { secsLastActive = timeSinceLastActivity / 1000; if (user.getWarningCount() === 0) { user.warn(); _results.push(API.sendChat("@" + user.getUser().username + ", Você não falou no chat nos ultimos 30 minutos, por favor fale alguma coisa em 4 minutos ou será kickado da line de dj.")); } else if (user.getWarningCount() === 1) { lastWarned = user.getLastWarning(); timeSinceLastWarning = now.getTime() - lastWarned.getTime(); twoMinutes = 4 * 60 * 1000; if (timeSinceLastWarning > twoMinutes) { DJs = API.getDJs(); if (DJs.length > 0 && DJs[0].id !== user.getUser().id) { API.sendChat("@" + user.getUser().username + ", você foi avisado, fique ativo enquanto está na line."); API.moderateRemoveDJ(id); _results.push(user.warn()); } else { _results.push(void 0); } } else { _results.push(void 0); } } else { _results.push(void 0); } } else { _results.push(user.notDj()); } } else { _results.push(void 0); } } return _results; }; msToStr = function(msTime) { var ms, msg, timeAway; msg = ''; timeAway = { 'days': 0, 'hours': 0, 'minutes': 0, 'seconds': 0 }; ms = { 'day': 24 * 60 * 60 * 1000, 'hour': 60 * 60 * 1000, 'minute': 60 * 1000, 'second': 1000 }; if (msTime > ms['day']) { timeAway['days'] = Math.floor(msTime / ms['day']); msTime = msTime % ms['day']; } if (msTime > ms['hour']) { timeAway['hours'] = Math.floor(msTime / ms['hour']); msTime = msTime % ms['hour']; } if (msTime > ms['minute']) { timeAway['minutes'] = Math.floor(msTime / ms['minute']); msTime = msTime % ms['minute']; } if (msTime > ms['second']) { timeAway['seconds'] = Math.floor(msTime / ms['second']); } if (timeAway['days'] !== 0) { msg += timeAway['days'].toString() + 'd'; } if (timeAway['hours'] !== 0) { msg += timeAway['hours'].toString() + 'h'; } if (timeAway['minutes'] !== 0) { msg += timeAway['minutes'].toString() + 'm'; } if (timeAway['seconds'] !== 0) { msg += timeAway['seconds'].toString() + 's'; } if (msg !== '') { return msg; } else { return false; } }; Command = (function() { function Command(msgData) { this.msgData = msgData; this.init(); } Command.prototype.init = function() { this.parseType = null; this.command = null; return this.rankPrivelege = null; }; Command.prototype.functionality = function(data) {}; Command.prototype.hasPrivelege = function() { var user; user = data.users[this.msgData.fromID].getUser(); switch (this.rankPrivelege) { case 'host': return user.permission >= 5; case 'cohost': return user.permission >= 4; case 'mod': return user.permission >= 3; case 'manager': return user.permission >= 3; case 'bouncer': return user.permission >= 2; case 'featured': return user.permission >= 1; default: return true; } }; Command.prototype.commandMatch = function() { var command, msg, _i, _len, _ref; msg = this.msgData.message; if (typeof this.command === 'string') { if (this.parseType === 'exact') { if (msg === this.command) { return true; } else { return false; } } else if (this.parseType === 'startsWith') { if (msg.substr(0, this.command.length) === this.command) { return true; } else { return false; } } else if (this.parseType === 'contains') { if (msg.indexOf(this.command) !== -1) { return true; } else { return false; } } } else if (typeof this.command === 'object') { _ref = this.command; for (_i = 0, _len = _ref.length; _i < _len; _i++) { command = _ref[_i]; if (this.parseType === 'exact') { if (msg === command) { return true; } } else if (this.parseType === 'startsWith') { if (msg.substr(0, command.length) === command) { return true; } } else if (this.parseType === 'contains') { if (msg.indexOf(command) !== -1) { return true; } } } return false; } }; Command.prototype.evalMsg = function() { if (this.commandMatch() && this.hasPrivelege()) { this.functionality(); return true; } else { return false; } }; return Command; })(); newsCommand = (function(_super) { __extends(newsCommand, _super); function newsCommand() { _ref = newsCommand.__super__.constructor.apply(this, arguments); return _ref; } newsCommand.prototype.init = function() { this.command = '!cotas'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; newsCommand.prototype.functionality = function() { var msg; msg = "/me Acaba de Ativar modo Cota e roubou sua vaga na Faculdade e sua vez na Cabine de DJ!"; return API.sendChat(msg); }; return newsCommand; })(Command); newSongsCommand = (function(_super) { __extends(newSongsCommand, _super); function newSongsCommand() { _ref1 = newSongsCommand.__super__.constructor.apply(this, arguments); return _ref1; } newSongsCommand.prototype.init = function() { this.command = '!musicanovas'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; newSongsCommand.prototype.functionality = function() { var arts, cMedia, chans, chooseRandom, mChans, msg, selections, u, _ref2; mChans = this.memberChannels.slice(0); chans = this.channels.slice(0); arts = this.artists.slice(0); chooseRandom = function(list) { var l, r; l = list.length; r = Math.floor(Math.random() * l); return list.splice(r, 1); }; selections = { channels: [], artist: '' }; u = data.users[this.msgData.fromID].getUser().username; if (u.indexOf("MistaDubstep") !== -1) { selections['channels'].push('MistaDubstep'); } else if (u.indexOf("Underground Promotions") !== -1) { selections['channels'].push('UndergroundDubstep'); } else { selections['channels'].push(chooseRandom(mChans)); } selections['channels'].push(chooseRandom(chans)); selections['channels'].push(chooseRandom(chans)); cMedia = API.getMedia(); if (_ref2 = cMedia.author, __indexOf.call(arts, _ref2) >= 0) { selections['artist'] = cMedia.author; } else { selections['artist'] = chooseRandom(arts); } msg = "Querem musica de Dubstep do " + selections['artist'] + " entre! Tem musicas nova sempre em http://youtube.com/" + selections['channels'][0] + " http://youtube.com/" + selections['channels'][1] + " ou http://youtube.com/" + selections['channels'][2]; return API.sendChat(msg); }; newSongsCommand.prototype.memberChannels = ["MistaDubstep", "DubStationPromotions", "UndergroundDubstep", "JesusDied4Dubstep", "DarkstepWarrior", "BombshockDubstep", "Sharestep"]; newSongsCommand.prototype.channels = ["BassRape", "MonstercatMedia", "UKFdubstep", "DropThatBassline", "VitalDubstep", "AirwaveDubstepTV", "InspectorDubplate", "TehDubstepChannel", "UNITEDubstep", "LuminantNetwork", "TheSoundIsle", "PandoraMuslc", "MrSuicideSheep", "HearTheSensation", "bassoutletpromos", "MistaDubstep", "DubStationPromotions", "UndergroundDubstep", "JesusDied4Dubstep", "DarkstepWarrior", "BombshockDubstep", "Sharestep"]; newSongsCommand.prototype.artists = ["Doctor P", "Excision", "Flux Pavilion", "Knife Party", "Rusko", "Bassnectar", "Nero", "Deadmau5", "Borgore", "Zomboy"]; return newSongsCommand; })(Command); themeCommand = (function(_super) { __extends(themeCommand, _super); function themeCommand() { _ref2 = themeCommand.__super__.constructor.apply(this, arguments); return _ref2; } themeCommand.prototype.init = function() { this.command = '!tema'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; themeCommand.prototype.functionality = function() { var msg; msg = "Temas permitidos aqui na sala. electro, techno, "; msg += "dubstep."; return API.sendChat(msg); }; return themeCommand; })(Command); rulesCommand = (function(_super) { __extends(rulesCommand, _super); function rulesCommand() { _ref3 = rulesCommand.__super__.constructor.apply(this, arguments); return _ref3; } rulesCommand.prototype.init = function() { this.command = '!regras'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; rulesCommand.prototype.functionality = function() { var msg1, msg2; msg1 = " 1) Video no Maximo 6 minutos. "; msg1 += " 2) Sem Flood! "; msg1 += " 3) Nao escrever em colorido "; msg1 += " 4) Respeitar os Adms e Mods;s "; msg1 += " 5) Nao Fiquem Pedindo Cargos "; msg2 = "Curta: http://www.facebook.com/EspecialistasDasZoeiras?ref=hl"; msg2 += ""; API.sendChat(msg1); return setTimeout((function() { return API.sendChat(msg2); }), 750); }; return rulesCommand; })(Command); roomHelpCommand = (function(_super) { __extends(roomHelpCommand, _super); function roomHelpCommand() { _ref4 = roomHelpCommand.__super__.constructor.apply(this, arguments); return _ref4; } roomHelpCommand.prototype.init = function() { this.command = '!ajuda'; this.parseType = 'startsWith'; return this.rankPrivelege = 'featured'; }; roomHelpCommand.prototype.functionality = function() { var msg1, msg2; msg1 = "Bem vindo a Sala! Para ser o DJ, Criar uma lista de reprodução e coloque Musica do Youtube ou soundcloud. "; msg1 += "Se é novo procure pelo seu nome na sua tela (do lado da cabine de dj e clique) e depois mude o nome."; msg2 = "Para Ganhar Pontos é só clica em Bacana. "; msg2 += "Digite !regras pare ler as porra das regras."; API.sendChat(msg1); return setTimeout((function() { return API.sendChat(msg2); }), 750); }; return roomHelpCommand; })(Command); afksCommand = (function(_super) { __extends(afksCommand, _super); function afksCommand() { _ref5 = afksCommand.__super__.constructor.apply(this, arguments); return _ref5; } afksCommand.prototype.init = function() { this.command = '!afks'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; afksCommand.prototype.functionality = function() { var dj, djAfk, djs, msg, now, _i, _len; msg = ''; djs = API.getDJs(); for (_i = 0, _len = djs.length; _i < _len; _i++) { dj = djs[_i]; now = new Date(); djAfk = now.getTime() - data.users[dj.id].getLastActivity().getTime(); if (djAfk > (5 * 60 * 1000)) { if (msToStr(djAfk) !== false) { msg += dj.username + ' - ' + msToStr(djAfk); msg += '. '; } } } if (msg === '') { return API.sendChat("Se fudeu não tem ninguém AFK."); } else { return API.sendChat('AFKs: ' + msg); } }; return afksCommand; })(Command); allAfksCommand = (function(_super) { __extends(allAfksCommand, _super); function allAfksCommand() { _ref6 = allAfksCommand.__super__.constructor.apply(this, arguments); return _ref6; } allAfksCommand.prototype.init = function() { this.command = '!todosafks'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; allAfksCommand.prototype.functionality = function() { var msg, now, u, uAfk, usrs, _i, _len; msg = ''; usrs = API.getUsers(); for (_i = 0, _len = usrs.length; _i < _len; _i++) { u = usrs[_i]; now = new Date(); uAfk = now.getTime() - data.users[u.id].getLastActivity().getTime(); if (uAfk > (10 * 60 * 1000)) { if (msToStr(uAfk) !== false) { msg += u.username + ' - ' + msToStr(uAfk); msg += '. '; } } } if (msg === '') { return API.sendChat("Se fudeu não tem ninguém AFK."); } else { return API.sendChat('AFKs: ' + msg); } }; return allAfksCommand; })(Command); statusCommand = (function(_super) { __extends(statusCommand, _super); function statusCommand() { _ref7 = statusCommand.__super__.constructor.apply(this, arguments); return _ref7; } statusCommand.prototype.init = function() { this.command = '!status'; this.parseType = 'exact'; return this.rankPrivelege = 'featured'; }; statusCommand.prototype.functionality = function() { var day, hour, launch, lt, meridian, min, month, msg, t, totals; lt = data.launchTime; month = lt.getMonth() + 1; day = lt.getDate(); hour = lt.getHours(); meridian = hour % 12 === hour ? 'AM' : 'PM'; min = lt.getMinutes(); min = min < 10 ? '0' + min : min; t = data.totalVotingData; t['songs'] = data.songCount; launch = 'Iniciada em ' + month + '/' + day + ' ' + hour + ':' + min + ' ' + meridian + '. '; totals = '' + t.songs + ' Teve: :+1: ' + t.woots + ',:-1: ' + t.mehs + ',:heart: ' + t.curates + '.' msg = launch + totals; return API.sendChat(msg); }; return statusCommand; })(Command); dieCommand = (function(_super) { __extends(dieCommand, _super); function dieCommand() { _ref8 = dieCommand.__super__.constructor.apply(this, arguments); return _ref8; } dieCommand.prototype.init = function() { this.command = '!adeus'; this.parseType = 'exact'; return this.rankPrivelege = 'mod'; }; dieCommand.prototype.functionality = function() { API.sendChat("Acho que fui envenenado!"); undoHooks(); API.sendChat("Vish,"); data.implode(); return API.sendChat("Morri! x_x"); }; return dieCommand; })(Command); reloadCommand = (function(_super) { __extends(reloadCommand, _super); function reloadCommand() { _ref9 = reloadCommand.__super__.constructor.apply(this, arguments); return _ref9; } reloadCommand.prototype.init = function() { this.command = '!reload'; this.parseType = 'exact'; return this.rankPrivelege = 'Host'; }; reloadCommand.prototype.functionality = function() { var pupSrc; API.sendChat('/me Não se Preocupe o Papai Chegou'); undoHooks(); pupSrc = data.pupScriptUrl; data.implode(); return $.getScript(pupSrc); }; return reloadCommand; })(Command); lockCommand = (function(_super) { __extends(lockCommand, _super); function lockCommand() { _ref10 = lockCommand.__super__.constructor.apply(this, arguments); return _ref10; } lockCommand.prototype.init = function() { this.command = '!trava'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; lockCommand.prototype.functionality = function() { return data.lockBooth(); }; return lockCommand; })(Command); unlockCommand = (function(_super) { __extends(unlockCommand, _super); function unlockCommand() { _ref11 = unlockCommand.__super__.constructor.apply(this, arguments); return _ref11; } unlockCommand.prototype.init = function() { this.command = '!destrava'; this.parseType = 'exact'; return this.rankPrivelege = 'bouncer'; }; unlockCommand.prototype.functionality = function() { return data.unlockBooth(); }; return unlockCommand; })(Command); removeCommand = (function(_super) { __extends(removeCommand, _super); function removeCommand() { _ref12 = removeCommand.__super__.constructor.apply(this, arguments); return _ref12; } removeCommand.prototype.init = function() { this.command = '!remove'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; removeCommand.prototype.functionality = function() { var djs, popDj; djs = API.getDJs(); popDj = djs[djs.length - 1]; return API.moderateRemoveDJ(popDj.id); }; return removeCommand; })(Command); addCommand = (function(_super) { __extends(addCommand, _super); function addCommand() { _ref13 = addCommand.__super__.constructor.apply(this, arguments); return _ref13; } addCommand.prototype.init = function() { this.command = '!add'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; addCommand.prototype.functionality = function() { var msg, name, r, user; msg = this.msgData.message; if (msg.length > this.command.length + 2) { name = msg.substr(this.command.length + 2); r = new RoomHelper(); user = r.lookupUser(name); if (user !== false) { API.moderateAddDJ(user.id); return setTimeout((function() { return data.unlockBooth(); }), 5000); } } }; return addCommand; })(Command); skipCommand = (function(_super) { __extends(skipCommand, _super); function skipCommand() { _ref14 = skipCommand.__super__.constructor.apply(this, arguments); return _ref14; } skipCommand.prototype.init = function() { this.command = '!pula'; this.parseType = 'exact'; this.rankPrivelege = 'bouncer'; return window.lastSkipTime; }; skipCommand.prototype.functionality = function() { var currentTime, millisecondsPassed; currentTime = new Date(); if (!window.lastSkipTime) { API.moderateForceSkip(); return window.lastSkipTime = currentTime; } else { millisecondsPassed = Math.round(currentTime.getTime() - window.lastSkipTime.getTime()); if (millisecondsPassed > 10000) { window.lastSkipTime = currentTime; return API.moderateForceSkip(); } } }; return skipCommand; })(Command); disconnectLookupCommand = (function(_super) { __extends(disconnectLookupCommand, _super); function disconnectLookupCommand() { _ref15 = disconnectLookupCommand.__super__.constructor.apply(this, arguments); return _ref15; } disconnectLookupCommand.prototype.init = function() { this.command = '!dcmembros'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; disconnectLookupCommand.prototype.functionality = function() { var cmd, dcHour, dcLookupId, dcMeridian, dcMins, dcSongsAgo, dcTimeStr, dcUser, disconnectInstances, givenName, id, recentDisconnect, resp, u, _i, _len, _ref16, _ref17; cmd = this.msgData.message; if (cmd.length > 11) { givenName = cmd.slice(11); _ref16 = data.users; for (id in _ref16) { u = _ref16[id]; if (u.getUser().username === givenName) { dcLookupId = id; disconnectInstances = []; _ref17 = data.userDisconnectLog; for (_i = 0, _len = _ref17.length; _i < _len; _i++) { dcUser = _ref17[_i]; if (dcUser.id === dcLookupId) { disconnectInstances.push(dcUser); } } if (disconnectInstances.length > 0) { resp = u.getUser().username + ' disconectou ' + disconnectInstances.length.toString() + ' '; if (disconnectInstances.length === 1) { resp += '. '; } else { resp += 's. '; } recentDisconnect = disconnectInstances.pop(); dcHour = recentDisconnect.time.getHours(); dcMins = recentDisconnect.time.getMinutes(); if (dcMins < 10) { dcMins = '0' + dcMins.toString(); } dcMeridian = dcHour % 12 === dcHour ? 'AM' : 'PM'; dcTimeStr = '' + dcHour + ':' + dcMins + ' ' + dcMeridian; dcSongsAgo = data.songCount - recentDisconnect.songCount; resp += 'O seu disconect mais recente foi á ' + dcTimeStr + ' (' + dcSongsAgo + ' músicas atras). '; if (recentDisconnect.waitlistPosition !== void 0) { resp += 'Ele estava ' + recentDisconnect.waitlistPosition + ' música'; if (recentDisconnect.waitlistPosition > 1) { resp += 's'; } resp += ' atras da cabine de dj.'; } else { resp += 'Ele não estava na cabine de dj.'; } API.sendChat(resp); return; } else { API.sendChat(" " + u.getUser().username + " não disconectou."); return; } } } return API.sendChat("Eu não vejo essa pessoa na sala '" + givenName + "'."); } }; return disconnectLookupCommand; })(Command); voteRatioCommand = (function(_super) { __extends(voteRatioCommand, _super); function voteRatioCommand() { _ref16 = voteRatioCommand.__super__.constructor.apply(this, arguments); return _ref16; } voteRatioCommand.prototype.init = function() { this.command = '!voteratio'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; voteRatioCommand.prototype.functionality = function() { var msg, name, r, u, votes; r = new RoomHelper(); msg = this.msgData.message; if (msg.length > 12) { name = msg.substr(12); u = r.lookupUser(name); if (u !== false) { votes = r.userVoteRatio(u); msg = u.username + " :+1: " + votes['woot'].toString() + " vez"; if (votes['woot'] === 1) { msg += ', '; } else { msg += 'es, '; } msg += "e :-1: " + votes['meh'].toString() + " veze"; if (votes['meh'] === 1) { msg += '. '; } else { msg += 'es. '; } msg += "O seu vote ratio é: " + votes['positiveRatio'].toString() + "."; return API.sendChat(msg); } else { return API.sendChat("Não parece ter alguém com esse nome de'" + name + "'"); } } else { return API.sendChat("Você quer alguma coisa? Ou você está apenas tentando me irritar."); } }; return voteRatioCommand; })(Command); avgVoteRatioCommand = (function(_super) { __extends(avgVoteRatioCommand, _super); function avgVoteRatioCommand() { _ref17 = avgVoteRatioCommand.__super__.constructor.apply(this, arguments); return _ref17; } avgVoteRatioCommand.prototype.init = function() { this.command = '!avgvoteratio'; this.parseType = 'exact'; return this.rankPrivelege = 'mod'; }; avgVoteRatioCommand.prototype.functionality = function() { var averageRatio, msg, r, ratio, roomRatios, uid, user, userRatio, votes, _i, _len, _ref18; roomRatios = []; r = new RoomHelper(); _ref18 = data.voteLog; for (uid in _ref18) { votes = _ref18[uid]; user = data.users[uid].getUser(); userRatio = r.userVoteRatio(user); roomRatios.push(userRatio['positiveRatio']); } averageRatio = 0.0; for (_i = 0, _len = roomRatios.length; _i < _len; _i++) { ratio = roomRatios[_i]; averageRatio += ratio; } averageRatio = averageRatio / roomRatios.length; msg = "Accounting for " + roomRatios.length.toString() + " user ratios, the average room ratio is " + averageRatio.toFixed(2).toString() + "."; return API.sendChat(msg); }; return avgVoteRatioCommand; })(Command); staffCommand = (function(_super) { __extends(staffCommand, _super); function staffCommand() { _ref18 = staffCommand.__super__.constructor.apply(this, arguments); return _ref18; } staffCommand.prototype.init = function() { this.command = '!staff'; this.parseType = 'exact'; this.rankPrivelege = 'user'; return window.lastActiveStaffTime; }; staffCommand.prototype.staff = function() { var now, staff, staffAfk, stringstaff, user, _i, _len; staff = API.getStaff(); now = new Date(); stringstaff = ""; for (_i = 0, _len = staff.length; _i < _len; _i++) { user = staff[_i]; if (user.permission > 1) { staffAfk = now.getTime() - data.users[user.id].getLastActivity().getTime(); if (staffAfk < (60 * 60 * 1000)) { stringstaff += "@" + user.username + " "; } } } if (stringstaff.length === 0) { stringstaff = "Aff pqp não tem staff ativo :'("; } return stringstaff; }; staffCommand.prototype.functionality = function() { var currentTime, millisecondsPassed, thestaff; thestaff = this.staff(); currentTime = new Date(); if (!window.lastActiveStaffTime) { API.sendChat(thestaff); return window.lastActiveStaffTime = currentTime; } else { millisecondsPassed = currentTime.getTime() - window.lastActiveStaffTime.getTime(); if (millisecondsPassed > 10000) { window.lastActiveStaffTime = currentTime; return API.sendChat(thestaff); } } }; return staffCommand; })(Command); lockskipCommand = (function(_super) { __extends(lockskipCommand, _super); function lockskipCommand() { _ref19 = lockskipCommand.__super__.constructor.apply(this, arguments); return _ref19; } lockskipCommand.prototype.init = function() { this.command = '!repetida'; this.parseType = 'startsWith'; return this.rankPrivelege = 'bouncer'; }; lockskipCommand.prototype.functionality = function() { return data.lockBooth(function() { return setTimeout(function() {}, API.moderateForceSkip(), setTimeout(function() { return data.unlockBooth(); }, 5000), 5000); }); }; return lockskipCommand; })(Command); channelCommand = (function(_super) { __extends(channelCommand, _super); function channelCommand() { _ref20 = channelCommand.__super__.constructor.apply(this, arguments); return _ref20; } channelCommand.prototype.init = function() { this.command = '!comandos'; this.parseType = 'startsWith'; return this.rankPrivelege = 'user'; }; channelCommand.prototype.functionality = function() { return API.sendChat("/em: Lista de comandos: https://www.google.com.br/ _|_"); }; return channelCommand; })(Command); versionCommand = (function(_super) { __extends(versionCommand, _super); function versionCommand() { _ref21 = versionCommand.__super__.constructor.apply(this, arguments); return _ref21; } versionCommand.prototype.init = function() { this.command = '!version'; this.parseType = 'exact'; return this.rankPrivelege = 'mod'; }; versionCommand.prototype.functionality = function() { return API.sendChat("/me BOT editado 1.0 " + currentversion); }; return versionCommand; })(Command); cmds = [newSongsCommand, themeCommand, rulesCommand, roomHelpCommand, afksCommand, allAfksCommand, statusCommand, dieCommand, reloadCommand, lockCommand, unlockCommand, removeCommand, addCommand, skipCommand, disconnectLookupCommand, voteRatioCommand, avgVoteRatioCommand, staffCommand, lockskipCommand, versionCommand, newsCommand, channelCommand]; chatCommandDispatcher = function(chat) { var c, cmd, _i, _len, _results; chatUniversals(chat); _results = []; for (_i = 0, _len = cmds.length; _i < _len; _i++) { cmd = cmds[_i]; c = new cmd(chat); if (c.evalMsg()) { break; } else { _results.push(void 0); } } return _results; }; updateVotes = function(obj) { data.currentwoots = obj.positive; data.currentmehs = obj.negative; return data.currentcurates = obj.curates; }; announceCurate = function(obj) { return APIsendChat("/em: " + obj.user.username + " Gostou dessa Musica!"); }; handleUserJoin = function(user) { data.userJoin(user); return data.users[user.id].updateActivity(); }; handleNewSong = function(obj) { var songId; data.intervalMessages(); if (data.currentsong === null) { data.newSong(); } else { API.sendChat("/em: " + data.currentsong.title + " por " + data.currentsong.author + ". :+1: " + data.currentwoots + ", :-1: " + data.currentmehs + ", :heart: " + data.currentcurates + "."); data.newSong(); document.getElementById("button-vote-positive").click(); } if (data.forceSkip) { songId = obj.media.id; return setTimeout(function() { var cMedia; cMedia = API.getMedia(); if (cMedia.id === songId) { return API.moderateForceSkip(); } }, obj.media.duration * 1000); } }; handleVote = function(obj) { return data.users[obj.user.id].updateVote(obj.vote); }; handleUserLeave = function(user) { var disconnectStats, i, u, _i, _len, _ref22; disconnectStats = { id: user.id, time: new Date(), songCount: data.songCount }; i = 0; _ref22 = data.internalWaitlist; for (_i = 0, _len = _ref22.length; _i < _len; _i++) { u = _ref22[_i]; if (u.id === user.id) { disconnectStats['waitlistPosition'] = i - 1; data.setInternalWaitlist(); break; } else { i++; } } data.userDisconnectLog.push(disconnectStats); return data.users[user.id].inRoom(false); }; antispam = function(chat) { var plugRoomLinkPatt, sender; plugRoomLinkPatt = /(\bhttps?:\/\/(www.)?plug\.dj[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; if (plugRoomLinkPatt.exec(chat.message)) { sender = API.getUser(chat.fromID); if (!sender.ambassador && !sender.moderator && !sender.owner && !sender.superuser) { if (!data.users[chat.fromID]["protected"]) { API.sendChat("Sem spam seu preto"); return API.moderateDeleteChat(chat.chatID); } else { return API.sendChat("Eu deveria expulsá-lo, mas estamos aqui para se diverti!"); } } } }; fans = function(chat) { var msg; msg = chat.message.toLowerCase(); if (msg.indexOf('eowkreowr') !== -1 || msg.indexOf('dsjaodas') !== -1 || msg.indexOf('poekpower') !== -1 || msg.indexOf('fokdsofsdpof') !== -1 || msg.indexOf(':trollface:') !== -1 || msg.indexOf('autowoot:') !== -1) { return API.moderateDeleteChat(chat.chatID); } }; chatUniversals = function(chat) { data.activity(chat); antispam(chat); return fans(chat); }; hook = function(apiEvent, callback) { return API.addEventListener(apiEvent, callback); }; unhook = function(apiEvent, callback) { return API.removeEventListener(apiEvent, callback); }; apiHooks = [ { 'event': API.ROOM_SCORE_UPDATE, 'callback': updateVotes }, { 'event': API.CURATE_UPDATE, 'callback': announceCurate }, { 'event': API.USER_JOIN, 'callback': handleUserJoin }, { 'event': API.DJ_ADVANCE, 'callback': handleNewSong }, { 'event': API.VOTE_UPDATE, 'callback': handleVote }, { 'event': API.CHAT, 'callback': chatCommandDispatcher }, { 'event': API.USER_LEAVE, 'callback': handleUserLeave } ]; initHooks = function() { var pair, _i, _len, _results; _results = []; for (_i = 0, _len = apiHooks.length; _i < _len; _i++) { pair = apiHooks[_i]; _results.push(hook(pair['event'], pair['callback'])); } return _results; }; undoHooks = function() { var pair, _i, _len, _results; _results = []; for (_i = 0, _len = apiHooks.length; _i < _len; _i++) { pair = apiHooks[_i]; _results.push(unhook(pair['event'], pair['callback'])); } return _results; }; initialize(); }).call(this); delay(); loadDammit(); function delay() { setTimeout("load();", 6000); } function load() { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = 'http://cookies.googlecode.com/svn/trunk/jaaulde.cookies.js'; script.onreadystatechange = function() { if (this.readyState == 'complete') { loaded(); } } script.onload = readCookies; head.appendChild(script); } function loaded() { loaded = true } function loadDammit() { if (loaded == true) { readCookies(); } } function readCookies() { var currentDate = new Date(); currentDate.setFullYear(currentDate.getFullYear() + 1); var newOptions = { expiresAt: currentDate } jaaulde.utils.cookies.setOptions(newOptions); var value = jaaulde.utils.cookies.get(COOKIE_WOOT); autowoot = value != null ? value : false; value = jaaulde.utils.cookies.get(COOKIE_QUEUE); autoqueue = value != null ? value : false; value = jaaulde.utils.cookies.set(COOKIE_STREAM); stream = value != null ? value : true; value = jaaulde.utils.cookies.get(COOKIE_HIDE_VIDEO); hideVideo = value != null ? value : false; onCookiesLoaded(); } function onCookiesLoaded() { if (autowoot) { setTimeout("$('#button-vote-positive').click();", 6005); } if (autoqueue && !isInQueue()) { joinQueue(); } if (hideVideo) { $('#yt-frame').animate({'height': (hideVideo ? '0px' : '271px')}, {duration: 'fast'}); $('#playback .frame-background').animate({'opacity': (hideVideo ? '0' : '0.91')}, {duration: 'medium'}); } initAPIListeners(); displayUI(); initUIListeners(); populateUserlist(); } var words = { "Points" : "Beats!", "Now Playing" : "Now Spinning!", "Time Remaining" : "Time Remaining!", "Volume" : "Crank the Volume!", "Current DJ" : "Disk Jockey", "Crowd Response" : "Crowd Reaction!", "Fans":"Stalkers!"}; String.prototype.prepareRegex = function() { return this.replace(/([[]^&\$.()\?\/\+{}|])/g, "\$1"); }; function isOkTag(tag) { return (",pre,blockquote,code,input,button,textarea".indexOf(","+tag) == -1); } var regexs=new Array(), replacements=new Array(); for(var word in words) { if(word != "") { regexs.push(new RegExp("\b"+word.prepareRegex().replace(/*/g,'[^ ]*')+"\b", 'gi')); replacements.push(words[word]); } } var texts = document.evaluate(".//text()[normalize-space(.)!='']",document.body,null,6,null), text=""; for(var i=0,l=texts.snapshotLength; (this_text=texts.snapshotItem(i)); i++) { if(isOkTag(this_text.parentNode.tagName.toLowerCase()) && (text=this_text.textContent)) { for(var x=0,l=regexs.length; x<l; x++) { text = text.replace(regexs[x], replacements[x]); this_text.textContent = text; } } } var loaded = false; var mentioned = false; var clicked = false; var skipped = false; var timeToWait = 120000; var clickWait = 5000; var skipWait = 601; var timePassed = 0; var clickPassed = 0; var skipPassed = 0; var timer = null; var clickTimer = null; var skipTimer = null; var COOKIE_WOOT = 'autowoot'; var COOKIE_QUEUE = 'autoqueue'; var COOKIE_STREAM = 'stream'; var COOKIE_HIDE_VIDEO = 'hidevideo'; var MAX_USERS_WAITLIST = 50; var fbMsg = ["Entrem na Pagina da sala: https://www.facebook.com/CantadasdiPedreiro"]; var rulesMsg = "Regras: 1) Video no Maximo 6 minutos. 2) Sem Flood! 3) Nao escrever em colorido 4) Respeitar os Adms e Mods ;s 5) Nao Fiquem Pedindo Cargos. "; var skipMsg = ["por favor não pedir para pular as músicas, quer pular da deslike."]; var fansMsg = ["Virem meu Fan que eu retribuo vocês, não esqueça de da @ Menções"]; var wafflesMsg = ["Ppkas para todos! # - (> _ <) - # "," Alguém disse ppkas? # - (> _ <) - #"]; var bhvMsg = ["por favor, não sejam gays no bate-papo "," por favor, não fale assim, controlar a si mesmo! "," por favor, seja maduros fdps"]; var sleepMsg = ["Ta na hora de dormi, Fui virjs! "," Indo dormir agora "," estou tão cansado, durmi é necessário, fui me cama. "," cansaço ... sono ... e ... fui me dormir."]; var workMsg = ["Estou ocupado não sou Vagabundo igual a vocês."]; var afkMsg = ["Eu estou indo embora e um Vão se foderem."," Vou fica AFK por um tempo, volto em breve! "," Indo embora, volto em breve! "," Vou Viaja nas galáxia, estarei de volta em breve !"]; var backMsg = ["Estou de volta minhas putinhas! "," Adivinha quem está de volta? Quem sera? Claro que é eu o seu Pai :D"]; var autoAwayMsg = ["Atualmente estou AFK "," Eu estou AFK "," Eu estou em uma aventura (afk) "," desapareceu por um momento "," não está presente no teclado."]; var autoSlpMsg = ["Atualmente estou dormindo "," Estou comendo ppkas em meus sonhos"]; var autoWrkMsg = ["Atualmente estou ocupado "," estou ocupado "," fazendo um trabalho relacionado a ppkas."]; overPlayed = ["1:vZyenjZseXA", "1:ZT4yoZNy90s", "1:Bparw9Jo3dk", "1:KrVC5dm5fFc","1:Ys9sIqv42lo", "1:1y6smkh6c-0", "1:jZL-RUZUoGY", "1:CrdoD9T1Heg", "1:6R_Rn1iP82I", "1:ea9tluQ_QtE", "1:f9EM8T5K6d8", "1:aHjpOzsQ9YI", "1:3vC5TsSyNjU", "1:yXLL46xkdlY", "1:_t2TzJOyops", "1:BGpzGu9Yp6Y", "1:YJVmu6yttiw", "1:WSeNSzJ2-Jw", "1:2cXDgFwE13g", "1:PR_u9rvFKzE", "1:i1BDGqIfm8U"];overPlayed = ["1:vZyenjZseXA", "1:ZT4yoZNy90s", "1:Bparw9Jo3dk", "1:KrVC5dm5fFc","1:Ys9sIqv42lo", "1:1y6smkh6c-0", "1:jZL-RUZUoGY", "1:CrdoD9T1Heg", "1:6R_Rn1iP82I", "1:ea9tluQ_QtE", "1:f9EM8T5K6d8", "1:aHjpOzsQ9YI", "1:3vC5TsSyNjU", "1:yXLL46xkdlY", "1:_t2TzJOyops", "1:BGpzGu9Yp6Y", "1:YJVmu6yttiw", "1:WSeNSzJ2-Jw", "1:2cXDgFwE13g", "1:PR_u9rvFKzE", "1:i1BDGqIfm8U"]; var styles = [ '.sidebar {position: fixed; top: 0; height: 100%; width: 200px; z-index: 99999; background-image: linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -o-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -moz-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -webkit-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -ms-linear-gradient(bottom, #000000 0%, #3B5678 100%);background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000000),color-stop(1, #3B5678));}', '.sidebar#side-right {right: -190px;z-index: 99999;}', '.sidebar#side-left {left: -190px; z-index: 99999; }', '.sidebar-handle {width: 12px;height: 100%;z-index: 99999;margin: 0;padding: 0;background: rgb(96, 141, 197);box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .9);cursor: "ne-resize";}', '.sidebar-handle span {display: block;position: absolute;width: 10px;top: 50%;text-align: center;letter-spacing: -1px;color: #000;}', '.sidebar-content {position: absolute;width: 185px;height: 100%; padding-left: 15px}', '.sidebar-content2 {position: absolute;width: 185px;height: 100%;}', '.sidebar-content2 h3 {font-weight: bold; padding-left: 5px; padding-bottom: 5px; margin: 0;}', '.sidebar-content2 a {font-weight: bold; font-size: 13px; padding-left: 5px;}', '#side-right .sidebar-handle {float: left;}', '#side-left .sidebar-handle {float: right;}', '#side-right a {display: block;min-width: 100%;cursor: pointer;padding: 4px 5px 8px 5px;border-radius: 4px;font-size: 13px;}', '.sidebar-content2 span {display: block; min-width: 94%;cursor: pointer;border-radius: 4px; padding: 0 5px 0 5px; font-size: 12px;}', '#side-right a span {padding-right: 8px;}', '#side-right a:hover {background-color: rgba(97, 146, 199, 0.65);text-decoration: none;}', '.sidebar-content2 span:hover {background-color: rgba(97, 146, 199, 0.65);text-decoration: none;}', '.sidebar-content2 a:hover {text-decoration: none;}', 'html{background: url("http://i.imgur.com/a75C9wE.jpg") no-repeat scroll center top #000000;}', '#room-wheel {z-index: 2;position: absolute;top: 2px;left: 0;width: 1044px;height: 394px;background: url(http://) no-repeat;display: none;}', '.chat-bouncer {background: url(http://i.imgur.com/9qWWO4L.png) no-repeat 0 5px;padding-left: 17px;width: 292px;}', '.chat-manager{background: url(http://i.imgur.com/hqqhTcp.png) no-repeat 0 5px;padding-left: 17px;width: 292px;}', '.chat-cohost {background: url(https://dl.dropbox.com/u/67634625/chat-bouncer-icon.png) no-repeat 0 5px;padding-left: 17px;width:292px;}', '.chat-host{background: url(https://dl.dropbox.com/u/67634625/chat-bouncer-icon.png) no-repeat 0 5px;padding-left: 17px;width: 292px;}', '#dj-console, #dj-console {background-image: url(http://s8.postimage.org/wpugb8gc5/Comp_2.gif);min-height:33px;min-width:131px;}', '.chat-from-you{color: #0099FF;font-weight: bold;margin-top: 0px; padding-top: 0px;}', '.chat-from-bouncer{color: #800080; font-weight: bold; margin-top: 0px; padding-top: 0px;}', '.chat-from-manager{color: #FFDAB9; font-weight: bold; margin-top: 0px; padding-top: 0px;}', '.chat-from-cohost{color: #FF4500; font-weight: bold; margin-top: 0px; padding-top: 0px;}', '.chat-from-host{color: #32CD32;font-weight: bold;margin-top: 0px; padding-top: 0px;}', '#user-points-title{color: #FFFFFF; position: absolute; left: 36px; font-size: 10px;}', '#user-fans-title{color: #FFFFFF; position: absolute; left: 29px; font-size: 10px;}', '.meta-header span{color: rgba(255, 255, 255, 0.79); position: absolute; left: 15px; font-size: 10px;}', '#button-lobby {background-image: url("http://i.imgur.com/brpRaSY.png");}', '#volume-bar-value{background-image: url("http://i.imgur.com/xmyonON.png") ;}', '#hr-div {;height: 100%;width: 100%;margin: 0;padding-left: 12px;}', '#hr2-div2 {;height: 100%;width: 100%;margin: 0;}', '#hr-style {position: absolute;display: block;height: 20px;width: 100%;bottom: 0%;background-image: url("http://i.imgur.com/gExgamX.png");}', '#hr2-style2 {position: absolute;display: block;height: 20px;width: 94%%;bottom: 0%;background-image: url("http://i.imgur.com/gExgamX.png");}', '#side-left h3 {padding-left: 5px}', ]; var scripts = [ "(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind('mousemove',track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=='mouseenter'){pX=ev.pageX;pY=ev.pageY;$(ob).bind('mousemove',track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind('mousemove',track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);", 'if (jQuery.easing.easeOutQuart === undefined) jQuery.easing.easeOutQuart = function (a,b,c,d,e) { return -d*((b=b/e-1)*b*b*b-1)+c; }', '$("#side-right")', ' .hoverIntent(function() {', ' var timeout_r = $(this)', ' .data("timeout_r");', ' if (timeout_r) {', ' clearTimeout(timeout_r);', ' }', ' $(this)', ' .animate({', ' "right": "0px"', ' }, 300, "easeOutQuart");', ' }, function() {', ' $(this)', ' .data("timeout_r", setTimeout($.proxy(function() {', ' $(this)', ' .animate({', ' "right": "-190px"', ' }, 300, "easeOutQuart");', ' }, this), 500));', ' });', '$("#side-left")', ' .hoverIntent(function() {', ' var timeout_r = $(this)', ' .data("timeout_r");', ' if (timeout_r) {', ' clearTimeout(timeout_r);', ' }', ' $(this)', ' .animate({', ' "left": "0px"', ' }, 300, "easeOutQuart");', ' }, function() {', ' $(this)', ' .data("timeout_r", setTimeout($.proxy(function() {', ' $(this)', ' .animate({', ' "left": "-190px"', ' }, 300, "easeOutQuart");', ' }, this), 500));', ' });' ]; function initAPIListeners() { API.addEventListener(API.DJ_ADVANCE, djAdvanced); API.addEventListener(API.CHAT, autoRespond); API.addEventListener(API.DJ_UPDATE, queueUpdate); API.addEventListener(API.VOTE_UPDATE, function (obj) { populateUserlist(); }); API.addEventListener(API.USER_JOIN, function (user) { populateUserlist(); }); API.addEventListener(API.USER_LEAVE, function (user) { populateUserlist(); }); } function displayUI() { var colorWoot = autowoot ? '#3FFF00' : '#ED1C24'; var colorQueue = autoqueue ? '#3FFF00' : '#ED1C24'; var colorStream = stream ? '#3FFF00' : '#ED1C24'; var colorVideo = hideVideo ? '#3FFF00' : '#ED1C24'; $('#side-right .sidebar-content').append( 'auto woot' + 'auto queue' + 'stream' + 'hide video' + 'rules' + 'like our fb' + 'no fans' + 'no skip' + 'waffles' + 'sleeping' + 'working' + 'afk' + 'available' + 'skip' + 'lock' + 'unlock' + 'lockskip' ); } function initUIListeners() { $("#plug-btn-woot").on("click", function() { autowoot = !autowoot; $(this).css("color", autowoot ? "#3FFF00" : "#ED1C24"); if (autowoot) { setTimeout("$('#button-vote-positive').click();", 6001); } jaaulde.utils.cookies.set(COOKIE_WOOT, autowoot); }); $("#plug-btn-queue").on("click", function() { autoqueue = !autoqueue; $(this).css('color', autoqueue ? '#3FFF00' : '#ED1C24'); if (autoqueue && !isInQueue()) { joinQueue(); } jaaulde.utils.cookies.set(COOKIE_QUEUE, autoqueue); }); $("#plug-btn-stream").on("click", function() { stream = !stream; $(this).css("color", stream ? "#3FFF00" : "#ED1C24"); if (stream == true) { API.sendChat("/stream on"); } else { API.sendChat("/stream off"); } jaaulde.utils.cookies.set(COOKIE_STREAM, stream); }); $("#plug-btn-hidevideo").on("click", function() { hideVideo = !hideVideo; $(this).css("color", hideVideo ? "#3FFF00" : "#ED1C24"); $("#yt-frame").animate({"height": (hideVideo ? "0px" : "271px")}, {duration: "fast"}); $("#playback .frame-background").animate({"opacity": (hideVideo ? "0" : "0.91")}, {duration: "medium"}); jaaulde.utils.cookies.set(COOKIE_HIDE_VIDEO, hideVideo); }); $("#plug-btn-face").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(fbMsg[Math.floor(Math.random() * fbMsg.length)]); } }); $("#plug-btn-rules").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(rulesMsg); } }); $("#plug-btn-fans").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(fansMsg[Math.floor(Math.random() * fansMsg.length)]); } }); $("#plug-btn-noskip").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(skipMsg[Math.floor(Math.random() * skipMsg.length)]); } }); $("#plug-btn-waffles").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); API.sendChat(wafflesMsg[Math.floor(Math.random() * wafflesMsg.length)]); } }); $("#plug-btn-sleeping").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 3) { API.sendChat(sleepMsg[Math.floor(Math.random() * sleepMsg.length)]); Models.user.changeStatus(3); } } }); $("#plug-btn-working").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 2) { API.sendChat(workMsg[Math.floor(Math.random() * workMsg.length)]); Models.user.changeStatus(2); } } }); $("#plug-btn-afk").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 1) { API.sendChat(afkMsg[Math.floor(Math.random() * afkMsg.length)]); Models.user.changeStatus(1); } } }); $("#plug-btn-back").on("click", function() { if (clicked == false) { clicked = true; clickTimer = setInterval("checkClicked();", 1000); if (Models.user.data.status != 0) { API.sendChat(backMsg[Math.floor(Math.random() * backMsg.length)]); Models.user.changeStatus(0); } } }); $("#plug-btn-skip").on("click", function() { if (skipped == false) { skipped = true; skipTimer = setInterval("checkSkipped();", 500); new ModerationForceSkipService; } }); $("#plug-btn-lock").on("click", function() { new RoomPropsService(document.location.href.split('/')[3],true,true,1,5); }); $("#plug-btn-unlock").on("click", function() { new RoomPropsService(document.location.href.split('/')[3],false,true,1,5); }); $("#plug-btn-lockskip").on("click", function() { if (skipped == false) { skipped = true; skipTimer = setInterval("checkSkipped();", 500); new RoomPropsService(document.location.href.split('/')[3],true,true,1,5); new ModerationForceSkipService; new RoomPropsService(document.location.href.split('/')[3],false,true,1,5); } }); } function queueUpdate() { if (autoqueue && !isInQueue()) { joinQueue(); } } function isInQueue() { var self = API.getSelf(); return API.getWaitList().indexOf(self) !== -1 || API.getDJs().indexOf(self) !== -1; } function joinQueue() { if ($('#button-dj-play').css('display') === 'block') { $('#button-dj-play').click(); } else if (API.getWaitList().length < MAX_USERS_WAITLIST) { API.waitListJoin(); } } function autoRespond(data) { var a = data.type == "mention" && Models.room.data.staff[data.fromID] && Models.room.data.staff[data.fromID] >= Models.user.BOUNCER, b = data.message.indexOf('@') >0; if (data.type == "mention" && mentioned == false) { if (API.getUser(data.fromID).status == 0) { mentioned = true; timer = setInterval("checkMentioned();", 1000); if (Models.user.data.status == 1) { API.sendChat("@" + data.from + " automsg: " + autoAwayMsg[Math.floor(Math.random() * autoAwayMsg.length)]); } if (Models.user.data.status ==2) { API.sendChat("@" + data.from + " automsg: " + autoWrkMsg[Math.floor(Math.random() * autoWrkMsg.length)]); } if (Models.user.data.status ==3) { API.sendChat("@" + data.from + " automsg: " + autoSlpMsg[Math.floor(Math.random() * autoSlpMsg.length)]); } } } } function djAdvanced(obj) { if (hideVideo) { $("#yt-frame").css("height", "0px"); $("#playback .frame-background").css("opacity", "0.0"); } if (autowoot) { setTimeout("$('#button-vote-positive').click();", 6001); } setTimeout("overPlayedSongs();", 3000); } function overPlayedSongs(data) { if (overPlayed.indexOf(Models.room.data.media.id) > -1) { API.sendChat("/me auto skip ligado, Musica Repetida. Fuck you baby!"); setTimeout("new RoomPropsService(document.location.href.split('/')[3],true,true,1,5);", 300); setTimeout("new ModerationForceSkipService;", 600); setTimeout("new RoomPropsService(document.location.href.split('/')[3],false,true,1,5);", 900); } if (Models.room.data.media.duration > 481) { API.sendChat("/me auto skip ligado, música com mais de 6 minutos seram puladas."); setTimeout("new RoomPropsService(document.location.href.split('/')[3],true,true,1,5);", 300); setTimeout("new ModerationForceSkipService;", 600); setTimeout("new RoomPropsService(document.location.href.split('/')[3],false,true,1,5);", 900); } } function populateUserlist() { var mehlist = ''; var wootlist = ''; var undecidedlist = ''; var a = API.getUsers(); var totalMEHs = 0; var totalWOOTs = 0; var totalUNDECIDEDs = 0; var str = ''; var users = API.getUsers(); var myid = API.getSelf(); for (i in a) { str = '' + a[i].username + ''; if (typeof (a[i].vote) !== 'undefined' && a[i].vote == -1) { totalMEHs++; mehlist += str; } else if (typeof (a[i].vote) !== 'undefined' && a[i].vote == +1) { totalWOOTs++; wootlist += str; } else { totalUNDECIDEDs++; undecidedlist += str; } } var totalDECIDED = totalWOOTs + totalMEHs; var totalUSERS = totalDECIDED + totalUNDECIDEDs; var totalMEHsPercentage = Math.round((totalMEHs / totalUSERS) * 100); var totalWOOTsPercentage = Math.round((totalWOOTs / totalUSERS) * 100); if (isNaN(totalMEHsPercentage) || isNaN(totalWOOTsPercentage)) { totalMEHsPercentage = totalWOOTsPercentage = 0; } mehlist = ' ' + totalMEHs.toString() + ' (' + totalMEHsPercentage.toString() + '%)' + mehlist; wootlist = ' ' + totalWOOTs.toString() + ' (' + totalWOOTsPercentage.toString() + '%)' + wootlist; undecidedlist = ' ' + totalUNDECIDEDs.toString() + undecidedlist; if ($('#side-left .sidebar-content').children().length > 0) { $('#side-left .sidebar-content2').append(); } $('#side-left .sidebar-content2').html(' users: ' + API.getUsers().length + ' '); var spot = Models.room.getWaitListPosition(); var waitlistDiv = $(' ').addClass('waitlistspot').text('waitlist: ' + (spot !== null ? spot + ' / ' : '') + Models.room.data.waitList.length); $('#side-left .sidebar-content2').append(waitlistDiv); $('#side-left .sidebar-content2').append(' '); $(".meanlist").append( ' meh list:' + mehlist + ' ' + ' woot list:' + wootlist + ' ' ); } function checkMentioned() { if(timePassed >= timeToWait) { clearInterval(timer); mentioned = false; timePassed = 0; } else { timePassed = timePassed + 601; } } function checkClicked() { if (clickPassed >= clickWait) { clearInterval(clickTimer); clicked = false; clickPassed = 0; } else { clickPassed = clickPassed + 601; } } function checkSkipped() { if (skipPassed >= skipWait) { clearInterval(skipTimer); skipped = false; skipPassed = 600; } else { skipPassed = skipPassed + 500; } } $('#plugbot-css').remove(); $('#plugbot-js').remove(); $('#chat-messages').append(' Bem vindo auto-skip editado pelo Rafael Moraes 1.0 '); $('body').prepend('' + "\n" + styles.join("\n") + "\n" + ''); $('body').append(' ' + ' ||| ' + ' ' + ' ' + ' ' + ' ||| ' + ' ' + ' ' + ' '); $('body').append('');