--- title: Transfer learning in text keywords: fastai sidebar: home_sidebar summary: "How to fine-tune a language model and train a classifier" ---
from fastai2.basics import *
from fastai2.text.all import *
from fastai2.callback.all import *
from nbdev.showdoc import *
# all_slow
First we get our data and tokenize it.
path = untar_data(URLs.IMDB_SAMPLE)
df = pd.read_csv(path/'texts.csv')
df_tok,count = tokenize_df(df, 'text')
Then we put it in a DataSource
. For a language model, we don't have targets, so there is only one transform to numericalize the texts. Note that tokenize_df
returns the count of the words in the corpus to make it easy to create a vocabulary.
splits = ColSplitter()(df_tok)
vocab = make_vocab(count)
dsrc = DataSource(df_tok, [[attrgetter("text"), Numericalize(vocab)]], splits=splits, dl_type=LMDataLoader)
Then we use that DataSource
to create a DataBunch
. Here the class of TfmdDL
we need to use is LMDataLoader
which will concatenate all the texts in a source (with a shuffle at each epoch for the training set), split it in bs
chunks then read continuously through it.
dbunch = dsrc.databunch(bs=64, seq_len=72, after_batch=Cuda)
Or more simply with a factory method:
dbunch = TextDataBunch.from_df(df_tok, text_col="text", text_vocab=vocab, is_lm=True)
dbunch.show_batch()
| text | text_ | |
|---|---|---|
| 0 | xxbos xxmaj the line is funnier in xxmaj england , where , away from xxmaj vixen ! 's native xxmaj america , the word " xxunk " has a whole new meaning . xxmaj sadly , it 's the only laugh you 'll get in this terrible sex comedy that is neither sexy nor funny . \n\n xxmaj oddly xxunk with painted - on xxunk , xxmaj xxunk xxmaj gavin ( acting | xxmaj the line is funnier in xxmaj england , where , away from xxmaj vixen ! 's native xxmaj america , the word " xxunk " has a whole new meaning . xxmaj sadly , it 's the only laugh you 'll get in this terrible sex comedy that is neither sexy nor funny . \n\n xxmaj oddly xxunk with painted - on xxunk , xxmaj xxunk xxmaj gavin ( acting ability |
| 1 | character , but the rest of his hard - xxunk xxunk want the hit - man dead . xxmaj like most crime thrillers in the 1960s and 1970s , " big xxmaj guns " xxunk to the cinematic morality that crime does not pay . xxmaj interestingly , the one man who has nothing to do with the murder of the wife and son of the hero survives while another xxunk the | , but the rest of his hard - xxunk xxunk want the hit - man dead . xxmaj like most crime thrillers in the 1960s and 1970s , " big xxmaj guns " xxunk to the cinematic morality that crime does not pay . xxmaj interestingly , the one man who has nothing to do with the murder of the wife and son of the hero survives while another xxunk the hero |
| 2 | but xxunk xxmaj mr . xxmaj burton forgets that his xxunk have working brains . xxmaj the over the top xxunk of xxmaj xxunk xxmaj xxunk xxmaj carter 's chimp , the xxunk of the humans ' xxunk , the ease of their escape , their extraordinary skills of xxunk ( this is an astronaut and a group of human xxunk suddenly riding full xxunk ) , the massive and immediate human | xxunk xxmaj mr . xxmaj burton forgets that his xxunk have working brains . xxmaj the over the top xxunk of xxmaj xxunk xxmaj xxunk xxmaj carter 's chimp , the xxunk of the humans ' xxunk , the ease of their escape , their extraordinary skills of xxunk ( this is an astronaut and a group of human xxunk suddenly riding full xxunk ) , the massive and immediate human xxunk |
| 3 | ingredients : it is just as poorly acted as their other efforts , we can watch xxmaj bo xxunk or xxunk for wet xxmaj t - shirt xxunk quite frequently , the story is just laughably idiotic , and the film takes itself much too seriously . xxmaj and then : xxmaj xxunk xxmaj xxunk in xxmaj africa ? \n\n xxmaj but it has a few things going for it . xxmaj | : it is just as poorly acted as their other efforts , we can watch xxmaj bo xxunk or xxunk for wet xxmaj t - shirt xxunk quite frequently , the story is just laughably idiotic , and the film takes itself much too seriously . xxmaj and then : xxmaj xxunk xxmaj xxunk in xxmaj africa ? \n\n xxmaj but it has a few things going for it . xxmaj bo |
| 4 | married to director xxmaj michael xxmaj xxunk . \n\n xxmaj but for me , the most memorable and weird aspect of the film is the seemingly gay subplot -- sort of like a xxup xxunk xxup mountain from the 1930s ( and we thought this was a xxup new idea ) . xxmaj gary xxmaj cooper 's character was raised by two men who hate women and do everything they can through | to director xxmaj michael xxmaj xxunk . \n\n xxmaj but for me , the most memorable and weird aspect of the film is the seemingly gay subplot -- sort of like a xxup xxunk xxup mountain from the 1930s ( and we thought this was a xxup new idea ) . xxmaj gary xxmaj cooper 's character was raised by two men who hate women and do everything they can through much |
| 5 | males and xxunk some of their body parts , was probably the most xxunk serial killer of our generation . xxmaj however , the real sick individuals are the filmmakers of this awful spectacle who should have had their heads examined before deciding to xxunk this awful ` xxunk ' project . xxmaj this is not an easy film to xxunk , even though xxmaj jeffrey would have easily xxunk it with | and xxunk some of their body parts , was probably the most xxunk serial killer of our generation . xxmaj however , the real sick individuals are the filmmakers of this awful spectacle who should have had their heads examined before deciding to xxunk this awful ` xxunk ' project . xxmaj this is not an easy film to xxunk , even though xxmaj jeffrey would have easily xxunk it with some |
| 6 | xxmaj grandfather who 's the only semi - likable character in this whole mess . xxmaj do n't waste your money , or time . xxmaj in fact here 's a word of advice , xxmaj if xxmaj troma puts it out on xxup dvd , but does xxup not make it themselves , in all likelihood it 's crap . \n\n xxmaj troma xxup dvd extras : commentary with xxmaj omar | grandfather who 's the only semi - likable character in this whole mess . xxmaj do n't waste your money , or time . xxmaj in fact here 's a word of advice , xxmaj if xxmaj troma puts it out on xxup dvd , but does xxup not make it themselves , in all likelihood it 's crap . \n\n xxmaj troma xxup dvd extras : commentary with xxmaj omar and |
| 7 | and xxunk tragic . xxmaj not for kids . xxmaj not for those with thin skins or who lack xxunk . xxmaj thought - provoking . xxmaj at once literal , xxunk , and surreal in disturbing ways . xxmaj the xxunk comedy i can recall . \n\n xxmaj and very possibly the most wonderful thing i will ever see . xxbos xxmaj this movies is the best movie to watch for | xxunk tragic . xxmaj not for kids . xxmaj not for those with thin skins or who lack xxunk . xxmaj thought - provoking . xxmaj at once literal , xxunk , and surreal in disturbing ways . xxmaj the xxunk comedy i can recall . \n\n xxmaj and very possibly the most wonderful thing i will ever see . xxbos xxmaj this movies is the best movie to watch for comic |
| 8 | movie , since i like zombies and horror movies in general . xxmaj but i did not think it would be such a piece of sh!t like it was . xxmaj the only zombie in the movie is at the beginning and he gets ran over by a god damn car xxrep 3 ! xxmaj the movie looks to be written by a porn director and filled by porn actors , i | , since i like zombies and horror movies in general . xxmaj but i did not think it would be such a piece of sh!t like it was . xxmaj the only zombie in the movie is at the beginning and he gets ran over by a god damn car xxrep 3 ! xxmaj the movie looks to be written by a porn director and filled by porn actors , i would |
learn = language_model_learner(dbunch, AWD_LSTM, metrics=[accuracy, Perplexity()], path=path, opt_func = partial(Adam, wd=0.1)).to_fp16()
learn.freeze()
learn.fit_one_cycle(1, 1e-2, moms=(0.8,0.7,0.8))
| epoch | train_loss | valid_loss | accuracy | perplexity | time |
|---|---|---|---|---|---|
| 0 | 4.450261 | 4.002472 | 0.273968 | 54.733280 | 00:15 |
learn.unfreeze()
learn.fit_one_cycle(4, 1e-2, moms=(0.8,0.7,0.8))
| epoch | train_loss | valid_loss | accuracy | perplexity | time |
|---|---|---|---|---|---|
| 0 | 4.380655 | 4.388360 | 0.237928 | 80.508240 | 00:19 |
| 1 | 4.286285 | 4.307310 | 0.248634 | 74.240486 | 00:17 |
| 2 | 3.900547 | 4.226243 | 0.261510 | 68.459518 | 00:17 |
| 3 | 3.377858 | 4.264581 | 0.262330 | 71.135124 | 00:17 |
Once we have fine-tuned the pretrained language model to this corpus, we save the encoder since we will use it for the classifier.
learn.show_results()
| input | target | pred | |
|---|---|---|---|
| 0 | xxbos xxmaj this is n't one of xxmaj arbuckle 's or xxmaj keaton 's better films , that 's for sure . xxmaj fatty 's wife is tired of all his heavy drinking , so she takes him to a xxunk where a psychiatrist ( keaton ) claims to have a guaranteed cure ! xxmaj well , once there , xxmaj arbuckle accidentally eats a xxunk and is taken to surgery . | xxmaj this is n't one of xxmaj arbuckle 's or xxmaj keaton 's better films , that 's for sure . xxmaj fatty 's wife is tired of all his heavy drinking , so she takes him to a xxunk where a psychiatrist ( keaton ) claims to have a guaranteed cure ! xxmaj well , once there , xxmaj arbuckle accidentally eats a xxunk and is taken to surgery . xxmaj | xxmaj this is a a of those hollywood 's better xxmaj keaton 's better films , but 's what me , xxmaj the xxmaj wife , a of his the xxunk drinking , but he 's a to the xxunk xxunk he man ( robert ) is that be a xxunk cure . xxmaj the , he he , he jigsaw is xxunk a xxunk and turns thrown to the . xxmaj |
| 1 | references to xxmaj asimov 's xxmaj laws of xxmaj xxunk , but they are an xxunk to the xxup cgi and action scenes . \n\n xxmaj smith is likable , as he is in most of his films , but honestly , the story is n't that good . you figure it out long before these genius characters do . xxbos xxmaj my husband and i bought the xxmaj old xxmaj school | to xxmaj asimov 's xxmaj laws of xxmaj xxunk , but they are an xxunk to the xxup cgi and action scenes . \n\n xxmaj smith is likable , as he is in most of his films , but honestly , the story is n't that good . you figure it out long before these genius characters do . xxbos xxmaj my husband and i bought the xxmaj old xxmaj school xxmaj | to the xxunk 's " xxunk of xxmaj xxunk . and this did not xxunk of the xxunk xxunk . the scenes . xxmaj xxmaj the 's a as but he is a a of his films , but he , he movie is not that good . xxmaj can out out . ago you two xxunk will n't xxmaj xxmaj this wife and i bought this xxup xxunk xxmaj school xxmaj |
| 2 | is the central philosophy of post modern capitalism : your xxunk is the most important thing . you must place yourself in the center , and no one else but you is the matter . this is the philosophy the film stands for , and that 's just it 's first sin . \n\n xxmaj if you disagree with me on the political side , xxmaj i 'm sure you will agree | the central philosophy of post modern capitalism : your xxunk is the most important thing . you must place yourself in the center , and no one else but you is the matter . this is the philosophy the film stands for , and that 's just it 's first sin . \n\n xxmaj if you disagree with me on the political side , xxmaj i 'm sure you will agree that | n't only xxunk of the modern capitalism . xxmaj xxunk are xxunk only important thing of xxmaj can see your in a woods of and you one will . you can n't only of xxmaj is a only of movie has for . and it 's what a 's not rate . xxmaj xxmaj the you want with the , the xxmaj side , you i 'm not you will be with |
| 3 | could had been a fine or even classic xxmaj b - movie , but here it is just a bad attempt at film - making . \n\n xxmaj director xxmaj philip xxup j. xxmaj jones tells the tale of xxmaj james xxmaj bishop ( matt xxmaj xxunk ) , a young xxunk resident , who just got his dream job at xxmaj st . xxmaj andrew xxmaj mental xxmaj hospital ; but | had been a fine or even classic xxmaj b - movie , but here it is just a bad attempt at film - making . \n\n xxmaj director xxmaj philip xxup j. xxmaj jones tells the tale of xxmaj james xxmaj bishop ( matt xxmaj xxunk ) , a young xxunk resident , who just got his dream job at xxmaj st . xxmaj andrew xxmaj mental xxmaj hospital ; but the | n't been a bit xxunk even xxunk movie hollywood - movie . but it 's was n't a xxunk movie at xxunk - making . xxmaj xxmaj the xxmaj xxunk xxmaj j. xxmaj xxunk is the story of a louis xxmaj xxunk ( james xxmaj damon ) , a professional man who who who is has his name job in a xxunk . xxmaj xxunk xxmaj hospital xxmaj hospital . he he |
| 4 | it has on the kid caught in between . xxmaj as a child of divorced parents i was totally relating to events in the film . xxmaj also - a really cool zombie twist which i thought was xxup very xxup original . xxmaj i 'm tired of the same old stuff in movies . a very realistic portrait of a broken family and the effect it has on the kid caught | has on the kid caught in between . xxmaj as a child of divorced parents i was totally relating to events in the film . xxmaj also - a really cool zombie twist which i thought was xxup very xxup original . xxmaj i 'm tired of the same old stuff in movies . a very realistic portrait of a broken family and the effect it has on the kid caught in | 's been the whole 's in the . xxmaj the a whole of xxmaj parents , was xxunk relating to the in the movie . xxmaj the , the very good scene twist which was thought was a very xxup original . xxmaj the 'm sure of the old old stuff and movies like xxmaj lot good portrait of a young family and the xxunk it has on the kid . in |
| 5 | " scene and had to stop . xxmaj we could n't take it anymore . xxmaj this film is an xxup xxunk for xxmaj xxunk xxmaj xxunk . \n\n xxmaj if you are a fan of xxmaj office xxmaj space … … do n't waste your time with this turd . 0 / 10 xxbos xxmaj what i think xxmaj i 'll probably like best about the new xxmaj star xxmaj wars | scene and had to stop . xxmaj we could n't take it anymore . xxmaj this film is an xxup xxunk for xxmaj xxunk xxmaj xxunk . \n\n xxmaj if you are a fan of xxmaj office xxmaj space … … do n't waste your time with this turd . 0 / 10 xxbos xxmaj what i think xxmaj i 'll probably like best about the new xxmaj star xxmaj wars film | xxunk " the a be " " it were n't help it to . " it is is a xxunk ok movie a xxunk xxmaj xxunk . xxmaj xxmaj the you want looking fan of xxmaj xxunk xxmaj space , xxmaj xxmaj n't bother your money . this movie . xxbos / 10 xxbos xxmaj this i think of i 'm say be is about this movie xxmaj star xxmaj wars movie |
| 6 | of the film is to show what kids of that moment in time were doing , what mattered to them . xxmaj it shows that teenagers in general are good , all that mattered to these everyday kids was music , dancing and friendship . xxmaj having watched the xxup dvd recently i was xxunk surprised how well it had stood the test of time ! xxmaj the clothes did n't look | the film is to show what kids of that moment in time were doing , what mattered to them . xxmaj it shows that teenagers in general are good , all that mattered to these everyday kids was music , dancing and friendship . xxmaj having watched the xxup dvd recently i was xxunk surprised how well it had stood the test of time ! xxmaj the clothes did n't look dated | the xxunk 's xxunk be how happens are the day are the are doing . and is to them . xxmaj the 's that the are the are not , and of is to the kids kids is the , music , music . xxmaj the read this film dvd i i was xxunk to that much it was been for test of time . xxmaj the film and n't make like |
| 7 | . xxmaj there is xxunk and xxunk on both sides , and also the hope for change in the younger generation . \n\n xxmaj there is redemption of a sort , in the end , when xxmaj xxunk has to make a hard choice between a man who has ruined her life , but also truly loved her , and her family which has xxunk her , then later come looking for | xxmaj there is xxunk and xxunk on both sides , and also the hope for change in the younger generation . \n\n xxmaj there is redemption of a sort , in the end , when xxmaj xxunk has to make a hard choice between a man who has ruined her life , but also truly loved her , and her family which has xxunk her , then later come looking for her | xxmaj the are a xxunk xxunk in the sides . and the the xxunk for xxunk . the world generation . xxmaj xxmaj the is a of love xxunk of but fact end , where xxmaj xxunk xxmaj a xxunk a xxunk time with a man who has never her life and but she has xxunk her . and she mother is has never her and and her xxunk to for her |
| 8 | the deep freeze . mckenna had killed xxmaj wendt by biting a xxunk out of his neck . xxmaj now he feels he must destroy the evidence of his involvement in xxmaj wendt 's xxunk . ( what are the cops going to do , measure his bite xxunk ? ) mckenna xxunk xxmaj wendt 's head and neck from the freezer bag it 's in , takes an ax , and | deep freeze . mckenna had killed xxmaj wendt by biting a xxunk out of his neck . xxmaj now he feels he must destroy the evidence of his involvement in xxmaj wendt 's xxunk . ( what are the cops going to do , measure his bite xxunk ? ) mckenna xxunk xxmaj wendt 's head and neck from the freezer bag it 's in , takes an ax , and begins | xxmaj xxunk . xxmaj is a the dr by xxunk a xxunk over of his neck and xxmaj he he 's he 's have the xxunk of his xxunk in his jigsaw 's death . xxmaj he 's the victims going to do ) and his xxunk on ? ) xxmaj is his wendt 's head to legs in the head . . 's in . and a xxunk and and then |
| 9 | with my family , watching over my own father , xxunk in the xxup xxunk before he passed . \n\n xxmaj the episode begins with xxmaj tony in an alternate reality : he is a salesman who 's identity has been mistaken for that of a man named xxmaj kevin xxmaj xxunk . \n\n xxmaj by the time ten minutes had gone by , i knew either xxmaj tony was xxunk , | my family , watching over my own father , xxunk in the xxup xxunk before he passed . \n\n xxmaj the episode begins with xxmaj tony in an alternate reality : he is a salesman who 's identity has been mistaken for that of a man named xxmaj kevin xxmaj xxunk . \n\n xxmaj by the time ten minutes had gone by , i knew either xxmaj tony was xxunk , or | xxmaj xxunk and i it the home father , i , the xxup u.s . he xxunk . xxmaj xxmaj the story is with xxmaj tony and a xxunk reality , he is xxunk xxunk who has been is been xxunk for a of his man who xxmaj xxunk xxmaj xxunk . xxmaj xxmaj the the time of minutes are gone , , i was that the tony xxmaj making or or |
learn.save_encoder('enc1')
For classification, we need to use two set of transforms: one to numericalize the texts and the other to encode the labels as categories.
splits = ColSplitter()(df_tok)
dsrc = DataSource(df_tok, splits=splits, tfms=[
[attrgetter("text"), Numericalize(vocab)],
[attrgetter("label"), Categorize()]], dl_type=SortedDL)
We opnce again use a subclass of TfmdDL
for the dataloaders, since we want to sort the texts (sortish for the training set) by order of lengths. We also use pad_collate
to create batches form texts of different lengths.
dbunch = dsrc.databunch(before_batch=pad_input, after_batch=Cuda)
dbunch.show_batch(max_n=2)
| text | category | |
|---|---|---|
| 0 | xxbos xxmaj raising xxmaj victor xxmaj vargas : a xxmaj review \n\n xxmaj you know , xxmaj raising xxmaj victor xxmaj vargas is like sticking your hands into a big , xxunk bowl of xxunk . xxmaj it 's warm and gooey , but you 're not sure if it feels right . xxmaj try as i might , no matter how warm and gooey xxmaj raising xxmaj victor xxmaj vargas became i was always aware that something did n't quite feel right . xxmaj victor xxmaj vargas suffers from a certain xxunk on the director 's part . xxmaj apparently , the director thought that the ethnic backdrop of a xxmaj latino family on the lower east side , and an xxunk storyline would make the film critic proof . xxmaj he was right , but it did n't fool me . xxmaj raising xxmaj victor xxmaj vargas is | negative |
| 1 | xxbos xxup the xxup shop xxup around xxup the xxup corner is one of the xxunk and most feel - good romantic comedies ever made . xxmaj there 's just no getting around that , and it 's hard to actually put one 's feeling for this film into words . xxmaj it 's not one of those films that tries too hard , nor does it come up with the xxunk possible scenarios to get the two protagonists together in the end . xxmaj in fact , all its charm is xxunk , contained within the characters and the setting and the plot … which is highly believable to xxunk . xxmaj it 's easy to think that such a love story , as beautiful as any other ever told , * could * happen to you … a feeling you do n't often get from other romantic comedies | positive |
Or with a factory method of TextDataBunch
:
dbunch = TextDataBunch.from_df(df_tok, text_col="text", text_vocab=vocab, label_col='label')
learn = text_classifier_learner(dbunch, AWD_LSTM, metrics=[accuracy], path=path, opt_func=Adam, drop_mult=0.5)
learn = learn.load_encoder('enc1')
Then we can train with gradual unfreezing and differential learning rates.
learn.fit_one_cycle(4, moms=(0.8,0.7,0.8))
| epoch | train_loss | valid_loss | accuracy | time |
|---|---|---|---|---|
| 0 | 0.627347 | 0.444851 | 0.840000 | 00:10 |
| 1 | 0.564891 | 0.410152 | 0.825000 | 00:11 |
| 2 | 0.472728 | 0.367973 | 0.860000 | 00:10 |
| 3 | 0.429697 | 0.361784 | 0.845000 | 00:10 |
learn.unfreeze()
learn.opt = learn.create_opt()
learn.fit_one_cycle(8, slice(1e-5,1e-3), moms=(0.8,0.7,0.8))
| epoch | train_loss | valid_loss | accuracy | time |
|---|---|---|---|---|
| 0 | 0.382893 | 0.351107 | 0.850000 | 00:17 |
| 1 | 0.396118 | 0.360789 | 0.845000 | 00:18 |
| 2 | 0.324209 | 0.432927 | 0.790000 | 00:16 |
| 3 | 0.287399 | 0.371246 | 0.815000 | 00:20 |
| 4 | 0.254755 | 0.375270 | 0.835000 | 00:19 |
| 5 | 0.238167 | 0.375107 | 0.850000 | 00:16 |
| 6 | 0.220819 | 0.405301 | 0.825000 | 00:16 |
| 7 | 0.215843 | 0.400871 | 0.835000 | 00:17 |
learn.show_results(max_n=5)
| text | category | category_ | |
|---|---|---|---|
| 0 | xxbos xxmaj raising xxmaj victor xxmaj vargas : a xxmaj review \n\n xxmaj you know , xxmaj raising xxmaj victor xxmaj vargas is like sticking your hands into a big , xxunk bowl of xxunk . xxmaj it 's warm and gooey , but you 're not sure if it feels right . xxmaj try as i might , no matter how warm and gooey xxmaj raising xxmaj victor xxmaj vargas became i was always aware that something did n't quite feel right . xxmaj victor xxmaj vargas suffers from a certain xxunk on the director 's part . xxmaj apparently , the director thought that the ethnic backdrop of a xxmaj latino family on the lower east side , and an xxunk storyline would make the film critic proof . xxmaj he was right , but it did n't fool me . xxmaj raising xxmaj victor xxmaj vargas is | negative | negative |
| 1 | xxbos xxup the xxup shop xxup around xxup the xxup corner is one of the xxunk and most feel - good romantic comedies ever made . xxmaj there 's just no getting around that , and it 's hard to actually put one 's feeling for this film into words . xxmaj it 's not one of those films that tries too hard , nor does it come up with the xxunk possible scenarios to get the two protagonists together in the end . xxmaj in fact , all its charm is xxunk , contained within the characters and the setting and the plot … which is highly believable to xxunk . xxmaj it 's easy to think that such a love story , as beautiful as any other ever told , * could * happen to you … a feeling you do n't often get from other romantic comedies | positive | positive |
| 2 | xxbos xxmaj now that xxmaj che(2008 ) has finished its relatively short xxmaj australian cinema run ( extremely limited xxunk screen in xxmaj xxunk , after xxunk ) , i can xxunk join both xxunk of " at xxmaj the xxmaj movies " in taking xxmaj steven xxmaj soderbergh to task . \n\n xxmaj it 's usually satisfying to watch a film director change his style / subject , but xxmaj soderbergh 's most recent stinker , xxmaj the xxmaj girlfriend xxmaj xxunk ) , was also missing a story , so narrative ( and editing ? ) seem to suddenly be xxmaj soderbergh 's main challenge . xxmaj strange , after xxunk years in the business . xxmaj he was probably never much good at narrative , just xxunk it well inside " edgy " projects . \n\n xxmaj none of this excuses him this present , almost diabolical | negative | negative |
| 3 | xxbos xxmaj this film sat on my xxmaj xxunk for weeks before i watched it . i xxunk a self - indulgent xxunk flick about relationships gone bad . i was wrong ; this was an xxunk xxunk into the screwed - up xxunk of xxmaj new xxmaj xxunk . \n\n xxmaj the format is the same as xxmaj max xxmaj xxunk ' " la xxmaj xxunk , " based on a play by xxmaj arthur xxmaj xxunk , who is given an " inspired by " credit . xxmaj it starts from one person , a prostitute , standing on a street corner in xxmaj brooklyn . xxmaj she is picked up by a home contractor , who has sex with her on the hood of a car , but ca n't come . xxmaj he refuses to pay her . xxmaj when he 's off xxunk , she | positive | positive |
| 4 | xxbos xxmaj many neglect that this is n't just a classic due to the fact that it 's the first 3d game , or even the first xxunk - up . xxmaj it 's also one of the first xxunk games , one of the xxunk definitely the first ) truly claustrophobic games , and just a pretty well - xxunk gaming experience in general . xxmaj with graphics that are terribly dated today , the game xxunk you into the role of xxunk even * think * xxmaj i 'm going to attempt spelling his last name ! ) , an xxmaj american xxup xxunk . caught in an underground bunker . xxmaj you fight and search your way through xxunk in order to achieve different xxunk for the six xxunk , let 's face it , most of them are just an excuse to hand you a weapon | positive | positive |
from fastai2.interpret import *
interp = Interpretation.from_learner(learn)
interp.plot_top_losses(6)
| input | target | predicted | probability | loss | |
|---|---|---|---|---|---|
| 0 | xxbos xxmaj over xxmaj her xxmaj dead xxmaj body was a nice little xxunk was decent and entertaining , while still being pretty xxunk were a few cliché 's , but i found most stuff xxunk first i did n't think it was going to be good at all , when it started xxunk you can get past the first 20 minutes though , the movie starts getting more xxunk film was n't burst out in laughter hilarious , and was n't xxup oh xxup my xxup xxunk xxunk was just a movie that you can sit down and enjoy for how enjoyable it xxunk do n't see how this movie was xxunk rating is just a bit too xxunk could 've dealt with a xxunk a xxunk , giving this movie a 1 is xxunk was pretty good , and there was nothing horrible enough about it to give | positive | negative | 0.9911274313926697 | 4.724791526794434 |
| 1 | xxbos xxmaj not sure if it was right or wrong , but i read thru the other comments before watching the xxunk have to say i disagree with most of the negative comments or problems people have had with it . \n\n xxmaj as a first time " lone xxmaj wolf " director / producer , i like to see things that i can xxunk to , not necessarily from the pro 's , but by people just getting their feet wet like me . \n\n xxmaj if indeed this is also from a first - xxunk , as i read , i applaud the xxunk job then in that respect ! xxmaj there were some comments about the xxunk thought it was quite nice for the xxunk say it kind of xxunk along for a while , but i found that created tension xxunk being xxunk of it , | positive | negative | 0.989062488079071 | 4.515562057495117 |
| 2 | xxbos xxmaj of life in ( some ) colleges . xxmaj of course there were artistic xxunk taken , but some of what you saw in this film go on in some colleges . \n\n i went to colleges in xxmaj southern xxmaj california where the xxunk pretty much hang around with their own . xxmaj it 's funny because these are schools that want racial xxunk , equality etc . and i can honestly say , that it 's there . xxmaj but the thing is when class lets out , or when they 're just hanging out waiting for class , they ( students ) seem to just hang around with people of their own race or ethnicity . xxmaj is that bad ? xxmaj not really . xxmaj everyone needs a feeling of belonging . xxmaj but like the school paper of one of the schools i | positive | negative | 0.9781860709190369 | 3.8252058029174805 |
| 3 | xxbos i ca nt help it but i seem to like films that are meant to be scary and are just plain bad . i have personally listed it in my own top 10 worst movies right under creatures of the xxunk xxmaj watch this film and have a laugh just do n't expect to see any academy awards for acting . xxmaj more chance of understanding the film its self . xxmaj in all honesty though i have seen much worse than this . xxmaj plus some xxunk xxunk round the desert xxunk the same people out that just died is that unbelievable that its got to be original . i think its one of those love or hate movies . you can make up your own mind yes its awful but it pulls it off somehow that s why i love it | negative | positive | 0.9513773322105408 | 3.0236663818359375 |
| 4 | xxbos xxmaj like xxmaj tarzan the xxmaj ape xxmaj man ( 1932 ) , only more so . xxmaj there 's more of everything , more animals , more varied xxmaj african tribes , and scenes in which the thought must be , if this was good with three or four lions , forty would be better . xxmaj tarzan xxunk with xxunk the crocodile machine xxunk in the water like a rolling pin , around and around , jaws xxunk . xxmaj tarzan can kill it with his xxunk knife if the xxunk xxunk would hold still . xxmaj tarzan kills lions and xxunk and a xxunk xxunk number of animals . xxmaj his friends are real xxunk , people wearing larger ape costumes , and xxunk . xxmaj in fact , they use xxmaj indian xxunk more friendly and xxunk than xxmaj african xxunk costume ears attached to | positive | negative | 0.9405072331428528 | 2.821899890899658 |
| 5 | xxbos xxmaj this is yet another bad movie that you should probably avoid watching . xxmaj the plot could be a lot " xxunk " than it actually is and would be better made as a blockbuster type movie . \n\n xxmaj the acting leaves something to be desired , though you can not quite place your finger on what it is . \n\n xxmaj this is one of those that you watch on late night xxup tv , perhaps on xxup usa , simply because you can not get to sleep . xxmaj watch it if you want but do not expect too much from it . | negative | positive | 0.9324377179145813 | 2.6947054862976074 |


