top | item 45969018

(no title)

dwringer | 3 months ago

Well, I tried a variation of a prompt I was messing with in Flash 2.5 the other day in a thread about AI-coded analog clock faces. Gemini Pro 3 Preview gave me a result far beyond what I saw with Flash 2.5, and got it right in a single shot.[0] I can't say I'm not impressed, even though it's a pretty constrained example.

> Please generate an analog clock widget, synchronized to actual system time, with hands that update in real time and a second hand that ticks at least once per second. Make sure all the hour markings are visible and put some effort into making a modern, stylish clock face. Please pay attention to the correct alignment of the numbers, hour markings, and hands on the face.

[0] https://aistudio.google.com/app/prompts?state=%7B%22ids%22:%...

discuss

order

kjgkjhfkjf|3 months ago

This is quite likely to be in the training data, since it's one of the projects in Wes Bos's free 30 days of Javascript course[0].

[0] https://javascript30.com/

baxtr|3 months ago

I was under the impression for this to work like that, training data needs to be plenty. One project is not enough since it’s too "sparse".

But maybe this example was used by many other people and so it proliferated?

stalfie|3 months ago

The subtle "wiggle" animation that the second hand makes after moving doesn't fire when it hits 12. Literally unwatchable.

apetresc|3 months ago

In its defence, the code actually specifically calls that edge case out and justifies it:

    // Calculate rotations
    // We use a cumulative calculation logic mentally, but here simple degrees work because of the transition reset trick or specific animation style.
    // To prevent the "spin back" glitch at 360->0, we can use a simple tick without transition for the wrap-around,
    // but for simplicity in this specific React rendering, we will stick to standard 0-360 degrees.
    // A robust way to handle the spin-back on the second hand is to accumulate degrees, but standard clock widgets often reset.

skipnup|3 months ago

The Swiss and German railway clocks actually work the same way and stop for (half a?) second while the minute handle progresses.

https://youtu.be/wejbVtj4YR0

scotty79|3 months ago

Fixed with prompt "Second hand doesn't shake when it lands on 12, fix it." and 131 seconds. With a bunch of useState()-s and a useEffet()

kldg|3 months ago

in defense of 2.5 (Pro, at least), it was able to generate for me a metric UNIX clock as a webpage which I was amused by. it uses kiloseconds/megaseconds/etc. there are 86.4ks/day. The "seconds" hand goes around 1000 seconds, which ticks over the "hour" hand. Instead of saying 4am, you'd say it's 14.

as a calendar or "date" system, we start at UNIX time's creation, so it's currently 1.76 gigaseconds AUNIX. You might use megaseconds as the "week" and gigaseconds more like an era, e.g. Queen Elizabeth III's reign, persisting through the entire fourth gigasecond and into the fifth. The clock also displays teraseconds, though this is just a little purple speck atm. of course, this can work off-Earth where you would simply use 88.775ks as the "day"; the "dates" a Martian and Earthling share with each other would be interchangeable.

I can't seem to get anyone interested in this very serious venture, though... I guess I'll have to wait until the 50th or so iteration of Figure, whenever it becomes useful, to be able to build a 20-foot-tall physical metric UNIX clock in my front yard.

thegrim33|3 months ago

"Allow access to Google Drive to load this Prompt."

.... why? For what possible reason? No, I'm not going to give access to my privately stored file share in order to view a prompt someone has shared. Come on, Google.

LiamPowell|3 months ago

You don't want to give Google access to files you've stored in Google Drive? It's also only access to an application specific folder, not all files.

dragonwriter|3 months ago

I'm assuming because AI Studio persisted, including shared, prompts are stored in Drive, and prompt sharing is implemented on top of Drive file sharing, so if AI Studio doesn't have access to Drive it doesn't have access to the shared prompt.

lxgr|3 months ago

Because most likely (at least according to Hanlon's razor) they somehow decided that using Google Drive as the only persistent storage backing AI studio was a reasonable UX decision.

It probably makes some sense internally in big tech corporation logic (no new data storage agreements on top of the ones the user has already agreed to when signing up for Drive etc.), but as a user, I find it incredibly strange too – especially since the text chats are in some proprietary format I can't easily open on my local GDrive replica, but the images generated or uploaded just look like regular JPEGs and PNGs.

malfist|3 months ago

That is not the same prompt as the other person was using. In particular this doesn't provide the time to set the clock to, which makes the challenge a lot simpler. This also includes javascript.

The prompt the other person was using is:

``` Create HTML/CSS of an analog clock showing ${time}. Include numbers (or numerals) if you wish, and have a CSS animated second hand. Make it responsive and use a white background. Return ONLY the HTML/CSS code with no markdown formatting. ```

Which is much more difficult.

For what it's worth, I supplied the same prompt as the OG clock challenge and it utterly failed, not only generating a terrible clock, but doing so with a fair bit of typescript: https://ai.studio/apps/drive/1c_7C5J5ZBg7VyMWpa175c_3i7NO7ry...

dyauspitr|3 months ago

Having seen the page the other day this is pretty incredible. Does this have the same 2000 token limit as the other page?

Taek|3 months ago

No, and also the other page was pure HTML and CSS. This clock is using React and Javascript, so it's not a fair comparison.

dwringer|3 months ago

This isn't using the same prompt or stack as the page from that post the other day; on aistudio it builds a web app across a few different files. It's still fairly concise but I don't think it's that much so.

skybrian|3 months ago

It looks quite nice, though to nitpick, it has “quartz” and “design & engineering” for no reason.

wongarsu|3 months ago

Just like actual cheap but not bottom of the barrel clocks

pmarreck|3 months ago

holy shit! This is actually a VERY NICE clock!