Incredible how people are underestimating ChatGPT or overestimating open-source models.
A basic question: How can i join with SQL a column to a string separated with comma
GPT-4:
PostgreSQL: SELECT STRING_AGG(columnName, ', ') FROM tableName;
Guanaco:
Here is an example of how you could use the CONCAT function in MySQL to concatenate a string to a column value in a single-line query: SELECT CONCAT('The total price for ', product_name, ’ is ', SUM(price)) AS total FROM products; This will result in output like “The total price for Chocolate Bar is 10” or similar depending on your data.
> How can i join with SQL a column to a string separated with comma
I think I might give this one to Guanaco. I’m moderately familiar with SQL, and I can’t really understand your question. You’re faking the reader out by using “join” to mean something which is not JOIN.
So do you mean to concatenate a string in a column (coming from a single row) to a “string separated with a comma”? If so (and assuming “separated” means starting or ending with), then Guanaco nailed it. If you meant to join (in the Python sense) the values from a given column in multiple rows, then GPT-4 is doing better.
But GPT-4 gave no explanation, and my general experience with it is that it’s happy to write code that does something vaguely related to the prompt. As the prompt gets more complex or unusual, the degree to which the code doesn’t actually do something useful increases. And I have had quite poor results getting ChatGPT to generate code along with some explanation such that the code actually matches the explanation.
I don’t think that “prompt engineering” is quite the same thing as clearly specifying the problem. If I’m using a magic AI code-writing companion or asking an actual human to write code for me, I need to define the problem well enough if I want any expectation of getting _correct_ code.
A skilled human will distinguish themselves from a less skilled human by also thinking about the overall problem and helping make sure the specification is correct. This far, I have not seen an AI meet that bar unless the problem is something well-covered already on the web.
I have seen ChatGPT (3.5 and 4) output code that is syntactically correct, executes without errors, and does the wrong things in ways that are not entirely obvious to me until I read the docs myself.
> helping make sure the specification is correct. This far, I have not seen an AI meet that bar
I've only used Bard so far, but indeed, it has never replied to my question with a clarifying question. Only with a statement. This seems like an obvious evolution of the chatbot concept...
I have a hard time understanding the question as you phrased it. Tested with guanaco-33B and a cleaner question, looks like a much better response:
> How can I join a column with SQL in Postgres to a string separated with a comma?
You can use the `string_agg` function in PostgreSQL to concatenate columns into a string. For example, to concatenate all values from a column named "column1" into a single string separated by commas, you can run the following query:
```sql
SELECT string_agg(column1, ',') FROM table;
```
The `string_agg` function takes two arguments: the first argument is the expression to concatenate (in this case column1), and the second argument is the separator between each value (in this case a comma). The query above will return a single string containing all values from column1 separated by commas.
I generally find WizardLM 1.0, Guanaco and Manticore to be good enough for most GPT cases.
As a human, I wouldn't know what to give you for this either. Not surprised the models give unexpected results. "Guanaco" gives something more in line with what I understand you to be asking for, but clearly you're asking for something else that I don't understand.
GPT4All-J-v1.3 Groovy [1] gave me the following answer (no idea if this is good or not, but keep in mind that the model comes in a 3.8Gb file and is released under an Apache 2 license, freely available for use and distribution):
To join a column with SQL in Postgres to a string separated by a comma, you can use the STRING_AGG function. Here's an example query that demonstrates this:
SELECT STRING_AGG(column_name, ', ') WITHIN GROUP (ORDER BY id) AS joined_string FROM table;
In this query, we're selecting the joined_string column from a table called table. The STRING_AGG function is used to concatenate all values in the column_name column into a single string separated by commas. We use the WITHIN GROUP (ORDER BY id) clause to specify that we want to group the results by an integer value called id. This ensures that each row of data is treated as a separate entity, even if it has the same column_name.
The resulting output will be a single column with all values from the joined_string column concatenated into a string separated by commas. You can then use this query in your application to join multiple columns together and store them as a single string value.
Your question is a bit confusing and ambiguous. I think there are multiple valid answers. Here's a local test of a less ambiguous programming question with "Wizard-Vicuna-30B-Uncensored.ggmlv3.q8_0.bin" on llama.cpp on an M1 Max laptop with 64GiB of RAM.
This model seems roughly on par with GPT-3, maybe GPT-3.5 in some cases.
> Write a function to compute the maximum, minimum, and average of an array of doubles in C.
Here is an example function in C that computes the maximum, minimum, and average of an array of doubles:
```c
void compute_statistics(double arr[], int n) {
double max = arr[0];
double min = arr[0];
double sum = 0.0;
for (int i = 1; i < n; i++) {
if (arr[i] > max) {
max = arr[i];
} else if (arr[i] < min) {
min = arr[i];
}
sum += arr[i];
}
double avg = sum / n;
printf("Maximum: %.2f", max);
printf("Minimum: %.2f", min);
printf("Average: %.2f", avg);
}
```
To use this function, simply call it with the array of doubles and its length as arguments. For example:
```c
double arr[] = {1.0, 2.5, 3.0, 4.0, 5.0};
int n = sizeof(arr) / sizeof(arr[0]);
compute_statistics(arr, n);
```
This will output:
```
Maximum: 5.00
Minimum: 1.00
Average: 3.00
```
Here are some simple logic questions:
> Compute the sum of an array of 512 elements with each element having the value 2.
The sum of an array of 512 elements with each element having the value 2 is 1024.
> Compute the sum of an array of 512 elements with each element having the value 3.
The sum of an array of 512 elements with each element having the value 3 is 1536.
I just ask "What is the capital of France?" and I haven't had a correct answer yet in any model I tried. They often get Paris right at least, but most other details are wrong.
Guanaco says:
> The current capital of France is Paris. It has been so since 1982 when it replaced the previous one which was Vichy.
What model size? 7B? 13B? 33B? When people say "Guanaco" or "Alpaca" or "Manticore" they are referring to a whole family of models. The really small ones like 7B often are very weird.
One of the issues that i've observed with OpenAI, is that things the model got wrong a week ago it suddenly starts getting right but other examples that are not exactly the same question but very similar or another example of the same thing it gets wrong, then a few weeks passes and it gets this right.
My conclusion is that they are using the data from users to improve or some other prompt injection tricks.
> GPT-4: PostgreSQL: SELECT STRING_AGG(columnName, ', ') FROM tableName;
Well, you asked for sql and ansi sql function is listagg(), so technically this is not the right answer - and definitely a completely useless one for mysql or oracle users.
The default is rather wordy. You could instruct chatGPT4 to be less wordy or in the API put instructions to be less wordy in the system prompt or limit answers to a sentence.
I would assume the poster just edited this though.
Say, you manage to recruit the top-30 engineers who know all the in-and-outs of the google search engine. Add to that, their recent replacement of trad AI methods with full NN I believe, and I can't realistically believe it's not more than a 1B problem.
One of the reasons Google is going horizontal because their search engine can't be "magical" forever, this applies to their ad platform too.
Here are just a few of the things you aren’t considering:
* how many people worldwide keep their google places information up-to-date and not their local government office or their website.
* how advertisers can get value for their search ad campaigns; how to convince them of this
* how much google ad/targeting intelligence comes from off-site (eg Adsense, partner programs, xml ads)
* how many websites and website owners focus obsessively on their google presence making sure that even where Google’s tech gets it wrong they can get it corrected.
* how valuable the feedback loop is: google ads literally tells google what pages and terms are useful, what people like, and what to do more of at scale
* giving away free email and chat to build a whitelist of “good shares”
And that doesn’t cover video or the inverted index you need to provide governments access to emails and search terms. And so on.
Apple has all that data, if not better, on a much more valuable audience at that, and can market themselves as "privacy friendly" because only they will leverage said data and won't let anyone in on their platform, and naturally you will trust Apple.
Hell they can even throw a spin on how it's about "privacy" and not about taking another way to bank on their walled garden monopoly and the Apple crowd here will gobble it up with "we are finally free from Google spying, praise Tim and his holy father Steve in heaven".
I've been arguing app stores are a monopoly for years now and the amount of cultist here that were like "Apple is doing it to protect me from bad software" and "I would not use my iPhone if there was an option to install a different store" was staggering.
They'll want to know where their 10bn (ish) USD went that Apple currently gets from Google.
Is Apple going to increase their device sales substantially because of an Apple search engine? I think everyone who is going to buy Apple has bought Apple, so I think not.
On the other hand, if Apple sells ads on Apple search, and they charge the same fees Google does, they'll still need 50bn in turnover to drop Google; Advertisers aren't going to double their marketing budget, they'll split it based on the ROI, and unless Apple ads convert as good or better than Google, this is a net loss.
Remaking Google requires engineering talent and lots of clickstream data (ie. Hundreds of Billions of search queries and information about what search results were clicked by which users).
Nobody else has this, and until they do, they won't be able to recreate Google.
Is it not like statistical certainty: i.e. you need a million or so queries to cover the range of your possible outcomes, and the hundreds of billions just takes you from 0.999999 certainty to 0.9999999999999999999?
You do NOT get added benefit from big data by taking it from millions to hundreds of billions. It becomes just a lesson in scale, without bringing any added benefit of insight.
With ML methods, they do benefit from taking data from millions to billions.
You can see that yourself with Google by searching for something obscure (eg. "how to unblock a drain jammed with cat fur") and getting three friends to click the 2nd search result. Come back in a week, and suddenly the 2nd result is now the first result! (ignore the videos and answer box)
It turns out just three new data points is enough to influence ranking for that query. It even affected related queries if you change the word "jammed" for "gunked".
Modern lifestyle makes you chase technohopium based ideas. Often they'll sell you complex solutions for a non existent problem.
Modern life is never calling for bad ideas loudly, but tons of incentives that make you go the wrong way slowly.
Bad job -> stress -> comforting with premade meals too tasty due to sugar and additives. No more walking because you want to leverage your car. You delay sleep to work later (bad work practices) to have leisure.
When I did simpler but physically demanding jobs, I ate simpler, went to bed early because I was simply cooked but it didn't feel like stress, but good fatigue (the kind you have after long swim session).
Modern jobs also turn you against each other way too often. I firmly believe there's a huge amount of benefits of doing simple chores in team, rather than ruminating in your cubicle delaying answers in mails..
You two are talking different things, you originally said "modern lifestyle advice", but now you're saying "modern lifestyle", which are very different things, the "advice" agrees with you, that's what the guy was asking about it.
Let's not play on words. Consumerism sell you promises of better life which turned out to be false most often. It might only be an implicit advice but anyway.
I feel your example is a good portrayal of a life pretty much well-lived: you made money doing something you enjoy, met tons of people and fed your curiosity.
But according to this essay, you followed a BAD path not innovative enough, and the hidden reason why it's bad is because it will never generate any sort of profit for YC.
Now if you had tried 3 or 4 startups in that same timespan, burned through all your life savings, did not make several millions in the process, and failed all you endeavours, you will be applauded by YC.
Why ? because the more people exist like you, the better it is for them.
The way I see it is, say, you own a house. And you're having someone telling you that it is not properly secured.
If I come up to you, the owner, and kindly warn you that your doors can easily be unlocked, your reaction would probably be a big thank you.
But, I also understand that you are free to answer me to get the hell out of your lawn, because it's none of my business.
Sure I am doing it for your safety, for the safety of your kids, your wifes, and your valuables. I have no ulterior motives.
But, you have the right to not want to listen to all the ways an intruder can come to your house and steal all your stuff. You should have the right to find that information useless, and I don't have any say in that.
Now, warning all the town that your house is not secure enough to try to provoke an answer from you ? What do you think about that ? Really curious.
well in my article I never mentioned their name and pixelated the screenshots. The local paper did the same, it was more of a story "if an it security person tells you you have a problem, you should listen"
In the end it turned out that they didn't "not want to listen" the information just never got to the right person (internally) and I talked quite a bit with the owner (after understanding everything he even thanked me) and he said he never got a contact from CERT but I asked them and they said they wrote them twice.
I don't know. I think what we all do, we know how to do it without a computer. Computer just automate stuff for us. It's a very practical saying because it forces you to ask the right question about the problem you're trying to solve. (We all know how to do AirBNB by hand, or Uber by hand, but the mobile app is hyper efficient w/ GPS & 4G, that's all).
What you don't realize about Epitech (and other similar private schools) is that the only value you're getting is paying a bunch of millionaires the right to join a selective program.
I graduated from an enginnering school, and you can absolutely skip all classes if you wanted to. Sure, the teachers don't encourage you to do it, but the freedom is definitely there.
BUT, since there will always be a percentage of students who don't succeed in a "traditional" way, a bunch of rich people will always attempt to lure them into a paid program (which is, I repeat, selective). So they learn quite a bit, and they can become high-earners in the future, since they're all hanging out with technically good people.
A basic question: How can i join with SQL a column to a string separated with comma
GPT-4: PostgreSQL: SELECT STRING_AGG(columnName, ', ') FROM tableName;
Guanaco: Here is an example of how you could use the CONCAT function in MySQL to concatenate a string to a column value in a single-line query: SELECT CONCAT('The total price for ', product_name, ’ is ', SUM(price)) AS total FROM products; This will result in output like “The total price for Chocolate Bar is 10” or similar depending on your data.
Yeah, no...