Giter Site home page Giter Site logo

kirillosenkov / quickinfo Goto Github PK

View Code? Open in Web Editor NEW
172.0 12.0 28.0 2.06 MB

http://quickinfo.io - a search textbox with extensible "answers" (calculator, unit-converter, colors, ascii/unicode, etc). See demo at http://quickinfo.io/?demo

License: MIT License

C# 99.43% HTML 0.08% JavaScript 0.32% CSS 0.18%

quickinfo's Issues

Remove HTML from responses

The readme mentions getting quick answers from command line as motivation for this project

how do I generate a random Guid from command line

Currently, queries return HTML that is then directly placed in the website.
Would you be open to accepting a PR that refactors all queries to internally work with data structures friendly for programmatic consumption? Ultimately, the Engine could format these response as HTML, plain text or whatever is the flavor of the month.

How would you like these data structure to look like? How about a collection key-value pairs?

Arbitrary precision arithmetic

(((((365) * 4 + 1) * 25 - 1) * 4 + 1) * 25 - 366) * (10000 * 1000 * 60 * 60 * 24) - 1
double is not good enough for this

6'5" + 11"

Understand feet\inches notation by providing conversion to metric units and simple arithmetic.

cheat.sh

Part of the vision was to have something like http://cheat.sh - see if it makes sense to integrate in some way

Update nuget package

Thank you for building this tool. Would it be possible to update the nuget package with the latest changes? Current version doesn't have support for airport codes nor does the Unicode search.

"100 eur in usd" currency conversion throws

System.AggregateException: One or more errors occurred. (Response status code does not indicate success: 404 (Not Found).) ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at System.Net.Http.HttpClient.d__27.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()
at QuickInfo.Currency.GetRate(String from, String to) in C:\QuickInfo\src\QuickInfo\Processors\Converters\Currency.cs:line 35
at QuickInfo.Currency.<>c__DisplayClass4_0.b__0(ICacheEntry e) in C:\QuickInfo\src\QuickInfo\Processors\Converters\Currency.cs:line 25
at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreate[TItem](IMemoryCache cache, Object key, Func`2 factory)
at QuickInfo.Currency.Convert(String from, String to, Double value) in C:\QuickInfo\src\QuickInfo\Processors\Converters\Currency.cs:line 21
at QuickInfo.Units.<>c.<.cctor>b__64_90(Double p) in C:\QuickInfo\src\QuickInfo\Processors\Converters\Units\Units.cs:line 175
at QuickInfo.UnitConverter.GetResult(Double value, Conversion conversion) in C:\QuickInfo\src\QuickInfo\Processors\Converters\Units\UnitConverter.cs:line 251
at QuickInfo.UnitConverter.GetResult(Double value, Unit unit, Unit toUnit) in C:\QuickInfo\src\QuickInfo\Processors\Converters\Units\UnitConverter.cs:line 179
at QuickInfo.UnitConverter.GetResult(Query query) in C:\QuickInfo\src\QuickInfo\Processors\Converters\Units\UnitConverter.cs:line 106
at QuickInfo.Engine.GetResults(Query query) in C:\QuickInfo\src\QuickInfo\Engine.cs:line 55
at QuickInfo.Controllers.AnswersController.GetSingleResponseWorker(Engine engine, String input, HttpRequest request) in C:\QuickInfo\src\QuickInfoWeb\Controllers\AnswersController.cs:line 101
at QuickInfo.Controllers.AnswersController.GetResponse(Engine engine, String input, HttpRequest request) in C:\QuickInfo\src\QuickInfoWeb\Controllers\AnswersController.cs:line 84
at QuickInfo.Controllers.AnswersController.Get(String query) in C:\QuickInfo\src\QuickInfoWeb\Controllers\AnswersController.cs:line 16
---> (Inner Exception #0) System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at System.Net.Http.HttpClient.d__27.MoveNext()<---

Replace fixer.io with exchangerates.io

While fixer.io provides a free tier it does require and API key. This can be a bit of an issue if the library is used from a desktop application as it will require building a mechanism to provide the access key (and the potential not technical user to create such a key). Using https://exchangeratesapi.io/ is free and doesn't require any key. More than that it's API is fully compatible with fixer.io.

I see 3 potential options:

  1. Replace fixer.io with exchangerates.io in the current implementation.
  2. Build a mechanism that allows specifying the api in the quickinfo library.
  3. I can just build my own currency processor. However I thought it could be potentially beneficial for library consumers.

I would be happy to provide a PR with the changes for the first 2 options if you consider them.

Liquid volume

3 tsp = 1 tbsp
2 tbsp = 1 oz
1/2 cup = 4 oz
1 cup = 8 oz
1 pint = 2 cups
1 quart = 4 cups
1 gallon = 4 quarts

5 mi

should be interpreted as 5 miles

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.