Posts

Understanding caching, persisting in Spark -

Image
can 1 please correct understanding on persisting spark. if have performed cache() on rdd value cached on nodes rdd computed initially. meaning, if there cluster of 100 nodes, , rdd computed in partitions of first , second nodes. if cached rdd, spark going cache value in first or second worker nodes. when spark application trying use rdd in later stages, spark driver has value first/second nodes. am correct? (or) is rdd value persisted in driver memory , not on nodes ? change this: then spark going cache value in first or second worker nodes. to this: then spark going cache value in first and second worker nodes. and... yes correct! spark tries minimize memory usage (and love that!), won't make unnecessary memory loads, since evaluates every statement lazily , i.e. won't actual work on transformation , wait action happen, leaves no choice spark, actual work (read file, communicate data network, computation, collect result driver, exampl...

ruby - Rails 4 - Bootstrap modal form - setup -

i'm trying follow this tutorial setup modal containing nested form in rails 4 app. i have models project , invite. associations are: project has_many :invites invite belongs_to :project in views projects folder, have made partial called new_invitation.html.erb <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3 id="mymodallabel">modal header</h3> </div> <div class="modal-body"> **here comes whatever want show!** </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">close</button> <button class="btn btn-primary">save changes</button> </div> i'm trying link from project show page, has: <%= link_to 'invite team mates', ...

javascript - firebase.auth().createCustomToken is undefined on web app -

i'm trying create "remember me" function web app uses firebase. my goal when user clicks "remember me" , logs in successfully, authentication token stored using localstorage , logged in automatically on next visit (i prefer storing raw credentials in localstorage security purposes). however, when tried call firebase.auth().createcustomtoken got error saying not exist. wrong approach or wrong function call firebase? thanks! here sample of code: var customtoken = firebase.auth().createcustomtoken(user.uid); localstorage.setitem("savedtoken", customtoken); then later plan use line sign in: firebase.auth().signinwithcustomtoken(localstorage.getitem("savedtoken")).then(function() { firebase.auth().createcustomtoken available in server api. to authenticate email & password , token session, try this: firebase.auth().signinwithemailandpassword(email, password) .then(function(user) { user.gettoken().then(functi...

Colors are not concatenating correctly in Sass -

i trying concatenate 2 colors in sass: $helloworld: pink; $secondstring: red; p { color:$helloworld + $secondstring; } but result is: p { color: pink; } why aren't colors concatenating produce pinkred ? this because sass treats colors hex value, regardless if they're named pink . they're hex values under hood. per sass documentation : colors any css color expression returns sassscript color value . includes a large number of named colors indistinguishable unquoted strings. the emphasis mine. documentation states color value returned, hex value. included link shows named colors such pink hex values under hood. address adding issue, refer documentation again: color operations all arithmetic operations supported color values, work piecewise. means operation performed on red, green, , blue components in turn. example: p { color: #010203 + #040506; } computes 01 + 04 = 05, 02 + 05 = 07, , 03 + 06 = 09 , , compiled ...

git - how to do bisect to find a good commit from upsteam linux kernel? -

i using bisect find commit fix s4 issue upstream kernel codes. meet confusing issue when : git bisect start git bisect bad v4.8-rc1 git bisect v4.7 it take 13 steps finish result . but found bisect choose commits older v4.7 tag , normal ? in opinion ,bisect should choose commits between v4.7 tag , v4.8-rc1 tag judging time line . in opinion ,bisect should choose commits between v4.7 tag , v4.8-rc1 tag judging time line . this not bisect do. bisect choose commits contained in tag v4.8-rc1 , not contained in tag v4.7. differ if e.g. branch created v4.6 , changes committed before v4.7 created - branch not merged v4.7. in kernel development there might lot of changes have been committed quite time before have been merged. date of commits before v4.7, changes not contained in v4.7. it important bisect behaves way , not based on time used find commit introduced problem. can happen commit created before "good" version not contained yet. if hav...

python - Install Paramiko Errors -

i trying install paramiko. following errors. traceback (most recent call last): file "/usr/bin/pip", line 9, in <module> load_entry_point('pip==1.5.6', 'console_scripts', 'pip')() file "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 558, in load_entry_point return get_distribution(dist).load_entry_point(group, name) file "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2682, in load_entry_point return ep.load() file "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2355, in load return self.resolve() file "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2361, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) file "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module> pip.vcs import git, mercurial, subversion, bazaar # noqa...

javascript - How do you prevent nested queries/catches in sequelize? -

i think i'm preventing nested queries as possible, i'm not sure. understand calls here can executed in single select query, did simplify example. // example in typescript // find user user.find({where:{username:'user'}}) // if found user .then(function(user) { return user.find({where:{username:'other_user'}}) // if found other_user .then(function(other_user) { // stuff return whatever_i_need } // if went wrong, go straight parent catch .catch(function(err) { // stuff throw new error() } } // if previous .then() returned success .then(function(data) { return user.find({where:{username:'yet_another_user'}}) // if found yet_another_user .then(function(yet_another_user) { // stuff return whatever_i_need_again ...