They fail to recognize the value of an initial investment of time in future productivity.
- Feb 2021
-
www.huffpost.com www.huffpost.com
-
-
They fail to understand the importance of autonomy when delegating responsibilities.
-
They lack faith in the capacity of others.
-
They possess an unwavering belief in “one right way.”
-
-
-
trailblazer.to trailblazer.to
-
For me, a dream has come true. I work with crazy geniuses who share many of my opinions
-
Messages like “don’t worry, I’ll do it” combined with a pull requests minutes later - things I literally dreamed of a few years ago, are now part of my daily routine.
-
I learned to “let go” and simply trust others to maintain certain gem suites.
-
Around 2 years ago I decided to end the experiment of “TRB PRO” as I felt I didn’t provide enough value to paying users. In the end, we had around 150 companies and individuals signed up, which was epic and a great funding source for more development.
-
The legendary cfp-app will become a Rails-to-TRB refactoring tutorial.
-
We decided against paid documentation, so all will be freely available on our shiny new website.
inherit from: https://hyp.is/ntzyjnVpEeuLxrvf8MzCkA/trailblazer.to/2.1/blog.html
-
What this means is: I better refrain from writing a new book and we rather focus on more and better docs.
I'm glad. I didn't like that the book (which is essentially a form of documentation/tutorial) was proprietary.
I think it's better to make documentation and tutorials be community-driven free content
-
We’re now relaunching PRO, but instead of a paid chat and (never existing) paid documentation, your team gets access to paid gems, our visual editor for workflows, and a commercial license.
-
And yes, at TRB GmbH, we do pay people to work on OSS
-
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
- more than one right way (no one right/best way)
- release announcement
- Trailblazer
- unambiguous
- strong (extreme/great/high/intense degree/level/concentration/amount/quality of)
- pointing out gaps/downsides/cons in competition/alternatives
- knowledge commons (information/data/content)
- name changes
- funny
- I'm glad they did it this way
- finally / at last
- shift in preference
- version numbers
- gratis content
- improvement
- fix design/API mistakes as early as you can (since it will be more difficult to correct it and make a breaking change later)
- admit when you failed (failures)
- recant/retract/revert/withdraw your previous plans
- Rails app
- free content
- programming: return values / result objects that communicate a more precise/complete representation of the outcome
- newer/better ways of doing things
- open-source software: progress seems slow
- welcome/good change
- documentation
- refactoring
- job: benefits
- open-source software: funding: providing commercial dual-license
- dream come true
- abstractions
- if it's incorrect; fix it
- non-binary
- better late than never
- admit the limitations/shortcomings of your argument/benefits
- software preferences are personal
- do it right/well the first time because it may be too hard to clean up/fix later if you don't
- rails: the Rails way
- immutable data
- trusting others with responsibility/autonomy (letting go; delegating; having faith in others)
- paid content
- switching/migrating to something different
- freemium model
- focus on the user
- annotation meta: inherit same annotation/tags
- experimental
- getting paid to work on open-source software
- advantages/merits/pros
- transparency
- learn from your mistakes
- state charts
- discontinued products/services
- how did we ever live without it?
- Ruby
- example/demo app
- naming
- community-driven development
- rails
- interfaces (programming)
- very simple/small result/change in the end but took a lot of work/time to arrive there
- analogy
- debugging
- I agree
- non-free content
Annotators
URL
-
-
-
-
One of the most difficult transitions for leaders to make is the shift from doing to leading.
-
The upper limit of what’s possible will increase only with each collaborator you empower to contribute their best work to your shared priorities.
-
In the short term you may have the stamina to get up earlier, stay later, and out-work the demands you face. But the inverse equation of shrinking resources and increasing demands will eventually catch up to you, and at that point how you involve others sets the ceiling of your leadership impact.
-
-
github.com github.com
-
One of the main reasons to work with components is re-usability and portability, but also a delegation of responsibilities. Adding a component should be as easy as simply adding the component without having to know the inner workings (or markup) of this component. A consumer should only be aware of the properties, methods and events of a component. In order to style a child component one has to be aware of the markup as well, which violates this 'delegation of responsibility'-principle.
-
-
github.com github.com
-
en.wikipedia.org en.wikipedia.org
-
"Open access" refers to toll-free or gratis access to content
not necessarily free content
-
What is the opposite of free content?
The opposite of free/open-source software is proprietary software or non-free software (https://en.wikipedia.org/wiki/Proprietary_software).
So should we call the opposite of free content "non-free content"? Or "proprietary content"?
Seems likes either would be fine.
Looks like https://en.wikipedia.org/wiki/Wikipedia:Non-free_content prefers the term "non-free content".
Couldn't find anyone contrasting these 2 terms (like I could no doubt find for software):
- https://duckduckgo.com/?q=+%22non-free+content%22+%22free+content%22
- https://duckduckgo.com/?q=%22proprietary+content%22+%22free+content%22&ia=web
Not to be confused with:
- paid content ... just like:
- free content should not be confused with gratis content (?)
- free software should not be confused with freeware
-
Open access refers to online research outputs that are free of all restrictions on access (e.g. access tolls) and free of many restrictions on use (e.g. certain copyright and license restrictions).
-
A free cultural work (free content) is, according to the definition of Free Cultural Works, one that has no significant legal restriction on people's freedom to: use the content and benefit from using it, study the content and apply what is learned, make and distribute copies of the content, change and improve the content and distribute these derivative works.
-
Free content encompasses all works in the public domain and also those copyrighted works whose licenses honor and uphold the freedoms mentioned above.
-
Because the Berne Convention in most countries by default grants copyright holders monopolistic control over their creations, copyright content must be explicitly declared free, usually by the referencing or inclusion of licensing statements from within the work.
-
A free cultural work (free content) is, according to the definition of Free Cultural Works, one that has no significant legal restriction on people's freedom to:
-
A free content, libre content, or free information, is any kind of functional work, work of art, or other creative content that meets the definition of a free cultural work.
-
-
en.wikipedia.org en.wikipedia.org
-
en.wikipedia.org en.wikipedia.org
-
The Definition of Free Cultural Works is a definition of free content from 2006. The project evaluates and recommends compatible free content licenses.
-
-
en.wikipedia.org en.wikipedia.org
-
In this continuum of community participation covered by CBD, new-generation CDD projects are located at the extreme right
-
However, CDD projects fit on the empowerment end of CBD by actively engaging beneficiaries in the design, management and implementation of projects
-
-
www.dictionary.com www.dictionary.com
-
a framework containing the basic assumptions, ways of thinking, and methodology that are commonly accepted by members of a scientific community. such a cognitive framework shared by members of any discipline or group:
-
-
en.wikipedia.org en.wikipedia.org
-
A freemium model is sometimes used to build a consumer base when the marginal cost of producing extra units is low.
Tags
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
In the telecommunications industry, on a conceptual level, value-added services add value to the standard service offering, spurring subscribers to use their phone more and allowing the operator to drive up their average revenue per user.
-
For mobile phones, technologies like SMS, MMS and data access were historically usually considered value-added services, but in recent years SMS, MMS and data access have more and more become core services, and VAS therefore has begun to exclude those services.
-
-
A distinction may also be made between standard (peer-to-peer) content and premium-charged content.
-
-
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
- well-written
- answer the "why?"
- clarification
- work: doing what you love
- distinction
- derivative work/based on
- annotation meta: may need new tag
- labor of love
- building software is hard
- support: peace of mind for those that have it
- proprietary software
- Business Process Model and Notation
- reminder
- integration
- open-source software: not contributing new code back to project
- software licensing
- time-consuming
- building software is time-consuming / a lot of work
- win-win
- Trailblazer: editor
- good point
- wording designed to be more palatable/pleasing/inoffensive
- loophole/escape hatch
- open-source software: funding
- neutral/dispassionate/impartial/objective wording
- LGPL
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
- thin abstraction/layer
- Trailblazer
- rails: the Rails way
- paid services
- leaving the details of implementation/integration up to you
- software development: organization of files
- software development: code organization: where does this code belong?
- trailblazer-operation
- models: should be thin, dealing with persistence/associations only, not business logic
- business logic
- encapsulation
- the Trailblazer way
- software development: organization of files: by component rather than by file type
- making changes / switching/migrating gradually/incrementally/step-wise/iteratively
- fewer layers of abstraction/indirection
- defending an idea
- Ruby
- freedom of user to override specific decision of an authority/vendor (software)
- test factory
- it's just _
- focus on what it should do, not on how it should do it (implementation details; software design)
- newer/better ways of doing things
- DSL
- 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)
- can be used independently (fine-grained/decoupled)
- focus on concepts/design/structure instead of specific/concrete technology/implementation
- abstractions
- replacement for:
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: nilfor 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_optionsblock).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
groupingis a comment:# User fields string :name integer :age date :birthday, default: nil # Food preferences array :pizza_toppings boolean :wants_cake, default: nilmay 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 endOr 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) => falseThis is one unfortunate side effect of Ruby having only
niland no built-in way to distinguish betweennullandundefinedlike 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.errorsobject. 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
nilbut 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]
Tags
- incidental
- JavaScript
- admit the limitations/shortcomings of your argument/benefits
- error/exception handling
- see content below
- important point
- comparison
- leverage library/tool to do something for you
- I have a question about this
- important distinction
- undefined vs. null
- makes sense to me
- scope: out of scope
- good example
- powerful
- ActiveModel
- can we do even better?
- naming
- unintuitive
- pipeline
- irrelevant
- good point
- verbose / noisy / too much boilerplate
- elegant solution
- flexibility
- clarification
- why is it better?
- ruby
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
- JavaScript
- equivalent/analogous/alternative ways to do something between 2 libraries/languages/etc.
- ruby: hash object destructuring
- error/exception handling
- flipping things around (reversing things; doing it the opposite way/direction)
- constant evolution/improvement of software/practices/solutions
- funny
- resurgence
- improvement
- feature parity
- good example
- object destructuring
- operators
- scope (programming)
- backwards compatible
- different way of thinking about something
- ruby
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
-