{{dialogHeader}}
The mango is a juicy stone fruit belonging to the genus Mangifera, consisting of numerous tropical fruiting trees, cultivated mostly for edible fruit. The majority of these species are found in nature as wild mangoes. They all belong to the flowering plant family Anacardiaceae. The mango is native to South and Southeast Asia, from where it has been distributed worldwide to become one of the most cultivated fruits in the tropics.
The highest concentration of Mangifera genus is in the western part of Malesia (Sumatra, Java and Borneo) and in Burma and India. While other Mangifera species (e.g. horse mango, M. foetida) are also grown on a more localized basis, Mangifera indica—the "common mango" or "Indian mango"—is the only mango tree commonly cultivated in many tropical and subtropical regions.
It originated in Indian subcontinent (present day India and Pakistan) and Burma. It is the national fruit of India, Pakistan, and the Philippines, and the national tree of Bangladesh. In several cultures, its fruit and leaves are ritually used as floral decorations at weddings, public celebrations, and religious ceremonies.
The mango is a juicy stone fruit belonging to the genus Mangifera, consisting of numerous tropical fruiting trees, cultivated mostly for edible fruit. The majority of these species are found in nature as wild mangoes. They all belong to the flowering plant family Anacardiaceae. The mango is native to South and Southeast Asia, from where it has been distributed worldwide to become one of the most cultivated fruits in the tropics.
The highest concentration of Mangifera genus is in the western part of Malesia (Sumatra, Java and Borneo) and in Burma and India. While other Mangifera species (e.g. horse mango, M. foetida) are also grown on a more localized basis, Mangifera indica—the "common mango" or "Indian mango"—is the only mango tree commonly cultivated in many tropical and subtropical regions.
It originated in Indian subcontinent (present day India and Pakistan) and Burma. It is the national fruit of India, Pakistan, and the Philippines, and the national tree of Bangladesh. In several cultures, its fruit and leaves are ritually used as floral decorations at weddings, public celebrations, and religious ceremonies.


 When I was given the opportunity to be part of the industry, I didn't think twice. In the world of video game design and development it is impossible to get bored, every day there are new challenges.
