1515 Commits

Author SHA1 Message Date
Dylan Lloyd
1ba01add51 wrote HexToDec & test 2014-06-27 17:11:32 -07:00
Zaahir Moolla
fc962e7b0b Merge pull request #515 from duckduckgo/mintsoft/regex_css
Fix for #474
2014-06-27 16:54:03 -04:00
Jag Talon
852d03f61d Merge pull request #472 from wilkox/master
Add DNA reverse complement goodie
2014-06-27 16:38:46 -04:00
Matt Miller
dee4314b42 NumberStyle: minimal changes for Conversions.
I am not claiming this is entirely the correct way to do this in this
package, just that it works fairly easily to expand the scope of the
Conversions goodie, as well.

Gonna need feedback from @moollaza and @mintsoft.

On the upside, I found a bug in the styler code by writing a test here!
2014-06-28 04:27:57 +08:00
Matt Miller
cd1d480294 NumberStyler: add proof-of-concept
Considering how all of this works, I'm not sure roles are quite the
right fit. It seems like we might just want a shared "Utility" package
or namespace to let us have access to some common library functions.

DDG::GoodieRole::NumberStyle is a particularly horrible name because
it's not even a role!

Also, the comments suck.

But such is the nature of a proof-of-concept.
2014-06-28 04:27:57 +08:00
Matt Miller
13c9ea7f55 Calculator: superscripting for arbitrary terms.
This would be better with some proper parsing, but this resolves some
issues with the current HTML output, making it raise things to
arbitrarily high superscripting levels based on what it seems to look
like.
2014-06-28 04:22:37 +08:00
Matt Miller
31b3443764 Calculator: refactor the output preprocessing.
I think this makes it somewhat easier to follow the intent here.  We're
just trying to convert these two known strings into different output
formats, so wrapping that up seems like a good idea.
2014-06-28 04:22:37 +08:00
Matt Miller
8745daaaea Calculator: use proper quoting of regex chars.
The old version clearly worked, but it was clunky and somewhat
inexplciable.  While reading up on something else, I discovered `perldoc
quotemeta` which resolves this in a much more predictable and correct
way.
2014-06-28 04:22:37 +08:00
Rob Emery
f9732ea9bc RegexCheatSheet: Switching our to my 2014-06-27 20:30:32 +01:00
Rob Emery
3e638e9283 Fortune: switching our to my 2014-06-27 20:29:21 +01:00
nishanths
5588470fb3 add ignorable word "display"
for query “How do I display a greater than sign in html”
2014-06-26 15:34:00 -07:00
nishanths
b54999273c change queries, add more natural queries with "?" 2014-06-26 15:06:23 -07:00
Rob Emery
b8f896a72a Fortune: Moving the file loading out of the sub so it's only loaded once 2014-06-26 22:04:17 +01:00
Rob Emery
d7b24620f8 RegexCheatSheet: switching to softabs 2014-06-26 21:53:19 +01:00
Rob Emery
444ab4a2f4 RegexCheatSheet: Normalising the whitespace around the regex symbols 2014-06-26 21:51:02 +01:00
Rob Emery
9de10e2cf0 Regex: moving the CSS slurp out of the sub so it's only parsed once 2014-06-26 21:45:50 +01:00
Pattarawat Chormai
5852576d88 Clean up waste space 2014-06-27 00:05:35 +07:00
Pattarawat Chormai
67f1b8b31c Return nothing if we find invalid date like Feb 30th 2014-06-27 00:05:34 +07:00
nishanths
d2efbb9dac add support for natural queries
- triggers to ‘any’
- add more triggers
- regex
- add tests
2014-06-25 21:28:20 -07:00
nishanths
166ed7870e change scope of $html to fix build 2014-06-25 15:32:01 -07:00
Rob Emery
90f893da43 BloodDonor: using new classes for colours! 2014-06-25 19:09:38 +01:00
gdrooid
af5cedf62e MD5: Fixed example queries. 2014-06-25 19:18:21 +02:00
nishanths
b6b021d774 explicit return 2014-06-25 08:14:41 -07:00
nishanths
b915e13bc1 html cleanup again 2014-06-25 08:11:09 -07:00
nishanths
0fa4095f62 clean up html tags 2014-06-25 07:59:54 -07:00
nishanths
f4f5293bbf Revert fc7bb8d..0f2e6ed
This rolls back to commit fc7bb8d564bf69ddeb4e276f72201f690d8063be.
2014-06-25 07:56:57 -07:00
nishanths
0f2e6ed822 Revert "clean up html output tags"
This reverts commit fc7bb8d564bf69ddeb4e276f72201f690d8063be.
2014-06-25 07:54:06 -07:00
nishanths
fc7bb8d564 clean up html output tags 2014-06-25 07:52:04 -07:00
gdrooid
5e2c0ee6b4 MD5: Removed base64 mode. Changed to trigger on startend. 2014-06-25 16:12:27 +02:00
Matthew Ramina
1f105afbb1 Teredo: gray labels, not italicize them 2014-06-25 09:33:04 -04:00
Matthew Ramina
2dddf7b00b SubnetCalc: spans instead of tables 2014-06-25 09:09:42 -04:00
gdrooid
198bb55834 MD5: Changed output to read MD5 instead of Md5. 2014-06-25 11:20:43 +02:00
nishanths
458e3de05e hash additions, fixes 2014-06-24 22:51:11 -07:00
nishanths
38ec92a4a8 cleanup
- accented_chars changes for the future
- substitutions in the Encode Goodie are now after the ‘else’ block
- regex change to one liners
- tests
2014-06-24 20:19:37 -07:00
nishanths
34d4ad5f01 URL encode now encodes reserved chars 2014-06-24 19:29:03 -07:00
nishanths
84f9dfd124 text--primary and text--secondary css 2014-06-24 13:27:50 -07:00
gdrooid
583b3045fb MD5: Restyled the response to match other IAs. 2014-06-24 22:22:10 +02:00
nishanths
f54ce2bf0b move css to separate files 2014-06-24 13:06:33 -07:00
gdrooid
43dde6ac8b MD5: Added comments to the source code. 2014-06-24 21:32:57 +02:00
jagtalon
7a4d762f3f Conversions: Use new CSS classes
These new CSS classes allow Goodies to work well with themes.
2014-06-24 19:25:27 +00:00
Matt Miller
41c070ba2b Calculator: fix mis-construed style for numbers with initial 0.
There should never be a thousands separator in that place, so don't
allow one.  This was a bit masked by taking all of the numbers in
combination which gave them more context.

