row.locations = skuLocationsMap[sku].reduce(function (accum, curr) { return accum + (accum !== '' ? ', ' : '') + curr;}, '');
The above is a complex way of doing Array.prototype.join() but it's helpful for remembering how reduce works.
row.locations = skuLocationsMap[sku].reduce(function (accum, curr) { return accum + (accum !== '' ? ', ' : '') + curr;}, '');
1 @Test
2 def testNullHandlerCallsStart(): Unit = {
3 predictor.setHandler(null)
4 when(predictor.log == null).thenAnswer(new Answer[Logger] {
5 def answer(invocation: InvocationOnMock): Logger = {
6 LoggerFactory.getLogger("Predictor")
7 }
8 })
9 when(predictor.enqueueEvent(any())).thenCallRealMethod()
10 val deactivation = new UnitUpdateNotification(unit, unit.updateStatus(Status.INACTIVE, Action.DEACTIVATED, "damaged", "user"))
11 callback.handle(deactivation)
12 verify(predictor).enqueueEvent(any(classOf[Event]))
13 }
newArrayList(string)Super handy method from Google Collections
sed -i "s/filename_prd/filename_dev/g" filename_dev.sql
sed 's/filename_prd/filename_dev/g' ./filename_prd.sql > ./filename_dev.sql
$ grep -lr "searchterm" location
$ grep -lr "Enum" /var/log/rtr/pops
$ grep -lr "receipt" .
You do not need sudo to run find for generally-accessible commands. If you don't want to see the error messages about inaccessible directories, get rid of the messages rather than using root privs unnecessarily. Using sudo all the time is a bad habit. Redirect stderr to /dev/null, like this:
find / -name java 2> /dev/null
Walter Underwood on SO
sed 's/^M//g' SHOP-684.sql > SHOP-684-noM.sql
$ sed 's/^M/\ [ HIT ENTER ] --- /g' SHOP-684.sql > SHOP-684-noM.sql
sed "s/ //g" SHOP-684-noM.sql > SHOP-684-noT.sql
$ head -n 1 *
$ head -n 1 * ==> Desktop <== ==> Development <== ==> Documents <== ==> Downloads <== ==> Dropbox <== ==> Environment <== ==> Library <== ==> Movies <== ==> Music <== ==> Pictures <== ==> Public <== ==> Sites <== ==> bin <== ==> current.html <==Current IP Check Current IP Address: 63.119.11.19 ==> databases <== ==> my.cnf <== [client]
select m.domain, ma.merchantacctid, ma.createddate,
fat.rowsprocessed, min(fat.processeddate)
from merchant_account ma
join merchant m on m.merchantacctid = ma.merchantacctid
join ftp_audit_trail fat on fat.merchantacctid =
ma.merchantacctid
where fat.processeddate > ma.createddate
and fat.rowsprocessed > 0
and ma.createddate > '2009-12-31'
group by fat.merchantacctid
order by domain;
MySQL extends the use of GROUP BY so that the select list can refer to nonaggregated columns not named in the GROUP BY clause. This means that the preceding query is legal in MySQL. You can use this feature to get better performance by avoiding unnecessary column sorting and grouping. However, this is useful primarily when all values in each nonaggregated column not named in the GROUP BY are the same for each group. The server is free to choose any value from each group, so unless they are the same, the values chosen are indeterminate.
11.15.3. GROUP BY and HAVING with Hidden Columns
select m.domain, ma.merchantacctid, ma.createddate,
fat.rowsprocessed, fat.processeddate
from merchant_account ma
join merchant m on m.merchantacctid = ma.merchantacctid
join ftp_audit_trail fat on fat.merchantacctid =
ma.merchantacctid
where fat.processeddate > ma.createddate
and fat.rowsprocessed > 0
and ma.createddate > '2009-12-31'
group by fat.merchantacctid
having min(fat.processeddate)
order by domain;
:set statusline=%t\ %y\ format:\ %{&ff};\ [%c,%l]Sample output: .vimrc [vim] format: unix [2,3].cd /System/Library/Frameworks/JavaVM.framework/Versionssudo rm 1.5sudo rm 1.5.0Open the file JavaForMacOSX10.5Update6.dmg with Pacifist.
sudo ln -s 1.5.0 1.5
Upon submitting a request to my service like CURL -X POST http://localhost:8600/a/b/c -d '{"assignmentId[]":[12345]}' ...