My passion is designing video games and board games, and as a programmer I like to develop and test every mechanic that comes from my imagination.
After the success of my first board game publication, "¡Arre Unicornio!", I'm working on launching the second board game "Bizarre Bid", and I also focus on an individual project, which I will present as TFG (Final Degree Project) the year next, which consists of the design and development of a competitive online multiplayer video game.
I mainly program in C / C ++, C # and Python. I usually use Unity as an engine, but I will use Unreal Engine in the TFG to get familiar with this engine.
This animation timeline is a tool that supports the team, speeding up the animation debug by being able to go frame by frame looking if all the animation is correct or if you have to cut or modify frames.
It has some menus on the left and right with which you can choose the animation and the bone in particular. The circles on the timeline tell you if that frame of a specific animation and a specific bone has a keyframe or not.
It also contains a scroll that you can drag and watch the animation, it also implements play and pause buttons outside the gameplay to see how the animation would run in the game.
I updated the animation timeline to detect if the animation object contained an audio component, a particle component and a script component, so that I could activate and deactivate audios and particles and obtain the functions of a script to execute this function in a certain frame from the animation timeline.
It is a system to give feedback to the player through the rumbler of the controller, for this I made different types of rumbler that obtain the strength and duration of a json and apply it to a controller index, or both.
In addition, I made a type of ascending rumbler and another descending one to which you have to indicate the duration by parameter and it does an interpolation of the force.
It is a system to manage the spawn of relics so that they randomly appear on the map. These relics grant the player elemental powers to the dash or some attack combo. These powers range from doing more damage to slowing or paralyzing enemies.
Upon completion of the combo apply burn the enemy according to the difficulty of the combo, at the end of the combo it will burn for x dmg over time, the duration depends on the difficulty of the combo.
When completing the application combo slows the enemy down, the duration depends on the difficulty of the combo.
At the end of the combo, double the damage of the last attack.
At the end of the application combo x charges according to the difficulty of the combo to the enemy.
When completing the combo applies stun, the duration of the stun depends on the difficulty of the combo.
When the player makes the dash, he leaves a trace of fire inflicting damage to the enemy above.
When completing the application combo slows the enemy down, the duration depends on the difficulty of the combo.
when dodging leaves a trail of sharp rocks on the ground that when colliding with it, the enemy is damaged and the part of the trail where it has crashed disappears.
Leaving a trail when dodging that applies poison to enemies.
In the boss Ciri, I have been in charge of the changes in the scene during the different phases of the boss. For the second phase, when the players kill 3 Ciri clones, the wall that surrounds the room begins to go down to give the feeling that the platform is going up, to achieve this effect I am replacing the parts that have already passed the partially bottom of the platform and place them on top of the wall. Also, some rocks begin to feel that damage the players, and some particles of pebbles are activated that give the effect that the wall is broken.
When the player reaches the third phase, by killing 3 other Ciri clones, the platforms begin to fall. For this, the first danger is indicated by changing the color of the platform material to red and then it begins to fall. After a while the wall is recycled to have a collider again and the players cannot fall. If the player falls during the platform fall, the player dies and teleports to where the player is alive so that he can be resurrected.
The sfx of the different pickups, which are: the relics, the life orbs and the coins.
The sfx of the effects that relics apply when they affect enemies. There are five: fire, ice, poison, earth, and electro


