AI 吐代码,工程师吐槽 - 调试器

🔍区块差异

@@ -74,9 +74,10 @@
74
"align": 2,
75
"height": 3000,
76
"scale": 1,
77
"token": "JaBYbKarmo8Tp6xPEdgcRfzrnsg",
78
- "width": 2000
79
},
80
"parent_id": "RJY2d3XMfozeBfxgCUUcrz4cnee"
81
},
82
{
@@ -170,9 +171,10 @@
170
"align": 2,
171
"height": 1386,
172
"scale": 1,
173
"token": "OJWQbdpmHoWStKxT3CXcGQdHnFb",
174
- "width": 770
175
},
176
"parent_id": "XDCsdtsPooMkuvxq3BicqsFznne"
177
},
178
{
@@ -530,9 +532,10 @@
530
"align": 2,
531
"height": 1430,
532
"scale": 1,
533
"token": "HT4pb00ThoY0jPxZWOscy1BpnDg",
534
- "width": 1384
535
},
536
"parent_id": "LeO0diVG9oi4FWxrobGcRy9An9b"
537
},
538
{
@@ -604,9 +607,10 @@
604
"align": 2,
605
"height": 3181,
606
"scale": 1,
607
"token": "XEb0bolaIoSrKpx2ZgucsAXHnwf",
608
- "width": 1080
609
},
610
"parent_id": "ChK6dnhNXoC3hixSH7lczVC6nmb"
611
},
612
{
@@ -767,9 +771,10 @@
767
"align": 2,
768
"height": 242,
769
"scale": 3.5096153846153846,
770
"token": "Ha7xbn5cvoUTzExJPGjcUUtXnzf",
771
- "width": 208
772
},
773
"parent_id": "H2wVdsUyRoNfFQxrKMzcgV8enRh"
774
},
775
{
@@ -790,9 +795,10 @@
790
"align": 2,
791
"height": 1234,
792
"scale": 0.3989071038251366,
793
"token": "BvOJbS1WWoMXIAxNPMncNePJncr",
794
- "width": 1830
795
},
796
"parent_id": "Bj0Zd6Xldouv6LxUHCvcPPm8nAh"
797
},
798
{
@@ -830,9 +836,10 @@
830
"align": 2,
831
"height": 1194,
832
"scale": 1,
833
"token": "IOH2bNgy1or3E0xUquyceshkn1d",
834
- "width": 2072
835
},
836
"parent_id": "Hf3IdJB5Kooww9xmugMcqx1hned"
837
},
838
{
@@ -870,9 +877,10 @@
870
"align": 2,
871
"height": 1200,
872
"scale": 1,
873
"token": "G6QnbzVS8o3CWVx2TE3cSNI2nyh",
874
- "width": 1974
875
},
876
"parent_id": "LefxdhVlPoxRfUxs9gYczCuknZd"
877
},
878
{
@@ -944,9 +952,10 @@
944
"align": 2,
945
"height": 1668,
946
"scale": 1,
947
"token": "GhRJb90bco7dESxOtS9chP1Nneb",
948
- "width": 1142
949
},
950
"parent_id": "HsBcdeJLIo0Lnoxo69icvtXVnfw"
951
},
952
{
@@ -984,9 +993,10 @@
984
"align": 2,
985
"height": 675,
986
"scale": 1,
987
"token": "UQjKbjAnkowVomxKhlbcwBPQnP0",
988
- "width": 1200
989
},
990
"parent_id": "HQx7duPQloKOCqxWiPVcx0Tlngf"
991
},
992
{
@@ -1024,9 +1034,10 @@
1024
"align": 2,
1025
"height": 1798,
1026
"scale": 1,
1027
"token": "ApXwbPgmrofUVBxBOxWcF49cnqS",
1028
- "width": 2438
1029
},
1030
"parent_id": "EuvRd9ZFqoEl04xNRBqcFo9GnVf"
1031
},
1032
{
@@ -1166,9 +1177,10 @@
1166
"align": 2,
1167
"height": 600,
1168
"scale": 1,
1169
"token": "AR8tbfCiLo9CmixfvBqc4FMfn5c",
1170
- "width": 536
1171
},
1172
"parent_id": "AieZd0rhzoYKwLxfNtfcur7cndh"
1173
},
1174
{
@@ -1285,9 +1297,10 @@
1285
"align": 2,
1286
"height": 225,
1287
"scale": 3.2444444444444445,
1288
"token": "XqnsbpAuBotRjWxhHSDc7BZxnse",
1289
- "width": 225
1290
},
1291
"parent_id": "EKPxd4lqooyKQnxqfAvcWCC0nje"
1292
},
1293
{
@@ -1308,9 +1321,10 @@
1308
"align": 2,
1309
"height": 372,
1310
"scale": 1.978319783197832,
1311
"token": "AAQkbCTl6oG3Bnx5XAlc43JqnLh",
1312
- "width": 369
1313
},
1314
"parent_id": "HCaMdcVjioLNn3xdI7Tcp6R1nKc"
1315
},
1316
{
@@ -1550,9 +1564,10 @@
1550
"align": 2,
1551
"height": 1798,
1552
"scale": 1,
1553
"token": "BfTLbY2FOowDfVxN3vPcRmMpnMh",
1554
- "width": 2036
1555
},
1556
"parent_id": "JlTMdAnF5orUcRxtMBWc8otvncf"
1557
},
1558
{
@@ -1838,9 +1853,10 @@
1838
"align": 2,
1839
"height": 300,
1840
"scale": 1,
1841
"token": "QDRTbbl7zopBDLxyYbocFwW1nkx",
1842
- "width": 300
1843
},
1844
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1845
},
1846
{
@@ -1875,9 +1891,10 @@
1875
"align": 2,
1876
"height": 274,
1877
"scale": 1,
1878
"token": "RZKBbmrzNohQUPx54W9cvhQKnhF",
1879
- "width": 512
1880
},
1881
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1882
},
1883
{
@@ -1912,9 +1929,10 @@
1912
"align": 2,
1913
"height": 316,
1914
"scale": 1,
1915
"token": "HeBnbOhtaoY5XNxa2AsccxDKnOb",
1916
- "width": 316
1917
},
1918
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1919
},
1920
{
@@ -1949,9 +1967,10 @@
1949
"align": 2,
1950
"height": 389,
1951
"scale": 1,
1952
"token": "UG8ZbJpZroReiLxRHO3cb85onLc",
1953
- "width": 262
1954
},
1955
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1956
},
1957
{
@@ -1986,9 +2005,10 @@
1986
"align": 2,
1987
"height": 384,
1988
"scale": 1,
1989
"token": "AkrlbCWuqodgvxx3ufmcadVunPe",
1990
- "width": 258
1991
},
1992
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1993
},
1994
{
@@ -2061,9 +2081,10 @@
2061
"align": 2,
2062
"height": 1310,
2063
"scale": 1,
2064
"token": "AcdebSsk4oOd1wxAkVFcterTnSb",
2065
- "width": 1080
2066
},
2067
"parent_id": "Qi53d4m61okRmnxVkn4cCr82ngd"
2068
},
2069
{
@@ -2538,9 +2559,10 @@
2538
"align": 2,
2539
"height": 608,
2540
"scale": 1,
2541
"token": "GhZabDtSZoMhPBxJStzcPWqPnpb",
2542
- "width": 1080
2543
},
2544
"parent_id": "Ppo6dcrAfoGQsUxqWrpc5wR1ntc"
2545
},
2546
{
@@ -2832,9 +2854,10 @@
2832
"align": 2,
2833
"height": 840,
2834
"scale": 1.064139941690962,
2835
"token": "KPfjbxuIZokTiQxBVFEcUx0Unue",
2836
- "width": 686
2837
},
2838
"parent_id": "MzHNdp8C8oP3tyxW79scGZOYnnd"
2839
},
2840
{
@@ -2855,9 +2878,10 @@
2855
"align": 2,
2856
"height": 1488,
2857
"scale": 0.532069970845481,
2858
"token": "Mc5FbpCdiojkF3xOMLacHgdOnIf",
2859
- "width": 1372
2860
},
2861
"parent_id": "ILS1dQI5TofGfwxsNrec76Jyn4c"
2862
},
2863
{
74
"align": 2,
75
"height": 3000,
76
"scale": 1,
77
"token": "JaBYbKarmo8Tp6xPEdgcRfzrnsg",
78
+ "width": 2000,
79
+ "url": "/api/Lark/file/JaBYbKarmo8Tp6xPEdgcRfzrnsg/placeholder"
80
},
81
"parent_id": "RJY2d3XMfozeBfxgCUUcrz4cnee"
82
},
83
{
171
"align": 2,
172
"height": 1386,
173
"scale": 1,
174
"token": "OJWQbdpmHoWStKxT3CXcGQdHnFb",
175
+ "width": 770,
176
+ "url": "/api/Lark/file/OJWQbdpmHoWStKxT3CXcGQdHnFb/placeholder"
177
},
178
"parent_id": "XDCsdtsPooMkuvxq3BicqsFznne"
179
},
180
{
532
"align": 2,
533
"height": 1430,
534
"scale": 1,
535
"token": "HT4pb00ThoY0jPxZWOscy1BpnDg",
536
+ "width": 1384,
537
+ "url": "/api/Lark/file/HT4pb00ThoY0jPxZWOscy1BpnDg/placeholder"
538
},
539
"parent_id": "LeO0diVG9oi4FWxrobGcRy9An9b"
540
},
541
{
607
"align": 2,
608
"height": 3181,
609
"scale": 1,
610
"token": "XEb0bolaIoSrKpx2ZgucsAXHnwf",
611
+ "width": 1080,
612
+ "url": "/api/Lark/file/XEb0bolaIoSrKpx2ZgucsAXHnwf/placeholder"
613
},
614
"parent_id": "ChK6dnhNXoC3hixSH7lczVC6nmb"
615
},
616
{
771
"align": 2,
772
"height": 242,
773
"scale": 3.5096153846153846,
774
"token": "Ha7xbn5cvoUTzExJPGjcUUtXnzf",
775
+ "width": 208,
776
+ "url": "/api/Lark/file/Ha7xbn5cvoUTzExJPGjcUUtXnzf/placeholder"
777
},
778
"parent_id": "H2wVdsUyRoNfFQxrKMzcgV8enRh"
779
},
780
{
795
"align": 2,
796
"height": 1234,
797
"scale": 0.3989071038251366,
798
"token": "BvOJbS1WWoMXIAxNPMncNePJncr",
799
+ "width": 1830,
800
+ "url": "/api/Lark/file/BvOJbS1WWoMXIAxNPMncNePJncr/placeholder"
801
},
802
"parent_id": "Bj0Zd6Xldouv6LxUHCvcPPm8nAh"
803
},
804
{
836
"align": 2,
837
"height": 1194,
838
"scale": 1,
839
"token": "IOH2bNgy1or3E0xUquyceshkn1d",
840
+ "width": 2072,
841
+ "url": "/api/Lark/file/IOH2bNgy1or3E0xUquyceshkn1d/placeholder"
842
},
843
"parent_id": "Hf3IdJB5Kooww9xmugMcqx1hned"
844
},
845
{
877
"align": 2,
878
"height": 1200,
879
"scale": 1,
880
"token": "G6QnbzVS8o3CWVx2TE3cSNI2nyh",
881
+ "width": 1974,
882
+ "url": "/api/Lark/file/G6QnbzVS8o3CWVx2TE3cSNI2nyh/placeholder"
883
},
884
"parent_id": "LefxdhVlPoxRfUxs9gYczCuknZd"
885
},
886
{
952
"align": 2,
953
"height": 1668,
954
"scale": 1,
955
"token": "GhRJb90bco7dESxOtS9chP1Nneb",
956
+ "width": 1142,
957
+ "url": "/api/Lark/file/GhRJb90bco7dESxOtS9chP1Nneb/placeholder"
958
},
959
"parent_id": "HsBcdeJLIo0Lnoxo69icvtXVnfw"
960
},
961
{
993
"align": 2,
994
"height": 675,
995
"scale": 1,
996
"token": "UQjKbjAnkowVomxKhlbcwBPQnP0",
997
+ "width": 1200,
998
+ "url": "/api/Lark/file/UQjKbjAnkowVomxKhlbcwBPQnP0/placeholder"
999
},
1000
"parent_id": "HQx7duPQloKOCqxWiPVcx0Tlngf"
1001
},
1002
{
1034
"align": 2,
1035
"height": 1798,
1036
"scale": 1,
1037
"token": "ApXwbPgmrofUVBxBOxWcF49cnqS",
1038
+ "width": 2438,
1039
+ "url": "/api/Lark/file/ApXwbPgmrofUVBxBOxWcF49cnqS/placeholder"
1040
},
1041
"parent_id": "EuvRd9ZFqoEl04xNRBqcFo9GnVf"
1042
},
1043
{
1177
"align": 2,
1178
"height": 600,
1179
"scale": 1,
1180
"token": "AR8tbfCiLo9CmixfvBqc4FMfn5c",
1181
+ "width": 536,
1182
+ "url": "/api/Lark/file/AR8tbfCiLo9CmixfvBqc4FMfn5c/placeholder"
1183
},
1184
"parent_id": "AieZd0rhzoYKwLxfNtfcur7cndh"
1185
},
1186
{
1297
"align": 2,
1298
"height": 225,
1299
"scale": 3.2444444444444445,
1300
"token": "XqnsbpAuBotRjWxhHSDc7BZxnse",
1301
+ "width": 225,
1302
+ "url": "/api/Lark/file/XqnsbpAuBotRjWxhHSDc7BZxnse/placeholder"
1303
},
1304
"parent_id": "EKPxd4lqooyKQnxqfAvcWCC0nje"
1305
},
1306
{
1321
"align": 2,
1322
"height": 372,
1323
"scale": 1.978319783197832,
1324
"token": "AAQkbCTl6oG3Bnx5XAlc43JqnLh",
1325
+ "width": 369,
1326
+ "url": "/api/Lark/file/AAQkbCTl6oG3Bnx5XAlc43JqnLh/placeholder"
1327
},
1328
"parent_id": "HCaMdcVjioLNn3xdI7Tcp6R1nKc"
1329
},
1330
{
1564
"align": 2,
1565
"height": 1798,
1566
"scale": 1,
1567
"token": "BfTLbY2FOowDfVxN3vPcRmMpnMh",
1568
+ "width": 2036,
1569
+ "url": "/api/Lark/file/BfTLbY2FOowDfVxN3vPcRmMpnMh/placeholder"
1570
},
1571
"parent_id": "JlTMdAnF5orUcRxtMBWc8otvncf"
1572
},
1573
{
1853
"align": 2,
1854
"height": 300,
1855
"scale": 1,
1856
"token": "QDRTbbl7zopBDLxyYbocFwW1nkx",
1857
+ "width": 300,
1858
+ "url": "/api/Lark/file/QDRTbbl7zopBDLxyYbocFwW1nkx/placeholder"
1859
},
1860
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1861
},
1862
{
1891
"align": 2,
1892
"height": 274,
1893
"scale": 1,
1894
"token": "RZKBbmrzNohQUPx54W9cvhQKnhF",
1895
+ "width": 512,
1896
+ "url": "/api/Lark/file/RZKBbmrzNohQUPx54W9cvhQKnhF/placeholder"
1897
},
1898
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1899
},
1900
{
1929
"align": 2,
1930
"height": 316,
1931
"scale": 1,
1932
"token": "HeBnbOhtaoY5XNxa2AsccxDKnOb",
1933
+ "width": 316,
1934
+ "url": "/api/Lark/file/HeBnbOhtaoY5XNxa2AsccxDKnOb/placeholder"
1935
},
1936
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1937
},
1938
{
1967
"align": 2,
1968
"height": 389,
1969
"scale": 1,
1970
"token": "UG8ZbJpZroReiLxRHO3cb85onLc",
1971
+ "width": 262,
1972
+ "url": "/api/Lark/file/UG8ZbJpZroReiLxRHO3cb85onLc/placeholder"
1973
},
1974
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
1975
},
1976
{
2005
"align": 2,
2006
"height": 384,
2007
"scale": 1,
2008
"token": "AkrlbCWuqodgvxx3ufmcadVunPe",
2009
+ "width": 258,
2010
+ "url": "/api/Lark/file/AkrlbCWuqodgvxx3ufmcadVunPe/placeholder"
2011
},
2012
"parent_id": "BcqXdrEcLoI8pfxGBL6c9UE3nJe"
2013
},
2014
{
2081
"align": 2,
2082
"height": 1310,
2083
"scale": 1,
2084
"token": "AcdebSsk4oOd1wxAkVFcterTnSb",
2085
+ "width": 1080,
2086
+ "url": "/api/Lark/file/AcdebSsk4oOd1wxAkVFcterTnSb/placeholder"
2087
},
2088
"parent_id": "Qi53d4m61okRmnxVkn4cCr82ngd"
2089
},
2090
{
2559
"align": 2,
2560
"height": 608,
2561
"scale": 1,
2562
"token": "GhZabDtSZoMhPBxJStzcPWqPnpb",
2563
+ "width": 1080,
2564
+ "url": "/api/Lark/file/GhZabDtSZoMhPBxJStzcPWqPnpb/placeholder"
2565
},
2566
"parent_id": "Ppo6dcrAfoGQsUxqWrpc5wR1ntc"
2567
},
2568
{
2854
"align": 2,
2855
"height": 840,
2856
"scale": 1.064139941690962,
2857
"token": "KPfjbxuIZokTiQxBVFEcUx0Unue",
2858
+ "width": 686,
2859
+ "url": "/api/Lark/file/KPfjbxuIZokTiQxBVFEcUx0Unue/placeholder"
2860
},
2861
"parent_id": "MzHNdp8C8oP3tyxW79scGZOYnnd"
2862
},
2863
{
2878
"align": 2,
2879
"height": 1488,
2880
"scale": 0.532069970845481,
2881
"token": "Mc5FbpCdiojkF3xOMLacHgdOnIf",
2882
+ "width": 1372,
2883
+ "url": "/api/Lark/file/Mc5FbpCdiojkF3xOMLacHgdOnIf/placeholder"
2884
},
2885
"parent_id": "ILS1dQI5TofGfwxsNrec76Jyn4c"
2886
},
2887
{

📄文档

AI 吐代码,工程师吐槽

今天致敬我老乡唐香玉 —— 这篇是纯骂人,毫无意义!

AI 拉屎山,工程师通马桶

AI 吐千行单位的 .vue,Vue 官方开发扩展把 VS Code 搞崩了……

去他爹的 Vue 单文件组件,TSX 语法糖干翻你!

import { Vue, Component, toNative } from 'vue-facing-decorator';
import { observer } from 'mobx-vue-helper';

import counterStore from './models/Counter';

@Component
@observer
class MyMobX extends Vue {
  render() {
    return (
      <button onClick={() => counterStore.increment()}>
        Count: {counterStore.count}
      </button>
    );
  }
}
export default toNative(MyMobX);
import { observer } from 'mobx-vue-helper';

import counterStore from './models/Counter';

export const MyMobX = observer(() => (
  <button onClick={() => counterStore.increment()}>
    Count: {counterStore.count}
  </button>
));

AI 打死写不出 Nuxt.js 服务端渲染自定义 Markdown

不但 AI 反复写都是客户端渲染代码,以下官方文档的方法在 .vue 文件中不是报错就是静默失败……

去他爹的 Nuxt.js 官方文档、issue,类组件上大分~

import { Suspense } from 'vue';
import * as runtime from 'vue/jsx-runtime';
import { Component, Setup, toNative, Vue } from 'vue-facing-decorator';
import { evaluate } from '@mdx-js/mdx';

import { Link } from '../components/Link';

const evaluateMDX = (link: string) =>
  defineAsyncComponent(async () => {
    const { data, error } = await useFetch<string>(link);

    if (error.value) throw new URIError(error.value?.message);

    const { default: MDXContent } = await evaluate(data.value!, runtime);
    // @ts-expect-error Upstream Type compatibility issue
    return () => <MDXContent components={{ a: Link }} />;
  });

@Component
class MdxDemoPage extends Vue {
  @Setup(() => evaluateMDX('https://cdn.jsdelivr.net/gh/idea2app/Nuxt-MobX-Shadcn-ts/README.md'))
  MDXContent?: ReturnType<typeof evaluateMDX>;

  render() {
    const { MDXContent } = this;

    return (
      <div style={{ maxWidth: '800px', margin: '0 auto', padding: '20px' }}>
        <Suspense>{MDXContent ? <MDXContent /> : <p>Loading MDX content...</p>}</Suspense>
      </div>
    );
  }
}
export default toNative(MdxDemoPage);

Vite 不支持 ES 装饰器 stage-3 候选发布标准?Parcel 来救场~

AI 能 solo?工程师擦屁股

甲方:现在 AI 代码编辑器都能 solo 了,你们有十倍效率提升了吧……

敏捷笑话永不过时:老板认为一个女人十月怀胎,用了敏捷,十个女人一月怀胎就生了!

甲方:3 天 solo 出所有前端页面,我要给客户演示……

(合同中的开发)计划赶不上(甲方的)变化……

萧山鸡排哥:做完你的做你的,做完你的做你的……

台北王世坚:本来应该从从容容、游刃有余~

台北王世坚:到现在是匆匆忙忙、连滚带爬!

AI:你一次性让我写一套页面赶工期,我就开始编……

前端页面的数量和细节复杂性让 AI 的识图遵从性很差

类人的疲态表现说明:这不是技术问题,是阶级问题!

后端识图抽字段的遵从性反而很高

当前 AI 的能与不能

  • 天马行空做个新项目 —— 表现惊艳
  • 既定框架下赶工期 —— 表现拉垮
  • 知无不言、言无不尽的提示词 —— 尚能思考

立党哥是我嘴替!

AI 时代更需要甲方做“禁欲系”男友

克制一下拍脑袋既要又要还要也要都要全要的欲望……

我:真正容易让 solo 的不是“主流库”,而是让人和 AI 都能低代码

甲方觉得“主流”的 Shadcn UI 只会助长 AI 在我的 Git 历史记录里堆屎山

ThoughtWorks 中国 CTO:复杂需求必需图灵完备,而掌握它的只有程序员

水歌推论:好工具是服务高频用户的。

基于 MVC 和装饰性语法的数据表定义

@Entity()
export class User extends Base {
    @IsString()
    @Column()
    name: string;

    @IsEnum(Gender)
    @IsOptional()
    @Column({ type: 'simple-enum', enum: Gender, nullable: true })
    gender?: Gender;

    @IsUrl()
    @IsOptional()
    @Column({ nullable: true })
    avatar?: string;

    @IsEmail()
    @IsOptional()
    @Column({ nullable: true })
    email?: string;

    @IsMobilePhone()
    @IsOptional()
    @Column({ nullable: true })
    mobilePhone?: string;

    @IsStrongPassword()
    @IsOptional()
    @Column({ nullable: true, select: false })
    password?: string;

    @IsEnum(Role, { each: true })
    @IsOptional()
    @Column('simple-json')
    roles: Role[];

    @IsJWT()
    @IsOptional()
    token?: string;
}

基于 service 封装增删查改

@JsonController('/template')
export class TemplateController {
    service = new UserServiceWithLog<Template>(Template, ['name', 'description']);

    @Post()
    @Authorized()
    @HttpCode(201)
    @ResponseSchema(Template)
    createOne(@Body() data: Template, @CurrentUser() createdBy: User) {
        return this.service.createOne(data, createdBy);
    }

    @Get('/:id')
    @OnNull(404)
    @ResponseSchema(Template)
    getOne(@Param('id') id: number) {
        return this.service.getOne(id);
    }

    @Put('/:id')
    @Authorized()
    @ResponseSchema(Template)
    updateOne(@Param('id') id: number, @Body() data: Template, @CurrentUser() updatedBy: User) {
        return this.service.editOne(id, data, updatedBy);
    }

    @Get()
    @Authorized()
    @ResponseSchema(TemplateListChunk)
    getList(@QueryParams() filter: TemplateFilter) {
        return this.service.getList(filter);
    }
}

基于 MVVM 和 RESTful API 封装接口调用

import { buildURLData } from 'web-utility';
import { Filter, ListModel } from 'mobx-restful';
import { components } from '@octokit/openapi-types';

import { client } from './client';

export type Organization = components['schemas']['organization-full'];
export type Repository = components['schemas']['minimal-repository'];

export class RepositoryModel<
    D extends Repository = Repository,
    F extends Filter<D> = Filter<D>
> extends ListModel<D, F> {
    client = client;
    baseURI = 'orgs/idea2app/repos';

    async loadPage(page: number, per_page: number) {
        const { body } = await this.client.get<D[]>(
            `${this.baseURI}?${buildURLData({ page, per_page })}`
        );
        const [_, organization] = this.baseURI.split('/');
        const {
            body: { public_repos }
        } = await this.client.get<Organization>(`orgs/${organization}`);

        return { pageData: body, totalCount: public_repos };
    }
}

export default new RepositoryModel();
import { text2color } from 'idea-react';
import { computed } from 'mobx';
import { GitRepository } from 'mobx-github';
import { observer } from 'mobx-react';
import { Column, RestTable } from 'mobx-restful-table';
import { Component } from 'react';
import { Badge, Container } from 'react-bootstrap';

import { repositoryStore } from '../model/service';
import { i18n, t } from '../model/Translation';

@observer
export class PaginationPage extends Component {
    @computed
    get columns(): Column<GitRepository>[] {
        return [
            {
                key: 'full_name',
                renderHead: t('repository_name'),
                renderBody: ({ html_url, full_name }) => (
                    <a target="_blank" href={html_url} rel="noreferrer">
                        {full_name}
                    </a>
                )
            },
            { key: 'homepage', type: 'url', renderHead: t('home_page') },
            { key: 'language', renderHead: t('programming_language') },
            {
                key: 'topics',
                renderHead: t('topic'),
                renderBody: ({ topics }) => (
                    <>
                        {topics?.map(topic => (
                            <Badge
                                key={topic}
                                as="a"
                                className="me-2 text-decoration-none"
                                bg={text2color(topic, ['light'])}
                                target="_blank"
                                href={`https://github.com/topics/${topic}`}
                            >
                                {topic}
                            </Badge>
                        ))}
                    </>
                )
            },
            {
                key: 'stargazers_count',
                type: 'number',
                renderHead: t('star_count')
            }
        ];
    }

    render() {
        return (
            <Container style={{ height: '91vh' }}>
                <RestTable
                    className="h-100 text-center"
                    columns={this.columns}
                    store={repositoryStore}
                    translator={i18n}
                    striped
                    hover
                    editable
                    deletable
                    onCheck={console.log}
                />
            </Container>
        );
    }
}

AI 新时代?工程师操碎心

以下是 2023 年初 GPT 3 发布不久后,我与某 AI 大厂中国区高管的一次聊天

AI 时代警言第一弹《雪国列车》

AI 时代警言第二弹《机械公敌》

AI 时代警言第三弹《西部世界》

AI 时代警言第四弹《终结者》

AI 时代警言第五弹《黑客帝国》

高管重复:这是第四次工业革命!他们被淘汰也没有办法~

像西部世界里未觉醒的机器人,对现实世界的照片总机械地重复:我没看出有什么问题……

人工智能的反面 —— 能治工人

我回味过来前面说的十倍效率 —— 甲方的潜台词其实是说:我可要十倍地砍工期和预算啦!

我:我月初的重感冒,在没休息好的情况下,又加重到“类新冠”症状了……

甲方 2:你每天用 20% 的精力写 AI 提示词也能赶上演示节点!

我:我就是让 AI 反反复复改联调细节代码写不好,最后还得我来擦屁股!

多少倍的效率提升我是没见着,但前些天几档的高烧我是上去了…… 下面我们先来做个小学算术题:

  1. 重感冒期间日均有记录的静息心率 100 ~ 120 次每分钟(实际感受上不封顶)
  2. 健康时静息心率平均 75 次每分钟
  3. 按近日很常出现的 120 次为例,心动过速 45 次每分钟
  4. 按医学统计,人静息心率每升高 10 ~ 15 次,体温升高 1℃
  5. 按 15 次 1 度保守估算,45 ÷ 15 = 3℃
  6. 以新冠疫情期间频繁测体温的均值 36.5℃ 为正常体温,则 36.5 + 3 = 39.5℃
  7. 若以 10 为单位,高烧已到 41℃(我小时候被同一体温烧昏厥过,抢救及时才没烧成脑残)

应开发提问智能 —— 能治问题

AI: step by step, please! No Mission Impossible!

我希望 AI agent 能增加质疑人类变态需求的特性,敢于提出问题,毕竟完成不可能任务的阿汤哥只有一个,还是在电影里……

我:不要解决不了问题,就解决提出问题的人!

关于前面那位女高管:

  • 小八卦:我在和她同在的一个行业协会同为理事,今年我被当成提出问题的人解决了……
  • 好消息:她今年被 AI 大厂裁了~
  • 坏消息:她加入了一家具身智能创业公司……

时代发展、技术无罪,但要警惕 AI 幕后人的伦理

谢谢大家,我是 idea2app 的水歌!

左边是我的个人飞书,右边是我们开源社区的飞书群,欢迎扫码交流~