Thursday, August 3, 2023

Show HN: TripClub – Plan Travel with AI https://ift.tt/XVxrCTZ

Show HN: TripClub – Plan Travel with AI Hey HN! This is Will and Riley from TripClub ( https://tripclub.ai/ ). TripClub helps you plan and visualize your trips while giving you recommended itineraries to anywhere in the world based on your input. We began working on this when we couldn’t find a good solution to plan trips with friends, and found that most people we knew used something like google docs along with 24 tabs for researching places. Also, with the recent progress in generative AI, we found that we could now create detailed trips based on any input you’d like, and turn these into visually appealing itineraries. As you may have suspected, we primarily use openAI models for trip generation on the backend. We put the recommendations into an interactable map and itinerary. After creating a trip, you can add your friends so everyone can collaborate on editing the various places on your itinerary. Right now every aspect of the app is free and we hope to keep it that way. However we haven’t built in a source of revenue at the moment and are fully bootstrapped, so this could change (we plan to make revenue on hotel bookings in the future). We’re looking forward to hearing any of your comments, questions, and feedback! https://tripclub.ai/ August 3, 2023 at 09:06PM

Show HN: Learn languages through immersion with AI friends https://ift.tt/zvLXgP6

Show HN: Learn languages through immersion with AI friends https://ift.tt/QcHEa41 August 3, 2023 at 07:26PM

Show HN: Grammar Generator App for Llama.cpp https://ift.tt/qaEKoWy

Show HN: Grammar Generator App for Llama.cpp llama.cpp added context-free grammar guided generation functionality. It requires passing a file in a derivative of BNF notation, which gets messy very quickly for things like JSON. To improve the experience, we built a small compiler from TypeScript interfaces to the grammar file format and have it hosted in a little browser app. See more in discussion at https://ift.tt/caMeJgZ https://ift.tt/k9o2v6U August 3, 2023 at 02:09AM

Show HN: Using LLama2 to Correct OCR Errors https://ift.tt/TD6JP9L

Show HN: Using LLama2 to Correct OCR Errors I've been disappointed by the very poor quality of results that I generally get when trying to run OCR on older scanned documents, especially ones that are typewritten or otherwise have unusual or irregular typography. I recently had the idea of using Llama2 to use common sense reasoning and subject level expertise to correct transcription errors in a "smart" way-- basically doing what a human proofreader who is familiar with the topic might do. I came up with the linked script that takes a PDF as input, runs Tesseract on it to get an initial text extraction, and then feeds this sentence-by-sentence to Llama2, first to correct mistakes, and then again on the corrected text to format it as markdown where possible. This was surprisingly easier than I initially expected thanks to the very nice tooling now available in libraries such as llama-cpp-python, langchain, and pytesseract. But the big issue I was encountering was that Llama2 wasn't just correcting the text it was given-- it was also hallucinating a LOT of totally new sentences that didn't appear in the original text at all (some of these new sentences used words which never appeared elsewhere in the original text). I figured this would be pretty simple to filter out using fuzzy string matching-- basically check all the sentences in the LLM corrected text and filter out sentences that are very different from any sentences in the original OCRed text. To my surprise, this approach worked very poorly. In fact, lots of other similar tweaks, including using bag-of-words and the spacy NLP library in various ways (spacy worked very poorly in everything I tried). Finally I realized that I had a good solution staring me in the face: Llama2. I realized I could get sentence level vector embeddings straight from Llama2 using langchain. So I did that, getting embeddings for each sentence in the raw OCRed text and the LLM corrected text, and then computed the cosine similarity of each sentence in the LLM corrected text against all sentences in the raw OCRed text. If no sentences match in the raw OCRed text, then that sentence has a good chance of being hallucinated. In order to save the user from having to experiment with various thresholds, I saved the computed embeddings to an SQLite database so they only had to be computed once, and then tried several thresholds, comparing the length of the filtered LLM corrected text to the raw OCRed text; if things worked right, these texts should be roughly the same length. So as soon as the filtered length dips below the raw OCRed text length, it backtracks and uses the previous threshold as the final selected threshold. Anyway, if you have some very old scanned documents laying around, you might try them out and see how well it works for you. Do note that it's extremely slow, but you can leave it overnight and maybe the next day you'll have your finished text, which is better than nothing! I feel like this could be useful for sites like the Internet Archive-- I've found their OCR results to be extremely poor for older documents. I'm very open to any ideas or suggestions you might have. I threw this together in a couple days and know that it can certainly be improved in various ways. One idea that I thought might be fun would be to make this work with a Ray cluster, sending a different page of the document to each of the workers in the cluster to do it all at the same time. https://ift.tt/YxG6PAH August 3, 2023 at 01:23AM

150 Years Ago Today – The Cable Car is Born

150 Years Ago Today – The Cable Car is Born
By Kelley Trahan

August 2, 2023, marks the 150th anniversary of the world’s first successful cable railway, born right here in San Francisco. To celebrate the occasion, we bring you the story of Andrew Hallidie and the very first cable car company, the Clay Street Hill Railroad. 

Andrew Hallidie (1834-1900) was a pioneering inventor and entrepreneur who changed urban transportation. In 1852, at the age of 18, Hallidie emigrated with his father from the United Kingdom to San Francisco during the California Gold Rush. His father, an engineer and inventor, had a wire rope patent that played a crucial role in his son's future success.  

Black and white photo of Cable Car Inventor Andrew Hallidie.

Portrait of Andrew Smith Hallidie in 1890.

Inspired by his father's wire rope business, Hallidie developed a steel cable mineral mine hauling system in 1857. About a decade later, he designed a wire rope aerial tramway for transporting materials over mountainous terrain. Then, after a stint in bridge construction across California, he returned to San Francisco. 

Legend has it that the idea to build a cable car came to Hallidie one foggy, wet San Francisco evening in 1869 when he witnessed a tragic accident. A team of horses pulling a streetcar up a steep cobblestone hill slipped, causing the streetcar and horses to slide down the hill into a heap of wreckage. Drawing on his mining experience, Hallidie believed he could come up with a better way to transport people up and over San Francisco’s many hills.

Picture of an 19th Century bus ticket that says Clay Street Hill Railroad Co.

Transfer from the Clay Street Hill Railroad Company used until early 1875.

Hallidie chose Clay Street between Kearny and Jones as the first route and raised $118,000, including significant investments from the residents of Clay Street. With engineering design work by William Eppelsheimer, construction began in early 1873. By mid-summer, the double-track line, powerhouse, cable and cars were completed at a total cost of $85,150. The first test run took place in the pre-dawn hours of August 2, 1873, and proved to be a tremendous success. One month later, on September 1, 1873, the Clay Street Hill Railroad Company began regular passenger service with a fare of five cents.  

Black and white photo of two cable cars with people riding on the back and looking at the camera.

Clay St. Hill Railroad Co. Dummy 7 and Trailer on Clay and Jones Streets in 1873.

Hallidie's historic efforts not only revolutionized transportation but also yielded profitable returns for his investors. His invention provided a safe and efficient means of travel up and down the city's hills and spurred the expansion and development of San Francisco's neighborhoods and businesses. The Clay Street Hill Railroad marked the beginning of many cable car railways in San Francisco and around the world. Within just two decades, eight different companies operated cable cars on 54 miles of track around the city. 

Throughout his life, Hallidie remained active in various engineering ventures and played a vital role in founding the San Francisco Mechanics' Institute, promoting scientific and technological education. Hallidie Plaza, near the Powell and Market Street cable car turntable, and the Hallidie Building in the city's Financial District are named after him. 

Black and white photo of a ceremony at the bottom of an escalator with crowds watching a speaker.

Dedication Ceremony for Hallidie Plaza at Market and Powell Street on March 14, 1973

Although none of the original Clay Street Hill Railroad line remains today, its legacy lives on. Muni’s 1 California bus route traverses the same path over Nob Hill and two cable cars that once served the line survive to this day. An original 1870s grip car, number 8, is on display in the San Francisco Cable Car Museum, and “Big” Cable Car 19, one of the last cable cars to run on Clay Street, is back in limited service through the fall in honor of the 150th anniversary. 

Color photo of a cable car with people riding on board and a man giving it a push start.

150th Anniversary of the cable cars kickoff event with "Big 19,” on July 10, 2023

Celebrate the 150-year legacy by hopping on San Francisco’s iconic cable cars or catching a special anniversary event. Find more information at SFMTA.com/CableCars150 and https://sfcablecars.org



Published August 03, 2023 at 12:33AM
https://ift.tt/jScO4C8

Show HN: We built swup+fragment-plugin to visually enhance classic websites https://ift.tt/ZXDuEiJ

Show HN: We built swup+fragment-plugin to visually enhance classic websites ## TL;DR - Progressively enhance your classic website / MPA to a single page app. - Support for fragment visits, comparable to nested routes in React or Vue. - Keep your site crawlable and indexable without any of the overhead of SSR. - No tight coupling of back- and frontend. Use the CMS / Framework / SSG of your choice. - Strong focus on interoperability with DOM-altering JS tools (think Alpine.js, jQuery, ...). - Strong focus on accessibility, even for fragment visits. ## Long Version: Best of three worlds Hi, I'm Rasso Hilber. I have been a web designer and developer since around 2004. From the beginning of my career, I always had to make tradeoffs between 3 goals when building websites: 1. The websites I build should be visually impressive, original, and snappy. 2. The websites I build should be crawlable, accessible and standards compliant. 3. The websites I build should have low technical complexity and be easy to maintain in the long run. In the beginning, I was able to achieve goals 1 (impressive!) and 3 (easy to maintain!) by using Macromedia/Adobe Flash, but due to the nature of the technology horribly failed to deliver crawlable and accessible websites. Later, I found a way to run two sites in parallel for each website I built, one using CMS-generated XHTML for crawlability, one in Flash for the visitors, fetching the data from its XHTML twin. Now I had solved goals 1 and 2, but my setup was awfully complex and brittle. Around 2010, I was relieved to see Flash finally coming to its end. I switched to building websites using PHP, HTML, and jQuery. I could now tick goals 2 (accessibility) and 3 (low complexity), but the websites I was able to build using these technologies weren't as impressive anymore. Hard page loads between every link click being one of the biggest regressions in UX from the days of Flash IMO. Around 2014/15, I first heard about the new frameworks: Angular, React, Vue. These frameworks were not intended to be used for classic websites. They were made for single-page-apps! But it felt to me like no one cared. Even when building classic websites, many developers sacrificed SEO and accessibility for a snappy experience, serving an empty `
` to the browser. I couldn't blame them; I had done the same in my early days as a Flash developer. They ticked goal 1 (impressive) and goal 3 (low complexity). But the lack of accessibility kept me from joining the movement. I was still building classic websites, after all. After some time, many started realizing that serving an empty div had downsides – SSR, hydration, and whatnot were born, now ticking goal 1 (impressive) and goal 2 (accessibility), with the trade-off of awful complexity. It reminded me a lot of my little Frankenstein's monster "Flash+XHTML," and I still didn't want to join the hype. Still, because the noise was so loud, I felt like I might be becoming obsolete, an "old man yelling at the clouds". New very interesting tools like HTMX or Unpoly popped up that looked promising at first, but at closer inspection weren't optimized for my use case either. These were primarily built for real interfaces/single-page-apps (html snippets instead of full pages, UI state independent of URLs, altered DOM saved in history snapshots, ...). I wanted to find a tiny tool, optimized for building presentational , content-driven websites with a strong focus on accessibility . Instead, after a few years of rolling my own home-grown solutions, I started using swup[0], a "Versatile and extensible page transition library for server-rendered websites". Swup consists of a tiny core and a rich ecosystem of official plugins[1] for additional functionality. It was hitting the sweet spot between simplicity and complexity, and felt like it was perfect for my use cases. Shortly after I had started using it, I became a core contributor and maintainer of swup. The only thing I was still missing to be a happy developer was the ability to create really complex navigation paths where selected fragments are updated as you navigate a site, much like nested routes allow in React or Vue. The last two months I teamed up with @daun [2] to finally solve this hard problem. The result is two things: 1. A new major release of swup (v4) that allows customizing the complete page transition process by providing a powerful hook system and a mutable visit object 2. The newly released fragment-plugin [3] that provides a declarative API for dynamically replacing containers based on rules Use cases for the fragment-plugin are: - a filter UI that live-updates its list of results on every interaction - a detail overlay that shows on top of the currently open content - a tab group that updates only itself when selecting one of the tabs - a form that updates only itself upon submission I can now finally build websites that tick all three boxes: 1. Visually impressive, fun, and snappy by using swup's first-class support for animations[4], cache[5], and preload capacities[6], enhanced with fragment visits as seen on the demo site. 2. Accessible by being able to serve server-rendered semantic markup that will fully work even with JavaScript disabled (try it out on the demo site!). On top of that, swup's a11y plugin[7] will automatically announce page visits to assistive technologies and will focus the new `
` element after each visit. 3. Because now all I need for my fancy frontend is a bit of progressive JavaScript, I can choose whatever tool I like on the server, keeping complexity low and maintainability high. I can use SSGs like eleventy or Astro (the demo site is built using Astro!), I can use any CMS like WordPress or ProcessWire, or a framework like Laravel. And I don't have to maintain an additional node server for SSG! The plugin is still in it's early stages, but I have a good feeling that this finally is the right path for me as a web developer. All it took was 20 years! ;) [0] https://ift.tt/hNK038M [1] https://ift.tt/WtK6Izl [2] https://github.com/daun [3] https://ift.tt/n3z17qF [4] https://ift.tt/zPLfIU1 [5] https://ift.tt/s8ZNRhp [6] https://ift.tt/5PbB72m [7] https://ift.tt/i0skID1 https://ift.tt/sDBAUkW August 2, 2023 at 05:45PM

Show HN: Glo Dollar – the antipoverty stablecoin https://ift.tt/2EyfiVI

Show HN: Glo Dollar – the antipoverty stablecoin Hi everyone! I just shipped a crypto project which I think all of you might actually like. It’s a digital dollar that helps end extreme poverty called Glo Dollar. We're backed by Sid Sijbrandij (GitLab). How it works: 1. You buy $1 Glo Dollar for $1 USD 2. Our partners invest the $1 USD in US Treasuries 3. Revenue we make we donate to a charity called GiveDirectly.org who use it to fund basic income programs for people in extreme poverty Note that you can _always_ redeem your $1 Glo Dollar for $1 USD again. We’re doing this because we believe stablecoins are a public good and should be managed as one. At the moment, the two big stablecoin companies are making record profits for a tiny group of shareholders instead. Tether, the issuer of USDT, shared profits of ~$1.5 billion in Q1 on assets under management of ~60 billion, with just ~50 people on staff. Even though its success is mostly attributable to the ecosystem’s adoption. Glo Dollar seeks to radically change this dynamic by repurposing its revenue to a good cause rather than risk/profit-seeking shareholders. At scale, we could lift millions of people out of extreme poverty. So even if you loathe crypto, we hope you at least appreciate what we’re trying to achieve. Very curious what y’all think :-)! https://ift.tt/EvTHsXA August 2, 2023 at 11:52PM

Show HN: Do You Know RGB? https://ift.tt/t8kUpbO

Show HN: Do You Know RGB? https://ift.tt/OWhvmMT June 24, 2025 at 01:49PM