This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Can you explain what this following piece of code from erlserver:do_recv/1 does? | |
HaX = lindellnco_hashtag_evaluator:evaluate_hashtag(grab_x_from_string(Bin)), | |
HaY = lindellnco_hashtag_evaluator:evaluate_hashtag(grab_y_from_string(Bin)), | |
Xsearch = list_to_binary(grab_x_from_string(Bin)), | |
Str1 = grab_y_from_string(Bin), | |
[YList|_] = string:tokens(Str1,"\r"), | |
Ysearch = list_to_binary(YList), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Can you explain the sequence of events that occurs during the communication to the CouchDB | |
%in order to save a tweet? Just a high level description of what the code does. | |
couch_save_tweet(Hashtag) -> | |
Db = couch_open_db(), | |
{Status, Doc} = couchbeam:open_doc(Db, Hashtag), | |
case Status of | |
ok -> | |
{[{_, Ids},{_,_},{_,Uses}]} = Doc, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Can you explain how your battle server works? Give a high level description of the code below | |
battle_loop(Session, Celeb1, HP1, Celeb2, HP2) -> | |
receive | |
{tweet, Celebrity, Tweet} -> | |
case Celebrity of | |
Celeb1 -> | |
bridge ! {battle, Session, Celeb1, HP1, HP2-1, Tweet}, | |
battle_loop(Session, Celeb1, HP1, Celeb2, HP2-1); | |
Celeb2 -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%can you give us a high level explanation of the following code? | |
handle_post(Sock) -> | |
Length=get_content_length(Sock), | |
PostBody=get_body(Sock, Length), | |
Status = processJSON(PostBody), | |
case Status of | |
{ok, added} -> send_accept(Sock),twitter_parser:restart_keyword_change(); | |
{ok, removed} -> send_accept(Sock),twitter_parser:restart_keyword_change(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Have you address the feature in the "TODO" comment below? If yes, where and explain the code, if no, | |
% how does this affect your overall performance and quality of product? | |
-module(twitterminer_couchbeam). | |
-export([connect_server/0, open_db/1, save_doc/3, open_doc/2, read_value/3, update_value/4, extend_doc/4, save_to_doc/5, doc_exists/2, db_save/2]). | |
%TODO: When saving to database: First check if Key already exists. If so: Update Value instead of creating Key, Value. (Check if there's already | |
%a built-in support for this - can two keys have the same value, or are they merged automatically?) | |
connect_server() -> | |
couchbeam:server_connection("127.0.0.1", 5984, "", []). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Why is the following piece of code so important not to be changed? Explain what's its purpose | |
% ///// DO NOT TOUCH //// | |
handle_cast(_Message, Redis) -> {noreply, Redis}. | |
handle_info(_Message, Redis) -> {noreply, Redis}. | |
terminate(_Reason, _Redis) -> terminated. | |
code_change(_OldVersion, Redis, _Extra) -> {ok, Redis}. | |
% ///// END //// | |
%if not so important then what does this do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%can you give a high level description of the following code? What does it do? | |
saveVenue(#venue{fs_id=FSID, | |
insta_id=InstaID, | |
name=Name, | |
address=Address, | |
contact=Contact, | |
img_posts=Posts}) -> | |
case InstaID of | |
"" -> ok; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Can you give a high level description of what the following code does? | |
% Function which runs when you use text_val/1 | |
text_Eval(BinText, From, State) -> | |
Self = self(), | |
%%io:format("BinText from text_Eval/3 ~ts~n", [BinText]), | |
Text = binary:bin_to_list(BinText), | |
Tokens = string:tokens(Text, " "), % split by spaces into list | |
%%PointsList=[word_Eval(N, State) || N <- Tokens], %Create a list with all scores for each word | |
Pids = [spawn_link(fun () ->Self ! {self(), word_Eval(N, State)} end) || N <- Tokens], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Διαβάστε τον κώδικα, προσπαθήστε να καταλάβετε τι κάνει από μόνοι σας (σκοπίμως δεν έχουν μπει σχόλια που να εξηγούν | |
τι κάνουν οι διάφορες εντολές) και μετά γράψτε μόνοι σας το υπόλοιπο πρόγραμμα με τις οδηγίες που θα βρείτε στα σχόλια. | |
Χρησιμοποιήστε της μεταβλητές αληθείας (boolean) ώστε οι εντολές της κάθε κατάστασης (state) να εκτελούνται μόνο μια φορά. | |
Ο σκοπός σας είναι, να τελειώσετε το πρόγραμμα στο σπίτι και όταν το δοκιμάσετε στο αμαξάκι, το αμαξάκι να επιδείξει | |
την εξής συμπεριφορά: | |
Θα προχωρήσει περίπου 20 εκατοστά και θα στρίψει 180 μοίρες (αυτό είναι ήδη έτοιμο για εσάς). | |
Θα προχωρήσει ΕΠΙΠΛΕΟΝ περίπου 60 εκατοστά (δηλαδή πόσα απ' την αρχή της λειτουργίας του;) και θα στρίψει 90 μοίρες προς | |
τα αριστερά. | |
Τέλος, θα συνεχίσει να κινείται ευθεία, μέχρι να διανύσει συνολικά (από την αρχή δηλαδή της λειτουργίας του) 150 εκατοστά. */ | |
#include <Smartcar.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The running arduino sketch on the Android Autonomous Vehicle by Team Pegasus | |
* Original file: https://github.com/platisd/AndroidCar/blob/master/examples/androidCar/androidCar.ino | |
* Description: The vehicle is based on an Arduino Mega, that is connected to various sensors | |
* (infrared, ultrasound, speed encoder, gyroscope and 9DOF IMU) and receives driving instructions | |
* from an Android phone, via Bluetooth, that is attached on the top of the vehicle. The vehicle | |
* can follow street lanes, park and overtake obstacles, using image processing on the Android phone. | |
* | |
* Author: Dimitris Platis | |
*/ | |
#include <Smartcar.h> |
OlderNewer