|
STOR
Server-less, Embeddable NoSQL Document Store
|
node represents an interface to a specific element in the underlying JSON data tree. More...
#include <node.h>
Public Member Functions | |
| virtual | ~node () |
| Destructor. | |
| node (const node &o) | |
| Shallow Copy constructor. More... | |
| node (node &&o) | |
| Move constructor. | |
| node & | operator= (const node &o) |
| Shallow Copy assignment. More... | |
| node & | operator= (node &&o) |
| Move assignment. | |
| virtual bool | is_num () const |
| Check whether underlying data is a Number. More... | |
| virtual bool | is_int () const |
| Check whether underlying data is a Integer. More... | |
| virtual bool | is_bool () const |
| Check whether underlying data is a Boolean. More... | |
| virtual bool | is_long () const |
| Check whether underlying data is a Long. More... | |
| virtual bool | is_double () const |
| Check whether underlying data is a Double. More... | |
| virtual bool | is_string () const |
| Check whether underlying data is a String. More... | |
| virtual bool | is_object () const |
| Check whether underlying data is an Object. More... | |
| virtual bool | is_array () const |
| Check whether underlying data is an Array. More... | |
| virtual bool | is_null () const |
| Check whether underlying data is Null. More... | |
| virtual int | as_int () const |
| Attempts to return the underlying data as Integer. More... | |
| virtual int64_t | as_long () const |
| Attempts to return the underlying data as Long. More... | |
| virtual double | as_double () const |
| Attempts to return the underlying data as Double. More... | |
| virtual std::string | as_string () const |
| Attempts to return the underlying data as a string. More... | |
| virtual std::pair< const char *, std::size_t > | as_cstring () const |
| Attempts to return the underlying data as a C string paired with its actual length. More... | |
| virtual bool | as_bool () const |
| Attempts to return the underlying data as Boolean. More... | |
| virtual node | with (const std::string &key) |
| Get or create in place object node under key. More... | |
| virtual node | with_array (const std::string &key) |
| Get or create in place array node under key. More... | |
| virtual void | operator= (int v) |
| Set current value node underlying data to. More... | |
| void | operator= (int64_t v) |
| Set current value node underlying data to. More... | |
| virtual void | operator= (double v) |
| Set current value node underlying data to. More... | |
| virtual void | operator= (bool v) |
| Set current value node underlying data to. More... | |
| virtual void | operator= (const std::string &v) |
| Set current value node underlying data to. More... | |
| virtual void | operator= (const char *v) |
| Set current value node underlying data to. More... | |
| virtual node & | put (const std::string &key, int v) |
| Add key-value to object node. More... | |
| virtual node & | put (const std::string &key, int64_t v) |
| Add key-value to object node. More... | |
| virtual node & | put (const std::string &key, double v) |
| Add key-value to object node. More... | |
| virtual node & | put (const std::string &key, bool v) |
| Add key-value to object node. More... | |
| virtual node & | put (const std::string &key, const std::string &v) |
| Add key-value to object node. More... | |
| virtual node & | put (const std::string &key, const char *v) |
| Add key-value to object node. More... | |
| virtual node & | add (int v) |
| Add int to array node. More... | |
| virtual node & | add (int64_t v) |
| Add long to array node. More... | |
| virtual node & | add (double v) |
| Add double to array node. More... | |
| virtual node & | add (bool v) |
| Add bool to array node. More... | |
| virtual node & | add (const std::string &v) |
| Add string to array node. More... | |
| virtual node & | add (const char *v) |
| Add C string to array node. More... | |
| template<typename forw_it > | |
| node & | add (forw_it begin, forw_it end) |
| Add all items dereferenced from forward_iterator forw_it to array node. More... | |
| template<typename item > | |
| node & | add (const std::vector< item > &v) |
Add all items from the vector v to array node. More... | |
| virtual node | add_array () |
| Add array to array node. More... | |
| virtual node | add_object () |
| Add object to array node. More... | |
| virtual bool | has (const std::string &key) const |
| Check whether a member exists under. More... | |
| virtual node | operator[] (const std::string &key) const |
| Attempts to return node with key 'key'. More... | |
| virtual node | operator[] (std::size_t indx) const |
| Attempts to return node at index. More... | |
| virtual std::size_t | size () const |
| Return number of children for this node. More... | |
| virtual bool | empty () const |
| Return true if size() == 0. More... | |
| virtual bool | remove (const std::string &key) |
Remove the child node at key key . More... | |
| const_iterator | remove (const_iterator it) |
removes the member iterator it points to and returns the iterator to item coming after the one deleted. If it is equal to cend(), the behaviour is undefined. More... | |
| const_iterator | remove (const_iterator first, const_iterator last) |
| removes the members in the range [first, last) and returns the item coming after the one deleted. More... | |
| virtual void | remove_all () const |
| Removes all the children of this node. More... | |
| virtual std::string | json () const |
| Return string JSON represeantation of the this node and descendants. | |
| virtual void | json (const std::string &jsn) |
replaces this node with the node resulting from parsing json More... | |
| virtual void | copy (const node &v) |
deep copies the node v onto this node. | |
| virtual std::ostream & | write_to_stream (std::ostream &os) const |
| Write this node and descendants into std::ostream. More... | |
| virtual iterator | begin () |
| return iterator to first child of this node More... | |
| virtual iterator | end () |
| return iterator to one after the last child of this node More... | |
| virtual const_iterator | cbegin () const |
| return const_iterator to first child of this node More... | |
| virtual const_iterator | cend () const |
| return const_iterator to one after the last child of this node More... | |
Protected Member Functions | |
| node (rapidjson::Value *value, rapidjson::Document *doc) | |
| Constructor. More... | |
| node () | |
| Default constructor. | |
| void | set_underlying (rapidjson::Value *underlying) |
| Inject underlying data pointer into node. | |
| void | set_document (rapidjson::Document *doc) |
| Inject rapidjson::Document pointer into node. | |
Friends | |
| class | iterator |
| class | const_iterator |
node represents an interface to a specific element in the underlying JSON data tree.
node is a thin wrapper of an underlying JSON data node, only made of weak pointers to such data and exposes the functions used to create or alter JSON data. For this reason, nodes can cheaply be returned by value. ATTENTION: Because the owner of the underlying JSON tree is esft::stor::document, a single node existence depends on the existence of document. For this reason, a node instance must not be used after its document owner has ceased to exist.
Some functions are only usable if the underlying data is either of type value, object or array, or a combination of them. If a certain functionality is invoked on the wrong node, a document_exception is thrown.
| esft::stor::node::node | ( | const node & | o | ) |
Shallow Copy constructor.
For deep copy, use json()(string) serialization/deserialziation mechanism or copy(node&)
|
protected |
Constructor.
| value | pointer to underlying data |
| doc | pointer to document (node tree owner) |
|
virtual |
Add int to array node.
| v | int value |
| document_exception | if node is not of type array |
|
virtual |
Add long to array node.
| v | long value |
| document_exception | if node is not of type array |
|
virtual |
Add double to array node.
| v | double value |
| document_exception | if node is not of type array |
|
virtual |
Add bool to array node.
| v | bool value |
| document_exception | if node is not of type array |
|
virtual |
Add string to array node.
| v | string value |
| document_exception | if node is not of type array |
|
virtual |
Add C string to array node.
| v | C string value |
| document_exception | if node is not of type array |
|
inline |
Add all items dereferenced from forward_iterator forw_it to array node.
| forw_it | forward iterator to items of an array node |
| begin | iterator pointing to beginning of range |
| end | iterator pointing to one after end of range. |
| document_exception | if node is not of type array |
|
inline |
Add all items from the vector v
to array node.
| item | item of an array node |
| v | vector of items |
| document_exception | if node is not of type array |
|
virtual |
Add array to array node.
| document_exception | if node is not of type array |
|
virtual |
Add object to array node.
| document_exception | if node is not of type array |
|
virtual |
Attempts to return the underlying data as Boolean.
This function may only be called on a value node, which is a node that is not an object node nor an array node. In JSON terms, it can only be used for leaf elements. ie: node = "true" -> ok node = {"a":"true"} -> not ok
| document_exception | if node is not of type value. |
|
virtual |
Attempts to return the underlying data as a C string paired with its actual length.
The actual length refers to the entire string, which may be exceed the first \0 character encountered. Having this length returned is necessary, as JSON can contain \0 (escaped as , different from \0 required by C), according to RFC 4627. If you know that the returned string will be a normal C string, then just invoke esft_stor_node_as_string
This function may only be called on a value node, which is a node that is not an object node nor an array node. In JSON terms, it can only be used for leaf elements. ie: node = "hello" -> ok node = {"a":"hello"} -> not ok
| document_exception | if node is not of type value. |
|
virtual |
Attempts to return the underlying data as Double.
This function may only be called on a value node, which is a node that is not an object node nor an array node. In JSON terms, it can only be used for leaf elements. ie: node = "1.0" -> ok node = {"a":1.0} -> not ok
| document_exception | if node is not of type value. |
|
virtual |
Attempts to return the underlying data as Integer.
This function may only be called on a value node, which is a node that is not an object node nor an array node. In JSON terms, it can only be used for leaf elements. ie: node = "1" -> ok node = {"a":1} -> not ok
|
virtual |
Attempts to return the underlying data as Long.
This function may only be called on a value node, which is a node that is not an object node nor an array node. In JSON terms, it can only be used for leaf elements. ie: node = "1" -> ok node = {"a":1} -> not ok
| document_exception | if node is not of type value. |
|
virtual |
Attempts to return the underlying data as a string.
This function may only be called on a value node, which is a node that is not an object node nor an array node. In JSON terms, it can only be used for leaf elements. ie: node = "hello" -> ok node = {"a":"hello"} -> not ok
| document_exception | if node is not of type value. |
|
virtual |
return iterator to first child of this node
|
virtual |
return const_iterator to first child of this node
|
virtual |
return const_iterator to one after the last child of this node
|
virtual |
Return true if size() == 0.
|
virtual |
return iterator to one after the last child of this node
|
virtual |
Check whether a member exists under.
| key | This function can only be used from an object node |
| key |
| document_exception | if called on a non object node |
|
virtual |
Check whether underlying data is an Array.
An Array is intended in the JSON sense of Array.
|
virtual |
Check whether underlying data is a Boolean.
|
virtual |
Check whether underlying data is a Double.
|
virtual |
Check whether underlying data is a Integer.
|
virtual |
Check whether underlying data is a Long.
|
virtual |
Check whether underlying data is Null.
An Null is intended in the JSON sense of Null, as in Empty. ie: {}, []
|
virtual |
Check whether underlying data is a Number.
Underlying data is a Number if it's either an:
|
virtual |
Check whether underlying data is an Object.
An Object is intended in the JSON sense of Object.
|
virtual |
Check whether underlying data is a String.
|
virtual |
replaces this node with the node resulting from parsing json
Shallow Copy assignment.
For deep copy, use json()(string) serialization/deserialziation mechanism or copy(node&)
|
virtual |
Set current value node underlying data to.
| v | |
| v | Integer to assign as new value to underlying data |
| document_exception | if node is not of type value |
| void esft::stor::node::operator= | ( | int64_t | v | ) |
Set current value node underlying data to.
| v | |
| v | Long to assign as new value to underlying data |
| document_exception | if node is not of type value |
|
virtual |
Set current value node underlying data to.
| v | |
| v | Double to assign as new value to underlying data |
| document_exception | if node is not of type value |
|
virtual |
Set current value node underlying data to.
| v | |
| v | Bool to assign as new value to underlying data |
| document_exception | if node is not of type value |
|
virtual |
Set current value node underlying data to.
| v | |
| v | String to assign as new value to underlying data |
| document_exception | if node is not of type value |
|
virtual |
Set current value node underlying data to.
| v | |
| v | C string to assign as new value to underlying data |
| document_exception | if node is not of type value |
|
virtual |
Attempts to return node with key 'key'.
This function can only be used on an object node
| key |
|
virtual |
Attempts to return node at index.
This function can only be used on an object node
| key |
|
virtual |
Add key-value to object node.
| k | key |
| v | int to assign to key |
| document_exception | if node is not of type object |
|
virtual |
Add key-value to object node.
| k | key |
| v | long to assign to key |
| document_exception | if node is not of type object |
|
virtual |
Add key-value to object node.
| k | key |
| v | double to assign to key |
| document_exception | if node is not of type object |
|
virtual |
Add key-value to object node.
| k | key |
| v | bool to assign to key |
| document_exception | if node is not of type object |
|
virtual |
Add key-value to object node.
| k | key |
| v | string to assign to key |
| document_exception | if node is not of type object |
|
virtual |
Add key-value to object node.
| k | key |
| v | C string to assign to key |
| document_exception | if node is not of type object |
|
virtual |
Remove the child node at key key
.
| const_iterator esft::stor::node::remove | ( | const_iterator | it | ) |
removes the member iterator it
points to and returns the iterator to item coming after the one deleted. If it
is equal to cend(), the behaviour is undefined.
| const_iterator esft::stor::node::remove | ( | const_iterator | first, |
| const_iterator | last | ||
| ) |
removes the members in the range [first, last) and returns the item coming after the one deleted.
|
virtual |
Removes all the children of this node.
|
virtual |
Return number of children for this node.
|
virtual |
Get or create in place object node under key.
| key | This function can only be called on an object node. If object node exists with |
| key,a | reference to it is returned. Otherwise, such object is added as a member to the underyling data, with key |
| key | ie: node = [1,2,3] -> not ok node = {"a":{"b": 1}} -> ok. with_key("a") returns {"b": 1} node = {"a":1} -> ok. with_key("b") makes {"a":1,"b":{}} and returns {} |
| key | parent of object |
| document_exception | if node is not of type object. |
|
virtual |
Get or create in place array node under key.
| key | This function can only be called on an object node. If array node exists with |
| key,a | reference to it is returned. Otherwise, such object is added as a member to the underlying data, with key |
| key | ie: node = [1,2,3] -> not ok node = {"a":[1,2,3]} -> ok. with_key("a") returns [1,2,3] node = {"a":1} -> ok. with_key("b") makes {"a":1,"b":[]} and returns [] |
| key | parent of array |
| document_exception | if node is not of type object. |
|
virtual |
Write this node and descendants into std::ostream.
| os | reference to std::ostream to write into |


