This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-08
Channels
- # aws (9)
- # beginners (69)
- # boot (14)
- # cider (26)
- # cljs-dev (56)
- # cljsrn (9)
- # clojars (4)
- # clojure (229)
- # clojure-brasil (1)
- # clojure-france (11)
- # clojure-greece (2)
- # clojure-italy (4)
- # clojure-mke (6)
- # clojure-serbia (6)
- # clojure-spec (83)
- # clojure-uk (38)
- # clojurescript (171)
- # core-async (3)
- # cursive (11)
- # data-science (11)
- # datomic (27)
- # emacs (113)
- # funcool (6)
- # hoplon (4)
- # jobs (1)
- # luminus (13)
- # lumo (44)
- # off-topic (148)
- # onyx (5)
- # overtone (1)
- # pedestal (4)
- # powderkeg (1)
- # proton (2)
- # re-frame (150)
- # reagent (16)
- # ring-swagger (43)
- # spacemacs (4)
- # specter (36)
- # vim (4)
- # yada (10)
Never thought of that... What's a web browser like vertically? When I see people with vertical screens, it seems odd.
Has anyone found a way on macOS Sierra to remap CapsLock to Control (when used as a modifier key) and to Escape (when pressed quickly)?
It used to work with Karabiner on earlier versions of macOS
https://www.keyboardmaestro.com/main/ seems to support it but it's 40 EUR !
@pesterhazy https://9to5mac.com/2016/10/25/remap-escape-key-action-macbook-pro-macos-sierra-10-12-1-modifier-keys/ - the mapping to esc
@qqq, exatly
@gmercer that's a good first step, but it gives me either control or escape, not both (which is the holy grail)
@pesterhazy the real magic may be deeper in KeyBindings http://stackoverflow.com/questions/40932684/catch-and-change-keyboard-on-mac-sierra-to-emulate-neo2-keyboard-layout/41004544#41004544
all so easy on linux: https://github.com/alols/xcape
macOS sometimes feels like the Windows of the 90s, with all kind of shareware needed to be productive
from previous ... The text system supports the specification of multiple keystroke bindings through nested binding dictionaries. For instance, Escape could be bound to cancel: or it could be bound to a whole dictionary which would then contain bindings for the next keystroke after Escape.
I'm now using Keyboard Maestro, which does work (but boy is it pricey)
Hey, guys!! I have just written another article about Javascript. Let me know what you think π https://medium.com/@flaviohfreitas/javascript-save-time-by-avoiding-re-writing-these-common-functions-266835c0bf68
@pesterhazy : think this can be solved in 30 lines of swift
Pretty sure they did that solely to spite / prevent Windows installations on their hardware
Ctrl-Shift-Esc comes to mind - that's the combo for bringing up the task manager directly
But a lot of applications use the Esc key to implement functions equivalent to 'cancel'
If they relly want to piss off Windows, they sholuld (1) only have backspace, no delete or (2) only one of ctrl/alt
I have a TV, which when mounted horixontally, uses 400mmx 200mm. Suppose I mount it vertically at 200mmx400mm, would there be problems? (My main concern is that the VESA mount on the TV is intended to only carry weight in one direction; and now I'm applying force in a perpendicular direction
TBH, the lack of F keys on a macbook is already pretty rage-inducing for your average Windows user π
USB Esc key seems like itβd be a thinkgeek april fools product
so does a laptop for programmers that lacks an esc key
This is why our company suddenly backed down from moving onto MacBooks as our standard dev laptop
i use ?-[ but i can't remember what ? is away from my keyboard, maybe ctrl. works everywhere.
too bad itβs so hard to hit one handed though
fortunately i have 2 hands :). found it, ^[ = ESC. invaluable if you have to switch from mac/window/linux frequently.
the only time I use F keys is when switching virtual consoles in linux but most of the Windows users I know perfer them over chorded keys
now that I look at the standard PC keyboard again, it's actually pretty hard to press Ctrl+R...... I remapped my Ctrl key to whatever next to the spacebar.
@mobileink : btw, I'm still waitingon that polymer library of yours
you can take a look at some demos at https://github.com/miraj-project/demos/tree/master/hello-world
i'll be uploading revisions today but that code will give you some idea. docs are outdated .
one thing that is done is the sugar: :#foo = id="foo", #.bar => class="bar", #!baz => boolean attrib. so:
(h/span :#foo.bar.baz!centered "hello")
=> <span id="foo" class="bar baz" centered>hello</span>
. not earth shattering but kinda nice imho.also:
(h/span :#foo {:miraj.style/color "red" :miraj.syle/hover {:color "green"}} "hello")
does the right thing.so it's not really an atom, but it's related or similar in some way. to what extent need the name reflect the semantics?
fwiw, i'm only half unserious - i spend waaay too much time thinking about names. but in the end i think it's worth it.
Regarding @hiredman's point about stale reads... Isn't it the case that threads in Clojure can also have stale content? Due to persistent structures? But because the structures are persistent, it's okay because we're working with a stable version of the value? And if we want to commit a new value, it won't commit unless the working value lines up with the latest value, right?
no, you can't get stale reads with an atom, once you have swapped in a value(or even reset! a value), all derefs after that (determining what after means here can be problematic) will read that
@hiredman But, to clarify, when I say a "subscriber swaps," that subscriber sends the function to do the swapping to the owner.
if you send the function, js is single threaded, need to really even do a compare, just apply the function producing the new value and move on
if you actually want to do the cas, the thing to do is read the old value, apply the function to it, then send cas old-value new-value to whatever owns the reference, then get a succeeded/failed value back, and try again if it failed
what if the subscribing context wants to update the atom, conditionally, based on the current value? If they issue the fn with an incorrect assumption of the current value...
@hiredman That's what I'm doing. The swap function is just built on top of that process.
@mobileink yeah, but in js, workers def have their own bits and bytes. You can't view others' values without passing messages.
@mobileink core.async's go blocks are not interleaved and are cooperative, so unless you actually do an async operation some other "thread" isn't going to run in the middle of whatever you are doing
@hiredman oh, that's not exactly what I'm doing... why do you want to have the execution local, and then update the remote context?
be the time you send the message it may have changed, which is why the cas message includes old and new values
so the "owner" gets the cas message, can determine if the cas is valid to run or not
if it is not valid it replies "not valid" and the send of the cas has to re-read and try again
doesn't cooperative imply interleaved? sorry to be dense, i'm thinking coroutines. not much point to it if no interleaving (by which i mean sth like dispatching to other "threads").
right but that is not inconsistemt with interleaving (depending on how you understand the latter).
coroutines are cooperative in the sense that another coroutine won't just randomly run in the middle of the coroutine that is currently running
if I write a go block with a hot loop that never calls any of the parking ops, on clojurescript, nothing else will ever run
there will be the single js thread, executing my hot loop, and core.async doesn't "yield" to other "threads" unless you do async ops
that's what i understand by "interleaving" - it does not imply preemptive scheduling.
but interleaving won't happen unless you let it, so if you have a section of code that is adverse to interleaving, don't let it
sure they can, you have that shared communication channel that passes messages with the ui thread
So, I do plan on implementing a callback queue... what do you mean by "park" in this context though?
@hiredman exactly. i guess my point is there are 2 kinds of interleaving, preempitive and not. concurrency is consistent with single thread if you have coroutines, no?
@mobileink : so to see the demos, I have to check out the rep oand open it locally?
I wonder if there's some way where these demos can be hosted, online, as a webpage or something
to clarify : there are also 2 notion of thread here. one is the machine, the other is program text.
I suggest some kind of launch worker function and then a nice core.async api on top of however you pass messages back and forth
I'm thinking about supporting returning chans on mutation operations, as an extra feature.
@qqq: like i said it's killing me. the goal is to get templates in place so you can easily start futzing with it, or you can fork/clone demos and play. i gave the ref just so you can inspect the code until i get that done. Real Soon Now. Rilly!
@hiredman do atoms have queues? How does Clojure repeatedly
swap on an atom, say, with inc
, without each swap waiting for the new value of the atom?
ah, and all the swaps are synchronously executed on a particular thread, so they aren't competing.
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/atomic/AtomicReference.html
So, since all of my mutation operations occur asynchronously, every call to swap immediately populates the calling function with the old-val
which is what I did with my agent proof of concept. Wasn't sure if i'd need it for the atom-like thing
since we're talking about program text, you could also borrow a term from https://en.m.wikipedia.org/wiki/List_of_sewing_stitches
I would suggest you read up on compare-and-swap, if you don't understand what it does (the fencing behavior, beyond just writing new contents to memory) then it is very unlikely you will implement it correctly
@hiredman I have been researching CAS and I plan to dig in more. Thanks for all the advice. I really appreciate it.
likewise @mobileink