i have a php script that is called via javascript requests in the script i make a database connection then have
register( ‘config’, $config ); then anywhere you want – do $config = Registry
Permalink Comments off
VPS * JSP * Java * Servlet * J2EE * Tomcat * Dokeos * Elgg * Atutor * PHP5 * FTP * SSL * b2evolution
register( ‘config’, $config ); then anywhere you want – do $config = Registry
Permalink Comments off
they get a little defensive about that
pardon me, but duuuuuuuhr
I was thinking of doing something to my java applets to make them better on the web. Can an applet be rewritten to function in javaFX, and what is the benefit? Or is there something else I should consider?
javafx is an applet env
Does it start faster than an applet or is it the same? I saw it compaired to flash somewhere
not sure
I really need to look into javafx, don’t I
The Art, Philosophy, and Science of Object-Oriented Programming” ?
I’ve been putting it off because it always seems like such a half-baked idea
I can’t imagine it would be any faster to start up than an applet. Could conceivably be a little slower but probably not much.
The script seems pleasant.
does it? compared to what, and why?
Which script in the first place?
JavaFXScript (previously known as F3 before the marketing guys got ahold of it).
javafx has its own scripting language
Compared to say, java web hosting + XML. Seems to do a reasonable job of integrating declarative GUI design in with the scripting language and has some cute features for array/collection manipulation, etc.
I’ll have to look into it more
I have to admit that javafx is way out of my normal problem domain
It’s definitely not new, revolutionary and amazingly awesome. Just… pleasant. Integrates a few things nicely, reasonably nice languages and has some cute features.
whats that output stream that counts the num of bytes written?
which cute features?
DRMacIver, but do you think that we can use javafx instead of swing?
It’s been a while since I’ve looked at it – I don’t actually use it. The main one I remember is that it has some neat comprehension/query stuff for dealing with arrays and collections.
hmmm
Well, it works with Swing as far as I know. There shouldn’t be any problem using Swing components in JavaFX.
And type inference. Type inference is nice.
heh
“Exception in thread “main” java.lang.UnsatisfiedLinkError: mouseGesturesBox.UnfocusedKeyPressedWrapJNI.isKeyPressed(I)Z” does this mean Java can’t find the .dll or the wrapped method?
hello
hi
Netbeans 6 is yet a beta version /;
?
Clown-MG: yes, it hasn’t been released yet.
jottinger thanks
version 5.5.1 is the released version.
ok
i got it
DRMacIver, uhm maybe but I give a rapid look at it and seems nice but I don’t find a way to put dynamic content
i´m a java newbie
on such component like tree or list
well I’d use eclipse anyway ;P
Clown-MG: avoid IDEs until you grok the language some
~tell Overlook217 about tool
Overlook217, A tool is only as good as its user. Tool.
jottinger what do you recommend?
avoiding IDEs until you understand java some.
Like I said. I don’t use it myself. Wrong person to ask.
Thanks 4 info
i disagree. I think eclipse api hosting has been a mighty help-along for me
compared to what?
i’m a newbie but my java project – http://redick.googlecode.com – has been a pleasure in conjunction with Eclipse
bit of a blue devils fan, huh
java is very much a language where you need to be able to browse large trees of source and docs to use and Eclipse is well-suited for it. Clown-MG – download Eclipse from http://www.EasyEclipse.org
and what else have you used?
no I dont like duke or college bball that much
just redick, huh
I have 8 years of Perl experience. all done without IDE
jj is nice
so you’ve used… eclipse for java, and what else?
jottinger i have been using Delphi Ide during last 12 years
I like NetBeans
I don’t really consider this a positive thing though.
Clown-MG: irrelevant
Other than the fact that Netbeans consumes 120MB at any random time, its nice
Eclipse is a pure joy to use
and debugging with eclipse is amazing
again… compared to what? command-line?
doing java servlet hosting without ide its easy if you use ant or maven
compared to 8 years of debugging using print statements
AH yes
so you’re comparing a one-eyed man to a kingdom of blind peasants?
Perl is fine without an IDE. In Java you really need one..
When I started using an IDE with GDB.. it was.. heaven
Great. If it works for you that’s awesome. But advising others to pick the same choice should only be backed up by experience
I stopped all that printf at random parts
and it is my experience that I am speaking from
yes. But others have lots more experience… and have tried alternatives.
some of those people agree with you. More don’t.
clearly opinions vary even amongst the experienced. as amongst us newbies… i’m just putting in my 2 cents
it’s a personal preference; there’s nothing wrong with eclipse in any absolute sense.
But when you’ve tried nothing else, making a recommendation seems kinda iffy to me.
Experience in terms of java combines with IDEs? Seems like you never used BlueJ, NetBeans, JBuilder, IntelliJ etc. blaaa.. Some even don’t exist any more (thank god), but that was the point here: Recommending something after evaluating several choices is better than saying “X works for me.
Pick it.”
all you’re saying is “use an IDE, I do”
jbuilder’s gone, jdeveloper isn’t
bluej should be
i tried Netbeans hosting for awhile
i downloaded intellij but saw nothing in it for me.. eclipse host is free with tons of plugins
intellij costs a lot of money
heh, free means so little when you’re a professional
yea, programming does pay well doesn’t it
intellij paid for itself in time after about two hours
wow
eclipse is worth every penny, though
so is netbeans
(do the math. really.)
Hmm.. Not if your boss doesn’t pay for it. I used it a while (and really like it), but I’m not going to spend my own money on my productivity tools
dont you have some code to write? this discussion is going nowhere
is an IDE integreated into Websphere?
my boss didn’t pay for it. Not unless you consider the career advancement I got for being, like, productive.
No, actually I don’t.
no. But there’s an IDE that accompanies Websphere.
of course, I can get intellij for free now
since I work on various open source projects
I’m not yet entirely sold on the “IDEA is the bestest thing ever!!” school of thought.
Good point. I need to find one to a) have a new pet project and b) get my hands on that ide again
But it’s definitely worth the license fee.
and for make guis with SWING hosting you do all by hand?
Aye
Matisse for eclipse is a good choise
s/choise/choice
what makes IDEA something I should look at over Eclipse?
of course, matisse for netbeans is an even better choice, since matisse is a netbeans package in inception
IDEA actually helps you code. Eclipse enables you to code.
but Visual Editor on Eclipse is a PAIN
The interface is noticably nicer to use and the refactoring support is a great deal stronger in a number of areas.
yeah, eclipse steals refactorings from IDEA all the time
refactoring? how does that work. I dont use that in Eclipse.
and IDEA can refactor even broken code
okay, suppose you write a block of code, then realise that it should be broken out into its own method
I particularly like the refactoring support as I’m currently aggressively refactoring.
“extract method” is a common refactoring
I rather like the live templates as well.
yeah, I keep forgetting that $other_ide doesn’t have the same ones
drives me nuts
New Class and then paste the code over there
try refactoring it instead
it may surprise you at how capable it is, even in eclipse
and how about developing web apps? I guess IDEA has support for making that easy too?
yes
good support for the whole java ee/j2ee stack
To be honest, the refactorings I use the most in any IDE are “extract variable” and “rename”
Alt+R
ups, Alt+Shift+R
The only code I’ve wanted to seriously apply extract method to was so mangled as to be intractable.
(And I don’t have to deal with that code anymore. Switching jobs++ )
hello there
jottinger please, wher do i must to start ?
*where
Clown-MG: the java tutorial
really
hehe
Clown-MG, #java-br
Hi! Using a Servlet 2.4 engine, can I access a session bean used in a JSP from a class implementing HttpSessionListener?
joaop obrigado
thanks
the sun java hosting tutorial got me going
(i.e. I have a jsp host page which uses a session bean to store some information, and as soon as sessionDestroyed() is called in the session listener I wrote I’d like to clean up a few things in my session bean containing the session data)
thanks in advance for any hints/pointers/google-keyword-hints
of course you can
I’m a little bit confused as to why you think it can’t
simply by retrieving my session in sessionDestroyed I guess, but how do I get an object containing the specific bean I use then?
are you not storing a reference to it in the session?
well, I think it should be possible, I just don’t know how
ah, that would be wise of course
how would I do that ideally? a hashmap containing a reference to the bean?
erm
why not session.putAttribute(“refToBean”, beanRef);
ah, that sounds much better
thank you very much
i hope today goes by fast
ok i either need to score a 3rd monitor or i need workspaces for windows
get rid of windows
wish i could
i was actually told they would never allow a mac on the network
hey people! and especially java programmers )
is there anybody having experience with CA?
certificate authorities for SSL?
jchauncey, O_O strange place… how about a linux box?
doubt a linux box would fly either, the it guys here only know how to fix windows machines =
~tell progreSSive about anyone
progreSSive, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
bprogreSSive, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will./b
ubprogreSSive, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will./b/u
well, the problem is, i have created a certificate (a not trusted one ), and my client, while connecting to my web-service, is throwing an exception “javax.net.ssl.SSLPeerUnverifiedException: could not verify peer certificate:”
do you, people, know how to overcome this?
or how to add the certificate to the trusted-certificates list?
i’ve tried everything, i’ve read all the documentation on the “keytool”, added the cert. to my java cacerts trusted list, but still the same problem )
or maybe you will suggest me any verified and cheap CA to buy a trusted certificate from!?
so, any suggestions??
here you go.. silence
hm, this is weird
foos = someobject.getFoos(); for (Foo foo : foos) {..} compiles, but for (Foo foo : someobject.getFoos()} {} complains that it expects type Foo instead of Object and points at the getFoos() call
and I cannot reproduce this with a simple example
?
yes, otherwise the first example wouldn’t compile, right?-)
is it a typo that instead of a “)” you have a “}” at the closing end of your foreach,
no, and that would mostly likely cause a syntax error
the parens match properly, too
okok, just checking.
show us the actual code and the actual error. put it up on the pastebin.
yes, I’m in the process of minimizin this
getFoos most likely returns a Set rather than a SetFoo
The compiler will implicitly cast to a generic type in a number of cases, but the foreach loop isn’t one of them,.
yes, that’s what I thought – however it’s specified to return SetFoo
specified in the source, I mean
Oh well. I’ll wait to see your code before I comment further.
ha
Does anyone know which virtual keycodes in KeyEvent are the two Windows keys?
couldn’t you write a small application that print out the codes for pressed keys and just check?
I missed the fact that someobject is an instance of BarT, but the someobject variable is only typed Bar
for some reason the genericity of the type causes the error, but I don’t understand, how
Logi, that doesn’t tell me the name of them
I’ll post the test case
Bonjour.
Mixing erased and unerased types is black magic. Don’t do it unless you Know What You’re Doing.
Oh, there’s a VK_WINDOWS in Java 5, that helps
indeed – I guess I should read up on the rules again too
is there some book which teaches me J2EE and websphere ?
hi all. Can somebody recomend me a good introductory book about j2ee. I already know java well. thanks in advance
http://rafb.net/p/FoMN2W33.html if someone wants to see the error for himself
hehe, we make a tag team
ah, right
yes DaBonBon… would you like to go to the bookstore with me
Found them in the Java 5 docs, I was looking at 1.4.2, thanks
it was nothing
literally
if you’re in india, cool !
i’m in Uruguay
:-/
Can anyone tell me why, when Sun adds new API’s to the language, that Sun does not typically rewrite internals of existing functions to utilize the newer ways of doing things?
so, any preferred books on j2ee ? using websphere would be an icing on the cake
MarkT-: err.. few sun employees you’ll find over here, i think
MarkT-: Laziness, backwards compatibility, sheer size of the existing API.
MarkT-: Also I would guess that the people adding shiny new things are not the same as the people maintaining the existing APIs.
http://www.amazon.com/Beginning-Java-EE-Novice-Professional/dp/1590594703/ref=pd_rhf_p_2/103-3820306-5643832 and http://www.amazon.com/Sams-Teach-Yourself-J2EE-Second/dp/0672325586/ref=sr_1_18/103-3820306-5643832?ie=UTF8&s=books&qid=1187790523&sr=1-18
I’ve been perusing the source code for the JDK, and I’ve noticed that even long-since deprecated functions are still being called by other ones in the library.
thanks I will take a look….
MarkT-: of course, backwards compatibility
MarkT-: Feel free to submit a patch.
~openjdk
cheeser, openjdk is http://openjdk.dev.java.net
hello, is there some lib to make managing ssl/network connections easier? (trying to program a daemon that listens on a port and waits for our door opener to ask if access is granted – this happens over a ssl secured connection)
any hits
i really wish i could find some websphere + j2ee book :-/
can i ask a weird question about inheritance?
sure
MarkT-: Anyway, I don’t mean to belittle your concerns. It’s annoying. But there’s not really a good answer other than “because” in most cases.
ok, say you have a class with a method, say it’s called “sharedMethod()”
(Well, unless Sun have Deep And Important Reasons which for some bizarre reason they’ve neglected to tell me)
it’s used by the subclass, and it calls another method called “uniqueMethod()” which the subclass overrides
you work for sun ?
the superclass has its own uniqueMethod() it calls
when sharedMethod() is called from the subclass, will it call the overrided version of uniqueMethod() or the original?
MarkT-: The deprecated stuff isn’t going away (unfortunatley, as some may say). So changing wel-tested working and known good code just becauses it uses a deprecated method doesn’t sound like a good way to psend ones time.
it will call the overriden method
No
when sharedMethod() calls a method it’ll call the superclass’ method, because it’s a method of superclass
with ‘public class FooT extends Foo’, I can demand that ‘T’ is a subclass of Foo
that’s what i think though .. i guess trying yourself is the best solution
(i.e: it will use the method that belongs to “this”)
ahh, thank you
can I also do something to demand that ‘T’ implements some interface?
The “for some bizarre reason they’ve neglected to tell me” part was sarcasm intended to convey that I’m not exactly privy to their inner decision making process.
hehe ok
because if you did, i wanted to ask you for a book on j2ee
is there an easy way to do what i’m trying to do, have a common method call different methods based on its class?
i guess i could test for class.name or whatever
interfaces /
interfaces! ahhh
~tell tobins2 about inheritance
tobins2, inheritance is http://java.sun.com/docs/books/tutorial/java/concepts/inheritance.html , http://java.sun.com/docs/books/tutorial/java/javaOO/subclass.html and http://java.sun.com/docs/books/jls/third_edition/html/names.html#104101
have a common interface that declares that method, and all your classes implement it, DRMacIver ?
you can call a superclass method like this: SuperClass.this.method1()
It makes extending a class that might want to override and extend the newer way of doing things more awkward
err, i meant tobins2 and not DRMacIver
???
Either you seem to be confusing inheritance with inner classes or I’ve missed something serious…
thanks, that’s a good idea, i never use interfaces really, this will be a good chance to learn them
bthanks, that’s a good idea, i never use interfaces really, this will be a good chance to learn them/b
tobins2:
any hits ?
found any suitable books ?
On a slightly related note, is “Real Soon Now” slang for “when hell freezes over”?
i’m searching open books now. But i don’t use websphere…
if A extends B then, in the context of A you can say B.this.method()
ok, but if you find any suitable on ee please tell me
is that the same as super.method() ?
yes is the same and you can do super.super.super things
this.this.this.this
No you can’t.
You’re confusing inner classes with inheritance.
I’m taking a look at http://java.sun.com/javaee/5/docs/tutorial/doc/
This only works for enclosing classes.
yeah i tried it too, but it was a bit slow and not captivating
oh then tobins2 nevermind. sorry my bad
yes and they use “Sun Java System Application Server Platform”
See, yet another sign of the need for proper closures
~tell MarkT- about rsn
MarkT-, rsn is real soon now, otherwise known as ‘never’.
MarkT-: They were supposed to fix the NIO API to use covariant return with the advent of Java 1.5. Guess what we’re still waiting on…
bMarkT-: They were supposed to fix the NIO API to use covariant return with the advent of Java 1.5. Guess what we’re still waiting on… /b
in emule I have found IBM_WebSphere_j2EE_app_devel.pdf
can you please download it and pass it on to me ?
is that a free pdf?
if it’s not too large
it’s about 11mb
I don’t know/care
i do. any warez in here and i’ll ban you.
when you cancel() a TimerTask, does that block until the TimerTask’s run method completes?
take a look at: http://www.gayanb.com/free_j2ee_books.php
Can’t be bothered, as it doesn’t really affect me. I rarely use NIO. I just use it as a commentary on Sun’s slowness.
If I were set up to contribute to open JDK I probably would. But I’m not, and I don’t really feel like doing so.
thanks cheeser
then stfu with the whining. 8^)=
thanks sgx___ , i’ll see if i can find that book on emule myself
I’m “observing” rather than whining.
ed2k://|server|85.17.52.92|5000|/ is the server I used
ok, looking
ah. semantics is the game is it?
8^)=
Yep. Semantics is the study of meaning. And your meaning is wrong.
bYep. Semantics is the study of meaning. And your meaning is wrong. /b
How to hide String in java so that ppl won’t see the content of the string when decompile.
you don’t
so don’t put passwords/private keys in your code
but I want
~tell poguy about sol
poguy, sol is Shit Out of Luck – in other words, no chance.
Uh…
well there are some java .class file obfuscators
try those ?
nope
Try the Java Cryptographic Extensions.
you can’t obfuscate data values in code like that.
You can use symmetrical block encryption for that.
~tell poguy about JCE
http://java.sun.com/products/jce/
So here’s what you do: write a Java class that encrypts/decrypts the code, and a custom class loader for the rest of your application. The custom class loader will load your sensitive classes and decrypt them in-memory.
but you’ll still need to keep that key external to your system.
Yeah, but he can provide some external way of authentication, like a password (lame) or a biometric reader (better) or a combo pack.
that too much
Well, you wanted obfuscation, you have to be professional.
oh, i thought there existed some .. no idea
You also have to set the JVM extended options so that no memory swapping to disk occurs.
Check these out:
~tell poguy about JVM options
poguy, JVM options is http://blogs.sun.com/roller/resources/watt/jvm-options-list.html
Otherwise you risk exposing the keys or plain text to the public — not a good thing. So keep the whole thing in RAM.
You’ll need some JNI extensions to disable the OS from mounting external file systems, like USB, Firewire drives, or USB keys.
That will prevent someone from introducing a sniffer for your sensitive data in the system.
or you could just ship them a custom built machine with a custom OS and VM with no external interfaces.
Last, disable all networking for your application through a firewall. You don’t want any data going out.
i mean, to be *truly* secure.
8^)=
for … write a Java class that encrypts/decrypts the code, and a custom class loader for the rest of your application. The custom class loader will load your sensitive classes and decrypt them in-memory…. WHERE do you hide the key?
in your pocket?
In your pocket, in your head, use your thumbs or retinas, etc.
Lots of ways to keep the key secret. Technically, though, you’ll need TWO keys: something you know and something you have.
on a CD that is also encrypted and password protected and locked in a vault
jchauncey++
jchauncey has a karma level of 1, pr3d4t0r
I see you’re getting it. Another security expert is in da haus!
May I send you a private message?
at my college the person in charge of maintaining the socials had all kinds of crazy things he had to do to keep them safe
sure
Well, I’ve seen your work here and I’d say it’s pretty secure.
jchauncey is very modest.
Just your everage paranoid geek
He’s better at security than me.
The class loader will be easy.
it’s the C2 certification that’ll kill you.
8^)=
Also, encrypt the classes AFTER jar compresses them.
That reduces redundancy in the plaintext and makes your code less vulnerable to an attack.
So this is how it’d work:
Sensitive.class
just sue people with the dmca if they reverse engineer your code /sarcasm
I think that would be a good /topic for a thesis.
agreed
what’s the C2 certification ?
and throw in a one time pad for added security
just make sure your build the perfect random number generator
Heh
wow, great to see what sarcasm a simple question can induce .. regards, poguy
bwow, great to see what sarcasm a simple question can induce .. regards, poguy/b
bye, bbl ..
Well to the rest of us, that looked like joed laughed and was booted….
Well to the rest of us, that looked like joed laughed and was booted….
Heh
well just booted, not excommunicated
He liked it!
Yeah at the “perfect random number generator”
Yeah, I needed to wake up.
Anybody there know whits Free Java Dev. program I need to download on my linux ? sorry for my bad english
It was whatever characters you generated — they messed up my display
Hehe, it was actually just from a normal Colloquy window
cute.
Anybody there know whits Free Java Dev. program I need to download on my linux ? sorry for my bad english
heh
Long live irssi!
[TechGuy]: irssi doesn’t do split windows like WeeChat
The JDK? java.sun.com
~tell Selveste1 about downloads
Selveste1, you can find the latest JDK and JRE downloads at http://java.sun.com/javase/downloads/index.jsp. Look under “Previous Releases” for older versions.
Hrm. I’ll have to ping my one friend on that.
[TechGuy]: Check out WeeChat. Very nifty.
But slightly buggy.
[TechGuy]: irssi/vim = WeeChat/emacs
irssi splits windows very nicely
Not horizontally, only vertically.
You can’t split your windows into quadrants in irssi. Only into bars.
s/bars/bands/
indeed. that’s not enough for you?
instead of vim/emacs wars we are now going to enjoy an era of weechat/irssi wars
haha
cgi:irc !!!
I think I’d go bug-eyed trying to track channel quadrants in irssi
No.
pr3d4t0r, lawl!
~pastebin
wait, who won the vim/emac war? definatley vim right…
don’t go there
the flames still burn
See pr3d4t0r’s post at http://www.rifers.org/paste/show/5304
http://www.rifers.org/paste/content/paste/5304/image
That’s what my irssi window looks like.
dear lord…
Can someone explain why my jar file doesn’t run?
with event listeners how do you get the flow of your program in one place, seems silly to have them all get back to the main class somehow when they could just do their junk and pass on to the next class in the flow… whats the norm?
shing`: only if you explain what the error is
whaley, there is no error, it doesn’t do anything.
I tried a basic Hello World program, running in console, and nothing is outputted.
Hm
shing`: does your manifest file define a main class?
…
whaley, on the last page of the Eclipse export window, it said Select the Class of the Application Entry Point if thats what you mean.
shing`: yeah, if you are using eclipse, that would have done it.
shing`: you are running your jar via a command like `java -jar yourjarfile.jar` ?
whaley, I just double click it in windows
Oo
whaley, java -jar works in console, but is there a way I can get it to display a console when I double click it
shing`: run it via the command line, so you can actually see any output… chances are your console window is just dissapearing after the program exits
whaley, java -jar works in console, just typing test.jar doesnt
shing`: that’s expected
console windows don’t apply when running a JAR with javaw (e.g. “double-clicking them”)
oh.
~[TechGuy]++
[techguy] has a karma level of 43, whaley
~[TechGuy]++
[techguy] has a karma level of 44, shing`
ty
thanks for that… we would have gone in circles because i haven’t encountered that before
interfaces only have method signatures?
First “tech guy” thats actually been able to fix anything for me
Yes
so are they just an OOP best practice, not really usable for getting rid of redundant code?
They’re an OOP core tenant for enabling design contracts and allowing for replacable multiple implementations of a contract
you won’t get code reuse by using interfaces… you will get polymorphism, however
ahh, thank you, i believe that’s what i need, polymorphism
Perhaps you are rather interested in writing an abstract class
if i’m understanding correctly i have somewhat polymorphism through class inheritance, but do interfaces add like more capabilities to that?
if i understand it, an abstract class is one that you don’t need to instantiate
like Math
Math.random()
i don’t think it’s what i need but i may be missing some of its value
not more… just the equivalent effect of just being able to refer to an object by its Interface and not its concrete type – analagous to the same relationship between super/subclasses
i’m having an issue with overriding a method that’s called from a superclass method
i think the superclass method is calling the original method, not the overriding one?
is the method static?
hey, has anyone read “Java For Artists” ?
no
would that help?
did you put @Override on your method
no
i have a stack overflow that is happening when i need 6000 level recursion.. can i increase stack size?. or is there really an erro rin my method that makes it run forever?
don’t put static on things unless you know what it means.
~tooldocs
cheeser, tooldocs is http://java.sun.com/j2se/1.5.0/docs/tooldocs
i already fixed it by not using recursion (but there is a corner case that i am ignoring)
@Override? i never heard of it?
i’ll google it thanks
Sorry, you don’t know the secret code
=(
tis ok
man, OOP seems like a simple concept at first until you get into these crazy things
Anyone know when “Consumer JRE” will be released?
concepts, no matter what domain really, seem simple until you actually try to apply them
i’m just glad i’m finally learning some of the things in java i missed in the past 5 years of using it
heh multiplication is a simple concept, but try telling someone how to multiply 2 two digit numbers. It is a lot harder than it seems
things like reflection, interfaces
always better late than never
.. interfaces ?
Damn girl….
so how exactly did you survive without interfaces ?
abstract classes
lots of ways
it’s a tool i never had so i got along without it
You don’t need interfaces really.
They’re nice to have, but not indispensable. More robust languages than Java do without them.
certain parts of the language seemed just crazy to me, interfaces was one of them
thats kinda like saying its nice to be able to extend classes, but its not “really required” since copypaste!
in javascript, closures were crazy to me
confusing
java is so much nicer than javascript
except for Swing
oh, why is that ?
Swing?
i don’t like it
but then again i don’t really have a use for it
everything i make in java is on the server side
maybe i should use the GWT
meh, i rather have swing than make my own windowing system.
in JSTL
but there seems to be no cookie for me
requestScope.set…
iirc
I mean I want to check if this set contains a given number
not set something
c:if test=”${mySet.contains(123)}”adaf/c:if
requestScope.set.contains(…)
though i’m not sure EL supports stuff like that.
thankfully i haven’t had to do JSP work in a year or two now.
yeah I want to avoid jsp “scriptlets”
haha, JSP is my favorite
but I don’t see any other way
it’s pretty crippled
and you don’t like swing? you’re messed up.
use a taglib.
haha, maybe it’s gotten better, i haven’t used swing since like 2004
cheeser, which one
uh… you know you can write your own, yes?
plus back then i was a noob
now i code a lot better, but still learning
cheeser, yes I know but I only need “contains” in one place
so?
custom tags are so sweet
so I’m probably do a scriptlet anyway
that’s what i love most about JSP
…
it’s your funeral
?
cheeser, huh?
if you do, you deserve the hell you’ll create for yourself.
There is nothing to love about jsp
scriptlets are bad bad bad
right
is there a Graphics2D equivalent to cairo’s save/restore functionality?
haha, back in 99 winamp and napster made me so happy
good lord there’s some java work in phoenix
phoenix?
there’s nothing to love about swing
yeah, I’m supposed to be hiring a couple guys, but I took a look and I’m competed with a ton of companies for people right now
s/competed/competing
there’s nothing to love about applets
well, some things
im more skilled in html/css so doing jsp work appeals to me more than swing =\
awe come on, the were fun in 96/97
same here
i love HTML/CSS
and getting more proficient with javascript
i think my problem here is that i was trying to be cheap and save a class
instead of having 1 class inherit from another class
i need to make 1 base class
and 2 subclasses
or maybe even an interface!
haha
haha, i could try
i still don’t really grok it though
you have method signatures, but what’s the good?
the fact you get the type, without inheriting the implementation
since that can be baggage
if i have a base class it’ll be better than an interface though, no?
it may or may not be usefull or useless
because then instead of method signatures i can have actual methods
and those methods call other methods which are just empty in the base class
indeed, but also you force everyone to inherit form your class
tobins2, you can only extend one class but implements alot!
ahh, right… if i needed multiple inheritence
this is a very small program though
With full code coverage…
i won’t need to inherit more than one class
wait, will i run into the same problem here, even with a base class?
i’m getting so confused with this one point, it’s silly
what is your problem ?
method A() is inherited but the subclass, method A() calls method B() which has 2 different implementations in the subclass and superclass
i can’t seem to find a save/restore [or similar] system in Graphics2D.. how does swing recursively render widgets [if it is given a single G2D for each OS level window or associated image buffer, and has to draw several widgets in it] without this?
which version of method B() is called from method A() in the subclass?
*by the subclass*
i just need to do a test
start a new project
well think about it this way
and do public class Monkey extends Animal
yes?
its just new layers on top of eachother
obviously you cant modify the layers before it, since if you did, they would break.
i’m not sure i understand
you can just override
you can’t override the method and expect the new method to be called
someone suggested that
@override?
hi! does anyone know if there is some method to check if a JPA query is valid or not? (I mean the syntax is valid)
the new method wont be called from the superclasses, since they have their own method.
IDEA validates that for me.
and if you’re using Hibernate and named queries, hibernate will validate at start up
yes but from inside the subclass, it won’t call either right?
it’ll call the superclasses version still?
if you arent overriding, it inherits it.
if the superclass calls a method that’s overridden, it’ll call the overridden version.
but only if the object is of the overridden type.
hmm, this is confusing
i.e., an A will only call A’s methods.
yeah i know, but I’ve meant dynamic queries
B will call B’s method?
but if you override something in B, those calls will use B’s versions.
ahh, that’s what i need it to do
in practice, I find little use for named queries :/
but i got scared
unsure of it
Hi i’m new to java ! I’m looking for functions that will scan or dir the files over a certain directory?
in practice, then, perhaps you should take a look at how your structure your system.
8^)=
~tell alexseif about javadoc File
alexseif, please see java.io.File: http://java.sun.com/javase/6/docs/api/java/io/File.html
~tell alexseif about io
alexseif, io is http://java.sun.com/tutorial/essential/io
but now, do i need to use @override or do i just write the new method with the same name and params in the subclass?
cheeser im starting to think you have that stuff scripted
using @Override tells the compiler to verify the original method exists
what do you mean?
Thank you , I’m just finding it hard to browse through the documentation while I’m still a rookie, I already looked through java.io
ahh thanks
i mean we use the hell out of named queries.
only rarely do we not use them.
alexseif, new File(dir).list();
gr8 thnx!
my problems with named queries: no way to adjust the sorting dynamically, no way to filter dynamically
i still think i should go with a base class and 2 subclasses just to make this code cleaner
it’s too confusing
what is ?
having one class inherit from another and they’re both in use
is there a site where I can browse the functions ?
i’d rather have a base class that is not used with the common functions
arnt named queries safer as well?
what functions?
seems clearer to me
yes
java functions in general
Howdy
java has no functions
sorry, methods
http://java.sun.com/javase/6/docs/api/
but to browse you want, yes the classes and interfaces
yes
java has some of the best docs of any programming language
I’m sorry I said I was a rookie
thankfully that passed
or are you still a rookie O_o ?
I don’t understand
he he
~tell alexseif about RBI
alexseif, RBI is http://java.sun.com/docs/books/tutorial/reallybigindex.html
Anyone know when “Consumer JRE” will be released?
Runs Batted IN
hmm, where can i read up on what “mainloop:” does ?
never encountered that before..
how can I chmod a linux file from java?
yes I read that stuff, I guess I’m just used to C++ and php
mainloop: ?
bytecode stuff?
cheeser, im not sure to be honest..
it is present in a run() method i am reading..
Sounds like bytecode
oh wait…
I’m thinking turning over to JAVA for job opportunities any pointers
run() {mainloop: while() {}}
basically
EWWW
labeled breaks, continues, gotos, etc
I’m using netbeans and the java doc from the official site
and I have the java 2 complete reference
alexseif, that’s good, the javadocs are nice
nay, java has no pointers.
netbeans is my personal fav too, but lots of people like eclipse and intelliJ IDEA
dont use an IDE when learning java..
lies. Use ide when learning java.
learn java using console and an editor…
yeah, that’s how i learned
I guess I’m not familiar with packages and classes yet
but the RBI someone passed is helping
just dont use ide when learning how to compile, and how to use buildsystems
maybe get a lightweight java editor with syntax coloring
or rather make sure you understand what the IDE does for you if you insist on using it..
Will java ever see optional parameters like lisp has? Would it even be worth while?
ahh, like javascript too
I have eclipse but the netbeans seams more powerfull
Woflborg, well i can argue that codecompletion dont really teach you how to properly use the methods,
emacs!
i found netbeans to be simpler
i like it, and it’ll help you learn, but you may at times find yourself fighting it
yes it sorts out somestuff I’m not familiar with
problem of every IDE and lazy human
if you run into trouble with it, you might consider going to command line to compile
how do you mean, it displays generally the javadoc page for the method.. what else could one need to learn how to use a certain method ?
no offense
Woflborg, depends on your ide i guess but sure if yolu actually read the javadoc then its decent
I agree with loesh but I don’t jave time for that
a good newbie ide to use is jgrasp
if your just starting out
one thing people often run into with netbeans is that when you have files you want to write or read from, it puts it in a directory like Program Files/netbeans
which is stupid IMHO
it should go in the root directory of the project
no my problem is with examples
That /is/ craz
y
i could argue that if people arent reading what the javadoc says, they are going to meet quite a bit of errors in a hurry..
yeah you can change it but i always forget where the option is
since I don’t know the building directories stuff well enough I don’t know how to preview an example in the netbeans
read the doc
in that case you should really compile on the command line
I downloaded a couple of source code from source forge, but I use the notepad to see them
do you know how to use javac to compile .java files to .class files?
yes I tried it a couple of times
but not enough
isnt that more of a question of not knowing how to use netbeans, how would it help him to gain more knowledge on manipulating projects in netbeans… by using commandline ?
well it won’t help him learn netbeans, but it’ll help him get examples running faster
I know you javac from .java to .class
and then java your class
yeah
but that doesn’t set as much directories
how do you mean set as much directories?
like you have inner folders you want to compile?
he probably means it doesnt work like the build system in netbeans..
ahh probably
well in netbeans you have like 6 folders after you compile and run
and is the source code from the stuf I dowloaded
I try new existing project and errors come out
undefined symbol and stuff
netbeans is simple enough, you just have to plop the code in the default package or plop the package in if it’s in a package
indeed, its simple once you understand what packages and such are.
I gues I’ll get the hang of it in a while
ok here is a question
i have a project started in java 1.4 and use xerces/xalan/xml-apis, java5 supposedly uses them, which jars can i get rid of?
when you start to make an application and you want a form you use a class or package
a package is basically like a folder
i’m not sure what you mean by “a form”
form with buttons ( desktop applications)
oh, that would be a class inherited from javax.Swing.JFrame or whatever
you need to use Swing most likely to make GUIs
heya soulreaper_
yes i know that netbeans opens up a package and then I make a seperate class from the wizard with a form
but the main class is in a package
what ftp clients do you guys use?
anyway thanx a lot
winscp
ahh, i never used any of the GUI creation tools
ssh
i don’t really make desktop apps
how can I set permissions (equivalent of chmod) on a linux file from java?
Runtime.exec(), jbellis
no native alternative?
same here, SSH
that *is* native.
but no, there is no pure java approach
k, tx
on linux i use gftp
filezilla
hi Sou|cutter
ooh, i have to try firezilla
on linux (its still a beta, but it works fine=
i try to try as many mozilla and google products as i come across
i heard a rumor a while ago google wanted to buy opera, did that ever happen?
http://filezilla-project.org/nightly.php
who would want opera
opera’s ok
better than IE
ie is magically looking more and more like opera by the year..
most browser are better than ie
new ie is ok though
hell, even ie has tabs nowdays
but i prefer firefox
does IE 7 block google adsense ads?
It don’t have to be good, just to be better then IE
hmm, maybe that’s another reason to switch to YPN?
if it doesn’t also block those
it doesn’t even block them nicely, i just have white squares on my black page
hmm maybe that’s another reason to switch the background to white?
haha, no, i’m silly
love web dev though
Do anybody knows to this program netbeans ? it looks god !
You want my job? I hate it.
sure, i’ll take it
i’m unemployed now
Well, I hate the front end sort of stuff…
almost done with my B.S. in comp sci
I like designing custom components and such
JSF?
About to start mine
No framework
ahh, hardcore
i like it
I tried to push JSF on them, but couldn’t get them to adopt it
but lately i’ve grown respect for frameworks and leveraging the work of others
soon i’ll be cured of my NIH syndrome
Not Invented Here
hehe
I’ve been exposed to the code NIH-syndrom has generated at my current employer, and that has effectivly cured me of any such tendencies
wlfshmn++
wlfshmn has a karma level of 7, cheeser
haha yeah, that’s one thing they can’t teach you in college
but hopefully from my own projects i’ll be almost cured of it by the time i actually enter a work environment
opera was a good option on linux for quite a while, before mozilla really started up
It was that or netscape
I’m so glad we have firefox now
I did it the other way around.. I’m taking up college again after wokring for a bundle of years
I need to hurry up and make my first million before I get too old… I’m already 20!
I should have made it 2 years ago…
ahh, that’s probably better, get a lot more out of classes that way
wanna know the secret to getting that million?
i learned this from warren buffet.
haha, sure
start with $1B and buy an airline.
haha
at my school they stress us out so much with programming that a lot of what you learn is just time management and how to deal with pressure
valuable skills though
but being from the working world you’ll already know that and can focus on the real learning
yeah probably the best things i learned
so it is real learning
but on my own time i learn more about code than i do in class
I would like to say I choose this order due to some smart choices, but frankkly, I was just sick of school, did an attempt to get motivated, spent a yea rin college, realized I couldn’t take it, and went to work instead
you probably got into at a good time, during the tech boom?
i got into computers only in 2002
so school was essential
at first i was only going to go for an associates degree
college is for fundamentals and sciences. specific languages and such are going to be obsolete, or have changed singificantly, before one graduates anyway.. it’s not like I currently use a single sliver of my specific language skills I had when I started working, in todays
projects
but i loved it so much i transfered, essentially lost 2 years of my life, and now i’m almost done with bachelors
I started working in 2000, before the worst of it hit, and the job remained stable although the company got resized and bought up
yeah when i was a freshman in 2003 they taught us java, now they teach them python
also when i took web programming in 2004 there was no javascript, the teacher hated it, the next year came the AJAX craze and he started teaching that
or was that 2005?
i don’t know, but i was like ahead of my time
i used some cool javascript tricks in my project before AJAX was a buzzword
well, there, “web programming” sounds like a typical course that maybe shouldnt’ be taught at uni, or as an elective at most, sinc eit sounds like it’s going to have a short expiration date
actually i think it was internet programming
but it was all about the web
JSP, XML
HTML CSS and XHTML
imagine looking back at your transcript in ten years and thinking “Which of these skills are still usefull to me today?”
no javascript though
that was one of the best classes i took
that, software engineering
which was like databases + web stuff
yeah, databases too, i learned a lot from that
useful stuff
but all the assembly language stuff i doubt i’ll ever use again
in my last semester i’m taking compiler design
if web-related techniques are used as tools to teach more fundamental skills, that is fine though.. it’s just teaching narrow skills I dislike..
i get to learn how to use javacc
anyway, I should be heading home…
ok later man
must you use javacc? oh i guess so for your course… I like SableCC personally
yeah, they tell us what tools to use
i might actually drop the class, it’s scary
~hotspot
g[r]eek, hotspot is Sun’s JVM http://java.sun.com/docs/hotspot/
g[r]eek, hotspot is Sun’s JVM a href=”http://java.sun.com/docs/hotspot/”http://java.sun.com/docs/hotspot//a
i might take principles of programming languages instead
which is like java prolog python and SML or whatnot
supposed to be easier
lots of little projects instead of a few huge ones
also i can start learning that stuff now
prolog
such a pain
write a text calculator in java that parses expressions
without using expr
or whatever
then change it to use postfix notation
there isn’t an expr() in java.
oh, that’s javascript
eval() ?
i forget
i’m confused
anyway
computers are fun
programming is the best thing to me
it’s like a game
the best game ever
it’s like second life but better
computers are not fun, and programming isnt either… wait till you get in the real world
~punctuation
joed, punctuation is hey, everybody loves it when you correct their punctuation, so give a helping hand!
hehe, hopefully it’ll stay fun
you got burnt out on it?
I can think of worse professions than computers/programming.
not burnt out yet, havnt been out of college long enough. So can I, and I have done them. But staying in a cubicle all day sucks and having managment that has no idea what is good design can drive you insane.
good days / bad days just like anything else
that way it’ll always stay fun?
maybe it’s how prostitutes feel about sex
hahaha
i’ll have to get employment some time.. and it’ll probably be programming.. so maybe it won’t be fun for long
lot’s of suckier jobs out there
*lots
i’m seriously thinking of moving to a cheap apartment and getting a part time job that gives me health insurance and just programming as a hobby / second job
yeah i wouldn’t mind that kind of lifestyle
i’ll probably be doing something like that soon [sharing accomodation with a few friends, working in some kind of shop, or maybe computer repair]
that would be awesome
do hardware work during the day
programming at night
ever see the movie Primer?
nope
you should really see it
it’s one of my favorite movies
[remember to reserve some time for partying and juvenile activities!]
haha, smoking pot and programming all night
doing LSD and writing LISP code at Berkeley
all night LISP coding sessions, fueled by LSD
bahaha
that could be interesting
coding stoned gives surprising results
haha i like it
i don’t like smoking around people, i get nervous
guys please take this conversation in private
but when i have work to do all by myself it’s perfect
once i wrote the foundations of a UI toolkit stoned, woke up the next day, thought “wow.. does it actually work?” and it was all fine
haha, nice
g[r]eek: hey it’s a genuine coding technique!
we were only off topic for a couple minutes
we’ll get back on
so.. does anybody know how to do cairo-like save/restore with Graphics2D? or how swing gets around the lack of it?
[3rd time lucky?]
cairo-like?
is cairo a program?
it’s a graphics library
[written in C]
cairo is a software library used to provide a vector graphics based, device-independent API for software developers. Cairo is designed to provide primitives for 2-dimensional drawing across a number of different backends.
ahh ok
i don’t know much about that stuff, sorry
i know how to generate PNGs
using Java
but that’s all
haha
i’m pretty into 2D graphics at the moment
do you know anything about 3D graphics?
specifically UV mapping?
actually, i found the formulas i need i think
none at all really [except a little raytracing]
ahh yes
i was trying to make a web-based program to take a 2D image and turn it into a UV map
for use in Second Life and other 3D environments
but screw it
maybe you can just save the ColorModel or whatever that holds the pixel data?
or are you looking for a quicker solution?
bah, i cannot help you, sorry
a quicker solution.. save/restore is just a way to save information such as clipping and current colour, then restoring it later.. it’s mostly of use for GUI toolkits i guess [where you have objects inside objects inside objects]
damnit, why can’t java be smalltalk
i want 1) closures, 2) spare memory and 3) java
guys – who has experience with webservices?
hi pr3d4t0r
pr3d4t0r, still doing some cobol, no?
actually he’s hunting aliens after that grand opening …
lol
Cobol – C w. Object Business Oriented Lexicon.
gimmeh random program idea
a program to generate random program ideas
Aftermath_ a program to read all directories on your harddisk.
and list it neatly
just tree /F
but its not .html
that’s an idea
No.
Aftermath_, create a class name Ideas, then a random method like math
thanks a lot
I haven’t touched COBOL since 1987 or so. And back then I learned only one instruction: CALL.
hoho
lol
pr3d4t0r, he he, was kidding my friend, lol
JavaCobol
oh I am afriad to google that
me 2
It’s “too”, not “2″.
~tell freddysatellite about aolbonics.
freddysatellite, aolbonics is talking like a retard using speech as if you were on AIM or using single letters for you, are, you are, you’re, see, etc. Talking like this is frowned upon in ##java and may result in you being silenced. You have a full keyboard so use it. We don’t care if you talk
like an idiot with your friends but we don’t want to sit through stuff like this: http://forums.oracle.com/forums/thread.jspa?threadID=499980&start=0&tsta
~tell freddysatellite about Java literacy.
http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=469758086_051b1dd752
pr3d4t0r, i support that
came from other channels that encourage that
dude, my boss
he’s a nice guy
but for 2 months this new guy started
and doesn’t hvae an email address yet
and he needs it to do his job
haha!
and my boss has been told at least 6 times that he should set it up. Every time he’s going to do it right away.
he doesn’t understand the concept that 2 people working on is better than 1. if I were a boss, i’d prioritize the tasks that prevent others from doing work of anything else
*yawn*
Kill him and take his job?
that’d work
but the email password would die with him
I have a more laidback approach to chatting… I can socialize no matter the IQ of those I interact with… http://www.teralaser.net/cm/displayimage.php?pid=148&fullsize=1
i’d set it up myself if it didn’t have a password
you allow small creatures to crowd around you and fornicate with each other?
Offer doing it for him?
Yeah, I know … their tails shows they are not doing it really, though…
haha, didn’t notice that
The girl in black does though
~persistent
joaop, I have no idea what persistent is.
~persistence
joaop, I have no idea what persistence is.
heh
i guess i’ll do that
is tss down?
hrm really slow
ah now it’s fast
i have a stack overflow that is happening when i need 6000 level recursion.. can i increase stack size?. i cut down some of my ussage by making sure i had less invakes per use.. but now i reached a new thing i need to process a little larger
~tell dmiles_afk about jvm options
dmiles_afk, jvm options is http://blogs.sun.com/roller/resources/watt/jvm-options-list.html
you can increase the stack, but 6k frames? that sounds a bit ridiculus? can you not rewrite your code?
thanks awesone url
i rewrote a little but to use a local variable for the “next” operatoin.. but there is one that i just cant seem to do that with
hi everyone
after an ajax call, how do you read the POST variables in java
i usually do get requests, so i jsut do request.getParameter
but this doesnt seme to be working for POST data
how do i read post data in java
ok -Xmx1024M -Xss16k -Xoss16k seemed to actually make it come earlier .. strange
post calls should work regardless with getParameter. Make sure your action is set to the right url
k thx
also you could try iterating over all the values sent to see if it is sending a null value or what exactly is happening
i think my params string might be wrong
cus in firebug it just shows the parameter string instead of listing the params in the post tab
the syntax is field1=value1&field2=value2 ect.. rite?
right
are you using input tags to submit data?
no im reading the data manually before sending it
and verifying it
with a submit butotn
the submit butotn does an ajax call instead of a form submit
cus the data requires some maniuplation before sending
ok so you are building a string and then sending that string to some processing page?
yea
using a jsp page to do the processing?
no the processing is done by a java page, im using struts
ah k
ive just always used a hidden iframe and submitted the data to a jsp page which is why i was asking
yea i dunno i think its definitly my params string syntax is off
Hello
Do you know how I can have a list of all nodes with jaxp?
it would look something like this something.jsp?param1=value1¶m2=value2
you’re doing an ajax call because the data needs manipulation before sending? Why don’t you do that in your controller?
or in your model, depending
doing it in ajax is *probably* dumb and might be a security risk since I could use a program to send the data directly
~spring
joaop, spring is a Java/JEE Application Framework – http://www.springframework.org/
how do you run a .jar file?
~tell pianoboy3333 about jar
pianoboy3333, jar is Java ARchive. See http://java.sun.com/tutorial/jar and http://java.sun.com/javase/6/docs/technotes/guides/jar/index.html for more information. Also
see fatjar
“java -jar foo.jar”
I just downloaded azureus as a jar file, but I’m not sure as to how to run it
ok thanks
but that only works if the jarfile is runnable…
ok
Is FileInputStream.read super inefficient, even with a large byte[] buffer? I’m seeing 4000ms to read 5MB locally (w/ a 128KB buffer) which seems horribly slow
ok… it’s not runable, now what do I do?
read the docs for the program…
thanks
FileInputStream.read(bigByteArray) is efficient
there a way to use a tray icon in java?
nope
reading 5 MB ought to take about .4 seconds if your hard disk has a speed of 60 MB/s (about normal for standard desktop), if the file is buffered you can get way faster results though…
not that i know of
so you see why i am puzzled
~tell AustLaw about javadoc SystemTray
AustLaw, please see java.awt.SystemTray: http://java.sun.com/javase/6/docs/api/java/awt/SystemTray.html
4s seems a bit long, yes…
since I do not see what you are doing it is hard to say what other silly thing that is taking time…
you may also want to look at the SystemTray info javabot gave…
i stripped everything else away
byte[] buffer = new byte[128 * 1024];
int bytesRead;
while ((bytesRead = fileInput.read(buffer)) != -1) {}
read the topic regarding pastes…
test case in pastebin?
how do you time it? the jvm statup time can be something like 3-4 seconds…
currentTimeMillis, so jvm startup is outside timer
how should one adjust the preferred size on a JPanel that they are drawing on since it won’t have a layout manager?
Permalink Comments off
Management beans are ‘defined’ (e.g. identified) primarily by their name – they end in MBean or MXBean. What the fuck is that?!??? we don’t do that in java, dickweeds. We use flag interfaces for that, have done for years.
Agrajag-: you can open them as InputStreams.
Agrajag-: Why would you want to address them as files? Normally java finds its class files in any of many ways. From directory, from jar file, over the network, generated, etc.
Agrajag-: and as far as directories go, no, it is completely impossible to do that within the existing java servlet hosting framework. You can only query resources, not contents of directories. You’d have to ship a file with a known name
that lists all other resources if you want that.
i didn’t mean class files, i mean other files like media – pngs and such
Agrajag-: I’m aware of that, but do oyu understand the difference between a File and an InputStream?
yes
Agrajag-: one is limited to physical files. The other can be from any reasonable source – be it a jar host file, the file system itself, a database, network, generated, etc.
yep ok
Agrajag-: right, so my question is: Why do you need these to be FILES? Is InputStream enough?
because accessing files stored with your classes as INPUTSTREAMS – no problem. as files: impossible.
I think that’s the least of problems with MBeans and MXBeans, though
Possibly. I’m working with them right now for creating some JConsole plugins, but so far I’m less than impressed.
because i’m using other packages that expect Files, i can’t modify those packages. it’s not necessary, it’s just something i thought would be nice to do – so that i can just release one jar file rather than have to also package media directories and stuff
jconsole, that was impressive. the beans not so much
Agrajag-: then you’re fucked.
nicely put
jconsole is impressive because of the user interface work, mostly
Agrajag-: if the programmers of those other packages were slightly less braindead when they wrote their methods this would have been no problem. I know what you mean though, a year or so ago I found an mp3 playing library that worked great, except the only input methods were either a string
(filename) or a File object. D’oh!
but *just* creating beans and automatically generating a user-interface for them seems to be a half-unsolved problem
I want to add a tab with my own stuff, and I thought it would be a good idea to transport the data from my jvm to jconsole using mx beans.
But even doing something as simple as creating my own Notification subclasses and including the class files for them in my jconsole plugin aint working. Shortsighted.
how would you have made the api?
using InputStream only, or if It was really important, a File and String-based ‘helper’ which just one-liners the creation of a new FileInputStream and calling the ‘real’ method (that takes an IS).
but the canonical method would always take an InputStream. Or a Reader if it was something based solely on character, not data, streams.
That mp3 library I talked about actually did that wrapper trick and then called a package private access method and never ever looked at the File object again. Talk about idiocy. So I hacked around it using a class with the same package name, but it wasn’t really a nice clean solution.
i see
good to know for my api’s
cause i often pass around File’s
yeah. Don’t do that unless the notion that it’s a physical file is actually important. It almost never is.
yes, braindead APIs sometimes suck
I spent a couple of days hacking around the limitations of Ejb3Configuration of Hibernate
Agrajag-: You can actually copy the files to a temporary file then hand teh tempfile to your media libraries, but that’s also not a very nice solution, especially not if the media files are large.
hmm yeah. it’s not a big deal, just something i thought would be nice so that the packaging is a bit easier. i’ll just leave them as real files in the filesystem for now
why did you have to hack around the limitations of Ejb3Configuration?
I wanted to load configuration from a location specified at runtime
you mean like persistence.xml?
the same information, yes
Agrajag-: In case you ever need to do this and inputstreams are acceptable, look into ClassLoader.getResourceAsInputStream
ok, cheers.
interesting. how did you manage to accomplish that? I also wish there was an easier way to specify the location of persistence.xml at runtime. Maybe an env variable or a better configuration api.
I load an empty persistence.xml from the default location for all the different runtime-configurations, to set up the initial Ejb3Configuration, and then insert all the required properties, entity classes etc. via the Ejb3Configuration methods
using the hibernate specific configuration api?
isn’t that what Ejb3Configuration is?
yeah, I guess it is
I guess that would work. Not as elegant as just specifying the location of persistence.xml at runtime.
indeed not
or, as surial said, just being able to feed the persistence.xml as an InputStream
java isnt showing a loading bar for me
did you ask nicely?
yeah that would be useful too
this is about the browser java plugin, not neccessarily applets
the java logo doesnt show progress on its bar
i recently did a full security overhaul
could this have broken java?
~tell DarthJesus about applets
DarthJesus, Check the topic, read the Wiki… Essentially we try to avoid them
this isn’t a java issue, it’s a browser issue.
right now i am seeing if java hosting is blocked from tcp/ip
…
this would be local…
not remote
Are you running an applet or a Java Webstart application?
if java cant use tcp/ip it would explain why the bar is broke
What are yourunning?
Er, you running?
it doesnt show loading progress for either applets nor java binaries
i am running xp
Reinstall the JRE.
what would i use to reinstall it?
Start/Control Panel/Add-Remove Software/Java Runtime or equivalent.
you want to see if javaws.exe is blocked if webstart cant download things
first i am seeing if the JRE is blocked for tcp/ip right now
http://java.sun.com
a href=”http://java.sun.com”http://java.sun.com/a
javabot tell DarthJesus about download
DarthJesus, download is http://java.sun.com/javase/downloads/index.jsp
that’s the download site
(direct link)
has anybody ever come up with a good setup for inheriting and extending toString methods?
huh? defining a public String toString() method too good for you?
it’s ok to just say ‘i don’t know’
but thanks for the input anyways
i’m serious. toString is defined in Object. it’s virtually impossible short of making the class/method final or not calling super to NOT override/extend
s/override/inherit
I mean adding information to base class toString of course
return addExtraStuff(super.toString()); where addExtraStuff processes what the base implementation outputs and adds what you want
collect $75.
yeah hmm
http://eugeneciurana.com/pastebin/pastebin.php?show=3621
no wonder,, my hdd was full x.x
erm…
~r0bby++
r0bby has a karma level of 38, Fanook
right now i am literally uninstalling 100s of progrrams i no longer use
x.x
start with the porn
there is no porn o.o
nor any mp3s
…what the hell do you have on there
?
nor other audio/video
Is there a way to set up arrays (like you can with javascript) so you can do arrayName["test"] instead of having to do arrayName[0]?
programs and source code!
that’s what Map is for
javabot tell dev- about arrays
dev-, arrays is http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
who’s trying to not override toSTring()?
meeper.
~wedgie meeper
mohadib, I have no idea what wedgie meeper is.
dev-: Not with arrays.
dev-: Look at hashtable.
hashmap
WHy?
pm
he never really gave a reason
i had 3 different usb wireless cards installed x.x
thanks pr3d4t0r
and we never ask
god damn it
s/we/I/
doing something in complicated in java that a database can do easy–
Huh?
~coffee tieTYT
a ha
i’m trying to make a report based off of header data and ip addresses
mofo print shop 22 is using 2.5 GB!!!
thanks for the update.
user-agent, isABot, unique-ip-addresses, unique-ip-addresses-by-first-2-octets-only
thats where all my space went o.o
ircbot?
user-agent, ip address
would you guys use java host to do this?
perl
##java isn’t your blog, so we don’t need a blow-by-blow account of what you’re removing from the system.
Thanks.
cause i would prefer to use a database
I’d use awk
and how would that avoid complication?
Huh? It’s worked since the beginning of dawn?
Otherwise, load it into a DB?
well you see, i already typed awk and it didn’t solve my problem
nevermind i’m just pissed off
goodbye nearing 3GB of _CLIP_ART_
o.o
…
ignorelist++
i deleted 3 word documents and a mp3 today
3.7GB, free space: 823MB – HOW IS THIS POSSIBLE?
o.o
i just deleted AT LEAST 2.5GB!
is my hdd corrupt?
yes
id throw it away
right now!
start a blog, please….
i wish i had swordfights at work… http://xkcd.com/303/
lol
my blog actually has 5511 pages o.o
no doubt
and its all of 3 weeks old now?
how do i have a jtable that is not editable but selectable
look at the jtable api
actually its an 8 year blog
or check exampledepot
hi
sup
mt lattitude in about a week
my
thats fun
vista?
noe , moving
and its latitude
always thought it had double ts
i have double d’s
Howdy all
yo
unit (scala) = void (java/c/etc.) ? what kinda silly keyword is that…
uunit (scala) = void (java/c/etc.) ? what kinda silly keyword is that…/u
im running jar from bash, and using the -C option, and also trying to specify all class files with *, e.g. jar cfm foo.jar Manifest -C bar/ baz/*.class – clearly bash isn’t going to expand the * to include all class files. short of writing a script to generate a list of class files for me, is
there a way to tell jar that i want all class files in a directory?
a classpath doesn’t include a .class file
it just includes the directory to find the classes.
~tell Agrajag- about classpath
Agrajag-, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM
i don’t think you’re answering my question..
ah, jar, not java. my mistake.
they sound alike
the number of times we get idiotic classpath host questions is boggling.
jar i believe functions just like tar.
I say we do away with the classpath altogether
so don’t you just need to specify the top level directory?
not really, as there’s files in other directories that i don’t want
nevermind, i’ll just do a script, i think that’s the only way. not too hard anyway
I think you’ll have to copy the files you want to a separate directory and tar from there
or jar, i should say
i’d actually use an xargs.
find . -name *.class | xargs jar cf foo.jar
ooo xargs…always forget about that one
ant++
heh. that too
hi, all. I have a question: Can I use jdb debug ejb in jboss? because I had read a little document about jpda, I don’t like use IDE for test hello, hwo to use jdb for debug ejb in jboss?
thanks
who can help me?please
?
Where is fmod in Java?
fmod?
floating point modulo
%
that’s not floating point.
I want to find a fastest way to r
er crap
i don’t think java supports floating point modulo.
sorry
~tell r0bby about rif
r0bby, Reading Is Fundamental
~ridicule r0bby
Actually I just want to round up angles to the range of -pi..pi
hello, is there a regex guru here ?
~tell NeoEcoS about anyone
NeoEcoS, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
hi, guys, please give me a little hit? thanks
hylinux, did you ask in the #jboss channel?
had asked in jboss. but no body response me.
feel better?
Uhhh… My ideas is that. I first get x fmod 2Pi. If it’s greater than Pi, -2Pi again…
why? mistake.
see http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/jdb.html
x+5×45z-3xy+6x, or 10 or x, or x34y23 ..etc
hint.
specifically, look at the -attach argument to jdb, I think that might get you what you need
No I hit you again, no mistake.
I mistake. about spell. it is “hint”. ok?
hehe
and you’ll need to add some extra arguments to your JBoss startup script
just ask your question.
I want to use jdb for debug ejb in jboss. how to do this?
I had made jobss run in debug model.
and I can attach jdb to jpda interface.
but how to debug ejb?
thanks
this is my pattern http://pastebin.com/d25c5e414 but if the string begin by x+anythings the program freezes
once you’re attached to the jboss server, it should be just like debugging anything else using jdb
“((+|-)\d*(x|y|z))(\s*(+|-)\s*(\d*(x|y|z)))*” and no, i’m not going to explain it.
have a question, I had attach the jboss server, example: now I had a ejb named “helloword”, so, can i run this bean?
Fanook, will you explain it to me?
no. go read the javadocs for Pattern
Fanook, is not necessary to explain it,
you’ll need something that calls a method on the Bean. I don’t know that there’s any way to initiate that from the debugger. Just whip up a simple little command line program that looks up the interface and calls a method.
~Fanook ++
I guess the factoid ‘be fanook’ might be appropriate:
hahaha
Fanook, i was not so long from the Pattern
~Fanook++
fanook has a karma level of 29, joed
~joed++
joed has a karma level of 55, Fanook
or a servlet that you can hit with a browser, that calls whatever method you’re trying to debug
ok. thanks. let me write a simple example for call that ejb.
that was priceless.
i’m fairly sure that was the first time that’s been invoked by someone other than me
I don’t think your regex is correct – it doesn’t match 10, for example
which is why it’s priceless…it was more the fact it was trying to increase your karma…maybe I have a weird sense of humor
from a unit : assertEquals(
“^.*\\s(19|20)\\d\\d([-/.])(0[1-9]|1[012])\\2(0[1-9]|[12][0-9]|3[01])(\\s+)(\\S+)(\\s)(\\S.+)”,
m_factory.getForwardingRegexp());
ah, good point. need to add ? after the xyz groups
also the sign for the first coefficient needs to be optional
uh, yes. i kinda added that part last minute
haha mindCrime
cute saying
i’ve seen that posted here in the past
Pattern polynomyPattern = Pattern.compile(“((\\Q+\\E|-)\\d*(x|y|z))(\\s*(\\Q+\\E|-)\\s*(\\d*(x|y|z)))*”); dosen’t works
and that’s only true if you’re not a complete… nevermind I’m gonna be nice
wish I could take credit for it. I think it was jwz
also, I understood there were exponents in the required polynomials, but yours doesn’t do exponents
I haven’t bothered to learn regex
erg, yeah. the groups need to be expanded too
if it hasn’t dawned on you yet, regex is a poor way to parse this kind of thing
Fanook, which other way i can use to do that ?
* can i use
i thought i would never say this, but StringTokenizer set up to return delimiters as tokens
string.split tosses the delimiters, and regex is really complicated, as you can see
Fanook, i like to learn regex, thanks by the help, will continue trying, will tell you if i got the regex working
…
Is there any reason for using float instead of double?
wtf is jusched.exe?
it’s smaller
java updater scheduler
except for space?
none
oh i blocked it using my firewall
Good. So I think I can just use doubles
what is IeSHAz then?
or rather
what is IeSHaZ then?
iESHaZ – *
what is an antivirus channel on freenode?
I have an idea: it’s probably the most inefficient: read it character by character and do a switch on the mathemetical delimiters +, -, *, /, %
Still too much to modify… Is there a way to automatically convert from float to double and back?
s/probably//
that’s what i was getting at with the StringTokenizer. split on the operators, then parse the monomials
ah yeh
except, i wasn’t going to use StringTokenizer *AT ALL*
just read the entire thing regardless
if t
pfft. easier to parse smaller things
If i wasn’t so lazy, i’d type up a test case
and if this didn’t scream homework
granted, StringTokenizer IS marked as obsolete, but this is one of the things it’s better at than .split or regex
if i StringTokenizer, by + or – the regex for getting coef, and variables exponets works well
StringTokenizer never liked me
if prefer todo a String.split(“+|-”)
Fanook told you that may not work
do that and you’ll lose whether you split on + or -
unless you split on +’s only and look for the -’s on your own….
agh… that’s a real problem :$
what is the secure way to implement cookies in jsp?
that’s where StringTokenizer is nice, you can tell it to return the delimiters as tokens
oh
Couldn’t you split on +’s and then split again on -’s?
specially from xss
you grab a String right? String has a method charAt() which allows you to iterate the String, one character at a time, you have a switch case for ‘+’,'-’/’ and ‘*’ performing the intended operation each time you encounter those.
is it possible to pass references into a class after its been created?
yes, i hope you like really complicated loops though
sure. use a setter method or a public member
public member huh, never heard of
And i’ll note as well that my solution is well…bad.
Fanook, not that complicated, just two loops…
buh bye!
sure, for only + and -. add the rest of the parsing
use a setter/getter to modify/retriuve a classes member variable
public variables can cause…unintended problems.
I’ll try that thanks you two.
you and your encapsulation fetish public members are fine when the object will never contain logic
what if your class relies on a variable to _NOT_ be null, you go and you set the variable to null outside the class, then inside your class you go and reference that later on/
*fapfapfap*
little do you know, i actually broke encapsulation in a private host project I wrote to do just satisfy a curiosity of mine
good for you
you broke encapsulation!? omg everybody panic
http://eugeneciurana.com/pastebin/pastebin.php?show=3623
example.
imagine Bar was defined for this example.
so that changes the bar to null ?
the client.
foo.bar = null;
yeah
just realized
s/Bar()/Foo()/
Wtf?
My priest just died. ;_;
WoW?
but lets say my Foo class needs a special variable to be built up, how do I pass the value into Foo AFTER its already been made?
O-o
NetHack.
ah
use a setter method and a private/protected member
private int, then a set method to set the int from another class right ?
Im working on that now, lets see
public void setFoo(int i) { this.whatever = i; }
/jj3/me hugs Fanook
wrong hug
Is there a way to advise the JVM (through Java) that, if possible, you’d like particular classes or variables not to be stored on disk?
[eg by being swapped out]
not that i’m aware of
Thanks
Is there a way to call a function based on a variable? IE if I have a variable named %i with the value of “test”, how would I call the function “test” using %i instead of “test”?
~reflection
stupid bot!
google java reflection
ok thanks
Reflection is an extrinsic conferred by the amulet of reflection, silver dragon scale mail, shield of reflection and longbow of diana. ¬_¬
javabot reflection
r0bby, reflection is http://java.sun.com/tutorial/reflect
aiyeeeeeeeeeeee javadoc works
~javadoc String
cheeser, please see java.lang.String: http://java.sun.com/javase/6/docs/api/java/lang/String.html
ok. i didn’t hammer anything
8^)=
What’s r0bby doing to poor javabot? :s
nothing.
’tis all me 8^)=
Oh noes!
Ah yeah it worked out just fine, tyvm r0bby
~javadoc Date
joed, please see java.sql.Date: http://java.sun.com/javase/6/docs/api/java/sql/Date.html
joed, please see java.util.Date: http://java.sun.com/javase/6/docs/api/java/util/Date.html
i tested that last night
Nah. it’s broke.
Should have replied ‘fucking does not make sense’
hehe
javadoc Pattern.split(*)
~javadoc Pattern.split(*)
Fanook, please see java.util.regex.Pattern.split(java.lang.CharSequence): http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#split(java.lang.CharSequence)
Fanook, please see java.util.regex.Pattern.split(java.lang.CharSequence, int): http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#split(java.lang.CharSequence,%20int)
stupid tilde
~javadoc String.regionMatches
I don’t know of any documentation for String.regionMatches
~javadoc String.regionMatches(*)
aditsu, please see java.lang.String.regionMatches(int, java.lang.String, int, int): http://java.sun.com/javase/6/docs/api/java/lang/String.html#regionMatches(int,%20java.lang.String,%20int,%20int)
aditsu, please see java.lang.String.regionMatches(boolean, int, java.lang.String, int, int): http://java.sun.com/javase/6/docs/api/java/lang/String.html#regionMatches(boolean,%20int,%20java.lang.String,%20int,%20int)
test in privmsg?
holy javabot spam
I wish javabot would escape brackets in urls too
my irc client doesn’t think the “)” is part of the url
also, it’s not really spam, I wanted to tell everybody about my latest finding
somebody asked about a startsWithIgnoreCase a few days ago, it can be implemented very easily using regionMatches
string.toUpper().startsWith(other.toUpper()) ?
that’s quite inefficient
and i’m sure firing up the regex stuff is *so* much faster
also, it’s toUpperCase, and it doesn’t work for the Georgian alphabet
have you even profiled it?
oh, dear lord.
you’re going to quibble API typos?
what regex stuff?
regionMatches() uses regex, yes?
either way, i don’t really care.
no, just a simple loop
it just looks like an engineering solution in search of a problem.
i’m actually on my way to bed…
that explains it then
good night
i feel i’m going near of the regex for polynomy
why are you doing this to yourself?
*yawn*
?
you’re supposed to catch it
hm, about 2.5 times faster
Hola.
hola despredador
aditsu!
hrm. anyone running bea weblogic on an apt-based distro like ubuntu?
~anyone
Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
¡pr3d4tor!
~mohadib–
mohadib has a karma level of 89, eidolon
what god forsaken encoding are you using?
spanish encoding
~mohadib++
mohadib has a karma level of 90, aditsu
\o/
~aditsu–
aditsu has a karma level of 15, eidolon
haha
~mohadib–
mohadib has a karma level of 89, eidolon
aditsu++
aditsu has a karma level of 16, mohadib
neener.
~javabot–
javabot has a karma level of 99, eidolon
karma fight? that’s lame
~hump eidolon about the leg area
/msg javabot eidolon–
er..
HAH
one time I — ricky_clarkson
he had a meltdown
heh
much lulz where had
where’s he gone, anyway? haven’t seen him in ages.
aye , he went back to VB
it breaks on my screen
he was in here yesterday, i think
~lastseen ricky_clarkson
I guess the factoid ‘ricky_clarkson.clone()’ might be appropriate:
eidolon, ricky_clarkson.clone() is MickMcMack
HAH
oh, I don’t know.. I suppose it’s sent out as UTF-8
!seen ricky_clarkson
2 GMT, saying ‘Things like emacsen and lisps work quite well without global
meh
this is what i see: http://eugeneciurana.com/pastebin/pastebin.php?show=3624
that’s probably UTF-8 interpreted as ISO-8859-1, or something like that
heh it’s weird
looked fine here
irssi?
yep
¡pr3d4tor!
lol , guess that still wont look right for you..
¬_¬
ipr3d4t0r!
same.
anyways
googling for information on the jni seems to give me info from 2003 at best
~tell r0bby about fail
r0bby, http://img378.imageshack.us/img378/4934/failtx2.jpg
r0bby, a href=”http://img378.imageshack.us/img378/4934/failtx2.jpg”http://img378.imageshack.us/img378/4934/failtx2.jpg/a
anyone worked with it in java 1.5 or 6 ?
oh sure, see, you don’t give avegas the ~anyone line.
!seen whats_in_a_name
5 GMT, saying ‘oh hi pr3d4t0r. i just got back from masterbating. yeah what am i apologizing for? i may, but i need to know what im guilty
~tell avegas about anyone
avegas, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
bavegas, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will./b
he is frequenting #c# (I think that’s the channel name)
we like you more, it’s an honor
##csharp
uhh. thanks. i think.
thanks
whaley, I’m just curious about horror stories / absence of horror stories
why i lurk there i have no idea
poser
:s
i have a friend there who works for ms
but i mostly speak to him on another irc network
i have no horror stories to tell
!seen cybereal
3 GMT, saying ‘not the reality of the languages but the idea of using MS Paint as an
~flog pr3d4t0r
I guess the factoid ‘bomb pr3d4t0r’ might be appropriate:
meh..
What’s up?
How was the drive back?
nothing much
am i being too noisy?
lol
I dunno. I just got here.
run pr3d4t0r is opped!
o
nvm
you can assume yes and be right 99% of the time
i assumed that because you opped, i was too loud
RBBY
oh, you can?
?
that fuckin guy
Hey aditsu, call pr3d4t0r a bitch.
see what happens.
show me
heh
nah
aditsu you broke pr3d4t0r’s window i think
What did you paste here? It totally fucked up my screen.
all I saw were question marks.
hm.. then I wonder if anybody could actually read it
it was “r0bby probably can’t read this”, but in a weird font
~fanook++
fanook has a karma level of 30, aditsu
mirc v6.21
Same on a mac
it’s not a different font, just a different set of unicode chars
gj
Nothing bad happened here, pft
Mayber pr3d4t0r’s irc client sucks.
specifically, characters 0xFF00 to 0xFF5F
are they goofy surrogate pairs or some shit?
*sigh*
I need to be coding but I’m just not up to it tonight.
they’re “Halfwidth and Fullwidth Forms” apparently
*yawn*
~coffee svm_invictvs
now stop complaining
SO I was so bored today, I wrote a program taht views an exception and its root causes in a Jtree.
actually…
it’s supposed to read a shit load of exceptions from a file that ahve been serialized.
lol
Hrm, is there some reason why I can test whether a string variable starts with a string, but not whether it’s equal to it using “==”?
because you’ve misunderstood what == does
A == B asks “are A and B the same object”
you want A.equals(B), which askes “Do A and B have the same content”
ah, thanks
I’m used to doing js stuff, so that change confused me a bit
dev-: you said “starts with”
~tell dev- about javadoc String.startsWith(*)
dev-, please see java.lang.String.startsWith(java.lang.String): http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String)
dev-, please see java.lang.String.startsWith(java.lang.String, int): http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String,%20int)
dev-, please see java.lang.String.startsWith(java.lang.String, int): a href=”http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String,%20int”http://java.sun.com/javase/6/docs/api/java/lang/String.html#startsWith(java.lang.String,%20int/a)
me too
groovy does
pnuts does too, in a way
what’s up with sohail?
idiotic troll
!seen sohail
0 GMT, saying ‘you should check the javascript
javabot tell aditsu about logs
aditsu, channel logs is http://servlet.uwyn.com/drone/log/bevinbot/%23java
search his nick
Hi
I can only find what people told him
Any Resin experts on?
aditsu:hold
anyway, I found something
you’re slipping, shouldn’t you have done “~tell qopit about anyone” yet?
you’re too late, now i’ve lost a bet
huh? That one is lost on me…
I haven’t been paying attention.
fine i’ll do it!
~tell qopit about anyone
qopit, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
thx… I have to confess (and scare people off) that this is my first time using IRC…
ok just dont paste code snippits and you’ll generally be ok
thx…
read javachannel.net
Ok… I will
it has an FAQ, as well as tutorials that will answer _MOST_ questions.
this channel, though, is especially anal, they dont like aol-ish abbreviations (like “thx”)
heed all of the bullet points on the front page of javachannel.net
Anal is good.
er… ok. Never heard that called AOL’ish before, but I’ll abide…
what, you mean javascript is NOT a superset of java? :O /jk
some chicks are way too into it and eventually you miss plain old vanilla sex
wiki
or is that not what you menat?
s/menat/meant/
vinse++
vinse has a karma level of 37, pr3d4t0r
dude..
I said /jk
I know
it’s not a subset, it’s *inerpreted* java
duh everyone knows that
s/iner/inter/
i f’ed up my joke
don’t meet sohail’s fate
~tell r0bby test
tell nick about factoid – you missed out the ‘about’, qopit
oop
what?
don’t do that unless you need to.
god so many rules
it’s almost like people enjoyed telling otehr people what to do
he’s just learning
but of course i’m sure it’s not
I know..
hi
pr3d4t0r, http://www.officer.com/online/article.jsp?siteSection=1&id=37374
it’s “~tell nick about factoid” w/o quotes; you’ll learn the factoids as you become more of a regular
you cannot issue a ~tell command more than once within a 10 second period.
if you’re enough of a borderline sociopath to become a regular, that is
(if cheeser push that?)
s/push/pushed/
And I care about it because….?
Anyway. Good night
pr3d4t0r, pull your head from your loins.. thought it was interesting…
you’ve become a model citizen
~tell javabot about ok… thanks. Assuming this worked…
javabot, I guess the factoid ‘this()’ might be appropriate:
javabot, this() is http://java.sun.com/docs/books/jls/third_edition/html/classes.html#78435
~tell qopit about message the bot
qopit, You can send me private messages, these annoy other users less. Note that in private messages, you don’t need the “~”.
that is how you do it. (consider doing it this way while you play with it)
(or maybe setting up your own; instructions to do so are on the javabot FAQ)
tell javabot about ok – thanks… that syntax seem very long, though. Apologies for the annoying new guy thing… shouldn’t last more than a few minutes more, I hope
in case you haven’t figured out yet, javabot is a bot, that is, a computer program; it doesn’t really understand what you say
1) javabot is not a human, it’s written in java. 2) stop doing that, use it when you need it, it floods the channel and annoys the crap out of people
~tell qopit about source
qopit, For a complete tutorial on how to get javabot up and running see http://javachannel.net/wiki/pmwiki.php/FAQ/RunningJavabot
go look at that if you don’t believe me.
tell aditsu about Thanks – I had figured that was the case… just trying to get the private message syntax worked out (tilde or not, slash or not, “tell about” or not). Sorry all if this is flooding the channel. I can find a better one to spam and figure this out.
stop.
when you talk to people, just use their nick (not “tell … about”), like I am doing now
tell doesn’t make javabot talk, it redirects factoid output to a specific user.
for private messages, try this: /msg javabot hi
with the colon like this? (at the risk of another annoying secure webmail web hosting line…)
then javabot will open a private conversation with you
you _CAN_ make javabot talk, but i’m not going to tell you, because you’d never stop using it
hahahah
seriously that’s hilarious, you have the poor guy totally confused
yeah, for example; your irc client should help you with nick completion
you see how i’m addressing you, this is how you do it.
also, it’s not polite to send private messages to people without asking them first
except javabot; that is the one exception.
because it’s not a person
giggle? i’m in tears
sorry
“tell aditsu about Thanks” is one of my favorite things ever said in here
if it didnt require context i would suggest putting it in the topic
guys, please, enough with the pm
i apologize
I love being the new guy at something again… the peanut gallery responses are always entertaining! I’m glad I’m providing entertainment at least…
it may help to google about irc basics and etiquette
i just cant believe something so simple somehow got so confusing
I generally don’t mind PMs if you’re an established regular
it wasn’t just you
i do though, you have to call my agent for an appointment
and he needs to clear it with my attorney
i didn’t mean to bother you, it was more for my own amusement; anyways; back to java!
also, cheeser is really strict about staying on topic; so make sure everything you say has to do with the java programming language and/or java-related technologies.
anyways, i’ve given all the tips i can, good luck
thanks…
I’ll just assume that application server questions are on topic, although not strictly a java language question… I expect to get lambasted if not, but what the hey, it isn’t blacklisted on javachannel.net
I wonder
they are.
they’re Java EE
~guffaw r0bby
svm_invictvs, I have no idea what guffaw r0bby is.
what the…
I wanted to javabot to let out a huge guffaw at you.
I’m trying to get Resin set up so that a base IP address will load up a specific webapp without needing to reference it… eg: http://192.168.1.1 should load up http://192.168.1.1/foo without the foo reference.
Does anyone know how to do this? I’ve tried putting the app in webapps/ROOT, but I end up getting a directory listing instead
uDoes anyone know how to do this? I’ve tried putting the app in webapps/ROOT, but I end up getting a directory listing instead/u
bah
what’s wrong?
I’m trying to explain to my friend why her boyfriend is a douchebag, but I’m failing at it.
Maybe I should have stuck with Tomcat… I’ll keep muscling away at Resin.
maybe he’s only a douchebag to me.
although there is a high level of douche taht resonates from him.
maybe she
s so in love with him, she’s blind to it
I think it should be configured in a similar way on diff. app. servers, but I don’t really know how
meh
but this isn’t java.
knows I’m trying to sleep with her.
So he’s a douchebag to me whnever I talk to him.
And I just wanna punch him.
it’s likely only to you.
ok – thanks. Maybe I’ll just use web forward at my DNS to avoid the application server config problem all together, but I’d prefer not to.
no, a mutual friend of hers thinks the same thing.
and thanks for the help… time to go for me. If anything, tonight has been entertaining for getting to be the new guy. Good night.
ok, good night to you
hey guys
anyone run into problems with Vista’s UAC yet?
lots of poeple, from what I can read on the ‘net
My program allows users to load a file from the desktop and the file is copied into the program folder. The only way it works on vista is to right click the program and run as administrator
UAC is blocking it, but I don’t know how to prevent this
you may have to read up on uac and vista specifics. it is really important that developers do. how is that program called? what is its manifest set to as far as privileges goes?
does the file have a shield icon?
WTF is UAC?
Clackwell, no
user account control, http://en.wikipedia.org/wiki/User_Account_Control
although either does netbeans or any other icon on my desktop!
lol, even avg doesn’t
Clackwell, I’ve been looking for a place to read up on this related to java. I only find questions on sun’s forum, no answers
Have any ideas?
UAC is http://ars.userfriendly.org/cartoons/?id=20070629 and http://ars.userfriendly.org/cartoons/?id=20070804
lol
what is happening when you run that file? what happens if the file is copied to the computer by some other way?
heh
~UAC is http://ars.userfriendly.org/cartoons/?id=20070629 and http://ars.userfriendly.org/cartoons/?id=20070804
Okay, aditsu.
that guy is talking about running as an admin, which still isn’t the recommended way to use any operating system, not even vista. cheap laughs, bah
you get the “usual” sudo-style login popup for anything an admin must do, once everyone has adjusted to how things need to be done these days.
Clackwell, ok I get the file using JFileChooser, then rename it (basically moving it to the program files\my program folder
success = licenseFileName.renameTo(new File(“Data”, “CompanyInfo.enc”));
no cluew what you mean. what i said before was about executables.
The program runs fine. The only program is when I try to move a file. I can even load files fine. But if I have the program take a file from the desktop and move it to the program files folder nothing happens, no error thrown either.
I can copy the file using cut and paste just fine
me has no clue what goo1 is trying to do, he assumed that copying a *.exe file to some folder and trying to run it was the operation being attempted.
No, not copying an exe. I’m copying an encrypted xml file from within the program
I doubt the file type matters though
you are copying a file and that “does not work”?
brb
Exactly
more information than just “does not work”?
what is the absolute path on the computer in question? cprogram files\….?
cprogram files\home inspector pro\data\
There is no more info. The file never gets copied, no error is thrown
success in the line I pasted returns true
success = licenseFileName.renameTo(new File(“Data”, “CompanyInfo.enc”));
The file already exists in the folder
In xp , mac, 98, etc it overwrites the existing file
maybe that’s the problem that it doesn’t have permission to overwrite
When I right click on the program and run as administrator it runs fine
if you were a QA engineer and you were responsible for improving the code quality of your project, what kind of things would you implement
write a test program. keep in mind that the program files folder (among others) is NOT writable for the common user. and per-user software that writes into its own directory must not be installed there.
to ensure that?
instead, as on unix, such software should be installed into the home directory of the user.
we are wondering about that too. so far we have come up with coding guides, mostly taken from the nasa coding style guide. and we plan full unit testing as well as applying stuff like lint and co.
Clackwell, it’s not meant to be per user software. It’s meant to be common to all users and works that way in all previous windows version. I didn’t realize that it’s not supposed to be writable. The program can write to it fine when I’m saving using JFileChooser
I am the project leader and I am trying to enforce good quality code. We have good formatting guides and coding style guides
sleepster:we will probably go to the length of specifying a blacklist of programming constructs which must not be used under any circumstances and hopefully some (custom?) tool can check for those to enforce that.
Are there any good tools you are using Clackwell?
how do you use Lint to improve code quality?
(the project is about c, c++, however)
have you use statsvn?
it shows you a huge amounts of information
sounds wrong that the program can write to the program files location when not running with admin rights (which is not the same as running it as an admin, per se)
about which developer checked in the code for which packages etc.
the amount of code they checked in. the frequency of checkins.
we have only come to gathering those ideas, haven’t looked at any tools in particular yet. we are fumbling about the build system at the moment (scons, python based).
we are using svn
statsvn is a pretty nice tool
I am trying to think of good means to utilizing this tool though
we aren’t so much interesting in the numbers you mentioned there.
interested, rather
yo fellows
is there any way to include the classes of another jar file in my own jar file
e.g. some apache commons library
if using an admin account, make sure that when running the program after login as amdin you do not get asked wether you really want to do that in that UAC prompt, because the program gets full admin rights when you agree. and then it can write to program files for sure.
this is probably a horrible way to package software, but i just want a nice package
horrible and nice?
can’t unpack them to package them all into a single jar?
jar cf MyJar.jar -C bin . -C c…\apache-commons-logging-1.1 apache-commons-logging-1.1.jar — doesn’t work
Clackwell, it works fine when running as admin.
there is a way with a (custom) classloader, getting the jars as resources (getResourceAsBytes or whatever), but…
you are trying to put jar files into a jar file just because you can’t manage to unpack and repack the existing jar files?
unpacking the jar files to where your own files lie around. jar the whole thing up, done.
clackwell, why should i unpack the existing jars? @_@ too much trouble
then you will have to have to write code to go the classloader route. good luck.
clackwell, ok ok, i’ll just copy all apache jars to MyApp\lib and add them to classpath
signed or sealed jars can be a reason to want to have jars in jars.
also consider wether your own perception of having a single jar file with everything in it is really relevant to your target group. often it isn’t, but the prorammer insists on his own personal feelings about the issue.
i didn’t suggest to ship the jar files separately. misunderstanding?
if you have 2 zip files you can unzip them and throw the zip files away. then you can zip the files you got again. that’s what i meant initially.
that way you still have a single jar file.
see you later
sounds like fatjar
~fatjar
Sou|cutter, fatjar is a jar file compiled from several other jars, see http://fjep.sourceforge.net/
ah thanks
this fatty jar seems nice
^.^
just remember, it’s not over ’till the fat jar is signed :p
*giggle*
hi
which java technologies are suitable for clien/server apps?
none.
krustofski, i’m not joking please!!!
~vague questions
I guess the factoid ’smart questions’ might be appropriate:
krustofski, smart questions is what you need to ask to understand a smart answer. See http://www.catb.org/~esr/faqs/smart-questions.html
hi
so?
any help?
which java technologies are suitable for clien/server apps?
you would probably need some kind of communication library
aditsu, yes,
aditsu, could you tell me some libraries that i can use?
for database access, i need jdbc
for sockets there’s e.g. mina, or you could use jms, or other stuff
but for establishing communications between tiers; i’m really confused
aditsu, the problem is that i’m not pro with java. so if my questions are stupd; just be patient
aditsu, do you jboss?
do you know jboss?
no, I only use jboss-cache
many people hate jboss for some reason
microtux, just do java servlet tutorial and play with tomcat
that’s my best advice if you are starting with java client/server
aditsu, so, what’s the best framework for the middleware layer?
aditsu, jsp??
your questions are too vague microtux
first of all, does it have to be on the web?
it seems you don’t have a clue of what you are talking about
andresgr, not exactly
i.e. http & html?
aditsu, i want to create an application client/server+database
for the database i’ll use jdbc
that doesn’t need to have any web stuff, from your description
for the server i’m confused. I don’t know whether it’s better to make a web based app or not?
do you know what you would pick for the task in some other language?
hello… I’m trying to compile a java app that uses javax.swing.GroupLayout but it says it can’t find the symbol ‘GroupLayout’ (using javac). But I created this project in netbeans and netbeans compiles it fine. Why would that be, does anyone know?
there will be many tasks that i have to put in the server(middleware)
so i want to know if ot’s better to have a web based app?
misc–: sounds like you are using some netbeans layout stuff
or should i create a GUI for clients and connect them to the server for computation tasks and for storage
yep correct… is that going to cause problems when I compile with javac?
tazle, aditsu andresgr any advise?
misc–: netbeans compiles with javac.. its just that it adds the special layout classes in the compilation.
ohh, right ok. So I should probably compile by using the same manifest or something?
microtux, yes, spend some days reading a good book about java ee.
it depends what the clients need to do
if it’s simple stuff that can be done with web pages, then go ahead and make a web app
misc–: well, the classes are in a certain .jar file, which is probably hiding in one of your netbeans projects directories.. you just need to learn how to include that when you compile.
then communication will be http, and the clients will be browsers
aditsu, sending/retrieving data from server, displaying results. computation tasks will be in the server
ok thanks. I can’t see any other jars but I will look into it
aditsu, it’s a good idea building a web based app
misc–: or you could just stop using the netbeans specific layouts.
aditsu, and the server? ihave to use JSP then ?
if the communication style is request-response, and the UI can be done in html, then ok
jsp sucks
you don’t *have* to use anything – you could implement a web server on plain old java sockets
I like those layouts though
I recommend the wicket framework
btw java works now that i reinstalled and uninstalled __ALL__ copies
(reverse order)
i had 3 versions installed
so i took em all off and reinstalled the latest i had already had
now applets and java binaries both work 100%
however the loading bar still doesnt work right on a specific applet
oh well,.
actually in the properties of the project, it’s including the swing layout extensions
nothing in it works 100% .. ever
also the msg when it is done loading doesnt appear
misc–: its just a code generation thing. You can get the gui builder to generate “standard java 6 code” or “netbeans layout extension code”.
i still have to test the sound loop glich for when the applet does not stop the audio manually
aditsu, thank you, but do you know other frameworks suitable for such apps?
thank you cya
misc–: it doesnt really change how the builder works, just what it outputs..
ohhh right ok. I’ll check how to do that then
~web frameworks
Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.
^
the only problem is… there are too many :p
mmm, Grails should be added to the previous definition
web frameworks is Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short introductions to
each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.
I already have a factoid with that name, andresgr
heh, http://docs.codehaus.org/display/TRAILS/2007/06/03/On+Grails,+Trails+and+Sails
aditsu, just some of theme, not all
too many “ails” :p
javabot, forget web frameworks
I guess the factoid ‘web services tutorial’ might be appropriate:
andresgr, web services tutorial is http://java.sun.com/webservices/docs/1.0/tutorial/doc/JavaWSTutorialTOC.html
you can do “~no, web frameworks is sayNowadays …”
~no, web frameworks is Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.
Okay, andresgr.
aditsu, thanks
you left out the say
~web frameworks
andresgr, web frameworks is Nowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.
he, ok. Last try.
just one other question… once I have found this .jar file, how do I get it to use this jar file? Can I import somehow or do I need to specify it on the command line with javac?
~no, web frameworks is sayNowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.
Okay, andresgr.
~web frameworks
andresgr, web frameworks is sayNowadays the popular choices are JSF, Struts, Webwork, Tapestry, Stripes, Wicket, Spring MVC, Grails and RIFE. See http://www.virtuas.com/articles/webframework-sweetspots.html for short
introductions to each. Also see http://java-source.net/open-source/web-frameworks for an exhaustive list.
damn it!
wow cant you do that in pms?
i could, but i need aditsu to tell me what i0m doing wrong
~tell misc– about classpath
misc–, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM
hm, that’s odd
thanks vinse
oh, sorry, I think it should be reply, try in pm
can I create a dynamic array that doesnt have a top bound ?
aditsu, no luck
reply, not replay
ArrayList?
or a MapInteger, Something
aditsu, victory! thanks
yay
I am trying to replicate the string .split() function which returns a string array
an ArrayList should be ok for something like that
I’m not sure why you want to replicate split though
I need to return a string array though. I am porting classes to J2ME which does not have split
use toArray
Also. J2ME does not have ArrayList
then use whatever List it has.. Vector or whatever
Only Vector – I am not sure of the performance issues I might get using it though
or make your own ArrayList
no .toArray in vector either.
sigh
hmm I did do java -cp swing-layout-1.0.jar Test.java but it still can’t seem to find the GroupLayout (which is in the swing-layout jar)
oh well
well, you can do what ArrayList does
use an array, and when it fills up, allocate a bigger one (multiply the size by something) and copy it, discard the old one
aditsu, the usage of hibernateor JDO, allows data recovery, or journal creation?
data recovery, journal creation?! aren’t those some internal database features?
aditsu, yes
then it’s not related to the library you’re using
aditsu, so what’s the role of hibernate then?
~orm
andresgr, orm is Object Relational Mapping
~hibernate
andresgr, hibernate is a nice ORM [see orm] tool and can be found at http://www.hibernate.org/ and #hibernate
aditsu, isn’t the data recovery?
no, it’s for mapping objects to database records, managing connections, and caching
aditsu, ok. and who is better? hibernate or JDO?
toplink
I don’t like hibernate personally, it’s too abstracted; I don’t know anything about jdo
I use ibatis, but it’s your choice
aditsu, i see
jdo is really fine, but it has been discontinued, so hibernate would be the best choice for the future, or also ejb 3.0, think about it
microtux:see
hi. what’s the usual way to monitor files on a file system?
b0r3d, uh?
through java i mean.. i want to monitor a file’s date changes and trigger actions accordingly
chnarr, thank you
….good question
I don’t think there’s good support for that in the file options currently available unfortunately.
(I’ve not done anything like that myself, but it’s come up before)
check date of last modify the file every x seconds in a thread…
I seem to recall the options as being either a) repeated polling (yuck) or b) Interfacing with the OS capabilities through JNI (also yuck)
b0r3d, you could try Mule
http://mule.codehaus.org/display/MULE/File+Provider
but i think it only checks for “new files”
I don’t want to try a third party library.
smack andresgr
The easiest thing to do is just poll repeatedly in a thread as per chnarr’s suggestion. It’s ugly as hell though.
yes I agree, it was just first Idea, but using a nice thirdparty would be probably better
Sure. I’m not saying it was a bad idea. There isn’t a non-ugly approach I know of.
~chnarr++
chnarr has a karma level of 1, andresgr
And using a nice third party library would indeed be the right approach.
unless you like new wheels…
Using a FULL FLEDGED ESB doesn’t count.
ehem
“Damn, that fly is really annoying. I think I’ll NUKE IT!”
Mule is very lightweight sir…
perfectly usable as a library, embbeded etc.
Uh huh
My question is how does actual application servers scan application directory changes to hot deploy apps ??
for example Jboss…who knows
It’s almost certainly a variant of the thread which polls, probably using some sort of timer service rather than a dedicated thread.
mmmhmm
you can use quartz also
JBoss is certainly not to be used as an example of code which isn’t ugly as hell though.
uJBoss is certainly not to be used as an example of code which isn’t ugly as hell though. /u
uuJBoss is certainly not to be used as an example of code which isn’t ugly as hell though. /u/u
I’m glad I don’t have to do it again.
hah
quartz falls under “some sort of timer service” doesn’t it?
so take weblogic as another example
This can very easily be resolved by looking at the source yourself you know.
Or to you point of view what would be the nice coded J2EE app server ?
uOr to you point of view what would be the nice coded J2EE app server ?/u
Permalink Comments off
yawn
Permalink Comments off
yawn
Permalink Comments off
i’m just gonna flush it for now
select * from mysql.user
… as root
is there a way to insert \t in the mysql so that when you display, it will show in a nicer way?
ahhh…it all works now
much thanks
haha
ah yeah… don’t worry.. it’s of type TEXT and it will never exceed..
Heya, what cache I should adjust if I want give more ram to b-tree’s?
or is it even possible?
I guess it’s that key_buffer_size
I’m trying to select rows that have a NULL value for a col
I use WHERE `col` = NULL but … it doesn’t select them.
ideas?
`col` is NULL ?
is..
I didn’t know I gotta use this
is this operator?
or you’re asking ?
all right I figure out now
IS NULL / IS NOT NULL, operators
hi, sorry to bother what looks like a dev channel, is there a channel for getting general newbie type help?
well try here
I just asked a noob question and people answered
nice
well, I am having a tricky time duplicating a db with latin1 chars.
I dump to a sql file with default char set = latin1 which makes the sql file look good – though the sql file appears to be encoded in utf8
when I try to import that sql into a new db I can’t get the encoding on the chars right
I’ve tried specifiying no char set, latin1 and utf8 — in all cases the special chars in the new db are goofy
would be most greatful if someone could point out what I don’t get. thanks!
backupname.sql on my local machine it exports my db
but its only a 9.7 gb sql host file
when my db iis over 18 gigs
is this okay?
hey all
anyone know a tool i can use other then mysql query browser or PHPmyAdmin
mysql client
anyone? -_-
tibyke, where can i get it from?
its in your mysql distribution
tibyke, arghh.. i’m trying to make it easier… don’t wanna use the dos looking like one…
there used to be a tool called mysqlgui
mysqldump…. brought my 17 gb database it a 9 gig sql file… is this ok before i start working on it?
dmb062082, maybe you dont have complete inserts enabled
question – enabling mysql logging (yes, i know it’s a killer, we’re trying to debug something) – requires a mysql reload or restart?
eidolon, right
how would i know this?
tibyke, that was an ‘or’ question which one?
eidolon, restart
ah, thank you.
dmb062082, mysqldump –help, by default its disabled
i must have complete inserts installed as I used them with phpmyadmin the other day
so you will have insert into whatever values (1,2), (3,4), (5,6), instead of insert info whatever (a,b,c,d) values (1,2,3,4), then again…. values (5,6,6,7,4);
dmb062082, “complete inserts” is a mysqldump boolean option, man mysqldump
so the command i used didnt provoke extended inserts?
backupname.sql
it didnt
mysqldump –help | grep -i insert
do i need to provoke that command?
-c -e are complete and extended insert
so where would i add those into my command?
backupname.sql
after –opt ?
eg.
tibyke do I need extended inserts installed?
when I import my database to another server will it all be there and correct?
complete and or extended
it will be fine with the default options
ok super duper
thanks man
un-related
how long do you think it will take to add a 9.7 gig file to a zip or gz archive
gig of ram average processor
linux of cource
it will take a while, and will take some resources for sure
gzip it with low priority
ok
say bye bye xchat
later man thanks
sure thing
hi, i have a php mysql script it makes kind of large procces with about 20 queires, it took 4 minutes in a pentium II 400 with 400 mb RAM and 30 seg in a pIV, now i have not optimized the mysql instalation in any way, i red in some place that putting indexes in memory can bring dramatic
impruments, howto do it or any other advice???
more info thanks
exactly what does the script do?
henke a lot of updates mainly
care to show?
lets say from a 500.000 records i select about 100.000 and group sum, count etc then with that i update some other table
yes, i care about this slow
mind slow != show
noooo
i read bad
with this kind of data sizes, you should definitly use indexes
yes i use them but only as defaults no optimization
create index hhhh on table (field1, field2); and no more
but did you pick the right fields..
yes im sure i did
you could always run EXPLAIN
more, i changed a lot of times
EXPLAIN YOURSELECT
i never runned explain that true
johnny that is ok
try to optimize via explain
another question, does matter if a put all this in stored procedures or it will be the same in execution time?
a stored procedure is precompiled
but you won’t exactly get any hudge gains
so, is there any posibility on different indexes creation options?
i mean to get huge gains
the large tables have bulk insert once a month
indexes only help on selects
they actualy slow updates down
ok, i see
so, i need to drop some i dont strictly need
it would be usefull if i expain my case better?
yes
it can’t hurt
ok, how can i do that? i mean where?
may i write and paste?
look up this thing called a pastebin
how do i remove row “5″ from an array?
arrays doesn’t exist in mysql, does they?
doh sorry wrong channel
im working in the docs
may i ask another question
don’t ask to ask
lets say i have ssh access to my web server and have my sql file on my local server
is it possible php mysql web hosting -u dbusername -p databasename /path/to/my/local/webserver/for/sqlfile.sql
if your db has remote access enabled then that would work locally
otherwise you could scp it up and then do that
scp
or you could use something like phpmyadmin, but it has been recommended against using it in this channel previously
altho i never had a problem
db is way to big or phpmyadmin
then you should use scp or similiar
anyway you could do a bit of spoon feeding
there’s something called google
that will do such a thing for you
you’ll find the command very useful, so you should go read more anyways
yes i was looking but i still dont understand how secure transfer will work with telnet
you never said anyting about telnet
you said you had ssh access
oh telnet or ssh
yes i have both
using ssh
why?
telnet is insecure
it should never be exposed publically
ok
not just never.. but NEVER
scp comes with the ssh package
there is one thing that won’t show up right away tho…
from what i see scp is just a secure way to transfer my file from my local server hosting to my webhost server
yes
sorry maybe im lost but what does that have to do with uploading during the import process
read what i wrote
or importing via mysql during the upload process rather
if your db isn’t set to allow remote access, that’s what you have to do
ok
i know mine isn’t
upload then import
yeah thats what i planned on doing
or you could ssh into the server
compressing the file ftping it to my server and then using ssh to import it to the db
and then do something like mysql scp yourlocalhost:/path
don’t bother with ftp
thats easy
just scp it up
i don’t allow ftp access either
it is not as insecure as telnet, but still..
or maybe it is just as insecure..
i’m not security guru.. but i won’t run anything like that
i even make my father use winscp for his web sites
mysql scp yourlocalhost:/path eh?
something like that
i’ve never done it
but it should work
ok
ty
hmm.. actually..
prolly better to use ssh with -c
mysql `ssh -c cat /path/to/sql`
I need to pipe some sql host into mysql from the shell, in a stream. How do I do this? For example: mysql dbFoo `cat /tmp/out.sql | perl -pi -e ’s,mq_en_,,g’`
band that doesn’t work ?
and*
looks ok to me
http://rafb.net/p/RmABOq29.html
dmb062082, forgot that would only work if your local box is a *nix box..
udmb062082, forgot that would only work if your local box is a *nix box.. /u
yes it is nix
Anyone know how I can do this? I need to create 54 separate instances of 36 tables each.. (1,994 tables), and I need to be able to import the SQL from a stream, not from a physical file.
setuid, what you wrote should work ?
-bash: `cat /tmp/out.sql | perl -pi -e ’s,mq_en_,,g’`: ambiguous redirect
bash doesn’t like it
you don’t have to cat to perl
you could add the file at the end
but anyways.. this is out of the scope of the channel
this is scripting now
# mysql dbFoo `perl -p -e ’s,mq_en_,,g’ /tmp/out.sql`
-bash: `perl -p -e ’s,mq_en_,,g’ /tmp/out.sql`: ambiguous redirect
not at all related to mysql
Sure, I’ll ask in bash then
setuid, somebody smarter than I might answer you here at some point tho
i’ve seen people get helped with 3rd party apps here sadly enough
at least your question is far more in scope than theirs
I’m open to other ideas that don’t require me to have 54 separate copies of an identical SQL file, except for a few table prefix changes.
well you haven’t provided enough info about your usecase to get any answer on that yet
I have a huge SQL export file, which contains the CREATE statements for 36 separate tables.
I need to reuse this SQL file 54 times, by replacing the standard table names with my_prefix_tablename
your way seems fine to me
altho you could use sed instead of perl
altho you should prolly wrap it in a for loop
That comes later
with a list of your prefixes
I’m just profiling the redirect at this point
or you could just make a giant sql file first
with all of the tables and their prefixes
and then import that
no redirect problem then
I got it… needed a pipe, and to move things to the other side
perl on the LHS
aha
perl -p -e ’s,mq_en_,,g’ /tmp/out.sql | mysql mediawiki
dmb062082, that’s how you’d do it
7 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t
7 mysqld
phree, Did you create the default mysql database?
howdy
heh
how do i do that, sorry i am new to this. I am just trying to start the demon
Hi. I have a ‘posts’ table, with several small fields, and one large dynamic field – content. I do a lot of searches on that table, and it’s important to me that searches on it will be fast.
phree, mysql_install_db
but that is in the manula
manual*
Should I separate the content field to a different table?
i think ill be all set
xif, first add the appropriate indexes, then profile
as long as the sql hosting file that i backed up is propper
ill just sftp it
extract and then import
sftp is near scp
so either way.. fine
woohoo, boy did i come to the right pace… thanks guys worked a treat
while dumping the 17 gig db on my local server… it went down to a 9.7 gig sql file
I did, things are generally OK, but `SELECT COUNT(*) FROM posts` is still very slow.
thats what scared me
but i guess its going to be ok right?
is there any straightforward way to make SELECT COUNT(*) fast?
xif, remove your field for testing
COUNT(*) is supposed to be optimized
that’s what the docs say anyways
did that as well search time improved dramatically.
what about count(field_name)
1.25 secs, without: 0.04 secs.
instead of COUNT(*)
count(id) == count(*)
then.. i guess you should move it
1.25.
i’m no guru
johnny thanks dude
I’m wondering, because I may not need need to do COUNTs
i can only assist with problems i’ve personally ran into
or heard others
if the problem is only with COUNT, maybe I should find a solution specifically for that, like keeping a count cache.
xif, i personally try not to do that
since it is redundant, but sometimes it is necessary
separating the table into two separate tables seems too much of a trouble just for keeping COUNT
depends on how your application grows i guess
howdy, is having a table with a column of varchar(1024) going to be significantly less efficient than say varchar(16)?
varchar(1024) works?
hm, maybe not :]
the posts table is certainly going to grow. to several times its current size at least.
i think i stick to varchar 255 at most
xif, i meant field wise
not data wise
in that respect, it’s not going to change much.
well you’re not going to get a good recommendation without posting your current schema to a pastebin
well, looks like i might be using text heh
and yes.. it will be less efficient than varchar..
and even less efficient than CHAR
fixed size fields are the most efficient
but obviously will make your db bigger
the problem with keeping count stored , is that you have to remember to update it
if you’re gonna do that, you should at least try to use transactions
then it will at least be mostly reliable
or you could use some sort of trigger
or stored procedure
the question is, if keeping the large text field `content` separate is the Right Thing (c), rdbms-lore wise
i do’t really use those myself, since i’m trying to stay db agnostic
bi do’t really use those myself, since i’m trying to stay db agnostic /b
hmm… have you read over any of the normalization guides?
I’m not sure it’s related to normalization…
sure it is
how?
anything db related should be gone over from a normalization standpoint
before doing anything else
i have heard that all fixed sized fields should go first
but i don’t know much data needs to be stored for that kinda optimization become apparent in
Got a tricky question for you guys, if anyone’s game ? I keep getting nailed by the inability to select from the same table I’m deleting from …
generally, at least in MySQL 4 and MyISAM, it was much better to keep static and dynamic fields separate.
yes
i don’t think that has changed
but you could try putting the dynamics at the end
the advice I read for MySQL 4 would definitely point towards moving that column to its own table.
then i think you should
are you sure MySQL 5 / InnoDB is the same?
some guy I met here said it no longer mattered.
not 100%
well at this point.. you just have to test it out
that InnoDB treated dynamic/static differently than MyISAM, so searches would be equally fast.
somebody submitted a bug for my project pointing to the advice i mentioned earlier, about moving dynamic fields towards the end
so both ideas are worth a shot
I’m happy with the current benchmarks, except for the count(*) benchmark
shouldn’t take very long to make that happen
the question is, if the COUNT(*) problem is just one specific problem that needs to be addressed by some hack,
I’ve got a table with tuples a and b. I want to delete from this table all rows but the highest b for all a. EX: say I have the tuples (1 1) (1 2) (1 3) (2 1) and (2 2). After the delete, I’d have left only (1 3) and (2 2)
or whether it’s a mark of non-optimal database design and the first of many problems to come…
Can’t figure out how to do this without subselecting from the same table, which isn’t allowed
xif, sorry, but that is past my personal knowledge
wait around and ask it later
i’m no dba
thanks anyway, you’ve been much help in any case
where would you post such a question, except here?
You know when INSERTing into the DB and you use Question Marks, instead of the values themselves as a SQL injection prevention. Could someone link me to some official mysql documentation relating to this, i’m having trouble finding it in google.
the mysql forums ?
I’ll google it, thanks.
Drag, that requires some sort of db abstraction layer
its layer specific
you mean like in Rails, for example?
the mysql forums are very busy, you should be able to get an answer there
Drag
i only know it from a php web hosting standpoint.. i’m sure other implementations due something similiar internally
i got a huge gain dropping indexes! from 3 to 1
update issues
s/due/do/
yeah, Rails has it as well. it’s framework-specific.
not just framework specific, but language specifics
lol
its layer specific guys
like in perl, you use DBI almost ALWAYS
yeah just almost
whatever, no big discussion, the db driver must do it
johnny, Getty, xif sorry for not replying, not used to this IRC client.
so it’s not generic mySQL syntax ?
not that i know of
no, cause the driver must give the interface to that values
the questionmark just represent that values in the prepared query
can you suggest anything in PHP that would enable me to do ?
Any DB Layer in PHP can do it
Drag, creole,adodb.. maybe pdo..
i don’t know enough about pdo yet..
so just read the f…… documentation of your favorite one
brunchtime.. bbiab
i’ll go with pdo, thanks !
I need some help to see if this is possible to do in one queue. I have categories and articles. Simple so to retrieve the categories I do “SELECT a.* FROM articles WHERE a.catid=1″ I now have another table that I want to make it so it can show articles on other categories that != catid. So
something like “SELECT a.* FROM articles AS a, articlelink AS al WHERE a.catid=1 OR (al.catid=1 AND a.articleid=al.articleid)”
” can show articles on other categories that != catid” ?? Not sure what you mean by that
I’ve got a table with tuples a and b. I want to delete from this table all rows but the highest b for all a. EX: say I have the tuples (1 1) (1 2) (1 3) (2 1) and (2 2). After the delete, I’d have left only (1 3) and (2 2). Can’t fiure out how to do this without a subselect, which apparently
isn’t allowed =(
is there any command line help inside mysql prompt?
for command syntax?
You should upgrade . Try using a temporary table
Create a temporary table with the values I want to delete, delete where they’re the same then remove the temporary table ?
-u root -p database b.sql
if that ever gets halted for some reason…. like my pc shutting off on me…
do i have to clear my tables before re uploading
or will it pick off where it left off
or will it clear the tables and restart
What version? select version();
hello
how can i make a regular search expression inside a database ?
i ment regular expression search
WHERE field1 RLIKE field2
does that work with MyISAM ?
The same for any other regex related operator.
It’s not related to the engine, unless you’re using something too old to know about those operators.
thanks for the quick answers
would you recomend it as the best way to search a data base for some ( checked ) text a user inputs on a web site ?
kind of like a search engine
Full text indexing is probably better
I feel that it’s very likely that a RLIKE query would do a full table scan (use EXPLAIN to verify this)
got any links that would explain or give some examples on how to perform a full text indexing ?
Read the documentation; it has plenty of information
Hi, is there any nice library for using mysql from c++? I tried to use the last version of mysql++ but without any success (gcc was not able to compile even the included example programs ).
Can you not use the mysql client library directly?
How easy is the implementation of this library? Is there any tutorials on the net?
Read the mysql documentation
hii!
hey! Question
I have a line which inserts a row into a table
but the table has a auto incremental primary key
is there away I can return that key?
The documentation will answer the question that this is the most easiest way to access a mysql database from c+?
SELECT last_insert_id(); using the same connection.
Xgc, I love you!
The php API to MySQL (if you’re using that) has a built-in function for this.
hi, i am trying to run the following command – mysqladmin -u root password yourrootsqlpassword = = but get the follwoing error — error: ‘Access denied for user ‘root’@'localhost’ (using password: NO)’
any ideas?
Xgc, I see that, thanks
obviously i put my real password at the end
is there a sure fire way to do a clean mysql re-install?
phree, format the drive. That’ll be pretty sure fire method
That is not the right syntax for the command line of mysqladmin – see the docs.
laugh, i nearly grinned, cheers shadow. i have the rest of the system configured just right. The mysql bit is screwed up big style and i cannt straighten it out
The documentation describes the C api of mysql, which can be used from C++ as well.
Mark, I am following a howto and thats what is states. Also when i set up mysql dummy user it gave me the same synetax from the mysql prompt
ok, I will check it. thank you for your time.
Mark, just checked another howto and that gives the exact same command
You already have a root password.
you need a -p on the command line
a -p drops to a request for a password. I enter the same password and I get the following error: ‘Access denied for user ‘root’@'localhost’ (using password: YES)’
in which case you entered the wrong existing password
hi, i am having an issue with a piece of software that I wrote.
It runs as a daemon and tries to keep a connection open with mysql, but mysql always gives an error “Server went away”
does MySQL (5) have a special, fast function to SELECT COUNT(*)?
Unknown command: ‘root’
I’m doing such a SELECT on a table with 40k rows and it’s taking more than a full second to complete.
Hello
EXPLAIN
I’ve messed with a few config options and also tried mysql_options but I have not found a solution to the problem?
Any ideas?
I think I have probably screwed it up good style by now. is there a way to remove the whole thing and start again
For use the function time() in PHP, i must be select DATE, VARCHAR or INT in mysql ?
MyISAM maintains a count permanently, so if you count *all* rows, that is a very fast operation
It really depends what’s in your WHERE clause and your table
If you’ve got WHERE (some complicated expression) and lots of huge blobs, I’m not surprised
badbugs, I recomend the date datatype
thanks henke37
why would the blobs matter?
I’ve done SELECT COUNT(*) (see explain pastebinned above)
err, COUNT(id)
id is a primary_key, should have been very fast SELECT, why would any irrelevant blob fields in the table matter?
It should just be looking at the index.
yup, exactly.
If the blobs were used in a WHERE clause, it would need to consider them
But you hadn’t at that point said if you were using a WHERE caluse
they’re not, it’s as simple as possible.
depends
if it is innodb, data is clustered together with PKs
haha
it is innodb, what do you mean?
Is this happening each time you do this query on a production-spec, otherwise idle server?
basically, it’s almost certainly the large content (of type “text”) field
every time.
Or is it only on a massively busy production server that the problem appears?
Does it happen on an idle production-spec server?
make sure it follows a secondary index, not a PK
the problem as pasted above happens even when it’s the only query running on the server.
so “idle production-spec server”
use non-primary pk
ergh, key
What table type is it?
http://pastebin.com/m3c3aa014 – table Spec. which should I use?
InnoDB
hmm, I’m not sure whether innodb stores index cardinality like myisam
possibly not, in which case it will need to scan the index
But 1.0 sec sounds like a long time for 40k rows
“if it is innodb, data is clustered together with PKs”, interesting.
yeah, definitely.
select count(publish_on)
wow, much faster
innodb does guesses on cardinality
how the heck did you know it would help?
random dives
1 row in set (0.02 sec)
thats how I get paid
I know stuff like that
why is it like that?
mysql trivia master
I told you already
right
‘trivia guru’
)
he’s a mysterious guru
because data is kept together with PK
ah, so any key except the PK would be good?
that makes, like, absolutely no sense at all.
that is quite a dramatic difference
indeed
No, it does make sense
yeah, almost x1000 times.
I didn’t realise that innodb kept PK with rows
thats because the other key is much more compact than PK
most people treat their Primary Key as the most optimized, reliable key in their table.
scanning compact key is cheaper than scanning not compact key
in fact, I’m pretty sure that’s the explicit reason for establishing primary keys.
on the other hand, there’s not that much difference on random accesses
and clustering of data by primary key make range scans of data more efficient
but in this case, the COUNT was consistently much slower…
well, its long talk anyway
and its 2am here
hehe, domas, thanks a lot.
also because innodb has to lookup the primary key to check the trx id to see if that row can even be part of the transaction
if it is (most likely) then the row is already read to send back
you probably saved me like 2 hours with that arcane piece of knowledge.
of course, because it had to scan whole key
trx id is in all keys, not just PK
so, YOUR LIES ARE DIRTY!
haha
hahaha
I got today a can of
I tried to ask heiki about that a few years ago and never got a response
‘ROOT SARS’
“the whole key” being, in this case, the entire row?
(this is a bit over my head)
you should ask us, not Heikki
;-p
anyway, pretty fun to have ‘ROOT SARS’ in a can
in a country that checks people temperature at airports
they have these temperature scanners
all records in an index
(to count ‘em all)
but I thought all keys kept all references to all records?
those things creep me out
xif all keys keep a copy of the primary key
or does the PK replicate the entire recordset?! o.O
in innodb every key has PK values of records
OK, and how is the PK different from all those other keys? (sorry if I’m being retarded)
say, you have table (a,b,c,d), and pk is (a,b), and you have a key on (b,c)
then the key (b,c) will be actually (b,c),(a)
it is not that expensive to make it (b,c,a)
if you don’t need d;-)
why (b,c),(a)?
it replicates the PK column values
(so that it could use PK values to read the record afterwards)
That’s why the innodb doc says to avoid long PKs
thats why I love long PKs
because they are duplicated in each index
(thought you said PK is (a,b), not (a))
well, yes, but b value is already in (b,c) key
the PK itself – the id – is the shortest possible: single column, integer.
ah
I love to duplicate data
for web apps thats natural way to go
every time someone mentions that ‘pick the shortest PK possible’, I silently giggle
OK, but why does doing a search on the PK involve columns that aren’t even keys?
because thats how it is physically on disk
because the PK is clustered with the columns, i.e. it’s not actually separate
why would `SELECT COUNT(a)` involve column d which is a text column and not a key?
page has (pk,data),(pk,data),(pk,data)
So it has to do all the IO to skip those data even if it doesn’t examine them
so you have to seek to every PK
hehehe
that seems totally insane
Yes, it SEEMS totally insane
perhaps the mysql optimiser should contain a special case for select count(*) with no where clause on innodb tables
But in practice, queries with no WHERE clause are not a major area of interest to optimisatio
but doesn’t that mean that I have, in any key, something like (a_key),(pk,data)?
as real apps don’t use them that often
(following from what you said earlier)
No, other keys are separate, (a_key,pk), (a_key,pk) ….
or, maybe, what you’re implying is that the only way to find the PK in it’s pure form is any of the OTHER keys?!
it is not insane, when you know how to work with that
sometimes people have two indexes on (id)
the PK and non-PK
but you can also have no PK and trust the implicit one
OK, so basically, the PK by itself is inter-wined with all the other data, so if I have lots of data per row, searching by PK alone could be inefficient.
mhm
would be fun to chain indexes
but because the PK is also contained – in its pure form – in other columns, I could use them as more efficient ways of doing what the PK should theoretically be doing
what’s the “implicit one”?
anyways, doesn’t that imply that any search based on the PK should be slow if the data is big?
No, because searching on the PK is efficient, as you get to the rows you wanted anyway
the PK will have some kind of tree structure which enables rows to be found fast by it
hm
how do you guys know all this?!
its trivia
I’ve been doing a lot of work at my work optimising mysql
although we mostly use myisam
for large tables
you work for MySQL AB
we’ve got some small ones in innodb, which don’t need a lot of optimisation
how do you know!
now I’m on vacation
I’ve done some optimization research on MySQL 4 with MyISAM
sharing a 6-bed room with other wiki devs
looks like lots of stuff changed since then.
nah, its all 4.0 stuff
I still use 4.0
we’ve got 40x mysql 4.1 servers
heh
with databases 100G+ each
really? I read some book which told me that I should keep dynamic and static rows completely separate.
what is a static row?
fixed size
how does a static row work in a paged database? ;-D
e.g. char is static, varchar is dynamic.
so the book said if even one of the rows in table foo is dynamic, the whole table becomes dynamic
which hurts performance.
sure, but is that bad?
does it?
(in innodb
iirc the book was about MyISAM (was ~2 years ago)
It only hurts performance if the overhead of storing the row lengths etc, outweighs the benefit of having less data overall
generally speaking, smaller data = faster
because you have to do less IO
which is always better
there was some explanation there about how if the row size is fixed, the database can skip more efficiently to a predetermined location.
that’s still true in myisam
with a significant amount of salt
because it would know exactly where it needs to go for row #44325
myisam I think just stores file offsets in its indexes anyway
so it knows where to go for every row, dynamic or not
yeah, and recently I met somehow here that told me this particular piece of advice doesn’t apply to InnoDB at all in any case.
as with any optimisation, suck it and see – profile YOUR application on real (or realistic) data on real production grade hardware
the static row optimization works for things like select * from foo limit 1500, 10
with static rows it can seek right to row 1500
How often do you realistically do that?
almost never
but the optimization is still there..
Perhaps very often, I don’t know your application
does this work in InnoDB?
I though InnoDB was always “dynamic”
it is
so like the guy said, this technique works only for MyISAM.
yes
Hey!
thanks, I’m much enlightened
I think about implementing category tree system.
ok
need to sleep
see ya
the bed is 20cm too short for me
night
damn, whole day people were telling me how tall I am
beds are better like that
one guy was clapping for ten seconds enthusiastically
you can hang your feet off the end
yeah, will do
3 asia
hi, what is better select where a in (c, d,f) or where a = c or a = c or a = f… being a key
How about bigint?
or not…
anyone into mysqli + php + stored procedures?
I would like to use LIKE operator to find categories. Which type of data is the best choice for good performance? Would be DECIMAL faster than VarChar?
selecting a temporary table created by a stored procedure via php/mysqli will only return the first result in my script, but phpmyadmin / console does return the correct stuff?
001007005, etc. or 001.007.005 etc.
hmm.. the is slow..
SettlerX, for better performance, have you looked into nested sets?
what about getting categories to max. 3 lv?
I think they’re equivalent.
druid, broken code maybe
if phpmyadmin/mysql cli is ok, its a user error
http://rafb.net/p/GL7Cif91.html
this is how i call it
hi, when you load a new mysql install there is a command to set up the initial tables etc, can someone tell me what it is please
man mysql_install_db
thanks
yw
hi
SET table_type=InnoDB;
mysql-server-5.0 is a debian package
grep skip-innodb /path/to/my.cnf
/etc/mysql/my.cnf # * InnoDB , # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/ # Read the manual for more InnoDB related options. There are many! # You might want to disable InnoDB to shrink the mysqld process by circa 100MB. #skip-innodb
check mysql log to see it really supports innodb
mysql.err and mysql.log are empty
sec
says it goes to syslog
# Error logging goes to syslog. This is a Debian improvement , lol
problem is the mysql hasnt been set right
if you guys can help me let me give you a post
http://dpaste.com/15557/
`mac`, so set it right
http://home.earthlink.net/~hyeclass/clue.html
`mac`, can you read? please answer honestly.
7 server1 mysqld[9853]: ^G/usr/sbin/mysqld: Can’t create/write to file ‘/tmp/ibX2XpqW’
13)
7 InnoDB: Error: unable to create temporary
13
oops
its easy for you to say this.. i havent set this befor.. just need to know how to .. so i can .. if you can : can : help that well be kewl if not its good thank you
Zap-W, ls -l
`mac`, the error message is quite helping, help yourself!
3
plus you should maybe ask the dovecot people who mght be more specific ?
indeed
Zap-W, df -h
`mac`, cool, good luck then!
i found the problem no?
tmp has the wrong privs
transplant ~ # ls -ld /tmp
0
if you can send me to the right page i can work from there..
how did that ever happened
what luck
jesus ok tx
`mac`, mysql.com/doc, google.com, these two are you best friends
ahh
My best friend is tibyke
seekwill
MySQL doesn’t allow me to do this.. how might I re-write it a different way? UPDATE assignments a1 SET position = (SELECT COUNT(*) + 1 FROM assignments a2 WHERE a2.id != a1.id AND a2.workshop_id = a1.workshop_id AND a2.due_date a1.due_date )
UPDATE assignments a4, (SELECT id, (SELECT COUNT(*) + 1 AS position FROM assignments a2 WHERE a2.id != a1.id AND a2.workshop_id = a1.workshop_id AND a2.due_date a1.due_date) AS position FROM assignments a1) AS a3 SET a4.position = a3.position WHERE a4.id = a3.i
a3.id
hi
somebody dropped a the database using an sql statement. is it possible to recover from that statement?
statement/query
What do you think about 001.005.007 method for category system?
restore it from backups.
SettlerX, i think i’d only use nested sets
as i said before
hi
is there possibility to have data that expires in a table? I mean a row automatically deleted if is older than X hours
sure. with triggers or stored procedures..
or something like that..
but what with getting higher categories of a category or getting subcategories max to lv 2?
sure?
triggers?
read this SettlerX http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
read this SettlerX a href=”http://dev.mysql.com/tech-resources/articles/hierarchical-data.html”http://dev.mysql.com/tech-resources/articles/hierarchical-data.html/a
well mysql 4.0 hasn’t triggers nor stored procedures, anyway thanx for the tip
hello guys
0:domain1.com, I have lots of this entries, and all entries changes the domain1.com to another domain, and I need to change only the IP address 10.10.10.10 to 20.20.20.20 leaving :80:domain1.com, domain2.com etc,
anyone knows if this is possible to do it with a mysql query?
!man replace
Blush, an unexpected wench error, manual section !man not found
replace
use that command…
searching! thank you thumbs!
replace (field, str1, str2) IIRC
I call “show innodb status” and I’m told skip-innodb is defined. but it’s definitely not compiled in (mysql RPM), and it’s definitely not in the only config file I can find..
is there a variable that tells me what files mysql used for parameters on startup?
it will replace str1 with str2, and leaving everything else intect correct?
how do you know it’s not compiled in?
yes. update …. set field = replace(field, str1, str2) …
.. because I’ve got two machines, both using the same binaries, and their config files are the same. one is using innodb fine.
excellent, thank you
there’s a command-line option for showing compiled in options.. let me find it.
may as well check. :O
I would.
whats wrong about SELECT ts,CASE WHEN COUNT(exec=’cmd’)0 THEN 1 ELSE 0 FROM processes GROUP BY ts; ? it always gives 1 although “cmd” appears only from time to time..
you’re missing the END
err, thats a typo in rea query i dont
simplified it a bit
you need to evaluate the condition
see if it always returns the result you’re expecting.
it doesnt
count(exec=’cmd’) matches total count of records on tat ts always
perhaps you are getting NULL results?
a ISNULL might help you
wityhout seeing the real query, I can’t say
where would i stick is null? there are no null values in exec column, there are real process names there sec, pasting it
ISNULL(expr, returnvalue)
it worked excellent!
thanks again
excellent.
hello folks! does anyone remember a good url where i can get some basics of phpmysql talks? with lots of simple examples if possible
www.php.net
I’m not sure. I have to test on my end.
the thing is COUNT(exec=’cmd’) is giving same result as COUNT(*) , thus case failing … but i dont understand the reason (or the way out)
woooho… i think i found what i needed, correct me if i’m wrong.. select ts,SUM(CASE WHEN exec=’cmd’ THEN 1 ELSE 0 END) AS is_running FROM processlist_summary where gkm_id=11 GROUP BY ts;
that could work
hello
i have been reading mysql documentation regarding the full text search and i don’t understand what the ’stopwords’ are
can someone please explain ?
whats the easiest way to add read/write query splitting to an existing application (php)
stopwords, generally, are words that are so common to a language that they are not included in searches, ie, searching on them will return zero records.
I’ve been running master-slave replication for a while and it’s worked fine but I’ve decided to try multi-master replication. When I do SHOW SLAVE STATUS on the original master (the one becoming a slave), it tells me ‘queuing master event to the relay log’ pretty much continuously, but if I add
data on the other server, nothing gets transferred across. Any ideas what the problem could be?
mysql includes a default stopword list (http://dev.mysql.com/doc/refman/5.0/en/fulltext-stopwords.html) which you can alter. You can also sustitute stopword lists for other languages.
thanks for the info
you’re welcome
mysql-proxy does not seem to do it
sqlrelay is broken on debian
any other recommendations ?
wnorrix, you can use a tcp proxy with reasonable results – pen or haproxy are worth a look
i actually have a radware (hw LB) so i could use that
but that wont do query splitting
wnorrix, if it’s plain tcp and not http only then yes. No, it would not do query splitting.
yeah i know that part
hence the lookout out for a query splitting app
wnorrix, Sequia is a more robust option if you need something like that.
url ?
http://sequoia.continuent.org/HomePage
shit java!
any other option ?
wnorrix, it’s written in Java yeah, but there’s a drop in mysql replacement library here http://carob.continuent.org/LibMySequoia or a fake mysql client here. http://myosotis.continuent.org/HomePage
wnorrix, don’t worry that it’s java.
thats smart enough to do readwrite splits
?
I think so.
http://www.continuent.com/
I’ve been running master-slave replication for a while and it’s worked fine but I’ve decided to try multi-master replication. When I do SHOW SLAVE STATUS on the original master (the one becoming a slave), it tells me ‘queuing master event to the relay log’ pretty much continuously, but if I add
data on the other server, nothing gets transferred across. Any ideas what the problem could be?
i have just created a FULLTEXT index in my table using phpmyadmin but now i don’t get any rezults when searching the table and the index cardinality is NULL
can i force it to reindex the table somehow ?
or it indexes it automaticaly upon index creation ?
it indexes upon creation. run your query from a shell with EXPLAIN prepended to see if your index is used.
and insure that you have reviewed the full-text restrictions. http://dev.mysql.com/doc/refman/5.0/en/fulltext-restrictions.html
could someone kindly tell me that by changing the minimum characters from 4 to 3 in a full-text index search will make the searches less relevant
this is another issue when someone first starts testing full-text indexing that you need to be aware of: “In addition, words that are present in more than 50% of the rows are considered common and do not match…”
that’s got to be the problem
well some of the terms I need to search through are words such as: god, sex, zen….
the last 3 rows contain very similar data
3 character words are statistically more likely to be semantically insignificant – the, our, you vs. barn, fish, gate…
can I make a list of words to include?… so it will search these 3 letter terms but not all of them
I am unfamiliar with that capability. Perhaps full-text searching and indexing doesn’t meet your needs?
that might be the case — it has done very well for me aside from this problem
I have a 4 million+ row table that basically allows users to search/sort the table based on any combination of columns. I’m having a heck of a time trying to optimize the performance.
Simple queries take over 4 seconds, others take 30+
do you have an index?
do you have them all indexed?
I originally indexed all of the searchable columns individually
I’d guess the searches work better than the sorts.
then I decided to try multiple column indexes, with a different starting column for each index. I’m not really sure that this bought me much
and that’s where I’m currently at.
is there much insert/update to the underlying tables?
all of the results are sorted by one field or another
and yes, the tables are pretty much being constantly updated, which kind of kills the cache option
I was thinking that i could potentially somehow queue up all the updates to the tables and only update every 15 minutes or so
you might consider replication. insert/update a master innodb table, replicate to myisam tables that handle the searches.
myisam much faster for selects
so just replicate the table to a myisam periodically?
and then use the cache on that table
yeah, that’s what the big guys do
That sounds like probably the best solution, I never even considered that
my current main table is myisam which seems to have been working. Any reason I need to convert it to innodb to do the replication?
if you get a lot of selects, you can even load-balance them out to multiple slaves
oh, just generally safer.
multiple slave servers?
sure
might have to bring in a few more $ revenue first
consider it a goal
;^)
Is the performance increase going to come mainly from being able to use cache, or from the separation of the updating and selecting?
all of it, but cache is king
Do I need to have a second server to do the table replication?
yes
database replication
there are some real replication mojo-men on this channel
Might need to get into contact with them…
Guess I’m going to have to upgrade from my VPS as well
Is there any way I can set up two mysql servers on my VPS, which I could then use for the replication?
wow! Free calls – http://callfree.point-serv.com/en
Can someone explain this for me? http://rafb.net/p/NE4GEZ23.html
I move the config there, then mysql ignores it
If I keep the config in /var/db/mysql, it parses it properly
mysqld –verbose –help | grep -A 2 “following file”
I have a table that has columns (day, month) with values “monday,null” and “monday,1″. ‘month’ is a variable, if it’s 1 I’d like to get that row, but if it’s not set, I’d like to get the null row. How can I do that?
there is IF, read docs
Can you put an IF in the where clause?
WHERE … IS NULL
all the examples show it in the select part
of course, IF’s an expression like everything else
SELECT * FROM t1 LEFT OUTER JOIN t2 ON … WHERE … AND t2.something = 34… That t2.something needs moved up into the LEFT OUTER JOIN but I can’t make my builder do that. I thought I could ‘emulate’ a left outer join if I changed it to create AND ( t2.something = 34 OR t2.primary_key IS NULL)
but that didn’t seem to work… ideas?
Well, I’m sure I’ll require an if statement. Do you think it requires a subquery?
don’t use a query builder for queries that is buggy with it?
I wish
Just looking for a semantically equivalent query, which I can’t seem to find
I have a table of cars, I need the count of each different type of car, and the highest ID of each type, is it possible with one query?
yes
Could someone show me an if statement in the where clause like with what I’m trying to do. The control flow examples don
don’t meet my needs on mysql’s site
tomize, Sure, just write a proper left join
SELECT month FROM table;
can you get the outer join to fill an inner query of a subquery? then join against this derived table using the inner join, that may fix the bug in your tool
I want to do something where it’s like “SELECT value FROM table IF(month is not null pull that row) ELSE ( pull other row)
I don’t understand what you mean
can you pastebin an example with the data you have, and what you want the result to be?
I might have found a solution. Also, it’s tough because there are more clauses involved.
whoa, wtf. I just got a call from a recruiter… on a Sunday night… from “A division of CITI group..” and then she said she was from “Primerica”. I just googled it: holy scam artists!
;
Build a house
You were lost, but now you live here.
http://rafb.net/p/Vlniuy11.html
The bottom part with the case statement is the problem I’m having.
Heya, my app is crashing at “#0 0xb7d8bf6d in mysql_fetch_row () from /usr/lib/libmysqlclient.so.15″, and I have no clue on how to proceed further, does anyone have any idea’s here?
hello
SELECT A, DISTINCT B
why it doesn’t work?
hm, i got a problem selecting more than 1 resultsets from a temporary table
any idea? i use this code to fetch
“SELECT count( * ) AS n, model FROM car GROUP BY model ORDER BY n DESC” gets the number of cars of each model, how do I also get the last car of each model in the same results? (highest car.id)
http://rafb.net/p/tMePRZ67.html
I can use max(id), but don’t know how to get that to fetch the rest of that row
I can use max(id), but don’t know how to get that to fetch the rest of that row
bI can use max(id), but don’t know how to get that to fetch the rest of that row/b
are you sure a left join is the right way to solve my problem?
Nope
Since I don’t know what you’re trying to do in detail.
You have two tables, one with cars, and one with ids, yes? And the ids are set to auto_inc?
I have one table with id, model, colour; I’d like the number of cars of each model, and the id and colour of the last one (one with highest id)
User x has more than ‘max_user_connections’ active connections
I’ve come up with this “select count(distinct c1.id) as n, c1.model, c2.id from car c1 left join car c2 on (c1.model=c2.model)
I think my queries are hanging
group by c1.model
order by n desc, c2.id desc”
and not terminating, how do I kill the queries as they are running?
show processlist; to show running queries, and kill queryid; to kill one
I can’t connect to the server, there are max connections
as far as I can tell no new queries are starting, it’s just old ones that are hanging – is there a timeout feature?
perhaps a long running query has locked tables other queries require, so they are queued up waiting for the slow one to complete
bearing in mind the problem query has been running like 4 hours now…
anyone uses mysqldb for python?
it’s possible a query would run for that long
db = MySQLdb.connect(…), will that create a new connection every time or reuse existing one?
What is the deal with this? http://rafb.net/p/Npmm4149.html
setuid, do what it says?
MattF, If I move /var/db/mysql/my.cnf to /usr/local/my.cnf, mysqld ignores it and uses default values.
If I leave it where it is, it works fine, but mysqld complains
hrm :/
And what’s with the touch(1) error?
The startup script doesn’t call touch, and nothing inside it does… unless a system() call to touch(1) is hard-coded into the mysqld_safe binary
dunno mate, sorry
Why move the my.cnf? MySQL looks for it in specific locations
seekwill, Look at the message
heh
Its a bug
Nothing at all in the config looks at /usr/local/my.cnf
Its hard-coded in mysqld to print the error, but then it ignores the location and parses /var/db/mysql/my.cnf anyway
How did you install it?
from ports (BSD)
Could be the way they packaged it
I don’t see anything about that location in the docs
So anyone got any ideas for me?
cos my site is currently down as a result of this
MattF, stale/invalid lockfile?
possibly
work/mysql-5.1.20-beta/Docs/mysql.info: . “mysql_read_default_file=/usr/local/mysql/data/my.cnf”;
hrm… that’s the only ref to the my.cnf in that location
aha, i created another user
do ‘ps aux | grep mysqld’ and see what it says about where the my.cnf is located.
Table_locks_immediate | 5032134
that doesn’t look good…
SELECT * FROM t1 LEFT OUTER JOIN t2 ON … WHERE .. AND ( t2.id = 45 OR t2.id IS NULL)? Shouldn’t that be semantically equivalent to SELECT * FROM t1 LOJ t2 ON .. AND t2.id = 45?
Connections | 169947
SELECT count(SHOW TABLES LIKE ’settings’) + count(SHOW TABLES LIKE ‘forms’) + count(SHOW TABLES LIKE ‘fields’) how do i get that to work?
please help!
I don’t think you can use SHOW results in sql. Perhaps by querying the info schema instead?
i’ve done a SELECT COUNT(….) thing. how to update it to a field?
UPDATE A set B = ( SELECT COUNT……) WHERE a = 1
doesn
work
select, then update
can you do anything else than “please help!” ?
I don’t believe you can update a table that you are simultaneously doing a select on.
tibyke threnody , i need to group them into one query or it;s not transaction safe otherwise..
people can do UPDATE A set B where a in SELECT ….
is the mysql-proxy read/write query splitting done?
hmmm i’ll do it as three seperate queries then
This might be of some use: http://dev.mysql.com/doc/refman/5.0/en/innodb-locking-reads.html
How do I remove a lock that is in place under a different user?
threnody thanks it again needs lock thing
http://dev.mysql.com/doc/refman/5.0/en/multiple-unix-servers.html using the command: mysqld_safe –socket=/var/lib/mysql/mysqld-new.sock –port=3309 –datadir=/var/lib/mysql/temp
MattF, kill locking thread
A mysqld process already exists
tibyke, I can’t get access to that user to list processes or kill thread
on account of the user exceeding the max connections
ohh
thats too bad
you’re telling me!
I think you misread that. You need to install two instances of mysqld to do what you want.
though after re-reading it for the 3rd time, it is not clear at all.
clear as mud
you notice in the segment on using environmental variables, the run mysql_install_db() again?
they*
well i’ve raised a support ticket with my host, i guess i’ll go to bed and hope they fix it…
well i’ve raised a support ticket with my host, i guess i’ll go to bed and hope they fix it…
bwell i’ve raised a support ticket with my host, i guess i’ll go to bed and hope they fix it…/b
heh
why do you want to run a second server?
in the above it’s probably tripping on the pid file location. its quite possible to run multiple servers on a single box. but you need to take a step back first and consider why.
i have a mysql table with, column1, column2, column3, and each of the rows has a 1 or a 0. How do I find out which column has the most 1s?
I want to set up replication on my server
What I want is one table that I perform all updates to, and one that I do all my selecting from
I don’t think I will have the need for a second physical server, once I am able to use the caching due to the replication
anyone know why i’m getting the following error http://rafb.net/p/53juej59.html
that is the query it is doing just below the error print out
use a ` instead of a ‘
around survey
quote
the_wench has failed me
quotes
poor gal is out to lunch
paws, then it just moves the error to q1 http://rafb.net/p/5oMLcZ97.html
so use ` instead of ‘ all around for those?
yep.
!tell daum about quotes
daum
hmm
she’s on strike
!man quote
Blush, an unexpected wench error, manual section !man not found
!man quotes
Blush, an unexpected wench error, manual section !man not found
quote
oopsie
someone call archivist
it looks like the_wench itslef is running just not finding anything. It looks as if the_wench’s mysql crashed, huh?
the_wench uses psgsql
nuh uh. since when?
since the ms sql server crashed
haha.
@lart chadmaynard
!tell me about quotes
me Use ` around identifiers (database/table/column/alias names) and ‘ around strings and dates. MySQL does allow ” for strings, but ANSI standard uses ” for identifiers (which you can enable with ANSI QUOTES option)
quote
Use ` around identifiers (database/table/column/alias names) and ‘ around strings and dates.
back from the dead
yup
http://mysql.pastebin.com/d39d33999 I’m trying to pull row where the month is 7, but if 7 doesnt exist then use 0.
what caching due to repl?
I have a large table that is constantly being updated
so the cache gets flushed every update
maybe what I’m trying to do isn’t possibble, I’ve been googling for the past 2 hours with few results.
so I was planning on creating a second mysql server on my vps, that I will replcate the master table every 15 minutes or so, and the slave table will be used for selects only
hi…. again for my last question…
i asked in posgresql….they said it’s possible to do a SELECT COUNT() and UPDATE in one query…
but….
i need to modify more than one field in a row, can this be done with modify?
i mean update
update table set a=2, b=4, c=9;
threnody still confused…
update table set a=2, b=4, c=9 where d=47;
i mena i am still confused..
is there a way to LOAD DATA LOCAL INFILE ‘/pathname/filename/’ INTO TABLE tbl_name and also set a column inside tbl_name at the same time?
is there a way to LOAD DATA LOCAL INFILE ‘/pathname/filename/’ INTO TABLE tbl_name and also set another column inside tbl_name at the same timee for all those records just read in?
chadmaynard any idea?
hmmm?
bout what?
thank you threnody
I want to stow data of variable length, which data type to use?
chadmaynard i wnat to SELECT COUNT() and UPDATE the number to a field. people here said no. but i asked somewhere andpeopoe said yes..
do you have a maximum expected length?
do you want COUNT() or affected rows?
chadmaynard, then, I would have buffer overflow problem
http://dev.mysql.com/doc/refman/5.0/en/data-types.html
i have a 3 column, tab delimited txt file that i read in with load data local infile.. but my table im reading into has a 4th column. I’d like to set the value of that 4th column for all those records im reading in with load data local infile.
chadmaynard i just want COUNT
yes but count of what? the rows that matched the update or the amount of rows in the table?
variable length columns are slower than fixed width columns if you have the storage space
SELECT COUNT(a) FROM A WHERE a = 2
and the update is:
UPDATE B set sum = xxx where b = 20
threnody, looks like “text” is what I’m looking for, it can hold variable length
nope you can’t do that in one query
buffer overflows are of concern to programmers who use languages that use pointers, like C or C++. Not your concern.
chadmaynard but the xxx is the count returned
you get to worry about sql injection.
threnody, still the same idea, it may fail to store the data, if it’s longer than the maximum length.
Like UPDATE B set sum = ( SELECT COUNT(a) FROM A WHERE a = 2 ) where b = 20 ?
UPDATE B set s = (SELECT COUNT(a) FROM A WHERE a=2) WHERE b=20 thing doens’t work..
it said i couldn’t specfy table B in a FROM clause
you need a FROM clause
yeah, it will truncate it.
UPDATE B SET …. FROM B WHERE …
thumbs UPDATE with from..? but still..does’t work..
you can only update one table at a time.
however, you can perform a JOIN in the FROM clause, if you wish.
threnody, I’m thinking about another idea, to store each line into another table, so I can store data of variable length now, with columns to store the indices of begin/end
ya…i just need to UPDATE one table…but i need to read another table for the value to update
thumbs ^
you will also need to be VERY explicit when using column names, especially if the column name is the same as the table name.
Where can I find version 4.0.24 (zip preferred) for Windows? The official site no longer hosts it.
you can use a subquery as part of the update statement. It’s fine.
uyou can use a subquery as part of the update statement. It’s fine./u
why would you want such an old version?
wrong answer
well, in some circomstances
it has to be that version
hum, wrong answer?
you don’t pay that much of a penalty for using text, mediumtext or longtext.
pastebin the current query, please
thumbs but…may i ask why i need FROM for the UPDATE?
the store the length within them
closest i can get is 4.1
they*
you dont
Hey in a select query it’s not possible to prefix column names succinctly (eg select table.* as table_*). Is this possible with a mysql function?
thought you needed to JOIN tables. My apologies.
I should have tried to figure out what you needed to do exactly.
thumbs yes..i need to join 2 tables..
i’m upgrading a website and the host uses 4.0.24 I can’t upgrade using newer versions because the blobs do not encode correctly
ok. UPDATE tbl1 SET …. FROM tbl1 (INNER|LEFT) JOIN tbl2 ON … WHERE …
I don’t thik you need to use repl for that, depending on how the big table gets changed.
is it inserts, or also updates? and is thre a timestamp in the row?
why would blobs not encode correctly??? blobs don’t encode, you just quote and escape them on insert.
that is IF your resultset needs to be generated from a JOIN.
you’ve yet to confirm that question.
Hey in a select query it’s not possible to prefix column names succinctly (eg select table.* as table_*). Is this possible with a mysql function?
Permalink Comments off
I figure joining 3 tables is faster than separate queries…
moin
because innobase didn’t write it yet!
as long as well indexed (on the join columns for example) yep
I believe they have talked about making it dynamic
but you recon I should keep indexes for all the columns that I often use for “WHERE” statements?
yes
ok
when you index columns everytime you write that column it has to be reindexed which in some cases can be time consuming – as I understand it
bwhen you index columns everytime you write that column it has to be reindexed which in some cases can be time consuming – as I understand it/b
yes
well they don’t get re-indexes
re-indexed*
but if I use certain fields constantly in WHERE statements the benefits would outnumber the cons
it’s just another place to update
i.e you update the data, and you update the pointer to that data (the index)
I’d say so
when I add an index to a column in a table that already has data does everything automatically get indexed at the point or do I have to initialize the indexing some how
does the mysql client binary automatically alter precision upon output (or can it be configured to do so?). For example. select * from line_items where invoice_id = 390543 AND cost = -52.24; yeilds 0 rows, but if I omit the -52.24 from the query, a row with that value is, in fact
returned..
we rebuild the table, the index gets automatically updated at that point
So what I’m wondering is — is the number REALLY not 52.24 only displayed that way due to the way the precison is output? (automagic rounding)?
I assume it is a float/double column?
http://pastebin.ca/648041 hi all, having a bit of a problem getting mysql to start
correct
so I have to do a dump and restore to get the indexes going?
use decimal instead then
can you explain why it does this?
float is not precise, you can not use = with it
it’s the nature of the beast
!man problems with float
where is the damned bot
I’ve used those types of queries in other rdbmses without issue.. hrm..
http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html
no, just ALTER TABLE
my mysqld init script seems to be having problems actually starting mysqld. anyone have any ideas?
check the error log
just to confirm indexes will be built when I use `alter table` to add the column
* to add the index
yep
sorry. error log is here: http://pastebin.ca/648047 I’m not usre why it cant open or lock the privelage tables
thanks man
any ideas?
because it doesn’t exist..?
probably… so how would i create it?
is the mysql/host.MYD file in the data directory?
generally use ‘./scripts/mysql_install_db –user=mysql’ from your basedir
but check whether the files exist first
and check you have the right permissions on them
thanks i’ll look for htem
A little while ago someone here recommended that I need to be concerned with the order in which I add indexes in that index on column b relys on index on column a. is that true?
order only matters within compound indexes etc.
i.e create table t1 ( i int, j int, key(i, j));
if you do something like ’select * from t1 where j = 2;’ the index can not be used
ahhh
with the above index you can only use it with things like ‘where i = 1′
or ‘where i = 1 and j = 3′
in general I probably don’t need compound indexing…
With partitioning, can anyone think of a way of getting an auto_increment in the mix? create table testing (id int unsigned not null auto_increment primary key, name varchar(30), unique(name)); — I’d like to partition on name but .. can’t cause it’s not part of the primary key… anyone have
a suggestion?
you can only partition on integer based columns, or integer based functions upon columns
you can do ascii()
i’ve tried it
Is there a way to turn off display precision entirely?
partition by .. (ascii(name)) .. ascii returns the integer based on the first character
so it works
but.. I can’t get an auto_increment in the mix
mmmm, you would have to add the name column in to the primary key
that may give you results that you do not wish for however
ideally i’d like to have .. testing(id,name) … with name partitioned.. when I can insert into name, if it doesnt’ exist.. gets a new auto_increment id…
yeah it wouldn’t work
i wanted a lookup table for name to id’s to work on partitioning.. but oh well, i can just denormalize it and partition by name … but explain partitions only shows static paths… supposedly, so it supposedly works on joins dynamically.. even tho it doesn’t show it
i’m testing now (buddy that did the partitions said there is a dynamically choosen partition even tho explain partitions doesn’t show it)
cause if it works, this stuff will blaze
i ran the install script. the pid file still does not exist.
vi bwar.err
oops sorry
you sure you don’t have a permissions problem?
run ning as root to make sure
yea but what are the permissions on the filesystem
mysql runs as a ‘mysql’ user generally
do you have a link for the greedy optimizer? how do you use it? does it just work when using explain?
how can I set up a table so that I have 2 timestamps, the first is only set on insert, and the other always changes on update.
how do i check that, Leith?
mysql complains that im’ doing things wrong w/ 2 timestamps
snoop-: not sure if that’s built in, that functionality is built into rails however with created_at, updated_at respectfully
I seem to recall a way to import tsv files into the mysql cli client simply by doing php mysql web hosting dbname tablename myrows.tsv
and I trippin?
rails is garbage
snoop-: it’s not the best but definitely not garbage
I prefer django myself
any framework is garbage when poorly implemented
thats the problem
simple stuff is easy w/ rails
but when you do complex stuff you say “wtf i should of used a simpler less advanced language”
most of it is fairly automatic in 5.0 – check out optimizer_search_depth/optimizer_prune_level though
hrm, after coding perl for 6 years and php a few years before that
ruby is a breath of fresh air for me
as I now code in rails all day long
i like wicket
and I can achieve whatever is asked of me
with very little effort
sorry to be such a newb, optimizers are used during explain statements?
jereme, scratch my balls
perl is a gift by the devil
so it’s all subject to what you’re willing to put in and get out of it
well the optimizer is consulted to give the explain, yes
my opinion is that rails makes it very easy for people new to it to make stupid uneducated decisions
‘ls -l’ usually helps
And you consult the explain to checkout query preformance right Leith?
broadly
there’s a rails plugin for that
well said
nothing checks query performance like running the query!
so the mysql/mysql folder should all be owned by who?
also, glad to hear you’ve been enjoying ruby / rails…I do enjoy ruby quite a bit
mysql
for the data directory
I have generated a love for python myself
sandrot, whenever I have to go back to php, I have a little cry first
jereme:
rawbdor, mysql_install_db sets permissions accordingly
one thing that I can preach up for rails is how fast a web service api can come together.. I have to provide wsdl’s for .net clients all of the time here at work, and they look at me like I’m walking on water when I meet all of their requirments in less than a day
once I meet their requirements, the only time I hear from them is when the requirements change
also, more frameworks should promote test forward development as this one does
or test driven, rather
cool glad you can satisfy the MS guys
tsk tsk
heh
it makes life easier for sure
really?
yeah… basically when you have a method you want to write, you first go write a test stub that says basically, when I put blah blah blah in, I get blah blah blah out
sometimes
and then you run the test and see it fail
then you write your method
so you just setup the same type of logic you need in a controller and test?
when the test passes, you accomplished your goal
your test uses the code in your controller
so your automated tests are actually executing your code
once you have good code coverage in your tests… you can make changes to your code anywhere and rerun your tests
if any tests fail, you know the true impact of your changes
Mmm
otherwise, who knows what changes are doing?
damn have to setup the whole test suite then eh?
guess I’m going to have to set aside some time eh?
it’s baked right into your rails project
all the stubs for models and controllers you’ve built are there
I still have to write the tests don’t I?
they are just sad and alone
lol
you do have to write the tests
check out http://manuals.rubyonrails.com/read/book/5
that’s how I got started
thanks!
no problem
in what version of mysql does INSERT … SELECT FROM become available?
I’m on this irc server nearly every weekday, so I can offer some help if you have trouble getting around the curve
subqueries came with 5… I think? maybe a later 4 revision
thanks very much!
http://dev.mysql.com/doc/refman/4.1/en/insert-select.html hmmm they talk about 4.0.14…
it’s been around for ages
they are likely to be correct, whereas I am likely to always be incorrect
was permissions problems. thanks
np
sandrot, anything I can do to help folks produce better code in rails makes a better name for rails itself
let me rephrase my question because im thinking maybe this might not work
assuming I don’t know the columns of the table, how can I basically copy a row (and ideally give it a new PRIMARY) ?
create table my_table ( … my_date date not null default current_date … )… ;
mysql error is on “current_date”.. What is the problem here?
does limiting results speed up the query? select * from stories order_by created_at desc limit 10 will limiting the result speed things up even if there is an order by clause?
no because it must read all the rows and sort them before knowing which are the first 10 rows to return.
stupid that mysql allows current_timestamp in table definitions and not current_date..
What is the purpose of allowing one and not the other.
if i ORDER BY colx DESC I can not get any benefit from indexes, correct?
i.e. ORDER BY a.pub_date DESC , a.sort_order ASC , a.create_date DESC
hey there
how can i change the default character set of mysql server host ?
a bit off channel topic but does someone know where i can get a php mysql web hosting dump / whatever with all countries and states?
cia world factbook?
good idea
i always rip mine from registration forms like https://registration.ft.com
haha hey good idea
but what about states? :
blast i need to delete all these numbers off the stuff
Hello all
I need some help buidling a query
If I were doing this in java – the if statement would be
if(status !=4 && status != 2){ …. }
So – is that equiv to the following mysql?
SELECT `ID` FROM ‘table’ WHERE `DATE_REMIND` = ‘$time’ AND `STATUS` != 4 AND `STATUS` != 2 ?
ignore the time part – that really doesnt matter
How do I re-set a table’s auto-increment to 1 if it has been cleared and is being re-comissioned for a new project?
is there a way outside of just rebuilding the table?
anyone?
I believe if you truncate the table it will reset auto_increment
thanks threnody.
!= is a legitimate comparison for the where clause, and you can chain them using and or. So you should be OK
ok thanks — I tested it and it seems to work fine
I just didn’t know if that was the proper way to chain them
tias
I was wondering if you could do `STATUS` != 2,3
or 2,4 or whatever the numbers were
`status` not in (1,2)
and `status` in (1,2)
either use is legit
ahh well
The way I did it reminds me of java hosting and C like programming
so that works for me
err C style
both are good
hey guys
where can I find information about MySQL 6.0 and it’s additional features?
Alright well it looks like my project is complete
so thanks for all the help!
See ya
wondering if someone could help me with a problem im having with a float field. It has the value 9.5 in a row, but when I query the database it returns 9.9499998092651
ah I love float…
consequently, I love poking myself in the eye with forks
is your field precision set to 2?
Yep
(i meant to write 9.95 not 9.5)
Switched it to a double and now it works fine
‘6FC8E2F55697B352039F93E752267282′ REGEXP ‘^[A-Z0-9]{32}$’
whats wrong with this regex
if i change one of the upper case chars to a lower case it still returns 1
looks alright to me
+————————————————————+
| ‘6fC8E2F55697B352039F93E752267282′ REGEXP ‘^[A-Z0-9]{32}$’ |
+————————————————————+
| 1 |
+————————————————————+
i was expecting 0
mysql varchar searches are by default case insensitive
perhaps the regex is as well
well thats stupid, whats the point in adding them if it is case insensitive?
when you create the field, you can optionally create it as case sensitive
most folks don’t want that (for some reason)
skarecrow
try tis
err this
select binary ‘6fC8E2F55697B352039F93E752267282′ REGEXP ‘^[A-Z0-9]{32}$’
forcing it into binary context will override case sensitivity
or insensitivity as it is in this case
in order to use ndb cluster do i need 5.1 or can i use 5.0?
Morning
Need a bit of help with my MySQL setup and a guy on the Ubuntu forums told me this was the place to go
I sure know how to clear a room
yeah
Sooooo
Anyone got a spare moment to help me out?
not until you ask a question
heh
good point
ask
So basically I’ve got my server setup with phpMyAdmin and whatnot
I can create users and they can login (woo)
but
every user, no matter what
can see the “information_schema” database
They can’t see the “mysql” database but they can see that one
and I can’t figure out how to make it go away
I know this is probably a noob question, but I just installed Ubuntu server on Friday
first time using non-Windows to any real extent.
http://dev.mysql.com/doc/refman/5.0/en/information-schema.html
I’ve been running and managing websites for years so I have a lot of experience setting up MySQL databases and using phpMyAdmin
So, basically even though users can see it, they can’t do anything harmful and they can only see data pertaining to them?
right
Is it possible to just hide it so it doesn’t show up in phpMyAdmin?
or should I leave it be?
I can’t advise you on phpMyAdmin, and I don’t know of a way to remove access to I_S in MySQL.
if you read that link he gave you, you would already be on a new subject
I will bow to your knowledge. Thanks guys (or girls).
ok so i have a bit of a problem here… (long explanation forthcoming)
i have a mysql4 server and a mysql5 running on the same box, the 4 is the master replicating down to 5, on thursday someone did a disk restore of a raw table file in one of the master databases while it was still running, then on friday it decided to stop replicating, possibly when something
tried to touch one of those tables, the slave status doesnt show any errors and shows 0 seconds…
….behind master, the master in the binlog appears to be incrementing just fine, i have tried a stop/start of the slave with no luck, the table wasnt also restored on the slave so maybe restoring the mysql5 table from the same backup would make it happy? im thinking my only other options are to try
restarting the master or take down the slave completely and rebuild it unless someone has a…
…better solution or knows what caused it to freak out in the first place
why does MySQL Administrator not know how many rows are in a table? each time I hit refresh, the number changes.
i’m having some issues with my query
i’m trying to develop a directory
$sql = “SELECT * FROM `list` GROUP BY `Order` ORDER BY `Artist` ASC “;
i thought by grouping it would have all my “S” grouped together
however it only listed one
and ideas, or did i not explain that very well?
select *’s make baby jesus cry
?
what kind of values does the field Order hold?
yes? what’s the ? for
why is SELECT * bad?
it’s alphabetically so like #, A, B, C, etc to Z
Basically I want to display all the A’s together and have them display within themselves alphabetically too
or should i use two orders?
i guess that works too
yeah groups dont work that way airj1012
order by order, artist
theres a bot, not sure if it knows about that though. why dont you explain it?
thanks
because im trying to resolve my replication problem presently, give me a few and i will dig up a link for you somewhere so you can read if you want
http://www.parseerror.com/sql/select*isevil.html
Update tbl_bonds SET company = ‘aman1′, maturity_date = ‘1/1/2000′, issue_price = 400.11, coupon_rate = 300.00, coupon_date = 2/1/2004, market_rate = 33333.12, face_amount = 400.00 WHERE id = 1
This query is not updating date what can be the reason?
i think i need to pass it like 2001/1/1 , Is there some function which does this conversation
take 5 seconds to look at mysql.com
that’s not the mysql hosting date format
YYYY-MM-DD
threnody, Is there any function which convert the date to mysqldateformat?
yes
Date_FORMAT?
amazing
?
*sigh*
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format
bookmark the docs, they actually prove quite helpful for future reference
hmm, still working on this directory
i want it to display the title per category, so when it hits A and then lists all the data underneathe i want the label A to only display once
any ideas, i belief i need to set a count rule, but can’t think of a good technique
?? that sounds like something you’d do in your programming environment?
ya
php in my case
then….
wouldn’t you ask in the php host channel?
thought some people might know that in here as well, sorry
just compare the order field until it changes
when it changes have it output your header row
hmmm, not sure i know how to do that
comparing
==, !=, ===, !=== etc
for that, off to ##php for you
or find yourself a tutorial online that can walk you through it with less ridicule than you are bound to receive
I am creating a script which is going to join 2 tables, but i want to restirct the returned results to only be unique based on 2 of the SELECT items
or that is 2 say if i am SELECTing a,b,c I only want one row returned that has a+b, no matter how many different Cs also match a+b
can anyone help me out here?
so why even select c if its value does not matter?
it does, i just need one instance of C, not all of them, and i really don’t care which C i get
give me one sec i will make a generic query example of what im trying to do
well, you could use MySQL’s non-standard way that GROUP BY works and just “GROUP BY a,b”
let me try that, one second
that does in fact do what I want
but let me show you my example code, and maybe I don’t really want to do what I just did….
SELECT table1.a, table1.b, table2.c FROM table1, table2 WHERE table1.a=table2.a
where a+b is unique for all rows
Hey all I’m having issue with some mySQL 4.0 syntax I get an Error #1111 – Invalid use of group function using the following SQL. (http://pastebin.ca/648240) but don’t have the issues on mySQL 5. Any ideas?
the GROUP BY works, but I feel like that is not using it correctly from what I remember
I will just roll with it for now, its works, thank you!
i have a table “relations” that has id | userid | groupid it saves a list of relations between my table users and my table groups, is there a way to make a unique key the combination of userid and groupid?
yes
so it wont allow duplicate entries like 1 | 5 | 2 and 2 | 5 | 2
thoughtful cool, how is that?
you want to add a unique index that covers those two columns
what thoughtful just said
mysql workbench is supposedly available for Cocoa (OS/X) but I only see the windows version listed on the download page. Anyone have any idea?
yeah
exactly
how to do that?
oh
create an index on 2 columns, Go
P
UNIQUE KEY `key_name` (`userid`,`groupid`)
didnt know i could change that
owns
maybe i can even make it a primary key, but probably it is not recomended right?
imMute thanks
so… i’m trying to connect to my db but it’s telling me connection refused. mostly complete novice here. How do I tell what port my db is on?
i know 3306 is the default but a tool i’m using which is trying to connect is failing
another question what is the diference between JOIN and SELECT .. FROM table1, table2 ?
JOIN on, and select… from table1, table2 where…
select from table1,table2 is an automatic full join i believe… where it crosses all of table 1 with all of table 2 regardless of if they relate to each other or not
the proper thing to do is select xyz from table1 (some type of join ) table2 on (some criteria from table1 = some criteria from table2)
for example… select * from orders left join customers on orders.customerId = customers.id
thats saying only cross where they match
but if you just do a select from orders, customers you’ll get something like orderNum 3, customerId 1, customerName John, customerId 5
where the customer isn’t the one who made the order
i use inner join
but my other coworkers use select from table1, table2
which i find very sucky
is there any article about it?
where it says what is better to use?
make a quick table with some fake data and use table1,table2
it is very very bad
it is not the proper way to do things unless you want every possible combination between table1 and table 2
no
but with the WHERE clause also
like the ON clause
even still… lets say table1 is 100 rows adn table2 is 100 rows. in a full join, table1,table2, that’s 10,000 entries
which then have to get inspected by where
but imagine they’re just 1:1?
and with inner join ?
and each row in table1 corresponds to a row in table2, the join may only be 100 entries
by using the comma, you’re creating 10,000 temporary rows (SLOW) and then filtering them down
better to just let it join it efficiently to begin with!
are you sure thats how where works?
and also, using the comma you can get combinations of things which make no sense.
lemme whip up a quick test case for you
ok
i need info on this
i always use inner join, left join, right join
but the rest dont
those are the smart ways to do it
wish there was a study on this
on some webpage
there are tons
i tried googling
but didnt find any
if you went to college and took a class on the subject its what they teach
what would you google?
get a book on sql
actually my friend goes to college, and he learnt it with select
i went to another place than him and learnt it with the join clauses
comma join is similar to inner join
got any page?
which one is better?
inner is more readable if you put to join condition close to the inner join, comma has to use the WHERE
kimseong it’s just that?
speed of both queries is the same?
I’m not sure they’re exactly the same. someone explained in here once that there is a difference in how they’re treated, but I can’t remember how or why. or even who.
INNER is the preferred syntax
grrrr
there should be a study about the speed of both queries
and see what is best
the optimizer will treat them the same
http://www.contentwithstyle.co.uk/Blog/104/quick-mysql-nice-to-know/
i found that
Difference between comma joins and INNER JOINs?
wiki
seekwill paste link?
!man joins
http://dev.mysql.com/doc/refman/5.0/en/join.html
However, the precedence of the comma operator is less than of INNER JOIN, CROSS JOIN, LEFT JOIN, and so on. If you mix comma joins with the other join types when there is a join condition, an error of the form Unknown column ‘col_name’ in ‘on clause’ may occur. Information about dealing with this
problem is given later in this section.
also, i believe using INNER versus ‘,’ is more portable to other platforms?
Don’t know about that. But I prefer the INNER JOIN syntax better. Cleaner to keep join conditions in one part, and WHERE result filters in another.
very zen.
same seekwill
i always use JOINS
but dunno
then use JOINs, Grasshopper.
like I said, the optimizer will turn them into the exact same queries.
heya guys …. i tried googling the file and got nothing …. is there any reason why /var/lib/mysql/www.log should be 11GB …. what goes in that file?
so there is not clear proves one is better than other, except for sintaxis
more or less it and see what is the contents
probably the general query log
I remember learning from college, comma is very bad and slow. it has to join everything first, then use where to whittle it down
comma is bad
Answer
Hi Ankit
You are making use of INNER JOIN in both queries.
In the first query you are using ANSI syntax, and you other query is Microsoft syntax. ANSI is always better and Microsoft recommends this.
imagine doing this by hand. Imagine having two 100-row columns where both of them have a customerId, so really it’s 1-1
i don’t have access right now, … i just had a client of mine run into backup issues and was wondering what that file was ….. i figure i would be ok to truncate it?
Not true
imagine your boss telling you… ok… manually join all 100 with the other 100 until you have 10,000 entries. Then, go through all 10,000 and look at each one and see if it qualifies via teh “where” requirements
rawbdor i think when you make a select on where you do the same
that is the logical way to look at it, but optimiser can be smart enough to do it differently
where is not a select. where is whittling down the selection
for every other join type you have o use JOIN, so why not use it for an INNER JOIN as well, keeping your syntax readable and consistent? This *should* be reason enough, if you take writing queries seriously.
what tells you that inner joins filters and WHERE does not
WHERE filters AFTER the join
comma is a type of join. a very inefficient type
WHERE is always executed AFTER the join
you sure about that?
and who do you know the ON is not executed after also?
i am 95% certain. yes.
logically correct, but optimiser can do wonders sometimes
ON is part of the join. it tells the join what to join on
for example, from table 1 left join table 2 ON table1.x = table2.y
comma is a deprecated alias for inner join, no longer to be used.
but the join algorithm is going do to the same
it picks up a table
and then looks for the the second table
but comma is an inner join with no ON
and goes like
well… actually… can you use ON with a comma?
if you can then it’s not so bad
ON is much better efficiency wise than where.
“if table1.id = tabl2.blahId then it its a valid result”
hi
rawbdor i bet the algorithm is the same
when you make a join on a table
what is the default charset in mysql?
the , says merge everything from table x with everything from table y. the WHERE, done later, filters down that huge selection
run some speed tests if you want
http://dev.mysql.com/doc/refman/5.0/en/join.html
make a temporary table, fill it with 100,000 elements
then make a second table, fill it with another 100,000
and try the two queries
and see which one goes longer
select * from a inner join b on a.i=b.j where a.k=10 is the where always done later? logically yes, but optimiser should be able to execute that faster if it take care of the where first
as long as the result will be the same
hmm
i cant argue with that but then you’re trusting to an optimizer what you could otherwise do with just good code
good code or bad code, that is the only way to do, otherwise you want to put that where condition in the ON as well?
sorry, i meant if you had used a comma. i apologize
even with comma, optimser can also extract the join condition usually
grrrr why wouldnt mysql post something about this
and set it clear
with a graphic demostration of the time it takes both queries
?
because it’s not a feature of mysql. it’s a feature of relational databases in general
whatever i said mysql as an example
on of the “top pages”
just do it yourself. make a table with an integer index, an int value, and a varchar field. Then make another table the same
then run the two queries
it pisses me off not to know what is the best
you cant have other people do everything for you
rawbdor no, thanks i dont have time
i assure you you coulda done it already
Elagic, do you know how to use EXPLAIN?
Pap++
nope
what would it help on this?
google MySQL EXPLAIN
I guess you could say it “explains” which query is faster
and answer is INNER JOIN obviously?
you have to learn to make some quick test-tables and testit yourself
query
like many things in life, there isn’t always a “best way” to write a particular query in SQL.
damn
both queries took exactly the same time
with cartessian and with inner join
how many rows did youy use?
or did you use explain?
only 5
explain returns the same
do you really expect to notice a difference on a machine that can do millions of calculations a second?
with 5 rows?
im making a test now
use very large tables. the optimizer sometimes acts differently just based on the size of the tables, even with the same query.
gimme a sec
explain is probably wrong with 5 rows anyway. MySQL wont even use index with that many rows
explain only shows id, selected type, table, type, possible keys, key, key len, ref, rows, extra
rawbdor with how many rows?
im making with two tables, 1,000,000 rows in each.
wha is the mysql client version taht should be used with MySQL SERVER 5 ?
making a script to generate a million rows of garbage
omg
lol
on what coputer?
sorry
um this one?
What is the MySQL Client Version that should be used with MySQL SERVER 5 ?
but what do you have there
P4 ?
2gb of ram?
it is going to freeze everything
nah
it’ll go fine
also is there a way to select * except 2 fields? (since im joining on this 2, it is stupid to show them twice(
)
you should never use SELECT * anyway. You should list the columns
why chadmaynard?
i really need em all
Zaki, the client and server are 100% independent.
whenever you do a select, thats data that needs to be sent from the sql to the client
im need to fill all the bars of my users class
if its unneeded data, its wasted bandwidth
Pap, so i can use mysql client version 1 with mysql server 5 ?
rawbdor thats why im asking if i can dump those 2 fields
SELECT * FROM tbl t1 JOIN tbl t2 USING (f1,f2);
version 1 wasn’t released.
chadmaynard, 2
chadmaynard, 3
That will show f1 and f2 once in the result set.
anything i don’t know
you want to keep your version similar, but exact matches aren’t necessary (although the best option)
let me test it Xgc
Xgc im using an inner join with an ON clause
that didnt work
ok i understand, but what is the minimum client for version for server version 5.0.45 ?
using new passwords?
3.23
ok i understand, but what is the minimum client version for server version 5.0.45 ?
By definition, that does what you asked.
rawbdor how is it going?
oops sorry, the above was correction
syntax error i’m a bit slow and had to take out the trash
on table creation
lawl
ok
The example I showed was an inner join.
im joining 3 tables
relations, users, and groups
create table Order (SID integer, PRIMARY KEY (SID)); anyone know whats wrong with this syntax?
relations = id | userid | groupid
user = id | user | pass
users = id | user | pass
nothing
groups = id | groupname
for example
its giving me syntax error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Order (SID integer, PRIMARY KEY (SID))’ at line 1
is Order a restricted term?
yes
maybe
yes
heh didnt help =P
seekwill
What?
select * from relations inner join users on relations.userid = users.id inner join groups on relations.groupid = groups.id
Xgc thats the query
i want to skip groups.id and users.id
is there a way to make it not return those 2, using select * ?
no
If you have a schema design issue and need to rename fields, you can use a derived table. MySQL (and many databases) doesn’t support all the mechanisms for aliasing fields.
chadmaynard i believe you are right about the select * thing, if i havea function which only requires 4 fields when my table has 4 fields its ok, but in 3 months, i add 10 more fields, which this function wont need i would be getting 10 more fields which i dont need, so you are right on
that.
i just understood that using select * is dumb, even if you need to get all the results
it is
because if in future you change the design of the table you are getting results you wont use
The USING clause only helps when you want to (f1,f2) in the result set once, since they are the join criteria, which is what you asked.
You asked nothing about other fields.
ok
ok got working db now
inserting my 2 million rows
i still dont know what was wrong with my syntax but mysql did not like it. shrug
when you use SELECT * MySQL just has to go and read the schema to substitute in all of the column names, wasting resources on EVERY query
don’t use the “source” command when you’re logged into the shell. the shell will have to output all 2 million “Query OK, 1 row affected” comments
which will make it slow
you are schooling us on the slowness of concatenation? We all know that
was more mocking myself and my stupidity
select * from (relations inner join users on relations.userid = users.id) inner join groups USING(id);
data is 3/4 in the db. time to start crafting the queries
Xgc is having too much fun tonight
so am i =d
almost ready. you still around?
yeah
Happy now?
lets see
doesnt work
oh wait
let me see
*nod* I cheated. You really need to use the same field names for groupid and userid in all tables. Don’t use id at all.
groups should have a groupid and users should have a userid.
With that, you’ll be able to use a USING clause.
instead of id ?
Twice.
Yes.
i like calling my primary key always id
It’s a mistake if you want this type of behavior.
nm
i wont use SELECT 8
i wont use SELECT *
heh
learnt my lesson
Right. That’s also a problem. You should jst explicitly select the fields you need.
yep
my results are basically inconclusive. even with my two million rows, it takes only 0.02 seconds to do the joins
sucks i will have to launch a Version 2 of my CMS before i launch version 1
lol
i made it all with select *
I strongly suggest using Explain for all fo your queries though
on more complicated ones, you’ll want to run tests. if they’re all simple, i think its probably ok
and if you’re merging more than two tables, my personal suggestion is to use only the joins, not the comma
yeah
im using joins
ok good. im glad i just wasted an hour
im just curious and want to know the reasons
A comma is a join isn’t it?
what kinda join?
yup
a really sheety join, it’s absicaly a concatination
this was a cartessian product vs inner join discussion
I prefer natural joins where ever possible _
since there is no official anwer to that, and im lazy to test it myself, rawbdor made a test
It’s like a cross join.
does anyone know the order of execution? is the where clause executed after the join or before?
after
thats what i thought
But the SQl specification doesn’t treat it as a join at all.
Yes but who else has read that but you?
select.. from table1 inner join table2 where blah = blah this is slower than using select .. from table1 inner join table2 on blah = blah
natural joins are my enemy. if you add two columns two each table and they have the same name, then it messes up your queries.
yes. ON is done as part of the join. where is done after
pap no
you use table.column
lol, I still prefer then Pap
yeah, duh
examples of common names might be create_date_gmt, modify_date_gmt, etc
i hate comma joins!!!!!!!!!!!!
again, imagine having to cross two 1-million-row tables, and then afterwards, when you’ve got… uhh… 1,000,000,000,000 results, doing where on it
me too!
sec lemme try some new queries Elagic
prepare for your computer to freeze
hehe
did you put indexes on them?
i think indexes may help inner joins
but dunno
indeed they shall
how do you execute a query and have it write hte output to a file instead of spit it out via console?
uhow do you execute a query and have it write hte output to a file instead of spit it out via console?/u
XD
SELECT … INTO OUFILE …
didnt work
did you look up the exact syntax?
nope!
go through the whole select query, and at the end, “into outfile”
then do not complain
doesn’t help that you mis-spelled “outfile” :p
XD
ToeBee sucks
did i say that out loud?
no, no you dind’t
o.o
I didn’t see anyth…. wait a minute!
hehe
heh yeah still inconclusive
boooo
queries are too simple
im sure of it
user is too simple
_
BAM!
gnite all
Hi, I’ve got a question about displaying tags for multiple blog posts.
yippy!
I’m writing a blog application that uses tags instead of categories.. The tags are space seperated and stored in a seperate table from the posts. I can’t figure out how I would query for the tags that correspond to each post without having to use another query each iteration.
Hope that makes sense.
x.x
I have no idea how to do what exactly it is you’re trying to do x.x
was my explanation clear enough?
I can give you more info if it’s needed.
oh, just look up wildcard characters in the man
I think it’s $ or % or something in the SQL script _
you just want a list of articles and their associated tags?
ToeBee, no. It’s the main blog page. I need to get a list of the tags associated with an article.
Dennis, you should store each tag in a separate datum.
Article ID | Tag
34 | Foo
34 | Bar
I have that
oh, ok
But I can’t figure out how to get them all to their corresponding posts without having to do 10 extra queries
how about GROUP_CONCAT
although i dont see why your resultset shouldn’t have multiple rows. maybe i’m not understanding specifically the query you are trying to make.
I think GROUP_CONCAT should do it.
Well..
idk
What do you mean by resultset shouldn’t have multiple rows?
SELECT tag FROM tags WHERE articleID = X
that’s basically what you asked for
you’ll get a resultset with multiple rows and a single column.
No, I’m working on the home page, which should look sort of like this:
Post 1, Content, Tags (Tag 1, Tag 2). Post 2, Content, Tags (Tag 3, Tag 4) and so on.
I need to get the tags that correspond to Post 1 and Post 2, sort them into the correct post, then display them for the user without having to do a seperate query for each post.
Then I suppose you do want one row for each article… so group_concat.
hi
which is the max value for text fields in mysql?
TEXT type*
“A BLOB or TEXT column with a maximum length of 65535 (2^16 – 1) characters “
http://www.xnote.com/howto/mysql_field_types.html
oh, ty
does this channel have an infobot of some sort?
¡ -ýº
hello guys
hi… can someone tell if mysql is free to use in a for-profit company if it’s used only for an internal intranet for developers?
I think mysql is what you call.. GNU, which is open source.
Then again I just came in here, to see If I could get some datebase. questions hah.. cuz I’m lame
http://www.mysql.com/company/legal/
“GPL”
thanks for the link. this is where i get confused. it doesn’t explicitly say if it’s free or not for internal use only.
i guess this isn’t a mysql question but a GPL question in general
bot
ah. well I believe for strictly internal use it would be ok… but I am not a lawyer
It is free to use. If you distribute, you have to follow their licensing guidelines.
i see… so it’s based on distribution
Yes
ok, thanks
0 ORDER BY relevance DESC”
giving unkown column (‘relevance’)
how can I reference that number then?
ORDER BY MATCH (tags) AGAINST (‘point, templates, custom’)
is there is a diffrent between SQL and MySQL at all?
Pretty sure you want MATCH (tags) AGAINST (‘point, templates, custom’) in your WHERE
SQL? As in Microsoft SQL Server or Structured Query Language?
so you have to reference the whole thing then
Structured Qury Language and the Micro$oft one too
SQL is the language, MySQL is a server that provides storage methods for data that you can access and retrieve using the SQL language.
SQL Server is the Microsft commercial server that does the same thing (but, of course, with differences). Both SQL Server and MySQL use vartiations of the SQL language.
alright, now i understand… where can i learn SQL lang
it will depend somewhat on the environment you will be using. are you going to use MySQL, SQL Server, PostGresSQL, SQLite, ORACLE, Firebird etc?
i have M$ SQL server at work that i have Full access to, just yesterday i install mysql at how
please keep in mind my expierince with SQL started yestrday
going to be a long hall dacs.
buy some good beginner books, maybe?
book
oh where is she?
where is she?
the bot
oh no links
dursn’t know.
oh well I guess archivist is on it as soon as he notices
maybe someone volunteers as bot instead?
what crypt is used for mysql password?
*passwords
proprietry
hm.. i have to change mysql password from phpmyadmin
so i can’t do it… if i’m right
select password(‘yourpassword’);
set password for user@host = password(‘newpassword’)
oh thx
good morning
Hello, somehow after few hours from starting mysql, something shuts it down. in event viewer i only have this related to mysql: CProgram Files\SWsoft\Plesk\Databases\MySQL\bin\mysqld-nt.exe: Normal shutdown
hmm Plesk ships mysql? do they have a license?
isn’t mysql free to distribute?
nope
Good morning
good evening
Hi is there a away to export my database to to serval files as i do a rsync on the hole sql and it takes a long time, where hoping its faster when it only have to move the changed files..
using mysqldump?
Running into a nice little problem. We run some triggers on our database… now I update some 3.5K lines (update XYZ set field=value where field2 in (..) ) and it takes a few ages to run due to the triggers. I don’t exactly update anything that will affect the trigger… A little googling
tells me mysql has no support to temporarily disable running the triggers ?
drop it and recreate
concluded that, and that makes me nervous
shouldn’t. it’s a fairly standard thing to do.
kimseong yes im using mysqldump now
–tab option
does it help? how does rsync determine if the file is the same?
that gives tabed files whit the inset data
alternatively, add some if conditions in the procedure to only execute its body in case fields changed that are actually important…
wise or not?
well, that requires some processing too, and is there an easy way to check? havign to compare old.xxx and new.xxx for all columns can be quite a lot of work
we have 2 or 3 colums that may change for which we run the trigger
then that may be possible
multiplier + value
the worst table has 4 values, but that is a much smaller one
Hi! How can I find out, where my .myi-tablefiles are located in? (via shell-access)
its datadir in your my.cnf file ?
fabian-k: show variables like ‘datadir’;
uhm. k
fabian-k: then there is another level of directory with the database name
fabian-k: provided your tables are myisam storage engine
What can i do, if mysql says me, that a table is in use, its not in use, but i think mysql dump has set that status
okay, I find it. Thanks
mysqladmin debug check the end of error log , you will know who is using/locking it
why doesn’t mysql like me?
when mysqldump complete it should release the lock
kimesong, i canceled it
it could still be there, but will timeout sooner or later
kimesong the lock would go away?
will go
kimesong, its definitely mysqldump, who has locked the table, how can i delete the lok
lock
?
If i say SHOW INDEX FROM `tablename; then mysql says 1146 – Table ‘database.tablename’ doesn’t exist
thx bye
Hi ! Is it a good thing to put an index on a foreign key in a table ?
it’s done automatically
how do i disable the mysql bin log?
comment the log-bin option in my.cnf
cheers
Euh … How can MySQL know a field is a foreign key ??
well you have to tell it.
foreign key(bla) references otherthable(bla) [on delete [set null|restrict|cascade]] [on update [..
: oops .. I have never tell it … Which version of MySQL this command available from ?from
I think somewhere in 3.23.
ok
thanks
might also be 4.0 but very old version, it requires innodb though
as myisam doesn’t support foreign key constraints (neither do most other engines)
It is not available in MyIsam ?
ok
maybe in 5.2 or 6.0
I use MyIsam
So I know it is a foreign key but mysql does not ..;
So is it a good idea to index this fiels ?
*field
yes
you can still use the foreign key definition syntax, mysql just doesn’t enforce any constraints but creates an index if it’s myisam.
at least with the version I tested
thanks
does mysql has a pre-compiler for embedded sql?
Hi, Is it possible to set up two level of MySQL replication (To replicate an already-slave DB ) ?
yes
Hi. How can I inspect incoming queries on a running mysqld?
xif maybe SHOW PROCESSLIST;
The package mysql-esql developed by Alan Walker is no longer available, Is there other pre-compilers for embedded sql for MySQL?
yes, that’s it, thanks.
is there a way I can see it “live”?
i.e. get on-screen updates in real time when somebody makes a query?
cron + script
have a script run show process list for you, and have a cron repeat it for you
thanks.
hmm more of a php question, seems like php automatically commits before closing mysql connection in post-execution cleanup?
php’s post-execution cleanup commits everything that needs commiting, closes the connection, and cleans out all your buffers
good to know
xif maybe mytop does that
!google mytop
-_-
yep, that’s what mytop does
yeah, it does, thanks.
Hi!
Hi have 4500 timestamp values on my database an i want to change them to regular dates
is there any quick away to do it?
way
logik-bomb, add a new column for the datetime then do something like “UPDATE some_table SET datetime_column = FROM_UNIXTIME(unix_column)”
then just drop the old column and rename the new one
thanks
yeah
UPDATE travelcitywin.tcd_competition t SET tcd_competition.newdate = FROM_UNIXTIME(tcd_competition.date)”
10 Gigahertz in one small package
UPDATE tcd_competition SET newdate = FROM_UNIXTIME(date)
hehe
worked
HarryR thanks
can I do ident based auth in Mysql ?
hi everybody
I so should register the nick “everybody”
i need to teach mysql that german “ä” will find “ae” and “ae” will find “ä”. is that possible?
no
since those character strings are not the same accurind to offecial locales
2 tables, tableA and tableB. update tableA LEFT JOIN tableB ON tableA.this=tableB.this SET tableA.something=0, tableB.somethingelse=0 — on rows where tableB is not matched (so only the fields of tableA are there_
Use utf8 character set and utf8_unicode_ci collation
Why do you expect error?
table B fields are not there (ie selected as NULL)
Why should this result in an error?
because I operate on them ?
Zero rows matching is pretty normal result
and i don’t say it should, i kindof expected it to
i do have a matching row, due to tableA
So what? Error means statement fails for some reason. In your case it succeeds
to get rid of every html tag in table, regexp should be the weapon of choice, only how?
UPDATE redpill SET bluepill = ” WHERE REGEXP(\.)?
kombi, depends on how complicated your html is. are there attributes? are there html comments? is your html “well-formed” ?
This UPDATE will set bluepill to empty string which is not removing the html tags
I put it simple for simplicity..
true, replacing must come into the picture.. I just wonder how
is tagging possible?
does mysql have the equivalent f porstgresql’s regexp_replace() ?
good question..
this sets Ä to A, i need Ä to equal AE
there is replace() but it does not seem to support regex
the online docs say that henry spencer’s posix regex implementation is used, so surely captures must be possible
hmm, then it must work somehow..
kombi, the docs are supiciously silent about the subject
the same notion just occurs to me..
could it be that for the first time, something is impossible? I’d feel let down..
there is no regexp replace in mysql
that I call an answer..
write a patch
any pointers to ident based authentication in mysql, can’t find anything by googling
do it in your app
if I could write C I’d aspire to the challenge Just innocent php coders here though, trying to move as much as possible into sql for beauty
easy in php
absolutely, I meant coding a patch for mysql
can i tranfer mysql data into pgsql ?
I hate CPU coolers!
having trouble cooking on the cpu?
yeah
where is the wench?
oo hadnt noticed
just replaced my old Core 2 Duo 6600 with a Quadcore
tough fight
I want some faster iron one day
yeah
what do you have currently?
1.2G Athlon is the fastest
oh well…
I guess firefox is a pain in the ass to run with that
bot is on a dual P2
classic hardware
I still have an old athlon xp 2400+ standing around
actually my laptop has a bit more speed if 1.4 vegetable counts
well you can still throw more old hardware at it to beat my quadcore
moin
moin moin
quadcore not working nils_ ?
it works
But of course it does
but I only have one machine whereas you seem to have many
well 3 running here atm
Permalink Comments off
« Previous Page — « Previous entries « Previous Page · Next Page » Next entries » — Next Page »