Posts

How to use autoclose brackets in Jupyter notebook? -

this may sound silly question, how make use of autoclose brackets in jupyter notebook? example, when type print( jupyter notebook auto-closes brakets print() and places cursor inside. type argument, say print(1 + 1) now cursor between second 1 , right bracket ) . key navigate right of ) ? of course can press end or → or ) achieve this, not seem save time, purpose of brackets autoclose suppose? thanks in advance.

git - What are the pitfalls of "always" rebasing? -

a few people @ work swear git pull --rebase . in fact, won't git pull without it, when several people working on shared branch. it understanding rewrites history . in fact, have seen said 1 should never rebase on public/shared branch . my question: what concrete example of way rebasing "rewrites history"? what concrete examples of bad things occur if violate "golden rule of rebasing"? possible difference suggested dupe: i'm not talking rebasing master feature branch. talking several developers working on same feature branch, doing git pull --rebase , making changes, pushing (doing pull --rebase if push rejected), etc. we use in our workflows. if use on short-lived branches it's relatively safe. you're replaying your local commits (rewriting that history) on top of pushed commits of coworkers. if you're rebasing entire collaboration branch in best interests coordinate coworkers. otherwise it's easy lose work...

Python- Calling elements from a list returns wrong ones -

from list, shuffle: rotationspeedarray = [4,6,8,10] #in hz random.shuffle(rotationspeedarray) i try call 1 specific number @ time, print rotationspeedarray[0] print rotationspeedarray[1] print rotationspeedarray[2] print rotationspeedarray[3] but whenever this: #an actual empty space [ 6 , the code part meant draw figure , rotate it. want different speeds, that's why created list takes 1 of rotation speeds , uses it. figure moves each trial @ different speed, process of taking 1 value @ time works. don't why whenever ask show me each value of list, this. i hope sufficiently clear; please don't hesitate asking me question. i'm having no problems. sure you're not surrounding converting list string somewhere down line?? it's treating rotationspeedarray string, why ask. random.shuffle throw typeerror if had put quotes around list, i'm assuming there code you're not showing somewhere past converting string? import random rota...

How to detect an CTS approved Android build? -

in documentation of android n preview mentioned: this build not compatibility test suite (cts) approved. apps depend on cts approved builds won’t work (android pay example). in android app want check whether device/build cts approved on first launch. possible? how android pay it? the safetynet api allows run compatibility check which: allows app check if device running matches profile of device has passed android compatibility testing. compatibility check creates device profile gathering information device hardware , software characteristics, including platform build. once have connected googleapiclient using safetynet.api , can call byte[] nonce = getrequestnonce(); // should @ least 16 bytes in length. safetynet.safetynetapi.attest(mgoogleapiclient, nonce) .setresultcallback(new resultcallback<safetynetapi.attestationresult>() { @override public void onresult(safetynetapi.attestationresult result) { status status = result.getstatus(); ...

javascript not working in embed svg file -

i start learning svg. got example code manipulating svg documents using ecmascript (javascript) , dom . change little: <!doctype html> <html> <body> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300"> <script type="text/ecmascript"> <![cdata[ function changerectcolor(evt) { var red = math.round(math.random() * 255); evt.target.setattributens(null,"fill","rgb("+ red +","+ red+","+red+")"); } ]]> </script> <g id="firstgroup"> <rect id="mybluerect" width="100" height="50" x="40" y="20" fill="blue" onclick="changerectcolor(evt)"/> <text x="40" y="100">click on rectangle change it's color.</text> </g> </svg> <...

javascript - Rails 4: dynamically added checkboxes are not submitting -

i started learn rails , try apply ajax records added dynamically in listing. want delete multiple records selected via checkboxes directly in listing. it works fine not when create new record , want delete without refreshing page . header's response : "activerecord::recordnotfound in accountscontroller#destroym". acts if click button without checking checkboxes. thanks :) accounts_controller.rb def destroym account.destroy(params[:delete]) respond_to |format| format.html {redirect_to accounts_path} format.js #render accounts/destroym.js.erb end end _row.html.erb <% @data = account.find(id) %> <tr id='tr<%= @data.id %>'> <td><%= @data.id %></td> <td><%= @data.login %></td> <td><%= check_box_tag 'delete[]', @data.id %></td> </tr> index.html.erb <table class="table table-striped table-hover " id="accountslisti...

assembly - I'm trying to make an array and sort it with a sentinel value which is 0 but it's not working it's giving me an error -

i want prompt user input want take input , put array. want print out array. know can print them out without putting them in array practice. .data array: .space 40 prompt: .asciiz "enter integer (0 quit) :" text: .asciiz "after sorting, list of integers is:" .text .globl main main: la $a1, array read_numbers: li $v0, 4 la $a0, prompt syscall li $v0, 5 syscall sw $v0, 0($a1) addiu $a1, $a1, 4 beqz $v0, sort j read_numbers sort: la $a1, $array li $v0, 4 la $a0, text syscall loop: lw $t0, 0($a1) addiu $a1, $a1, 4 beqz $t0, done li $v0, 1 move $a0, $t0 syscall j loop done: the error i'm having is: instruction references undefined symbol @ 0x00400050 [0x00400050] 0x3c010000 lui $1, 0 [$array] ;24: la $a1, $array