I'm a media professional with over 12 years experience writing, editing, and producing science journalism for broadcast radio, television, and publication online. I love pushing the boundaries, and I'm learning to code as evidenced by this website which I built.


San Francisco Symphony to perform "Ghostbusters" score live alongside the film
by Rusty BlazenhoffLooking for something special to do with the family? The San Francisco Symphony has a fun ongoing film program where they put a popular movie on the big screen and their orchestra performs the score live. The next performance is for Ghostbusters on November 29 and 30, at Davies Symphony Hall. Adult tickets start at $65.
Future film nights with the symphony include:
December 3 and 6: It's a Wonderful Life
July 2 and 5 (2020): Apollo 13
And, San Francisco isn't the only one doing this. Check Film Concerts Live! for shows near you.


--- layout: post title: 'MySQL, PostgreSQL and RDS to API With Emergent One' url: http://apievangelist.com/2013/03/01/mysql,-postgresql,-rds-to-api-with-emergent-one/ image: http://kinlane-productions.s3.amazonaws.com/api-evangelist-site/blog/emergent-one-logo-horizontal.png ---
There are numerous companies, with existing IT infrastructure, who are looking to deploy APIs in 2013. These companies will be deploying APIs using their existing technology teams, or depending on one of the 17 API management service providers available.
This market is ripe for the 3Scale's of the world to provide valuable services to, but for many companies, organizations and government agencies who need to deploy APIs this year, API deployment will be about taking an existing database or multiple databases, and open them up to the public, partners, 3rd party developers or possibly just provide access to a remote department or branch of their company in the easiest way possible.
Not all companies will have the resources, or the need to deploy full blown API programs. They just need a dead simple database to API solution that will quickly expose their data over the web in a secure way. Until recently this solution wasn’t available in the cloud, but a new API service provider called Emergent One has stepped up to fill in the gap.
Emergent One is a cloud service that allows you to connect to your company's MySQL, PostgreSQL or Amazon RDS databases, then generate a REST API from your existing data stores.
Using Emergent One you can define a new API, connect to your database using an agent or direct connection, then define your API resources complete with meta data, sub-resources, in-line resources, fields and computed fields. Pretty much all you will need to make a clean web API from a database.
Once you have your API resources defined, Emergent One provides you with a developer portal around these APIs, and the ability to provide developer registration, then issue keys they can use to access your data--providing the openness you desire, while keeping things secure and within your control.
The developer portal is complete with documentation, explorer console and code libraries for iOS, Android and in Ruby. Emergent One allows you to bind your own DNS to your endpoints, and also provide paid plans, complete with billing management.
Emergent One is a perfect service for any company looking to develop and manage APIs from your local databases. The only thing I would say is missing is support tools, to help you interact with your developers after you launch your API. But I'm sure its coming.
I’m happy to see the Emergent One platform has a freemium tier giving you up to 5,000 API requests a month, a business tier for up to 2.5M requests a month, as well as an enterprise tier with sales support for all levels of needs. The freemium tier will be critical for businesses to play with, and get to know better.
The Emergent One admin needs a little polishing, it could use a more dashboard like feel for the home page, but overall the Emergent One team nails it! Providing dead simple, yet robust API deployment from your MySQL, PostgreSQL and Amazon RDS databases, in a way that anyone can put to use.
If your company is looking to deploy and API using a database, and don’t have the resources internally to make it happen, I definitely recommend taking a look at Emergent One.


Having support for your purchased item means that we will be available to you to iron out any potential issues you have in using the item.
The item support period
The item includes support for 6 months from the purchase date. If you’re about to purchase the item, you’ll have the option to purchase extended item support, increasing the item support period up to a maximum of 12 months from the date of purchase.
What else is included?
Answering questions about how to use the item Answering technical questions about the item (and included third party assets) Help with defects in the item or included third-party assets Item updates to ensure ongoing compatibility and to resolve security vulnerabilities Updates to ensure the item works as described and is protected against major security concerns Included version updates for all items
What’s not included in item support?
Item support does not include services to modify or extend the item beyond the original features, style and functionality described on the item page. For customization services that will help you tailor the item to your specific requirements, we recommend contacting us to see if we privately offer paid customization service.
- Installation of the item
- Hosting, server environment, or software
- Help from authors of included third-party assets
Contacting support
Support is provided Mon - Fri through item support page.


