Posts

javascript - Circle Icon Overflowing Toolbar in React Native -

Image
i trying circled icon in toolbar positioned (see star icon below): does know how using react native's toolbarandroid, or whether possible? thank

javascript - RxJS: Debounce with regular sampling -

i have observable emits stream of values user input (offset values of slider). i want debounce stream, while user busy sliding, emit value if nothing has come through for, 100ms, avoid being flooded values. want emit value every 1 second if endlessly debouncing (user sliding , forth continuously). once user stops sliding though, want final value debounced stream. so want combine debounce regular "sampling" of stream. right setup this: const debounce$ = slider$.debouncetime(100), sampler$ = slider$.audittime(1000); debounce$ .merge(sampler$) .subscribe((value) => console.log(value)); assuming user moves slider 2.4 seconds, emits values follows: start end (x)---------|---------|---(x)|----| | | | | 1.0 2.0 2.5 3.0 <-- unwanted value @ end ^ ^ ^ sample sample debounce <-- these i don't want value emitted @ 3 secon...

linux - Bash script entrypoint (PID=1) kills `tail` sub process ONLY if a fake trap (which does NOTHING) was there -

i facing strange behavior in bash script, have bash script running pid 1 (it entrypoint docker container, if not familier docker, assume can ignore info). when run following script, sigterm terminates quickly, , seems fine (please keep in mind sshd service not exist! whole system starts script runs tail nothing more, till not problem). #!/bin/bash trap "pkill sshd" sigterm export path=/usr/local/samba/bin/:/usr/local/samba/sbin/:$path if [ -f /usr/local/samba/etc/smb.conf ]; exec /usr/local/samba/sbin/samba -i else tail -f /dev/null & wait ${!} fi the problem comes when delete trap . system hangs, , seems because tail till running , not end reason. (if familier docker, docker waits 10 seconds, , kill container, because didn't respond sigterm , again if not familier docker, ignore info). #!/bin/bash export path=/usr/local/samba/bin/:/usr/local/samba/sbin/:$path if [ -f /usr/local/samba/etc/smb.conf ]; exec /usr/local/sam...

How do I sort a list of dictionaries by last name of the dictionary in Python? -

i need write sort_contacts function takes dictionary of contacts parameter , returns sorted list of contacts, each contact tuple. the contacts dictionary passed function has contact name key, , value tuple containing phone number , email contact. contacts = {name: (phone, email), name: (phone, email), etc.} the sort_contacts function should create new, sorted (by last name) list of tuples representing of contact info (one tuple each contact) in dictionary. should return list calling function. for example, given dictionary argument of: {("horney, karen": ("1-541-656-3010", "karen@psychoanalysis.com"), "welles, orson": ("1-312-720-8888", "orson@notlive.com"), "freud, anna": ("1-541-754-3010", "anna@psychoanalysis.com")} sort_contacts should return this: [('freud, anna', '1-541-754-3010', 'anna@psychoanalysis.com'), ('horney, karen...

css - Use Dot Before Var in SCSS -

this scss works if remove dot before #{$i}s . @for $i 1 through 9 { #a#{$i} { animation-duration: .#{$i}s; } } however, when include dot, gulp gives me error: error: invalid css after "...ation-duration:": expected expression (e.g. 1px, bold), ".#{$i}s;" on line 3 of app/sass/_common.scss >> animation-duration: .#{$i}s; -------------------------^ i need dot because want .1s , .2s , .3s , on. how make work? i way: animation-duration: $i * 0.1s;

osx - How can I implement Java/Swing controls that are disabled until after the window is activated? -

i implementing java/swing application macos, common mouse button related behavior disabled until window activated. in other words, when mouse button pressed on inactive window, window activated nothing else happens. (there exceptions. buttons when clicked activate window , run normal action.) there way this? basic problem time application gets mouse pressed event, window active. thought far correlate window activated event , mouse pressed event time, might not reliable. you can make button's contains() depends on frame's active or not: final jframe frame = new jframe(); jbutton button = new jbutton() { @override public boolean contains(int x, int y) { return super.contains(x, y) && frame.isactive(); } }; when frame deactive , region of button clicked, button won't accept mouse event since contains() returns false, button's parent tested contains() instead (and parent's parent until returns tru...

mysql - Sql query count duplicates while grouping them -

i have issue when grouping values in sql.i want count duplicate values each product.also sum qty , cost separately per quarter.i have posted photos below understand better want achieve. i have applied query based on experience , web: select products,quarter,count(quarter) table-name group products,quarter; but output incorrect. check sample in link below http://sqlfiddle.com/#!9/b24863/1 giving few hints: - sum: aggregation function can used summation - count: used counting in order sum qty, cost per quarter, query can be: select quarter, sum(qty), sum(cost) tablename group quarter to stats per product , quarter, query can be: select products, quarter, sum(qty), sum(cost) tablename group products, quarter