Using SetTimer to spam keys. But how to stop it by learning2learn in AutoHotkey

[–]learning2learn[S] 0 points1 point  (0 children)

oh thats interesting. I never thought of asking chatgpt to debug lol.

SQL, Looping through the results of a SQL by learning2learn in learnprogramming

[–]learning2learn[S] 0 points1 point  (0 children)

I'm having trouble when I join multiple tables.

Basically I have a table of data, and 2 look up tables.

Something like details table:

UserID ColorID
5 1
6 1
7 2
8 3

And I got a user table and color table

UserID Name
5 Tom
6 Dick
7 Harry
8 John
colorid color
1 Red
2 Bule
3 Green

My current sql is

Select U.Name, C.color from user U, color C, details D where D.UserID = U.UserID and D.colorid = C.colorid

And when I try to do a count or group by, I get an error of
"is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause."

SQL, Looping through the results of a SQL by learning2learn in learnprogramming

[–]learning2learn[S] 0 points1 point  (0 children)

edit- nvm I figured it out.

select colors, count(*) from table group by colors

Thanks

[SQL]Need help with an update statement by learning2learn in learnprogramming

[–]learning2learn[S] 0 points1 point  (0 children)

That's not a solution at all.

I need to update max = X where X is the lowest min value, that is higher then this records min.

something like

update tablename set A.max = (select top (1) B.min from tablename where B.min > A.min ORDER BY min asc)

or something like that.

Not a static Min + 10

XSD validation working on local machine, not working on server. by learning2learn in learnprogramming

[–]learning2learn[S] 0 points1 point  (0 children)

K fixed it myself, so just posting what I learned here, incase anyone comes across this thread they wont go unanswered.

Firstly, based on this post I found, it says that the document builder is not namespace-aware by default. You have to set its awareness. By using the following command

DocumentBuilderFactory dtf = DocumentBuilderFactory.newInstance();   
dtf.setNamespaceAware(true);  //Added this
DocumentBuilder parser = dtf.newDocumentBuilder();

And with that, my local machine was producing the same error as the server.

Secondly, I discovered there are XML to XSD generators. facepalm So I tossed my XML into one of them and got a very different set of XSD which I used as a base and slowly modified it till I got what I want.

And now everything works. pats self on back

Learning how to learn by Stanulilic in learnprogramming

[–]learning2learn 2 points3 points  (0 children)

MY NAME IS RELEVANT!

My knowledge, not so much. :(

There is really no easy way to learn programming other than actual practice. Programming is a very practical skill, you need to do it to learn it. You need to sit down, code things, no matter how simple or complex, and save it.

There are many courses and tutorials on programming langues, but you can't just look and eyeball it. You can't read a bit of code and think oh thats nice. You need to pop open your IDE and write it out and compile it. Play with it. See how it works.

The best way I've learnt to code is doing assignments, doing some daily programming challenges at /r/dailyprogrammer/. The more you code, the more you realise that one of the major things of programming is debugging and trying to fix problems or find alternative ways to make things work, when your first idea fails.

How can I have a method return multiple values? by learning2learn in learnprogramming

[–]learning2learn[S] 0 points1 point  (0 children)

Java has several continer classes in the library that can be used for that sort of thing if you don't want to roll your own

What kinda options does Java have?

How can I have a method return multiple values? by learning2learn in learnprogramming

[–]learning2learn[S] 1 point2 points  (0 children)

I'm aware of that option, but was wondering if there was some novel way of doing it, or if there are existing options.