Testing a number individually exposed the error.
2014-06-24 15:51:08 +08:00
nishanths
a77eff4f24 Revert "regex fix"
This reverts commit 65072a4661005f650f3edaf17cfc51ccf032a681.
2014-06-24 00:38:16 -07:00
nishanths
65072a4661 regex fix
avoid, for example, removal of “sign” from “design”
2014-06-23 23:53:45 -07:00
Matt Miller
bc2249abde Calculator: improve precision/accuracy trade-off.
This includes multiplication and division in things which should not be
rounded to our determined precision. While this doesn't break any
current tests, it might lead to some surprising floating-point issues.

On the other hand, the other way led to some surprising results where

418.10 / 2 != 418.1 / 2

Hopefully there exists a better long-term solution which we'll find soon
enough.

Addresses issue #509.
2014-06-24 13:22:58 +08:00
nishanths
ced5244f8b Add css
File level:
- Rename decode module

Changes:
- Add css (not in share folder)
- Improve triggers
- Improve brackets vs. bracket, quotes vs. quote

Other:
- More tests
- Comments
- minor regex for spaces, html decoding
2014-06-23 22:12:47 -07:00
David Wilkins
769f3cab88 Add additional triggers (variations on shēngxiào) 2014-06-23 18:46:03 +08:00
Rob Emery
851954f4e8 BloodDonor: Adding styling as suggested by @chrismorast 2014-06-22 20:13:35 +01:00
David Wilkins
f73dd0721e Stricter filtering of date queries 2014-06-21 11:15:25 +08:00
David Wilkins
6244a1ada7 Add stricter filters on year 2014-06-21 09:57:48 +08:00
gdrooid
69c7c4ee09 Added 'Md5:' at the beginning of the answer. 2014-06-20 16:57:04 +02:00