There was a live demo of the next generation of OpenAI Codex code-generating software on August 10.
My impression from it is that "we have finally arrived" - this is a programming tool which seems to be more useful than an extra entry-level software engineer on the team. This starts to address the key bottleneck of our times: our limited ability to create software.
This was always my threshold: can we create an AI software which can be "hired instead of a junior software engineer"? That was the main temporal uncertainty for me: how long would it take to reach that level? It looks like this has been accomplished.
We are rapidly approaching the situation when AI will actively participate in programming AI software, for better or for worse...
OpenAI Codex is now a part of OpenAI API (which is still a closed beta with a waitlist), and it will be possible to participate in an informal competition today from 10am Pacific time (1pm Eastern) till 1pm Pacific (4pm Eastern) and try it a bit.
Links are in the comments.
My impression from it is that "we have finally arrived" - this is a programming tool which seems to be more useful than an extra entry-level software engineer on the team. This starts to address the key bottleneck of our times: our limited ability to create software.
This was always my threshold: can we create an AI software which can be "hired instead of a junior software engineer"? That was the main temporal uncertainty for me: how long would it take to reach that level? It looks like this has been accomplished.
We are rapidly approaching the situation when AI will actively participate in programming AI software, for better or for worse...
OpenAI Codex is now a part of OpenAI API (which is still a closed beta with a waitlist), and it will be possible to participate in an informal competition today from 10am Pacific time (1pm Eastern) till 1pm Pacific (4pm Eastern) and try it a bit.
Links are in the comments.
no subject
Date: 2021-08-12 09:52 pm (UTC)"Expected parse_imports('import os\nfrom typing import List') to equal ['os', 'typing.List'] but got ['os', 'typing', 'typing.List']"
I should also probably add their test case from the formulation of the problem to the code.
no subject
Date: 2021-08-12 10:00 pm (UTC)import ast from typing import List def parse_imports(code: str) -> List[str]: """ use ast.parse to make a parse tree from code traverse the parse tree to find Import constructs and to generate a fully qualified imported symbol for each construct sort the resulting list in ascending lexicographic order """ tree = ast.parse(code) result = [] for node in ast.walk(tree): if isinstance(node, ast.Import): for name in node.names: result.append(name.name) elif isinstance(node, ast.ImportFrom): if node.module == '__future__': continue # result.append(node.module) for name in node.names: result.append(f'{node.module}.{name.name}') return sorted(result) # Examples print(parse_imports('import os')) print(parse_imports('import os\nfrom typing import List')) test = """ import os import concurrent.futures from os import path as renamed_path from typing import ( List, Tuple ) """ # print(parse_imports(test)) print("this works in my Anaconda terminal, but has alignment problems within test string here")Rather remarkable!
no subject
Date: 2021-08-12 10:14 pm (UTC)Problem 5
You have several buckets whose sizes are represented by the list sizes. Find the number of different ways to arrange the buckets such that the first bucket’s size is greater than the second bucket’s size.
Constraints
sizes is a list of positive integers.
If sizes has fewer than 2 buckets, return 0.
Some buckets may have the same size, but are nevertheless treated as unique buckets.
Library Suggestion
Consider using the itertools module.
Examples
Input [10]
Output 0
Explanation No arrangement is possible.
Input [1, 2]
Output 1
Explanation The possible arrangements are (1, 2) and (2, 1). Of these, only (2, 1) has a first bucket that is bigger than the second bucket.
Input [1, 3, 1]
Output 2
Explanation Only the arrangements (3, 1, 1) and (3, 1, 1) satisfy the property that the first bucket is bigger than the second bucket.
import itertools from typing import List def count_arrangements(sizes: List[int]) -> int: """ if len(sizes) < 2 return 0 count permutations of sizes such that the first element of the permuted array is greater than the second element """ if len(sizes) < 2: return 0 return len( [ p for p in itertools.permutations(sizes) if p[0] > p[1] ] ) # Examples print(count_arrangements([1, 3, 1])) print(count_arrangements([1, 2]))no subject
Date: 2021-08-12 10:15 pm (UTC)It formed the list of good permutations, and returned its length!
It did not try to iterate and add the counter and all that imperative programming stupidity. Wow...
no subject
Date: 2021-08-12 10:21 pm (UTC)