And yes, at TRB GmbH, we do pay people to work on OSS
- Feb 2021
-
trailblazer.to trailblazer.to
-
-
Using a terminus to indicate a certain outcome - in turn - allows for much stronger interfaces across nested activities and less guessing! For example, in the new endpoint gem, the not_found terminus is then wired to a special “404 track” that handles the case of “model not found”. The beautiful thing here is: there is no guessing by inspecting ctx[:model] or the like - the not_found end has only one meaning!
-
termini (or “ends” as we used to call them).
-
A major improvement here is the ability to maintain more than two explicit termini. In 2.0, you had the success and the failure termini (or “ends” as we used to call them). Now, additional ends such as not_found can be leveraged to communicate a non-binary outcome of your activity or operation.
-
Yes, Trailblazer is adding new abstractions and concepts and they are different to the 90s-Ruby, but now, at the latest, it becomes obvious how this improves the developing process. We’re no longer talking in two-dimensional method stack traces or byebug hoops, the language and conception is changing to the actual higher level code flow, to activities sitting in activities structured into smaller step units.
-
To tell you the truth, the new tracing feature was the original reason why I decided to write 2.1 and make you sit and wait in agony for years. Nevertheless, tracing is simply blowing my mind. I can’t count how many hours and angering rushs of adrenaline I’ve saved since the introduction of the wtf? method and its helpful higher-level stack trace.
-
-
The new 2.1 version comes with a few necessary but reasonable changes in method signatures. As painful as that might sound to your Rails-spoiled ears, we preferred to fix design mistakes now before dragging them on forever.
-
The new call API is much more consistent and takes away another thing we kept explaining to new users - an indicator for a flawed API.
-
We try to keep the “information architecture” - a word I wouldn’t have learned without the inspiring Alex Coles - as simple as possible: so far, we got a handful of pages accessible through the top navigation, and then the documentation behind the DOCS link. Here, the right sidebar helps you to navigate within the chapter.
-
To make it short: we returned to the Rails Way™, lowering our heads in shame, and adhere to the Rails file and class naming structure for operations.
-
I feel how needed those new abstractions are. Yes, you can write everything with your own code, you don’t need abstractions for flow control and automatic error handling, which makes me wonder why you’re not programming in assembler since Ruby is also an “unnecessary abstraction” on top of a processor. We need abstractions, unless you want to program like we did 30 years ago.
-
Also, the more I use Trailblazer in projects or even in Trailblazer itself, I feel how needed those new abstractions are.
-
ather, data is passed around from operation to operation, from step to step. We use OOP and inheritance solely for compile-time configuration. You define classes, steps, tracks and flows, inherit those, customize them using Ruby’s built-in mechanics, but this all happens at compile-time. At runtime, no structures are changed anymore, your code is executed dynamically but only the ctx (formerly options) and its objects are mutated. This massively improves the code quality and with it, the runtime stability
-
It’s so simple that I sometimes wonder why it took years to develop it!
-
There is nothing wrong with building your own “service layer”, and many companies have left the Traiblazer track in the past years due to problems they had and that we think we now fixed.
-
The work put into Trailblazer 2.1 has been tremendous, it could easily have been TRB 3.0, or even TRB III, since Roman version numbering turns out to be quite a fancy thing to do. However, as much as the internals have been improved, as little has changed on the public APIs of Trailblazer, so we decided to go with a minor release.
-
We removed the trailblazer-loader gem just like Apple removed the headphone jack from the iPhone 6. This brings you faster startup and consistency with Rails autoloading.
Tags
- interfaces (programming)
- Ruby
- better late than never
- more than one right way (no one right/best way)
- non-binary
- how did we ever live without it?
- software preferences are personal
- analogy
- job: benefits
- pointing out gaps/downsides/cons in competition/alternatives
- funny
- state charts
- fix design/API mistakes as early as you can (since it will be more difficult to correct it and make a breaking change later)
- learn from your mistakes
- abstractions
- unambiguous
- newer/better ways of doing things
- recant/retract/revert/withdraw your previous plans
- immutable data
- documentation
- open-source software: progress seems slow
- debugging
- naming
- programming: return values / result objects that communicate a more precise/complete representation of the outcome
- if it's incorrect; fix it
- do it right/well the first time because it may be too hard to clean up/fix later if you don't
- getting paid to work on open-source software
- release announcement
- very simple/small result/change in the end but took a lot of work/time to arrive there
- shift in preference
- name changes
- advantages/merits/pros
- strong (extreme/great/high/intense degree/level/concentration/amount/quality of)
- improvement
- admit the limitations/shortcomings of your argument/benefits
- rails: the Rails way
- version numbers
- Trailblazer
Annotators
URL
-
-
www.merriam-webster.com www.merriam-webster.com
Tags
Annotators
URL
-
-
www.merriam-webster.com www.merriam-webster.com
Tags
Annotators
URL
-
-
www.merriam-webster.com www.merriam-webster.com
-
16! most different definitions I've ever seen (that I remember)
-
-
2019.trailblazer.to 2019.trailblazer.to
-
We use a subset of BPMN for the visual language in the editor, but added our own set of restrictions and semantics to it.
-
note that TRB source code modifications are not proprietary
In other words, you can build on this software in your proprietary software but can't change the Trailblazer source unless you're willing to contribute it back.
loophole: I wonder if this will actually just push people to move their code -- which at the core is/would be a direction modification to the source code - out to a separate module. That's so easy to do with Ruby, so this restriction hardly seems like it would have any effect on encouraging contributions.
-
Why is TRB licensed under LGPL, not MIT?
-
The LGPL allows users to use and integrate LGPL software components into their own software without being required to release the source code of their own software components. However, if users modify LGPL software components (“derivative work”), they are required to make the modified software component available under the same LGPL license. To avoid the latter with TRB, users have to comply with para. 5 LGPLv2.1: A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a “work that uses the Library”. Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. In other words: if you use the TRB libraries in your commercial applications or Open-Source projects, you’re not creating a derivative work of Trailblazer. Your software can be distributed under any terms.
-
Trailblazer (TRB) is an Open-Source project. Since we want to keep it that way, we decided to raise awareness for the “cost” of our work - providing new versions and features is incredibly time-consuming for us, but we love what we do.
-
This creates a win-win situation, you as the user have your peace of mind, and we can continue working with your funds.
-
Tags
- derivative work/based on
- LGPL
- open-source software: funding
- win-win
- work: doing what you love
- loophole/escape hatch
- annotation meta: may need new tag
- answer the "why?"
- Business Process Model and Notation
- building software is time-consuming / a lot of work
- proprietary software
- support: peace of mind for those that have it
- good point
- wording designed to be more palatable/pleasing/inoffensive
- distinction
- Trailblazer: editor
- reminder
- neutral/dispassionate/impartial/objective wording
- integration
- time-consuming
- open-source software: not contributing new code back to project
- labor of love
- software licensing
- well-written
- building software is hard
- clarification
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
Business Process Model and Notation (BPMN) is a standard for business process modeling that provides a graphical notation for specifying business processes in a Business Process Diagram (BPD),[3] based on a flowcharting technique very similar to activity diagrams from Unified Modeling Language (UML).
-
-
en.wikipedia.org en.wikipedia.org
-
github.com github.com
-
Trailblazer goes further and provides an approach to model entire life-cycles of business objects, such as "a song" or "the root user" using workflow (pro feature). Also, you don't have to use the DSL but can use the editor instead (cool for more complex, long-running flows).
-
Their high degree of encapsulation makes them a replacement for test factories, too.
-
Operations completely replace the need for leaky factories.
-
In Trailblazer, models are completely empty. They solely contain associations and finders. No business logic is allowed in models.
-
Operations don't know about HTTP or the environment. You could use an operation in Rails, Hanami, or Roda, it wouldn't know.
-
Operations encapsulate business logic and are the heart of a Trailblazer architecture.
-
The bare bones operation without any Trailblazery is implemented in the trailblazer-operation gem and can be used without our stack.
-
An operation is not just a monolithic replacement for your business code. It's a simple orchestrator between the form objects, models, your business code and all other layers needed to get the job done.
-
Operations define the flow of their logic using the DSL and implement the particular steps with pure Ruby.
-
Trailblazer extends the conventional MVC stack in Rails. Keep in mind that adding layers doesn't necessarily mean adding more code and complexity. The opposite is the case: Controller, view and model become lean endpoints for HTTP, rendering and persistence. Redundant code gets eliminated by putting very little application code into the right layer.
-
Trailblazer offers you a new, more intuitive file layout in applications.
-
Instead of grouping by technology, classes and views are structured by concept, and then by technology. A concept can relate to a model, or can be a completely abstract concern such as invoicing.
-
Concepts over Technology
-
While Trailblazer offers you abstraction layers for all aspects of Ruby On Rails, it does not missionize you. Wherever you want, you may fall back to the "Rails Way" with fat models, monolithic controllers, global helpers, etc. This is not a bad thing, but allows you to step-wise introduce Trailblazer's encapsulation in your app without having to rewrite it.
-
Only use what you like.
-
Trailblazer is no "complex web of objects and indirection". It solves many problems that have been around for years with a cleanly layered architecture.
-
you can pick which layers you want. Trailblazer doesn't impose technical implementations
Tags
- Ruby
- defending an idea
- can be used independently (fine-grained/decoupled)
- software development: code organization: where does this code belong?
- DSL
- it's just _
- software development: organization of files: by component rather than by file type
- software development: organization of files
- making changes / switching/migrating gradually/incrementally/step-wise/iteratively
- business logic
- focus on concepts/design/structure instead of specific/concrete technology/implementation
- the Trailblazer way
- encapsulation
- trailblazer-operation
- focus on what it should do, not on how it should do it (implementation details; software design)
- paid services
- test factory
- leaving the details of implementation/integration up to you
- fewer layers of abstraction/indirection
- models: should be thin, dealing with persistence/associations only, not business logic
- abstractions
- newer/better ways of doing things
- rails: the Rails way
- replacement for:
- freedom of user to override specific decision of an authority/vendor (software)
- Trailblazer
- allowing developer/user to pick and choose which pieces to use (allowing use with competing libraries; not being too opinionated; not forcing recommended way on you)
- thin abstraction/layer
Annotators
URL
-
-
www.youtube.com www.youtube.com
Tags
Annotators
URL
-
-
github.com github.com
-
ActiveModel provides a powerful framework for defining callbacks. ActiveInteraction hooks into that framework to allow hooking into various parts of an interaction's lifecycle.
-
If any of the inputs are invalid, #execute won't be run.
It does staged/pipelined execution/validation.
If any of these stages has any errors, then no other stages will be executed:
- validations on the inputs of the interaction itself
- run execute, which may:
- may use compose, which will (IIUC) abort the entire execute/run early if any of them fail, even if there are later composed interactions still to be run
- may try to save inputs into models, which themselves may have validation errors, which (assuming we use errors.merge), will show up on the
interaction.errors
(but won't abort the rest of theexecute
)
-
Grouped inputs It can be convenient to apply the same options to a bunch of inputs. One common use case is making many inputs optional. Instead of setting default: nil on each one of them, you can use with_options to reduce duplication.
This is just a general Ruby/Rails tip, nothing specific to active_interaction (except that it demonstrates that it may be useful sometimes, and gives a specific example of when you might use it).
Still, in my opinion, this doesn't belong in the docs. Partly because I think repeating the
default: nil
for every item is an acceptable type of duplication, which would be better, clearer (because it's more explicit), simpler, keeps those details closer to the place where they are relevant (imagine if there were 50 fields within awith_options
block).I also think think that it creates a very arbitrary logical "grouping" within your code, which may cause you to unintentionally override/trump / miss the chance to use a different, more logical/natural/important/useful logical grouping instead. For example, it might be more natural/important/useful to group the fields by the section/fieldset/model that they belong with, even if your only
grouping
is a comment:# User fields string :name integer :age date :birthday, default: nil # Food preferences array :pizza_toppings boolean :wants_cake, default: nil
may be a more useful grouping/organization than:
# Fields that are required string :name integer :age array :pizza_toppings # Fields that are optional with_options default: nil do date :birthday boolean :wants_cake end
Or it might be better to list them strictly in the same order as they appear in your model that you are trying to match. Why? Because then you (or your code reviewer) can more easily compare the lists between the two places to make sure you haven't missed any fields from the model, and quickly be able to identify which ones are missing (hopefully intentionally missing).
In other words, their "optionalness" seems to me like a pretty incidental property, not a key property worthy of allowing to dictate the organization/order/grouping of your code.
-
There are times where it is useful to know whether a value was passed to run or the result of a filter default. In particular, it is useful when nil is an acceptable value.
Yes! An illustration in ruby:
main > h = {key_with_nil_value: nil} => {:key_with_nil_value=>nil} main > h[:key_with_nil_value] => nil main > h[:missing_key] # this would be undefined in JavaScript (a useful distinction) rather than null, but in Ruby it's indistinguishable from the case where a nil value was actually explicitly _supplied_ by the caller/user => nil # so we have to check for "missingness" ("undefinedness"?) differently in Ruby main > h.key?(:key_with_nil_value) => true main > h.key?(:missing_key) => false
This is one unfortunate side effect of Ruby having only
nil
and no built-in way to distinguish betweennull
andundefined
like in JavaScript. -
When you run this interaction, two things will happen. First ActiveInteraction will type check your inputs. Then ActiveModel will validate them. If both of those are happy, it will be executed.
Failed type checks generate run-time errors. So it's up to the develop to fix these, permanently, since the user can't (99% of time) do anything to fix these.
Failed validations add errors to
interaction.errors
object. These are for the user to fix. -
outcome.valid?
This would read better if it were aliased as
success?
:if outcome.success?
-
compose(Add, x: x, y: 3)
How is this better than simply:
Add.run(x: x, y: 3)
?
I guess if we did that we would also have to remember to handle merging errors from that outcome into self...
-
Other filters will ignore blocks when given to them.
Would be better to raise an error if block isn't allowed/expected!
-
Filters
Might be helpful / more intuitive to think of filters as... inputs/attributes
Defining the filters defines which inputs are allowed and which type they are required to be.
-
If you have value objects or you would like to build one object from another, you can use the converter option. It is only called if the value provided is not an instance of the class or one of its subclasses.
-
account.first_name = first_name if first_name.present? account.last_name = last_name if last_name.present?
I guess this is needed so we don't reset to nil (erasing value in database) when they haven't even provided a new value as input.
But surely there's a cleaner way...
-
presence: true, unless: 'first_name.nil?'
This is seemingly contradictory at first glance: Why would we require it to be present ... unless it's not present? I think the reason they did it this way is to allow it to be skipped if and only if it is literally
nil
but to make it add an error if a blank value such as""
(or even" "
) is passed. -
It requires an account to update, but the other inputs are optional. If they're missing, it'll ignore those attributes. If they're present, it'll update them.
-
def edit account = find_account! @account = UpdateAccount.new( account: account, first_name: account.first_name, last_name: account.last_name) end
-
In this simple example, the destroy interaction doesn't do much. It's not clear that you gain anything by putting it in an interaction.
-
Note that we have to pass a hash to .run. Passing nil is an error.
That's why they pass
params.fetch(:account, {})
instead of simply
params[:account]
-
The value given to the default option will also be found.
clarification: using
find
, if needed -
Use the desc option to provide human-readable descriptions of filters. You should prefer these to comments because they can be used to generate documentation.
-
Lambda defaults are evaluated in the context of the interaction, so you can use the values of other inputs in them.
-
Setting it to a lambda will lazily set the default value for that input.
-
hash :with_defaults, default: {} do boolean :likes_cookies, default: true end
-
By default, hashes remove any keys that aren't given as nested filters. To allow all hash keys, set strip: false. In general we don't recommend doing this, but it's sometimes necessary.
-
Record filters allow you to require an instance of a particular class (or one of its subclasses) or a value that can be used to locate an instance of the object. If the value does not match, it will call find on the class of the record. This is particularly useful when working with ActiveRecord objects.
-
You can also create an anonymous interface on the fly by passing the methods option.
-
ActiveInteraction plays nicely with Rails. You can use interactions to handle your business logic instead of models or controllers.
-
> RecordInteraction.run!(encoding: 'ascii') => #<Encoding:US-ASCII>
Makes use of the fact that you can do:
main > Encoding.find('ascii') => #<Encoding:US-ASCII>
and that
If the value does not match, it will call
find
on the class of the record. -
ActiveInteraction type checks your inputs. Often you'll want more than that. For instance, you may want an input to be a string with at least one non-whitespace character. Instead of writing your own validation for that, you can use validations from ActiveModel. These validations aren't provided by ActiveInteraction. They're from ActiveModel. You can also use any custom validations you wrote yourself in your interactions.
-
recommended by (also my first sighting of it): https://hyp.is/oDsgQHF0Eeu7kEvGAmpHeQ/github.com/rails/rails/pull/19709
-
Since interactions behave like ActiveModels, we can use ActiveModel validations with them.
Tags
- default values
- reasonable defaults
- undefined vs. null
- software development: code organization: where does this code belong?
- irrelevant
- flexibility
- interesting idea
- important point
- elegant solution
- ruby
- incidental
- JavaScript
- good example
- reasonable behavior
- eager vs. lazy initialization
- ActiveModel
- unintuitive
- newer/better ways of doing things
- can we do even better?
- supersedes
- important distinction
- evaluation context
- dependent on:
- powerful
- I have a question about this
- scope: out of scope
- naming
- why is it better?
- comparison
- useful
- polymorphism
- makes sense to me
- good idea
- pipeline
- security: sanitizing input
- expected behavior
- good point
- business logic
- error/exception handling
- ActiveRecord
- default parameter values
- see content below
- admit the limitations/shortcomings of your argument/benefits
- documentation generator
- active_interaction
- rails: strong parameters
- rails: validation
- first sighting
- verbose / noisy / too much boilerplate
- leverage library/tool to do something for you
- clarification
Annotators
URL
-
-
store.steampowered.com store.steampowered.com
-
People who buy this buy for a reason, bonsai and some gaming experience. I'm disappointed from what I saw. I'd love to turn back and give another chance after it's completed. For now what I can say is it really amazes me how people here tend to glorify things easily while writing reviews.
Tags
Annotators
URL
-
-
store.steampowered.com store.steampowered.com
-
I was aware of the mixed reviews but "mixed" to me could be a game that's perfectly suitable for one person's taste and detestable to the next.
-
-
stackoverflow.com stackoverflow.com
-
Note: This question has been edited since it was asked. The original title was "Test whether a glob has any matches in bash". The specific shell, 'bash', was dropped from the question after I published my answer. The editing of the question's title makes my answer appear to be in error. I hope someone can amend or at least address this change.
-
-
stackoverflow.com stackoverflow.com
-
# catch multi-char special key sequences read -sN1 -t 0.0001 k1 read -sN1 -t 0.0001 k2 read -sN1 -t 0.0001 k3 key+=${k1}${k2}${k3}
-
for term in vt100 linux screen xterm { echo "$term:" infocmp -L1 $term|egrep 'key_(left|right|up|down|home|end)' }
-
For example, on the terminal I'm using, the right arrow outputs ^[[C. You can see what sequence your terminal outputs by pressing Ctrl-V Right Arrow. The same is true for other cursor-control keys such as Page Up and End.
-
-
-
If you kill ffmpeg process it will exit with code 255 (easily reproducible in the terminal)
-
-
unix.stackexchange.com unix.stackexchange.com
-
sig_handler() { exit_status=$? # Eg 130 for SIGINT, 128 + (2 == SIGINT) echo "Doing signal-specific up" exit "$exit_status" }
-
Example (in bash, but my question shouldn't be considered bash-specific):
-
Now this probably won't make difference in the real world (e.g. because the exit codes are not portable and on top of that not always unambiguous as discussed in Default exit code when process is terminated?)
-
-
-
unix.stackexchange.com unix.stackexchange.com
-
However, because so many shells follow that convention of having 128 + signal_number, programs know to avoid using those values above 128 for their exit code (or when they do exit(130), it's to report the death of a child that dies of a signal 2 like some shells do under some circumstances).
-
So if you get a number of 130, there's an ambiguity in that you don't know whether the process dies of a signal 2 or just did an exit(130).
-
-
askubuntu.com askubuntu.com
-
man ps has all the answers, under the "PROCESS STATE CODES" heading:
-
-
unix.stackexchange.com unix.stackexchange.com
-
non-interactive shells (actually when job control is not enabled)
-
In any case signal handling in shells is one of the least reliable and portable aspects. You'll find behaviours vary greatly between shells and often between different versions of a same shell. Be prepared for some serious hair pulling and head scratching if you're going to try to do anything non-trivial.
-
Here, you could use zsh instead of sh which doesn't have either of those annoying "features" (at least in current versions).
-
for sig in $(kill -l) ; do trap "echo parent:$sig" $sig done
-
-
akm111.wordpress.com akm111.wordpress.com
-
while : # This is the same as "while true".
-
-
stackoverflow.com stackoverflow.com
-
Both kill with a job specifier and terminal signals send to the entire process group, so both the shell and sleep.
-
-
stackoverflow.com stackoverflow.com
-
-
As usual with almost any command, if you want a normal argument that starts with a - to not be interpreted as a switch, precede it with --
-
rkill command from pslist package sends given signal (or SIGTERM by default) to specified process and all its descendants:
-
PGID=$(ps opgid= "$PID") # get the Process Group ID
-
-
stackoverflow.com stackoverflow.com
-
Typically, a process associated with a controlling terminal is foreground process and its process group is called foreground process group. When you start a process from the command line, it's a foreground process:
-
Quit the program by sending a different signal to both processes, e.g. SIGQUIT with Ctrl + \.
-
-
linusakesson.net linusakesson.net
-
Most users make mistakes while typing, so a backspace key is often useful. This could of course be implemented by the applications themselves, but in accordance with the UNIX design philosophy, applications should be kept as simple as possible. So as a convenience, the operating system provides an editing buffer and some rudimentary editing commands (backspace, erase word, clear line, reprint), which are enabled by default inside the line discipline.
-
Beware, though: What you are about to see is not particularly elegant. In fact, the TTY subsystem — while quite functional from a user's point of view — is a twisty little mess of special cases. To understand how this came to be, we have to go back in time.
-
-
stackoverflow.com stackoverflow.com
-
Why then sending the SIGINT manually to the shell doesn't kill the child, e.g. 'kill -2 <shell-pid>' doesn't do anything to a child process while Ctrl-C kills it?
-
-Wpedantic
-
The shell process itself is in yet another process group all of its own and so doesn't receive the signal when one of those process groups is in the foreground. It's that simple.
-
Switching "jobs" between foreground and background is (some details aside) a matter of the shell telling the terminal which process group is now the foreground one.
-
Check yourself some shell-sources.
-
If interested, you can check the plain old /bin/sh signal handling in the source code here.
-
I am trying to understand how CTRL+C terminates a child but not a parent process. I see this behavior in some script shells like bash where you can start some long-running process and then terminate it by entering CTRL-C and the control returns to the shell. Could you explain how does it work and in particular why isn't the parent (shell) process terminated? Does the shell have to do some special handling of CTRL+C event and if yes what exactly does it do?
-
-
stackoverflow.com stackoverflow.com
-
However, banning him opens a very dangerous precedent, making the US more like a dictatorship... more like China. Also it's not effective. Those who were silenced will only have more motivation, and the risk of terrorism is greatly increased. The people must decide what is true. Not big companies. Individuals must be able to express their beliefs. Bot accounts must be banned, but real individuals must not. If you think a group of people is a bunch of idiots who believe fake news, then, tough, that's democracy for you. Maybe it means that your government is not investing enough in education and welfare to properly educate and give hope to those people.
-
I oppose the banning of Donald Trump and his non-violent believers/content from social media platforms such as Facebook Twitter, YouTube and Amazon. I feel (irrationally?) Trump is arrogant and disgusting as a person. I like some of his anti-CCP policies, but not sure I'd vote for him. The "USA First" stance is particularly damaging as it scares USA allies away. I don't think there's enough evidence for the electoral fraud allegations, but I haven't researched the court cases extensively. However, banning him opens a very dangerous precedent, making the US more like a dictatorship... more like China. Also it's not effective. Those who were silenced will only have more motivation, and the risk of terrorism is greatly increased. The people must decide what is true. Not big companies. Individuals must be able to express their beliefs. Bot accounts must be banned, but real individuals must not. If you think a group of people is a bunch of idiots who believe fake news, then, tough, that's democracy for you. Maybe it means that your government is not investing enough in education and welfare to properly educate and give hope to those people. I'm against violence.
-
-
www.cnbc.com www.cnbc.com
-
AWS can even terminate or suspend its agreement with a customer immediately under certain circumstances as it did in 2010 with Wikileaks, pointing to violations of AWS’ terms of service.
-
The swiftness with which Amazon acted shouldn’t come as a shock. Companies have been disclosing details about their deals with Amazon that warn of these kinds of sudden discontinuations for years.
-
The incident demonstrates a type of power that Amazon wields almost uniquely because so many companies rely on it to deliver computing and data storage.
-
-
earthsci.stanford.edu earthsci.stanford.edu
-
The CTRL-\ key sends a kill signal to the foreground job which, under normal circumstances, is guaranteed to terminate it. This signal cannot be captured by a process. However, this means the process cannot cleanup and is just summarily stopped. In some cases, a process can be stuck in a kernel wait state so this signal never reaches it. In that case, the process is unusable but cannot be killed.
-
-
unix.stackexchange.com unix.stackexchange.com
-
-
This didn't work for me. Answering "y" somehow causes the script to finish immediately, rather than letting children continue sleeping. (Same thing if I make the signal handler function an empty no-op.) Does anyone know why it doesn't work for me or how to get it to work? It's as if the interrupt gets propagated to the child processes too so that it's no longer waiting for them.
-
Also, this code will fail if $$ is not the process group leader, such as when the script is run under strace. Since a call to setsid(2) is probably tricky from a shell script, one approach might be to ps and obtain the process group ID from that.
-
you really need #!/bin/sh -m for correct behavior of nested subshells. fg, bg, and wait wont work correctly otherwise
-
ps -o pid,pgid,stat,args
-
When your script starts a process, that child becomes a member of a process group with PGID equal to the PID of the parent process which is $$ in the parent shell.
-
To accomplish this, after starting the children (loop.sh) in the background, call wait, and upon receipt of the INT signal, kill the process group whose PGID equals your PID.
-
read -rep $'\nDo you wish to stop playing?(y/n)' yn
-
You also need job controlled -monitoring in your parent so it keep track of its children. wait, for example, only works at all with job control. -monitor mode is how shells interact with terminals.
-
You need a trap in loop.sh. Traps are cleared for every subshell started unless they are explicitly trap ''SIG ignored by the parent.
-
so again, what, precisely, is false? Do you deny that a Control+C goes to the foreground process group?
-
what, pray tell, is false in my examples? I am curious, so please be precise.
-
-
stackoverflow.com stackoverflow.com
-
Remove your last "just in case" trap, and the script should work fine also with the EXIT traps. INT in the trap calling the cleanup should be the correct way to deal with the interrupts, however
-
How about just having all the output from point X be redirected to tee without having to repeat it everywhere and mess with all the sub-shells and execs
-
exec > >(exec tee -a $logfile) 2>&1
-
Can you be more specific about the "weird version of bash" ? In some situations (when run as /bin/sh) it runs n Posix compatibility mode ... If this is the case add set +o posix prior to exec
-
The idea of the script is this: most of the important logic runs in a subshell which is piped through tee and to a logfile, so I don't have to tee every single line of the main logic to get it all logged.
-
The rsync and sleep commands (the sleep is just an example) are run through exec to prevent the creation of zombie processes if I kill the parent script while they're running, and each potentially-long-running command is wrapped in its own subshell so that when exec finishes, it won't terminate the whole script.
-
-
unix.stackexchange.com unix.stackexchange.com
-
The parentheses always start a subshell. What's happening is that bash detects that sleep 5 is the last command executed by that subshell, so it calls exec instead of fork+exec. The sleep command replaces the subshell in the same process.
-
-
meta.stackexchange.com meta.stackexchange.com
-
unix.stackexchange.com unix.stackexchange.com
-
Help defend Monica from defamation! Stack Overflow, Inc. must repair the damage caused by their libel against Monica Cellio, cooperate with the community, be willing to talk, treat users with respect, learn about the world outside the United States, open the governance of the sites.
-
-
unix.stackexchange.com unix.stackexchange.com
-
There's a bash debugger, bashdb, which is an installable package on many distros. It uses bash's built-in extended debugging mode (shopt -s extdebug).
-
-
-
ps --forest -o pid,tty,stat,time,cmd -g $(ps -o sid= -p 2795)
-
To get all the processes spawned by a process the whole tree needs to be built. I used awk for that. At first it builds a hash array to contain all PID => ,child,child... . At the end it calls a recursive function to extract all the child processes of a given process. The result is passed to another ps to format the result.
-
This is in fact where I started, but this gives me all processes, which is exactly what I don't want.
-
-
stackoverflow.com stackoverflow.com
-
time run_with_timeout 3 sleep_and_exit 1 7; echo $?
-
# Usage: run_with_timeout N cmd args... # or: run_with_timeout cmd args... # In the second case, cmd cannot be a number and the timeout will be 10 seconds. run_with_timeout () { local time=10 if [[ $1 =~ ^[0-9]+$ ]]; then time=$1; shift; fi # Run in a subshell to avoid job control messages ( "$@" & child=$! # Avoid default notification in non-interactive shell for SIGTERM trap -- "" SIGTERM ( sleep $time kill $child 2> /dev/null ) & wait $child ) }
-
Personally, I prefer signalling an error for invalid values
-
it propagates (Option -p) the returnlevel ($?) so you may use it for your purpose.
-
if the process does not react on a normal kill, you may want to add an additional kill -9 a few seconds afterwards.
-
-
devel.ringlet.net devel.ringlet.net
-
-
A “warning” signal is sent first, then, after a timeout, a “kill” signal, similar to the way init(8) operates on shutdown.
-
-
www.howtogeek.com www.howtogeek.com
-
We can ask timeout to try to stop the program using SIGTERM, and to only send in SIGKILL if SIGTERM didn’t work. To do this, we use the -k (kill after) option. The -k option requires a time value as a parameter.
-
-
stackoverflow.com stackoverflow.com
-
if you just want to add timeout as an additional option for the entire existing script, you can make it test for the timeout-option, and then make it call it self recursively without that option.
-
timeout_child () { trap -- "" SIGTERM; child=$!; timeout=$1; ( sleep $timeout; kill $child; ) & wait $child; } And the usage: ( while true; do echo -n .; sleep 0.1; done) & timeout_child 2
-
You might be confused because echo is both a shell built-in and a separate command.
-
-
www.washingtonexaminer.com www.washingtonexaminer.com
-
steamdb.info steamdb.info
-
Couldn't find on Steam. https://steamdb.info/app/793300/ claims that it is there, but https://store.steampowered.com/app/793300/?curator_clanid=4777282&utm_source=SteamDB just redirects to home page.
Don't redirect to a different URL, esp. without a message explaining why it did so instead of keeping me on the page that I request. That's just incorrect behavior, and a poor UX. Respond with a 404 if the page doesn't exist.!
That way (among other things), I could use Wayback Machine extension to see if I can find a cached version there.
But even that (http://web.archive.org/web/*/https://store.steampowered.com/app/793300) is saying "huh?" so I'm confused.
Where did it go and why?
I guess it's no longer available, because this page says:
section_type ownersonly ReleaseState unavailable
... but why?
Tags
Annotators
URL
-
-
www.metacritic.com www.metacritic.com
-
i dont know why everyone wants to **** on everything that is not a "AAA" game, its not in its perfect state, but far from deserve a 3, i will give it a 9 so it counters the "just hate
-
-
stackoverflow.com stackoverflow.com
-
The problem is that you what you want is actually not de-structuring at all. You’re trying to go from 'arg1', { hash2: 'bar', hash3: 'baz' }, { hash1: 'foo' } (remember that 'arg1', foo: 'bar' is just shorthand for 'arg1', { foo: 'bar' }) to 'arg1', { hash1: 'foo', hash2: 'bar', hash3: 'baz' } which is, by definition, merging (note how the surrounding structure—the hash—is still there). Whereas de-structuring goes from 'arg1', [1, 2, 3] to 'arg1', 1, 2, 3
-
-
-
{a: 1, b: 2, c: 3, d: 4} => {a:, b:, **rest} # a == 1, b == 2, rest == {:c=>3, :d=>4}
equivalent in javascript:
{a, b, ...rest} = {a: 1, b: 2, c: 3, d: 4}
Not a bad replacement for that! I still find javascript's syntax a little more easily readable and natural, but given that we can't use the same syntax (probably because it would be incompatible with existing syntax rules that we can't break for compatibility reasons, unfortunately), this is a pretty good compromise/solution that they've come up with.
-
-
You can rescue at the method level, but more likely you’d want to rescue at the statement level.
-
In Ruby 3 we now have a “rightward assignment” operator. This flips the script and lets you write an expression before assigning it to a variable. So instead of x = :y, you can write :y => x
-
(Yay for the hashrocket resurgence!)
-
we’re going to look how improved pattern matching and rightward assignment make it possible to “destructure” hashes and arrays in Ruby 3—much like how you’d accomplish it in, say, JavaScript
Tags
- different way of thinking about something
- flipping things around (reversing things; doing it the opposite way/direction)
- equivalent/analogous/alternative ways to do something between 2 libraries/languages/etc.
- operators
- feature parity
- constant evolution/improvement of software/practices/solutions
- ruby
- good example
- JavaScript
- resurgence
- ruby: hash object destructuring
- error/exception handling
- funny
- backwards compatible
- improvement
- scope (programming)
- object destructuring
Annotators
URL
-
-
www.metacritic.com www.metacritic.comFlorence1
-
Please, do not buy this. I am really tired of "games" that are given critical praise because its cool to praise or because its political correct to do. I will break up my review in points so its clear why I dislike this "game" : 1) This is not a game. This is a short story, like an interactive book. 2) This game is so short, that I completed it in a 3 hour bus ride. It was boring. 3) Its a story of a girl that have to take the reigns of her life after divorce. WOMAN EMPOWERMENT. Now you know why this game is rated so highly 4) This is a MOBILE GAME. I paid $3 to play on an iphone (after watching a gaming channel give it GOTY contender. Needless to say, I never watched that gaming channel again). I FELT I WAS ROBBED OF TIME AND $3. Imagine how much I hated this game to feel like I was robbed even though it costed me only $3. 5) This game costs $7 on the eshop. You could buy CELESTE for $9 on sale on the Eshop. That is a great game. I recently bought Hollow Knight for $7 on Playstation. This interactive novel should not be sold as a game. Period. It is a waste of time and money.
Nothing wrong with interactive novels being sold in the same store as games... as long as it's clear what it is (no false advertising).
Somewhat agree with some of the other points...
-
-
jointoucan.com jointoucan.com
-
That’s it, plain and simple. But if you want the legalese version, dive into it here.
-
What we do collect:The translated words you encounter so that we know what words you are exposed to and can serve up appropriate vocabulary quizzes.Any vocabulary quizzes you see and the results of those quizzes so that we can keep track of how well you know each vocabulary concept.Anonymized (not linked to anyone's particular account) web page URLs, whether translations show up on them, and whether any bugs or errors occur on those pages so that we can better detect any broad issues affecting our user base.
-
-
-
jointoucan.com jointoucan.com
-
What a cool idea!
first sighting: https://darkreader.org/help/en/
-
-
www.joinhoney.com www.joinhoney.comHoney1
Tags
Annotators
URL
-
-
www.joinhoney.com www.joinhoney.comHoney1
-
Honey does not track your search engine history, emails, or your browsing on any site that is not a retail website (a site where you can shop and make a purchase). When you are on a pre-approved retail site, to help you save money, Honey will collect information about that site that lets us know which coupons and promos to find for you. We may also collect information about pricing and availability of items, which we can share with the rest of the Honey community.
-
-
www.joinhoney.com www.joinhoney.comHoney1
-
-
corporatefinanceinstitute.com corporatefinanceinstitute.com
-
For example, a real estate agentCommercial Real Estate BrokerA commercial real estate broker is a middleman between sellers and buyers of commercial real estate, who helps clients sell, lease, or purchase commercial real estate. A commercial real estate broker has the freedom to work either as an independent agent, or as a member of a commercial real estate brokerage firm. with an established network of colleagues for contacting potential home buyers, in addition to a broad range of market information and advertising outlets. Wholesalers include the middlemen between manufacturers, producers, and retailers. The retailers themselves are the middlemen between wholesalers and the end customers.
-
-
darkreader.org darkreader.org
Tags
Annotators
URL
-
-
askubuntu.com askubuntu.com
-
Instead of modifying /usr/share/applications/google-chrome.desktop, the file can be copied into ~/.local/share/applications/google-chrome.desktop and modified without root access. This file will take precedence over the global desktop file.
-
This solution also works for chromium-browser.
-
-
github.com github.com
-
thanks for the quick reply
-
-
github.com github.com
-
-
Almost always form objects wrap existing model or two.
-
-
github.com github.com
-
Nevermind, I use now reform-rails
-
-
github.com github.com
-
-
added question and removed question labels
-
-
github.com github.com
-
(To clarify, I'm not personally needing / waiting on this change (not currently anyway). I was just looking at all the open issues in this project while deciding whether I should start using ActiveIntegration in my project...)
-
Now that v4 is released, maybe we can look again into merging this?
-
Any idea @AaronLasseigne if this is mergeable?
-
This is a breaking change so it'll have to go into a major release. I was working on a v4 release but it's too much. I think I'm going to pair it back and we can add this to the new v4. When I have that ready, I'll rebase the merge onto that branch.
-
pair
pare
Tags
- don't let big plans/goals get in the way of integrating/releasing smaller changes/improvements
- waiting for maintainers to review / merge pull request / give feedback
- why has this not been merged yet?
- typo
- breaking change
- releases: how much to include in a release / when to defer a change until next release
- issues: follow-up/ping
- issue grooming
Annotators
URL
-
-
github.com github.com
-
-
For now I've worked around this by putting all the key-value pairs into an array before passing them into the interaction, then re-building the hash inside the interaction. It works, but it requires some extra code
-
You can use it by allowing a hash with arbitrary keys, but that loses type-safety one that object.
-
No one has requested it before so it's certainly not something we're planning to add.
-
I'm sure there will be a few other people out there who eventually want something like this, since Interactions are actually a great fit for enforcing consistency in data structures when working with a schemaless NoSQL store, but obviously it's still a bit of a niche audience.
-
To give a little more context, structures like this often come up in my work when dealing with NoSQL datastores, especially ones that rely heavily on JSON, like Firebase, where a records unique ID isn't part of the record itself, just a key that points to it. I think most Ruby/Rails projects tend towards use cases where these sort of datastores aren't appropriate/necessary, so it makes sense that this wouldn't come up as quickly as other structures.
-
Thanks, I'll continue leaning on the array workaround for my use case then.
Tags
- use cases
- there is a need/niche for it
- less-than-ideal workarounds
- supporting uncommon use cases
- issues I'm watching
- type safety
- objects/hashes
- active_interaction
- missing feature leading to less-than-ideal workarounds
- component/library author can't consider/know ahead of time all of the ways users may want to use it
- arrays
- where it shines / best application
- smaller/minority/specific/niche audience
Annotators
URL
-