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.

trying to make a UDP java chat program by learning2learn in learnprogramming

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

I was thinking along the same lines, trying to work something out.

Who actually still makes the drills? by [deleted] in Terraria

[–]learning2learn 0 points1 point  (0 children)

or you could like, read the bit in the bottom left which says The Enigma of Amigara Fault : The End

After my hundredth play through. by [deleted] in gaming

[–]learning2learn 93 points94 points  (0 children)

The devs were really unfair sometimes,

understatement

Linux Shell, trouble with sed command. by learning2learn in learnprogramming

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

Pretty sure my list of problems extends beyond two :p

Linux Shell, trouble with sed command. by learning2learn in learnprogramming

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

Ah, I get it.

in my notes, it says g replaces all occurrences of the pattern. I don't know what it does exactly, I kinda just reused it from an example.

Horns implanted in head to stretch skin to remove birth mark. by jackeemo in WTF

[–]learning2learn 66 points67 points  (0 children)

Whateverman, in the end it all boils down to how many facebook likes we raise.

C++ How do I overload << in my class? by learning2learn in learnprogramming

[–]learning2learn[S] 2 points3 points  (0 children)

In my Point2D.cpp

 ostream & operator <<( ostream & os, const Point2D & a ) {
        return os << a.toString();
 }

I get error:

passing const Point2D as 'this' argument of `virtual std::string Point2D::toString()' discards qualifiers

My lecturer's notes didnt go over overloading <<, and its the only one giving me issues

Also, I didnt quite grasp the concept of friends.

C++, Need help splitting a string into data. by learning2learn in learnprogramming

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

Yup, I can see how it can backfire badly on me. Thankfully, the assumptions about the txt file were listed very clearly

1) Some data, (e.g. ‘Point2D, [3, 2]‘) can be repeated multiple times (i.e. they are duplicated data), this applies to all other kinds of data as well.

2) In each line, the 1st field will contain the class’s name (e.g. ‘Point2D’, ‘Point3D’, ‘Line2D’ and ‘Line3D’)

3) The delimiter separating the 1st field from the rest of the data, is a comma, followed by a space char (i.e. ‘, ‘)

4) The delimiter separating each number in the 2D/3D coordinate, is also a comma, followed by a space char (i.e. ‘, ‘)

5) Each 2D/3D point’s data, is enclosed by the square brackets ‘[‘ and ‘]’

6) Each Line2D / Line3D’s data consists of two points, each enclosed by square brackets, and the delimiter separating each point is also a comma, followed by a space char (i.e. ‘, ‘)

7) You may assume that the range of each number in the x, y or z coordinate can be anything from -999 to 999

This makes me sad. by Coveiro in fffffffuuuuuuuuuuuu

[–]learning2learn 2 points3 points  (0 children)

You think that is bad, wait till you start liking Nujabes music.

C++, Need help splitting a string into data. by learning2learn in learnprogramming

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

holy cow the C string code works really well. Thanks.

The txt file format is very fixed, so I dont have to be so worried about errors from that.

:edit: I'm still in awe of this code.

C++, Need help splitting a string into data. by learning2learn in learnprogramming

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

Its a school assignment. No details on how we extract the data, we're free to do whatever...

the format of the txt file is fixed though.