Project Euler Problem #1
Solved in Excel!
=SUMPRODUCT((MOD(ROW(A1:A999), 3)=0)*ROW(A1:A999))+SUMPRODUCT((MOD(ROW(A1:A999), 5)=0)*ROW(A1:A999))-SUMPRODUCT((MOD(ROW(A1:A999), 15)=0)*ROW(A1:A999))
Solved in Excel!
=SUMPRODUCT((MOD(ROW(A1:A999), 3)=0)*ROW(A1:A999))+SUMPRODUCT((MOD(ROW(A1:A999), 5)=0)*ROW(A1:A999))-SUMPRODUCT((MOD(ROW(A1:A999), 15)=0)*ROW(A1:A999))
OK, so the formula that I last posted apparently required a little work. It became immediately obvious that the use of the formula for a named range failed if the matching column was to the right of column Z; ther CHAR() function will only return one character. I needed to make the formula a bit more complex in order to handle that.
=OFFSET(INDIRECT(“Source!$” & IF(MATCH(“MatchingColumn”,Source!$1:$1, 0)>26, CHAR(64+TRUNC(MATCH(“MatchingColumn”,Source!$1:$1, 0)/26)) & CHAR(64+MOD(MATCH(“MatchingColumn”,Source!$1:$1, 0), 26)), CHAR(64+MATCH(“MatchingColumn”,Source!$1:$1, 0))) & “$2”), 0, 0, COUNTA(Source!$A:$A)-1,1)
Go to town!
I had been using the OFFSET() function with named ranges to create ranges with dynamic numbers of rows for a while, which worked very well, except when the source data was updated by moving columns around. If a column was added or deleted, I needed to update almost every defined name I had.
To counter that, I made a formula for a named range that only cares about the column header:
=OFFSET(INDIRECT(“Source!$” & CHAR(64+MATCH(“ColumnName”,Source!$1:$1, 0)) & “$2”), 0, 0, COUNTA(Source!$A:$A)-1,1)
Now, I can refer to this named range and get the right column no matter where it is on the Source tab! Tada!
(Yes, I know. Sue me.)
From the admin section of a Pligg installation (under “Modify Language”), a list of the constants used in templates, and their English defaults.
Yes, I know this matters to few of my regular readers, but given how totally unable *I* was to find a list such as this, maybe the internet will like it.
Below the cut (if the cut works). Thank me later.
(more…)
I wanted to put this up so I didn’t forget it. This is a trick to turn a field into a toggle, allowing for a default date range or a user-specified one. It’s made for Crystal, but would work for anything Oracle-based, I think, with some tweaking.
whateverdate between (decode(‘{?Timespan}’, ‘DEFAULT’, (Last_Day(Add_Months(SYSDATE, -2)) + 1), ‘{?StartDate}’)) and (decode(‘{?Timespan}’, ‘DEFAULT’, (Last_Day(Add_Months(SYSDATE, -1)) + 1)
Thank you for your time.
(Speaking Oracle, specifically)
When trying to SELECT INTO a variable, if the query returns no rows, an exception is thrown. I’d have thought that the variable would just be NULL, but noooooooooo…
You can nest BEGIN..END blocks to your heart’s content, but you can’t have more than one autonomous block within a given BEGIN..END block. (not that I’ve found, at least).
Exceptions don’t always tell you that they’ve been raised. Sometimes you have to figure it out by noticing that a NULL is where your return value should be.
That is all for now. Carry on, people, carry on.
When pausing external plugins from within another AMXX plugin, that “c” flag makes all the difference.
pause("acd", "externalplugin.amxx")
Lawdy that’s key… otherwise, the plugin that CALLED it will be the one that stops, and that isn’t likely to be what you’d like to have happen.
Combat Communism has hit version 0.23.
Changes include:
Go forth and be well with this knowledge.
Yesterday I stayed up authoring this script to help make it easier for people on the Hollow City boards to nominate worthy posts for experience.
And in this lesson, Sean learns that trying to ship a URL with parameters in a mailto link is decidedly tricky. But I figured it out anyway; the trick, for those who care, was to do a encodeURIComponent()
on the URL I was trying to send (as part of the email body), and a plain jane encodeURI()
on the rest of the arguments.
See title of post for possible relevance to your life.
Combat Communism has gone to version 0.2, and seems to work just ducky.
AMXX coding scares me. Python has spoiled me for the rest of the world.