Search   Feed   Browse   Add
Feed items 1 - 5 of 5 for November 2007

Getting more from streams in Bash - November 22, 2007

A handy trick in Bash is to split a stream to process it in more than one way without saving a temporary copy: Make 3 a copy of 1 (stdout) exec 3>&1 result="$(command to generate stream tee devfd3 command to process stream)" Now work with $result The original stream also went to the console The actual case I worked with this morning was a very simple demonstration: !binbash exec 3>&1 echo -e "Bob is my friend.nFred is my friend, too." tee devfd3 cut...
http://binkley.blogspot.com/2007/05/getting-more-from-streams-in-bash.html

Download web pages in BASH - November 22, 2007

BASH is quite amazing. From Bhaskar V. Karambelkar comes Bash shell tricks and this gem (with some small corrections): function headers() server=$1 port=$2:-80 exec 5<>devtcp$server$port echo -ne "HEAD HTTP1.0rnHost: $server:$portrnrn" >&5 cat <&5 exec 5<&-; I work behind a corporate firewall, so I need web proxy settings. No problem, BASH is still amazing: function webget() declare -a parts parts=($(echo $1 tr ' ')) ...
http://binkley.blogspot.com/2007/06/download-web-pages-in-bash.html

Followup to Feature request for JDK7: delegation - November 22, 2007

A followup to Feature request for JDK7: delegation. In the comments to my post requesting better IOC support in JDK7 Sam asks, "The keyword is needed... what if the delegate is editing the behaviour of one of the methods Perhaps to do some logging. You can't do that with the original code." For some context, he refers to code like this: class Scout implements Camper public void camp() ... class BoyScout implements Camper BoyScout(Scout scout) this = scout; ...
http://binkley.blogspot.com/2007/11/followup-to-feature-request-for-jdk7.html

Feature request for JDK7: delegation - November 22, 2007

Some while back I wrote about delegation for Java. Delegation By this I mean direct language support for constructor-based dependency injection of interface implementation, a.k.a. mixins. Many interesting proposals for JDK7 are in the air: the smell of change is replacing the mustiness of an aging language and I want my chance to improve Java while there is a open window of opportunity. About delegation For more details follow my three-year old posting. In a nutshell, delegation is...
http://binkley.blogspot.com/2007/10/feature-request-for-jdk7-delegation.html

Performing fixed amounts of work with blocking queues - November 9, 2007

A colleague of mine showed me a nice idiom with BlockingQueue for performing a fixed amount of work: final List<T> work = new ArrayList<T>(N); for (;;) Wait until there is some work work.add(queue.take()); Get more work, if available queue.drainTo(work, N - 1); for (final T item : work) process(item); work.clear(); This idiom works on 1 to N chunks at a time efficiently and succinctly. An example use is batching SQL updates. At the top of the..
http://binkley.blogspot.com/2007/09/performing-fixed-amounts-of-work-with.html
Available Archives
- May (1 item)
- June (3 items)
- July (1 item)
- August (3 items)
- September (1 item)
- October (6 items)
- November (5 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact