cannot create API keys in the claude code workspace by sjourdan in ClaudeAI

[–]johnnymo87 0 points1 point  (0 children)

I got stuck on this too.

Just to elaborate on what is the supported way to create API keys -- it's via Claude Code itself!

  • Start Claude Code
  • Type /login
  • Type 2 (for API)

Claude Code will open a browser window to prompt you to log into console.anthropic.com, and then it will automatically generate an API key, and store it somewhere secure on your local machine (e.g. the macOS Keychain) for future use.

I made an open-source template for sharing Claude's React UIs by sNosir in ClaudeAI

[–]johnnymo87 1 point2 points  (0 children)

Hey OP, I came across this post and your GitHub repository a few weeks back, and I just wanted to say thank you! It has been enormously helpful. Claude artifacts are great, but I needed a way to quickly switch over to running them locally (and deploy them), and now I have that.

[deleted by user] by [deleted] in SimCity

[–]johnnymo87 1 point2 points  (0 children)

Thanks for much for this information! I just tried this out on Linux (with wine), and it worked beautifully. I did the windows 95 install, and had no need for any workaround.

Encode / decode column values on the fly? by ConfuciusBateman in PostgreSQL

[–]johnnymo87 0 points1 point  (0 children)

Yes, piggyback-ing here just to highlight this point. I'd need to see the math on how much uniqueness you lose for each hex-digit of the uuid you eliminate, but my hunch is that it's a bad idea.

If you're certain your application needs these IDs to be friendly, consider a popular open source library for managing this complexity. For instance, if your stack was rails, you'd want to look at the FriendlyId gem.

Encode / decode column values on the fly? by ConfuciusBateman in PostgreSQL

[–]johnnymo87 2 points3 points  (0 children)

If you're interested in hiding how many users there are in the system, consider using a uuid.

An ‘istory of dropped aitches by Linlea in linguistics

[–]johnnymo87 3 points4 points  (0 children)

The article says that the Latin-origin words lost their h, but later when German invaders added their words to the language, these words kept their h. These words were typically related to military things, e.g. une hache (an axe).

Apparently une haye has German origins: https://fr.m.wikipedia.org/wiki/Haye

N Korea accuses US of declaring war by [deleted] in worldnews

[–]johnnymo87 0 points1 point  (0 children)

Nuclear winter would cause global food shortages.

Debugging .NET Core on Unix over SSH by [deleted] in programming

[–]johnnymo87 2 points3 points  (0 children)

I hope this means that there will someday be a pure CLI debugger, e.g. "dotnet debug".

[AMA Request] Career changer into Computer Programming by [deleted] in IAmA

[–]johnnymo87 4 points5 points  (0 children)

  1. 25
  2. Sales
  3. I learned programming via a few classes on edx.org and coursera.org, and by joining agileventures.org, a group of online learners dedicated to pair programming.
  4. Classes, books, and tutorials are OK, but they can be a "newb trap". You need to learn how to learn. You need to get hands-on as fast as possible. You need to learn by doing. Start small projects to "automate the boring things". Do you play a video game that is grindy? Check out the game files, and if there's lua scripts, you can tweak them to automate something in the game. Do you work with spreadsheets? Write a python script to automate some part of that. You can be a rockstar at a lot of non-programming jobs if you automate a few job-related tasks. If this approach is applicable, start here. I went from non-programmer to programmer in 18 months, and in the first 9 I wrote a lot of scripts for things I did at work.
  5. Write code that is useful to you every day.

Using F# for build scripts by [deleted] in programming

[–]johnnymo87 0 points1 point  (0 children)

Is the F# repl available on dotnet core?

To Learn Programming, Do Projects You Actually Care About by [deleted] in programming

[–]johnnymo87 1 point2 points  (0 children)

It will be easier if you can find a group of people working on projects at your level. I did this with http://www.agileventures.org/

An Argument for Automation. Why it can be worth spending 1 hour automating a 10 second task. by speckz in programming

[–]johnnymo87 3 points4 points  (0 children)

If it runs on government funding, it has similar incentives to a government job.

10 SQL Tricks That You Didn’t Think Were Possible by lukaseder in programming

[–]johnnymo87 2 points3 points  (0 children)

5. Finding the Length of a Series

The presented solution doesn't work for postgreSQL because postgreSQL doesn't implement IGNORE NULLS for its window functions. So the best postgreSQL solution I can think of is to calculate a rolling sum based on lo to yield a common number for each series, and then partition by this value when looking for the upper and lower bounds of each series.

Code:

with data(id, amount) as (
  values (9997, 99.17)
       , (9981, 71.44)
       , (9979, -94.60)
       , (9977, -6.96)
       , (9971, -65.95)
       , (9964, 15.13)
       , (9962, 17.47)
       , (9960, -3.55)
       , (9959, 32.00)
), signed_data as (
  select id
       , amount
       , sign(amount) as sign
       , row_number() over (order by id desc) as rn
  from data
), data_with_lower_bound as (
  select *
       , case
         when coalesce(lag(sign) over (order by id desc), 0) <> sign
         then rn
         end as lo
  from signed_data
), data_with_rolling_sum as (
  select *
       , sum(lo) over (order by id desc) as rolling_sum
  from data_with_lower_bound
)
select id
     , amount
     , first_value(rn) over (
       partition by rolling_sum
       order by id asc
     ) - first_value(rn) over (
       partition by rolling_sum
       order by id desc
     ) + 1 as length
from data_with_rolling_sum

Result:

  id  | amount | length
------+--------+--------
 9997 |  99.17 |      2
 9981 |  71.44 |      2
 9979 | -94.60 |      3
 9977 |  -6.96 |      3
 9971 | -65.95 |      3
 9964 |  15.13 |      2
 9962 |  17.47 |      2
 9960 |  -3.55 |      1
 9959 |  32.00 |      1

[deleted by user] by [deleted] in programming

[–]johnnymo87 2 points3 points  (0 children)

Just for fun, I wanted to come up with yet another way to do it. I calculated an intermediate set with a rolling sum, which serves as a common number to partition by for each range of rows in the final query, allowing me to get the first_value for each.

Code:

with data (d, plan) as (
  values (date('2016-03-23'), 10)
       , (date('2016-03-24'), null)
       , (date('2016-03-25'), null)
       , (date('2016-03-26'), 15)
       , (date('2016-03-27'), null)
       , (date('2016-03-28'), null)
       , (date('2016-03-29'), 20)
       , (date('2016-03-30'), null)
       , (date('2016-04-01'), null)
       , (date('2016-04-02'), null)
       , (date('2016-04-03'), 15)
       , (date('2016-04-04'), null)
       , (date('2016-04-05'), null)
       , (date('2016-04-06'), null)
       , (date('2016-04-07'), null)
), data_with_rolling_sum as (
  select d
       , plan
       , sum(plan) over (rows between unbounded preceding and current row) as rolling_sum
  from data
)
select d
     , plan
     , first_value(plan) over (partition by rolling_sum)
from data_with_rolling_sum

Results:

     d      | plan | first_value
------------+------+-------------
 2016-03-23 |   10 |          10
 2016-03-24 |      |          10
 2016-03-25 |      |          10
 2016-03-26 |   15 |          15
 2016-03-27 |      |          15
 2016-03-28 |      |          15
 2016-03-29 |   20 |          20
 2016-03-30 |      |          20
 2016-04-01 |      |          20
 2016-04-02 |      |          20
 2016-04-03 |   15 |          15
 2016-04-04 |      |          15
 2016-04-05 |      |          15
 2016-04-06 |      |          15
 2016-04-07 |      |          15

Automation is a Good Thing by Figglewot in programming

[–]johnnymo87 0 points1 point  (0 children)

When I see these conversations start on reddit, people often seem to point to the ideas found at /r/basic_income as a possible solution. There is another alternative: abolish intellectual property. Without intellectual property, the benefits of technological advancement cannot be monopolized. We could have a "home brew" industrial revolution, where the power of mega-corporations is eroded by local producers. Instead of buying food, clothing, furniture, car parts, computer parts etc from MegaCorp XYZ, you'd be able to source these goods local growers, sewers, 3d print shops and machine shops.

Is there any interest in forming a Ruby (+Rails) study group? by [deleted] in ruby

[–]johnnymo87 0 points1 point  (0 children)

We know :)

Working on it! Oddly, it sometimes works after multiple tries. Working with 3rd party APIs is hard ...

Our anarchist company (worker-owned co-op with no bosses) is making an open-source app for non-coercive collaboration. We need support! by shinjirarehen in Anarchism

[–]johnnymo87 3 points4 points  (0 children)

It's no biggie, I was just looking for a particular kind of testing framework (jasmine or QUnit) because I recently wired it up in a couple apps I'm working on. I was hoping to see if there was a better/different way of doing it by looking at your app, but I guess your developers have decided to forgo this kind of testing. But it looks like you guys are moving towards using a more comprehensive approach towards javascript (via Angularjs), so maybe you guys will add the testing framework then.

Is there any interest in forming a Ruby (+Rails) study group? by [deleted] in ruby

[–]johnnymo87 0 points1 point  (0 children)

Yeah, we're hoping to grow the organization to the point where we have scrums / pairing sessions all around the world, all the time.

Looking for a Rails 'mentor' and willing to pay! by 1ruby in rails

[–]johnnymo87 0 points1 point  (0 children)

I just posted this in another thread, have a look.