Syntax:
compute-restarts &optional condition => restarts
Arguments and Values:
condition---a condition object, or nil.
restarts---a list of restarts.
Description:
compute-restarts uses the dynamic state of the program to compute a list of the restarts which are currently active.
The resulting list is ordered so that the innermost (more-recently established) restarts are nearer the head of the list.
When condition is non-nil, only those restarts are considered that are either explicitly associated with that condition, or not associated with any condition; that is, the excluded restarts are those that are associated with a non-empty set of conditions of which the given condition is not an element. If condition is nil, all restarts are considered.
compute-restarts returns all applicable restarts, including anonymous ones, even if some of them have the same name as others and would therefore not be found by find-restart when given a symbol argument.
Implementations are permitted, but not required, to return distinct lists from repeated calls to compute-restarts while in the same dynamic environment. The consequences are undefined if the list returned by compute-restarts is every modified.
Examples:
;; One possible way in which an interactive debugger might present ;; restarts to the user. (defun invoke-a-restart () (let ((restarts (compute-restarts))) (do ((i 0 (+ i 1)) (r restarts (cdr r))) ((null r)) (format t "~&~D: ~A~%" i (car r))) (let ((n nil) (k (length restarts))) (loop (when (and (typep n 'integer) (>= n 0) (< n k)) (return t)) (format t "~&Option: ") (setq n (read)) (fresh-line)) (invoke-restart-interactively (nth n restarts))))) (restart-case (invoke-a-restart) (one () 1) (two () 2) (nil () :report "Who knows?" 'anonymous) (one () 'I) (two () 'II)) >> 0: ONE >> 1: TWO >> 2: Who knows? >> 3: ONE >> 4: TWO >> 5: Return to Lisp Toplevel. >> Option: 4 => II ;; Note that in addition to user-defined restart points, COMPUTE-RESTARTS ;; also returns information about any system-supplied restarts, such as ;; the "Return to Lisp Toplevel" restart offered above.
Side Effects: None.
Affected By:
Existing restarts.
Exceptional Situations: None.
See Also:
find-restart, invoke-restart, restart-bind
Notes: None.


Carnell-Rettgers Family History
Vietnam War Veterans
- Harold Lee Bassham (Navy)
- 1936 - 1990
- Service
- Ranks
- Kenneth Clifton Smith (Merchant Marine)
- Michael P Black (Navy)
- Paul Albert Angstadt (Navy)
- 1945 -
- Service not verified
- Donald Curtis Carnell (Army)
- Gregory Charles Cornell (Navy)
- 1952 - 1993
- Service
- Enlisted, 28 Feb 1972
- Discharged, 9 Feb 1978
- EM1 (not verified)
- Elmer Glenn Hickey (Army)


Welcome! The Quran in flask intends to provide a tutorial on steps to towards bring the Quranic text through Flask mico framemwork. There are two landing pages:
The project is located in the following github repository. Please fork and use the increamental releases to follow the steps towards a full functioning app
https://github.com/abdulbaqi/quranf
enjoy!


Jose Mourinho – club-by-club record
A look at Mourinho’s record at each of his former clubs.
Jose Mourinho has replaced Mauricio Pochettino as Tottenham manager.
Spurs, 14th in the Premier League, hired the former Chelsea and Manchester United manager to turn around their fortunes.
Here is a club-by-club record of the Portuguese’s managerial career to date.
Benfica (September 20, 2000 to December 5, 2000)
Played: 11
Won: 6
Drew: 3
Lost: 2
Win percentage: 54.55
Trophies: None
Uniao De Leiria (July 2001 to January 23, 2002)
Played: 20
Won: 9
Drew: 7
Lost: 4
Win percentage: 45.00
Trophies: None
Porto (January 23, 2002 to May 26, 2004)
Played: 127
Won: 91
Drew: 21
Lost: 15
Win percentage: 71.65
Trophies: Primeira Liga (2003, 2004); Portuguese Cup (2003); UEFA Cup (2003); Champions League (2004).
Chelsea (first spell: June 2, 2004 to September 20, 2007)
>
Played: 185
Won: 124
Drew: 40
Lost: 21
Win percentage: 67.03
Trophies: Premier League (2005, 2006); League Cup (2005, 2007); FA Cup (2007).
Inter Milan (June 2, 2008 to May 28, 2010)
Played: 108
Won: 67
Drew: 26
Lost: 15
Win percentage: 62.04
Trophies: Serie A (2009, 2010); Italian Cup (2010); Champions League (2010)
Real Madrid (May 31, 2010 to June 1, 2013)
Played: 178
Won: 128
Drew: 28
Lost: 22
Win percentage: 71.91
Trophies: Primera Division (2012); Copa del Rey (2011).
Chelsea (second spell: June 3, 2013 to December 17, 2015)
Played: 136
Won: 80
Drew: 28
Lost: 28
Win percentage: 58.82
Trophies: Premier League (2015); League Cup (2015).
Manchester United (May 27, 2016 to December 18, 2018)
Played: 144
Won: 84
Drew: 31
Lost: 29
Win percentage: 58.33
Trophies: EFL Cup (2017); Europa League (2017)


If your email address is recognised and valid, you’ll receive a notification with instructions about how to reset your password. If you do not receive a notification, please check your junk folder or try again.
If your email address is recognised and valid, you’ll receive a notification with instructions about how to reset your password. If you do not receive a notification, please check your junk folder or try again.


Sonia Gandhi will prune list, hope leaders
KPCC president Mullapally Ramachandran is against such a large forum and he has ensured that the leadership listens to his opposition.
by Cynthia ChandranTHIRUVANANTHAPURAM: Congress leaders expect changes on the list of proposed KPCC office-bearers, now before the high command, after the hue and cry over a jumbo panel.

It was evident when he vented his frustration against the factional pressures at the DCC presidents' meeting held here on Wednesday.
When he assumed office on September 19 last year, he had three working presidents, M. I. Shanavas, K. Sudhakaran and Kodikunnil Suresh. But the death of Mr Shanavas and the election of the other two to Lok Sabha left him alone.
Interestingly, the two MPs want to continue in their roles, which has not gone down well with the president and other leaders.
Besides, the two dominant factions suggested Thampanoor Ravi and V. D. Satheesan also in the same roles.
“What can we do when they tell the leadership they don’t have plans to step down? So we suggested only Mr Satheesan and Mr Ravi,” said a former president.
Mr Ramachandran only forwarded the lists given by Oommen Chandy, Ramesh Chennithala, MPs and his predecessors.
But a senior MP acted smart and gave three sets of lists to him and the AICC leadership.
Another former KPCC president said since complaints against the proposed jumbo list are mounting before the AICC, Congress president Sonia Gandhi will come up with a shorter list.
“Rahul Gandhi is expected to be back in New Delhi by Friday after which AICC organising general secretary K. C. Venugopal and his deputy in-charge of Kerala, Mukul Wasnik, will huddle together and finalise the list,” he told DC.


ARSENIC AND OLD LACE
November 12-21, 1982 at the Arabian Theatre
Director - Darlene Purcell & David Jones
Assistant to the Directors - Anita Boyd
THE CAST
Abby Brewster - Linda Nash
Rev. Harper - L.H. Walker
Teddy Brewster - Wess Hughes
Sgt. Brophy - Mike Perry
Officer Klein - Neil Russell
Martha Brewster - Fedwa Rahaim
Elaine Harper - Robin Rogers, Jayne Cooper
Mortimer Brewster - Jim Matheny
Mr. Gibbs - Don Crawford
Jonathan Brewster - Trey Carter
Dr. Einstein - Dwight Pitts
Officer O'Hara - Darryl MacDonald
Lt. Rooney - Herb Knotts
Mr. Witherspoon - Buzz Tanner
Taxi Driver - Robbie Everitt, Paul Wade


.entry-tittle
Page heading

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
 or
This is strongly emphasized text
This is bolded text
 or
This is emphasised text
This is italicised text
<s> or
This is emphasised text
This is italicised text
 or
This is emphasised text
This is italicised text

ExampleThere have been a number of sightings of a strange beast in or around Loch Ness in Scotland.
Truth: There is no scientific evidence that Nessy exists.
According to a number of eye-witnesses, a flying saucer crash-landed outside of Roswell, New Mexico in 1947.
Truth: There is no scientific evidence that Aliens or Flying Saucers exist.

Head Lay-about
Cat-nipper

| Row header | Row content |
|---|---|
| Row header | Row content |

Example| Row header | Row content |
|---|---|
| Row header | Row content |

ExampleIn order for evil to flourish, all that is required is for good men to do nothing.
- Edward Burke


PP and QQ
问题描述 :
PP and QQ were playing games at Christmas Eve. They drew some Christmas trees on a paper:
Then they took turns to cut a branch of a tree, and removed the part of the tree which had already not connected with the root. A step shows as follows:
PP always moved first.
PP and QQ took turns (PP was always the first person to move), to cut an edge in the graph, and removed the part of the tree that no longer connected to the root. The person who cannot make a move won the game.
Your job is to decide who will finally win the game if both of them use the best strategy.
输入:
The input file contains multiply test cases.
The first line of each test case is an integer N (N<100), which represents the number of sub-trees. The following lines show the structure of the trees. The first line of the description of a tree is the number of the nodes m (m<100). The nodes of a tree are numbered from 1 to m. Each of following lines contains 2 integers a and b representing an edge <a, b>. Node 1 is always the root.
The first line of each test case is an integer N (N<100), which represents the number of sub-trees. The following lines show the structure of the trees. The first line of the description of a tree is the number of the nodes m (m<100). The nodes of a tree are numbered from 1 to m. Each of following lines contains 2 integers a and b representing an edge <a, b>. Node 1 is always the root.
输出:
The input file contains multiply test cases.
The first line of each test case is an integer N (N<100), which represents the number of sub-trees. The following lines show the structure of the trees. The first line of the description of a tree is the number of the nodes m (m<100). The nodes of a tree are numbered from 1 to m. Each of following lines contains 2 integers a and b representing an edge <a, b>. Node 1 is always the root.
The first line of each test case is an integer N (N<100), which represents the number of sub-trees. The following lines show the structure of the trees. The first line of the description of a tree is the number of the nodes m (m<100). The nodes of a tree are numbered from 1 to m. Each of following lines contains 2 integers a and b representing an edge <a, b>. Node 1 is always the root.
样例输入:
2 2 1 2 2 1 2 1 2 1 2
样例输出:
PP QQ
#include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #include<algorithm> #include<string> #include<vector> #include<map> using namespace std; vector<int> gra[100005]; int sg(int now,int fa) { int sum=0; for(int i=0;i<gra[now].size();i++) if(gra[now][i]!=fa) sum^=sg(gra[now][i],now)+1; return sum; } int main() { // freopen("1.txt","r",stdin); int c; while(scanf("%d",&c)==1) { int n,x,y,sum=0; bool anti=1; for(int k=0;k<c;k++) { scanf("%d",&n); for(int i=n;i>-1;i--) gra[i].clear(); for(int i=1;i<n;i++) { scanf("%d%d",&x,&y); gra[x].push_back(y); gra[y].push_back(x); } int temp=sg(1,0); if(temp>1) anti=0; sum^=temp; } if(anti) { if(sum==0) printf("PP\n"); else printf("QQ\n"); } else { if(sum) printf("PP\n"); else printf("QQ\n"); } } return 0; }
(adsbygoogle = window.adsbygoogle || []).push({});
也许他们当时根本分不清两者的区别
顶一个 赞一个
递归还真是一门学问，学习了
其实国内大部分公司对算法都不够重视。特别是中小型公司老板根本都不懂技术，也不懂什么是算法，从而也不要求程序员懂什么算法，做程序从来不考虑性能问题，只要页面能显示出来就是好程序，这是国内的现状，很无奈。
算法是程序的灵魂，算法分简单和复杂，如果不搞大数据类，程序员了解一下简单点的算法也是可以的，但是会算法的一定要会编程才行，程序员不一定要会算法，利于自己项目需要的可以简单了解。
有没有C++编译的？
大哥，你复制也看看是不是这题的答案才复制吧。
网站不错，支持一个
88行是多余的，可以删除
学习了
我还有个问题想请教一下，就是感觉对于新手来说，递归理解起来有些困难，不知有没有什么好的方法或者什么好的建议？
先从简单的做起，归并排序，二叉树相关的遍历等
为什么for循环找到的i一定是素数叻，而且约数定理说的是n=p1^a1*p2^a2*p3^a3*…*pk^ak，而你每次取余都用的是原来的m，也就是n
.net中char类型不是两个字节么


You could think of HTML if you were writing a letter to a friend, just putting your text on the letter, with nothing else to spice things up. This gets the message across, but doesn't always appeal to the eyes. Add a few drawings, maybe change the writing to cursive & a splash of colour- there you have CSS. If you fill the envelope with glitter so when they open it they get a nasty surprise- there you have JavaScript.
Loops mean that you don't have to type the same repeatedly to get the same result.
These are achieved by using if/if else/else statements (conditional)
'while' loops & 'do' loops
&& switch statements/label statements/with statements.
A real life example of this being used could be something like
if derek = tired
a(go to sleep)
else
b( keep studying because god knows you need it and this javascript stuff is really hard)
The glue that ties everything together is called the document object model (DOM). Your DOM is an object representation of your entire workspace in your document. You can view the DOM through your browser & it represents all of your code in object form. Everything contained within the DOM is called a node- summoned by your browser.
Every HTML Element that you use has a javascript representation that backs it. By having an objrep you can not only access these elements in the DOM, but you can modify and create elements and add them while you work.
This could be especially helpful for seeing your live changes as you work without having to switch windows all the time.
The value of an array is that you can use them to store a collection of data; an example of some of the types of data you could store in your array are:
- Booleans (True / False)
- Integers (A whole number not surrounded by quotes)
- Strings (something surrounded by single or double quotes)
Arrays are defined in square brackets, and objects can be accessed with parenthesis or dot notation
If you have 1000 different entries of wind pressure from a wPS, they would go in an array. Once they are in the array you can iterate over the array and do something on each element, and the same thing on each other element. However conversely, each object is representitive of one whole thing. Say for instance I as a person am an object, the data stored inside my object properties could be my eyes, height, age, etc. But they are all different sets of data so we may want to use them in lots of different ways.
Functions are basically reusable pieces of code (containing a set of statements) that have conditional go-buttons for when they are required. There are lots of built in functions (we learnt some, for instance console.log, alert) but we can also create them for just about anything, and then called upon when needed. For instance:
function toCelsius(fahrenheit) {
return (5/9) * (fahrenheit-32); }
Is a function that converts Fahrenheight to Celcius, however you can also use functions as variable values:
var x = toCelsius(77);
var text = "The temperature is " + x + " Celsius";
This saves us a lot of time in the long run, not having to repeatedly type the same things over and over again and allows us to create much more useful applications with our code.


This project has been inspired by another great concept ngBoilerplate, allowing to create modern web applications in AngularJS. It follows all the best practices introduced in ngBoilerplate such as component/feature-oriented directory structure, intelligent build system, etc. However, I decided to improve it a little bit and create my own boilerplate from scratch since I missed some basic features like:
Please welcome ng-devstack!
console.log()
, multiple occurrences of 'use strict'
statement, etc.) from compiled JS code,


To see what you have so far, just open framework.html
in any HTMl5 compliant browser, such as Chrome, Safari, or Firefox. While writing code, you can refresh to page to see changes. Use the developer console of whatever browser you are using to see javascript errors and debug.
To add a file to the project, just create yourfile.js
in the js folder, and include it in framework.html
like this:
<!-- Include your files here -->
<script type="text/javascript" src="js/yourfile.js"></script>
All curve functions should be defined in this manner:
function CurveFunctionName(controlPoints, curvePoints)
controlPoints
is an Array
of objects that have x
and y
properties. So you can access each control point's x position like this: controlPoints[0].x
. The control points are the points that the user places on the screen.
curvePoints
is an Array
of objects in the same format. It is an output parameter which you must fill with the points defining the curve. The resolution of the curve depends on how many points you fill this array with. The points in this array will be connected with lines by the framework automatically. You could add a point to this array like this:
curvePoints.push({x: 10, y:10});
In order to see your curve function show up in the drop down list, you must add it yourself. To do this, edit main.js
and add the following:
JSGraph.AddCurveFunction("Curve Function Name", CurveFunctionName, minimumIterations, maximumIterations, showShells);
The first parameter is the string name to show in the drop down list. The second parameter is the function you want to be called in order to calculate that curve. minimumIterations
and maximumIterations
define the range of the iteration slider. It's up to you to figure out a good range for the curve you are using. It will take some experimentation. By default the graph will use the mean value of min and max. showShells
defines whether or not the shells should be drawn for this curve. Some of the curve functions don't have shells, so this should be set to false in those cases. It is true by default.
The JSGraph
has two other custom functions that can be defined, using JSGraph.SetShellFunction(func)
and JSGraph.SetKnotFunction(func)
respectively. Each takes as a parameter the function object to call when each item needs to be recalculated. The shell function takes these parameters:
function Shells(controlPoints, shellPoints, t)
Where controlPoints
is the same Array
as with the curve functions, and shellPoints
is the same as curvePoints
but is used for drawing the shells. t
is the current value of the T slider in the UI. The knot function looks like this:
function Knots(controlPoints, knotValues)
Where controlPoints
is the same Array
as before, and knotValues
is an Array
of values representing the knot sequence. knotValues
is an output parameter.
The framework comes with a few linear algebra functions that you may find useful.
function RowAdd(matrix, toRow, fromRow, fromRowScale)
matrix
- A 2d array of values
toRow
- The 0-based index of the row to add to
fromRow
- The 0-based index of hte row to add from
fromRowScale
- The scale to apply to fromRow
before adding (does not affect fromRow
)
function RowMultiply(matrix, row, scalar)
matrix
- A 2d array of values
row
- The 0-based index of the row to scale
scalar
- The scalar to apply to the given row
function RowReduce(matrix)
matrix
- A 2d array of values
Rref's the given matrix in place.
Many things about the framework can be configured via config.js
, including colors and line widths. It also allows you to enable the iteration slider, which is disabled by default.
That's it! If you have further questions about using the framework (not about the assignment!), email me at<EMAIL_ADDRESS>.


The following surveys are used to assess the security programs of third parties by credit unions interested in procuring new services or assessing the security stance of existing vendors. Vendors: Please consult your credit union point of contact to determine which surveys you need to complete.
The questionnaires cover the following topics:
- Web Application Security Questionnaire
- Security & Privacy Program Questionnaire
- Infrastructure Security Questionnaire
- Physical & Datacenter Security Questionnaire
Application bugs can be reported to the following Github repository. Any other feedback should be submitted at the end of each questionnaire.


Before Change
for i, label in enumerate(row_labels):
lang = get_language(label)
rows_by_language[lang].append(i)
all_languages = sorted(rows_by_language)
row_groups = [rows_by_language[lang] for lang in all_languages]
// Subtract the mean so that vectors don"t just clump around common
// hypernyms
for row_group in row_groups:
After Change
// Subtract the mean so that vectors don"t just clump around common
// hypernyms
orig_vecs -= orig_vecs.mean(0)
// Delete the frame we built, we won"t need its indices again until the end
del retroframe
vecs = orig_vecs
for iteration in range(iterations):
if verbosity >= 1:
print("Retrofitting: Iteration %s of %s" % (iteration+1, iterations))
vecs = sparse_csr.dot(vecs)
vecs -= vecs.mean(0)
// use sklearn"s normalize, because it normalizes in place and
// leaves zero-rows at 0
normalize(vecs, norm="l2", copy=False)


Bayes' Theorem
Here is how we can read it. The probability of the hypothesis (A) given (conditional) on a new piece of evidence (B) is equal to the probability of the evidence (B) given the hypothesis (A) multiplied by the prior probability of the hypothesis (A) divided by the prior probability of the evidence (B).
Ok, let’s stop right here. So I got the following task:
“Write about a topic you are finding particularly challenging. Do it in the form of a tutorial to help another aspiring data scientist to learn that topic.”
Not sure why that is, but probability (P) doesn’t come quickly to me, especially, Bayes’ Theorem. So I made the decision that I would create a blog about it to explain it to myself. If I can do that, it should help others. Now, googling that topic opens a whole world of youtube videos and blogs. Which doesn’t make it any easier.
So back to my task. There are several ways to approach Bayes’s Theorem, and the easiest one I found to help me make sense is a tree diagram. To understand the tree diagram for Bayes’ Theorem, let’s demonstrate it on an example. Assume that we have a group of teenagers (girls and boys) and we want to know how many do play soccer. We then would start drawing our tree diagram as follow:
Now depending on how many boys and girls we have in the group we can give each branch some weighting. Let’s say we have a group of 13 girls and 7 boys , from which some play soccer and others not . To visualize it on our tree diagram we are adding to each branch two more branches.
If a teenager plays soccer or not intersects whether or not they are a girl or a boy - denoted as for example. Which brings us to the conditional probability of soccer given it is a boy or a girl, eg. . Side note, if we write to describe the complement of S, we are saying “not playing soccer”.
By adding the new branches, we can view the first two branches as already happened. We are talking about the prior probability of the hypothesis and prior probability of the evidence .
However, before we are moving on, here are two helpful rules to help us solve a given problem.
- all values from each branch have to add up to 1
- we multiply all value going down a branch
Now, before we can answer any questions, we need some more information, given variables. Like, what is the ratio of girls and boys - which already have from above - and what is the likelihood that a boy or girl plays soccer like so,
So with that information, we can solve all our branches. Boys and girls which don’t play soccer, as well as our intersections. Note, that we can write our intersection as or , both are the same.
Ok, now we can ask questions, for example what is the probability that a girl plays soccer? Or in math terms, . With the conditional probability rule, we can break this up into
We know what our numerator is by looking at our tree diagram, . For the denumerator however, we need to find out the whole population playings soccer, both boys and girls, and add them together:
So now we can finally solve it:
The answer, the probability that a girl plays soccer from that group is 0.695 or 69.5%.
This is Bayes’ Theorem in a nutshell.


Preferred Method
Register with BC Services Card
- Safe & secure way to complete an online self-registration.
- Prepares you & your household for future emergencies.
- Access your profile anytime to view supports you have received.
- Update your details, as well as view current & past emergency events.
Register without BC Services Card
If you don't have a BC Services Card, you can still self-register as an evacuee.


--- layout: post title: Introducing the NServiceBus Second Level Retries date: 2012-05-23 08:14:59.000000000 +02:00 categories: - NServiceBus tags: [] status: publish type: post published: true meta: dsq_thread_id: '700562182' _edit_last: '1' author: login: andreas.ohlund email<EMAIL_ADDRESS>display_name: Andreas Öhlund first_name: Andreas last_name: "Öhlund" ---
In the latest release of NServiceBus (3.2) we have introduced the concept of Second Level Retries (SLR). We've always had retries in NServiceBus but those retries where aimed at transient errors like deadlocks and therefor performed instantly. Other more transient errors where just forwarded to a central error queue where they would be managed by the team maintaining the application. The SLR aims to solve the type of errors that can be classified as semi-transient. Examples would be a database being down for short period of time, a web-service being down for a few seconds etc. In previous versions of NServiceBus those errors would have been moved to the error queue but with SLR there is reasonably good chance that they will be retried successfully and there by not burdening the maintenance team.
As I mention in my post on errorhandling in a message oriented world retrying is potentially dangerous since while retrying no one will know about the problem and if the error is non-transient you could potentially retry forever. Bottom line is that retries risk breaking your SLA's without you even knowing about it. So as a rule of thumb you should only retry until you reach:
MaxRetryTime = SLA for the particular messagetype - (Current time - Time the message was sent) - Your average response time for failures sent to the error q
This will give you a chance to correct non-transient errors before you break your SLA.
NServiceBus will help you as much as it can by not retrying non-transient errors like deserialization exceptions etc but since we can't classify exceptions from user code this is of course not bullet proof.
I'm not going into the details on how to configure SLR since that is covered by the NServiceBus documentation:
We also included a sample that walks you through the full chain of error management in NServiceBus.
Happy retrying!


Bitcoin-Qt version 0.5.0 released
21 November 2011
Bitcoin-Qt version 0.5.0 is now available for download at: http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.5.0/
The major change for this release is a completely new graphical that uses the Qt user interface toolkit.
This release includes German, Spanish, Spanish-Castilian, Norwegian and Dutch translations. More translations are welcome; join the project at Transifex if you can help: https://www.transifex.com/projects/p/bitcoin/
Please report bugs using the issue tracker at GitHub: https://github.com/bitcoin/bitcoin/issues
MAJOR BUG FIX (CVE-2011-4447)
The wallet encryption feature introduced in Bitcoin version 0.4.0 did not sufficiently secure the private keys. An attacker who managed to get a copy of your encrypted wallet.dat file might be able to recover some or all of the unencrypted keys and steal the associated coins.
If you have a previously encrypted wallet.dat, the first time you run bitcoin-qt or bitcoind the wallet will be rewritten, Bitcoin will shut down, and you will be prompted to restart it to run with the new, properly encrypted file.
If you had a previously encrypted wallet.dat that might have been copied or stolen (for example, you backed it up to a public location) you should send all of your bitcoins to yourself using a new bitcoin address and stop using any previously generated addresses.
Wallets encrypted with this version of Bitcoin are written properly.
Technical note: the encrypted wallet’s ‘keypool’ will be regenerated the first time you request a new bitcoin address; to be certain that the new private keys are properly backed up you should:
-
Run Bitcoin and let it rewrite the
wallet.dat
file -
Run it again, then ask it for a new bitcoin address.
Bitcoin-Qt: Address Book, then New Address…
bitcoind: run the
walletpassphrase
RPC command to unlock the wallet, then run thegetnewaddress
RPC command. -
If your encrypted wallet.dat may have been copied or stolen, send all of your bitcoins to the new bitcoin address.
 IMPORTANT: be sure to request a new bitcoin address before backing up, so that the ‘keypool’ is regenerated and backed up.
“Security in depth” is always a good idea, so choosing a secure location for the backup and/or encrypting the backup before uploading it is recommended. And as in previous releases, if your machine is infected by malware there are several ways an attacker might steal your bitcoins.
Thanks to Alan Reiner (aka etotheipi) for finding and reporting this bug.
MAJOR GUI CHANGES
-
“Splash” graphics at startup that show address/wallet/blockchain loading progress.
-
“Synchronizing with network” progress bar to show block-chain download progress.
-
Icons at the bottom of the window that show how well connected you are to the network, with tooltips to display details.
-
Drag and drop support for bitcoin: URIs on web pages.
-
Export transactions as a .csv file.
-
Many other GUI improvements, large and small.
RPC CHANGES
-
getmemorypool : new RPC command, provides everything needed to construct a block with a custom generation transaction and submit a solution
-
listsinceblock : new RPC command, list transactions since given block
-
signmessage/verifymessage : new RPC commands to sign a message with one of your private keys or verify that a message signed by the private key associated with a bitcoin address.
GENERAL CHANGES
- Faster initial block download.


Home
Blog
(current)
Dropdown
Action
Another action
Something else here
Filter
Enter the new post details :
Author :
Title :
Contents :
Date :
Save


{% if object.avatar %}
{% else %}
{% endif %}
{{ object.quote }}
ABOUT
{{ object.bio }}
CURRENT AVAILABILITY TO JOIN A PROJECT
{{ object.get_availability_display }}.
APPLICATIONS I MANAGE
{% for app in application_list %}
{% include "includes/lists/object_block_base.html" with object=app %}
{% endfor%}
ACTION CLUSTERS I MANAGE
{% for actioncluster in actioncluster_list %}
{% include "includes/lists/object_block_base.html" with object=actioncluster %}
{% endfor%}
EVENTS I MANAGE
{% for event in event_list %}
{% include "includes/lists/object_block_base.html" with object=event %}
{% endfor%}
RESOURCES I MANAGE
{% for resource in resource_list %}
{% include "includes/lists/object_block_base.html" with object=resource %}
{% endfor%}
COMMUNITIES / ACTION CLUSTERS I MANAGE
{% for hub in hub_list %}
{% include "includes/lists/object_block_base.html" with object=hub %}
{% endfor%}


Common Data Visualisation Software Chart.js Fig.3.1 - Chart.js (Website) Chart.js is an open souce library which is best developed for small projects and hobbies. It consists of only six chart types and Chart.js makes interactive, flat designs; making it one of the best open-source libray for data visualisation. Tableau Fig.3.2 - Tableau (Website) Tableau is one of the most common software for data visualisation and it is free. The tool is really user-friendly and it is easy for users to transfer data into the software with real time update. D3 Fig.3.2 - Choropleth made on D3 (Website) D3.js is data visualisation tool on JavaScript library for dealing with documents based on information. It helps users to information to life using HTML, SVG, and CSS. It also allows the graphical data to be compatible on latest browsers. InstantAtlas Fig.3.3 - Mapping on InstantAtlas (Website) InstantAtlas provides users to create highly-responsive with constant changes and reports that mix statistics and map information to create best data visualisations. It is one of the best tool for mapping.


ezpp! browser extension allows you to calculate the osu! pp values for a given beatmap directly in the browser. Just go to a beatmap page and click the extension!
Output will be displayed here.


TMinc. focuses on the production advance, streamlining the tedious work of proper live event management.
Many breakthrough and middle-tier artists don’t have the opportunity to learn from an experienced road manager. This may cause artists to become stagnant, or worse, backslide in their attempts to reach that next level. TMinc believes proper production and tour management can start early and help artists realize their full potential.


🙏
github: github.com/mensfeld
www: mensfeld.pl
twitter: @maciejmensfeld
e-mail<EMAIL_ADDRESS>RubyGems is a package manager for the Ruby programming language.
Development of RubyGems started in November 2003 and was released to the public on March 14, 2004, or Pi Day 2004.
It was created by Chad Fowler and Richard Kilmer during RubyConf 2004
Please watch my Taking over a Ruby gem RubyKaigi 2019 presentation for live examples.
Not all of the risks are connected with malicious activities though.
Typosquatting, is a form of cybersquatting which relies on mistakes such as typos made by users when inputting a name.https://en.wikipedia.org/wiki/Typosquatting
and over 700 more
diff --git a/.ruby-version b/.ruby-version
index ecd7ee5..8e8299d 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.5.8
+2.4.2
diff --git a/damerau-levenshtein.gemspec b/damerau-levenshtein.gemspec
- s.required_ruby_version = ">= 2.5"
- s.name = "damerau-levenshtein"
+ s.required_ruby_version = ">= 2.4"
+ s.name = "damerau-levenstein"
- s.homepage = "https://github.com/GlobalNamesArchitecture/damerau-levenshtein"
+ s.homepage = "https://github.com/DarkWater666/damerau-levenshtein"
- s.add_development_dependency "activesupport", "~> 6.0"
- s.add_development_dependency "bundler", "~> 2.1"
- s.add_development_dependency "byebug", "~> 11.0"
+ s.add_development_dependency "activesupport", "~> 4.2"
+ s.add_development_dependency "bundler", "~> 2.0"
diff --git a/lib/damerau-levenshtein/version.rb b/lib/damerau-levenshtein/version.rb
- VERSION = "1.3.3"
+ VERSION = "<IP_ADDRESS>"
http://gavinmiller.io/2020/how-i-mitmd-rubygems-org-kinda/
Similar example but related to bitsquatting can be found in my Taking over a Ruby gem presentation from 2019.
There are:
Amongst those with more than 100 000 downloads
The event-stream module was originally by Dominic Tarr, who maintained the library before handing it to a contributor. Tarr indicated that he has not used the module and transferred its ownership after he received an email regarding its maintenance.
https://dgb.github.io/2019/04/05/bootstrap-sass-backdoor.html
- I couldn’t find <IP_ADDRESS> in the GitHub repo
- I couldn’t find any mention of the version in any issues or changelogs
- I couldn’t find any mention of the gem being yanked by the owners of the project
Account takeover is a form of identity theft and fraud, where a malicious third party successfully gains access to a user's account credentials.
rest-client 1.6.13
https://my.diffend.io/gems/rest-client/1.6.9/1.6.13/page/1#d2h-017072-851
Luckily for us, this one is going to be tackled in the upcoming weeks.
💪
This one is funny, because it's... accidental.
{
"data/config/access_token.txt.enc": {
"family": "application",
"full": "application/x-dosexec"
}
}
Huge subject on it's own so let's focus on one case:
What if I told you, that what you've uploaded to RubyGems month ago and what is being served right now are two different things?
There is always a possibility, that RubyGems is going to be hacked and that some of the gems content is going to be replaced.
Yoshitaka Sakurada, the minister for cybersecurity who recently confessed that he does not use computers, has now told a Diet committee that he is not very familiar with cybersecurity issues.
source 'https://rubуgems.org'
'у'.bytes => [209, 131]
vs
source 'https://rubygems.org'
'y'.bytes => [121]
IDN homograph attack
Unless a license that specifies otherwise is included, nobody else can use, copy, distribute, or modify that library without being at risk of take-downs, shake-downs, or litigation.
rm Gemfile.lock
bundle
bundle exec rspec spec
git add ./
git commit -m "gem bump"
git push origin master
vs
bundle outdated
bundle update XYZ
bundle exec rspec spec
git add ./
git commit -m "gem bump"
git push origin master
ENV.map { |a, v| [a,v] }.to_s
OSS supply chain security and management platform for Ruby applications
that is free :)
Diffend aims to analyze releases packages to find vulnerabilities and quality problems
Plan is to improve the ecosystem of gems releases, the same way we improve our code.
https://diffend.io/docs
ruby <(curl -s https://my.diffend.io/api/setup/ruby)
# or
curl https://my.diffend.io/api/setup/ruby \
-o /tmp/install.rb; \
ruby /tmp/install.rb
We're working on building a sandbox with modified MRI to analyze the system behaviour with new gems released.


Another house develops crack
by Special CorrespondentYet another house is said to have developed crack at Maradu near the Alpha Serene flat. Nedumparambil Jacob’s house is the affected one.
The crack was found in the kitchen at night on Monday, according to residents of the house.
It is adjacent to the house of Hari Sai, who had earlier reported a crack on the pillar under the stairs.
Alpha Serene is one of the four flats to be demolished as per the Supreme Court order for violating coastal zone regulations.
The houses that had developed cracks are separated only by a two-metre width space.
Sub Collector Snehil Kumar Singh, who is in-charge of Maradu flat demolition, told The Hindu that they had videographed about 20 houses on Monday and more houses would be videographed on Tuesday to ensure that there were no fake calls about cracks. The first crack that was examined by Mr. Singh on Friday would be repaired.
Maradu municipal chairperson T.H. Nadeera said she would visit the affected houses on Tuesday.