Page 646 of 865

Re: [Grubb's] Random Thoughts of the Day

Posted: Wed Oct 05, 2011 1:07 pm
by Merk
Merk wrote:I figured it out. SQL Server Management Studio had some bullshit option set where you could not run any queries that would drop a table.

Switched it off and now I'm breaking everything wooooo!! jkjkjkjk I'm writing a dumb inventory app please pay me $50k from now on.
On the plus side this app uses the exact same SQL functions that a score tracker like VJArmy (new record, edit record, delete record) would use so if I ever actually get around to writing something like that up the code is pretty much already there for me.

Yes I know those functions are easy as shit to write, fuck you, I am not good with computers.

Re: [Grubb's] Random Thoughts of the Day

Posted: Wed Oct 05, 2011 4:00 pm
by Merk
I think there's something fucked up about me - I have this weird obsession with earwax.

Sometimes big chunks of it will fall out of my ear and I will sit and stare at it for a long time.

Re: [Grubb's] Random Thoughts of the Day

Posted: Wed Oct 05, 2011 4:53 pm
by Pokebis
Do you clean your ears?

Re: [Grubb's] Random Thoughts of the Day

Posted: Wed Oct 05, 2011 5:58 pm
by MonMotha
See, now, if you had been using MySQL or PostgreSQL, I could have helped you. It's certainly possible to make a change like that on either of those without dropping so much as the column, let alone the whole table. MSSQL I don't know, though.

Re: [Grubb's] Random Thoughts of the Day

Posted: Thu Oct 06, 2011 9:17 am
by Merk
How would you do this in MySQL or PostgreSQL?

ALTER TABLE a_table
ALTER COLUMN a_column int NOT NULL IDENTITY(1 , 1);

Because that's how I would do it.

Re: [Grubb's] Random Thoughts of the Day

Posted: Thu Oct 06, 2011 4:40 pm
by MonMotha
MySQL:

Code: Select all

ALTER TABLE a_table MODIFY COLUMN a_column INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY;
Note that MySQL doesn't have an "IDENTITY" type (I believe that is MSSQL specific). Instead, you simply define a column to be non-nullable and set it to auto increment. The data type is somewhat arbitrary, but of course it has to be incrementable. Type "INT" is fairly common, but you could use a larger type if you really needed it. The PRIMARY KEY index then constrains it to be unique (and the primary key for the table). You could use a simple UNIQUE index if you already had another primary key or didn't want a_column to be the primary key, but that would be a typical use of the "IDENTITY" type in MSSQL. Newer versions of MySQL have a "SERIAL" type that corresponds to "BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE" if you wanted to use that.

PostgreSQL:

Code: Select all

CREATE SEQUENCE a_table_a_column_seq;
ALTER TABLE a_table ALTER COLUMN a_column TYPE INTEGER SET PRIMARY KEY DEFAULT NEXTVAL('a_table_a_column_seq');
Again, PostgreSQL doesn't have an "IDENTITY" type, so just use an INT (or, again, a BIGINT) and make sure it's unique and non-nullable. On PostgreSQL, a PRIMARY KEY automatically implies non-nullable (and of course unique); this may not be the case on MySQL, but it if is, and it probably is, the "NOT NULL" up there is redundant (but shouldn't hurt). PostgreSQL also has a more flexible "auto increment" method than MySQL. You create a sequence and then tell it to assign the default value as the next value in the sequence. You could play around with the sequence to do crazy things, if you felt like it.

Note that I haven't actually ran either of those queries against any version of the respective DB servers. They may have minor syntax issues. It's possible that the pgsql one needs to be broken into two lines (one to set the type and next value and the other to add the primary key), but I'm pretty sure the MySQL one is correct.

Re: [Grubb's] Random Thoughts of the Day

Posted: Sat Oct 08, 2011 9:10 pm
by Pokebis
I don't know how old this is, but Koreans always have the best webcomics.

(Oh, yeah, and I guess it's courtesy to say don't open this at work or whatever. Borderline "normal" NSFW, but this is more for a different reason. There's your warning thingy.)

Re: [Grubb's] Random Thoughts of the Day

Posted: Sun Oct 09, 2011 12:18 am
by LikeableRodent
Pokebis wrote:I don't know how old this is, but Koreans always have the best webcomics.

(Oh, yeah, and I guess it's courtesy to say don't open this at work or whatever. Borderline "normal" NSFW, but this is more for a different reason. There's your warning thingy.)
That comic is kind of old, but I'm a big fan of it's [sic] surreal style and technical implementation.

Re: [Grubb's] Random Thoughts of the Day

Posted: Mon Oct 10, 2011 8:12 am
by Merk
Hey Adam, could you go into detail about how people obtain driver's permits in Japan? I HAD HEARD SOMEWHERE that it's "very difficult" to get a driving license in Japan. Would you be able to elaborate on the process?

Re: [Grubb's] Random Thoughts of the Day

Posted: Mon Oct 10, 2011 8:52 am
by Ho
You could get an international driver's license...

Re: [Grubb's] Random Thoughts of the Day

Posted: Mon Oct 10, 2011 9:33 am
by Merk
nonononono, I'm not worried about myself actually driving in Nippon or being able to get a driving permit there and whatnot. I'm curious about the process for Japanese citizens. Adam more than likely doesn't have a driver's license which is fine, but he might be able to comment on the process itself. I'm mainly looking for an outside opinion on whether or not getting a driver's license in Japan is difficult.

Re: [Grubb's] Random Thoughts of the Day

Posted: Mon Oct 10, 2011 9:55 am
by Ho
I'd imagine that if he was going to get a driver's license there, he'd be getting the international one as he is not a citizen. I believe that's what Jon had/has. I don't know if an actual Japanese license would even be available to a foreign national. Of course Adam may be able to comment on the process based on people he knows there as I'm sure he has many friends. :)

Re: [Grubb's] Random Thoughts of the Day

Posted: Mon Oct 10, 2011 10:01 am
by Merk
Right.

I did not know he wasn't a citizen! I figured since he's been there forever now that he would have gotten dual citizenship. I'll gladly admit I don't know the first thing about dual citizenship so if I'm just living in a land of make believe where people can obtain dual citizenship wherever whenever then fuck my ass I am destined to work shitty entry-level jobs for the rest of my life because I am a stupid retard.

Re: [Grubb's] Random Thoughts of the Day

Posted: Mon Oct 10, 2011 12:03 pm
by Merk
I forgot to put on my belt today (I was in a hurry) and boy do I look stupid!

I'm thinking about getting a new job that's full-time. I feel like I'm not really learning much here and getting my CCNA isn't going to magically get my foot in the door to any place. Is anybody's company hiring?

Re: [Grubb's] Random Thoughts of the Day

Posted: Mon Oct 10, 2011 4:58 pm
by LikeableRodent
Merk wrote:Hey Adam, could you go into detail about how people obtain driver's permits in Japan? I HAD HEARD SOMEWHERE that it's "very difficult" to get a driving license in Japan. Would you be able to elaborate on the process?
I don't own a car and have no real reason to get a license, so I can't give specifics. However from talking to people about getting their license, it's primarily difficult because during the driving test you'll get counted off for silly inane things, specifics of which I can't remember. Nearly no one passes the driving test on the first try.

International licenses (I do have one) are only valid for one year. If that year runs out and you're still abroad, you have to get a local license. In Japan's case, Japan will recognize some countries' licenses and allow you to simply "transfer" your license from that country to Japan's. Off the top of my head I can think of Canada and New Zealand that qualify for this, though there are more.

On the other end of the stick are countries (the US is one) where Japan doesn't recognize their licenses, and you have to got a Japanese license from scratch.
Merk wrote:Right.

I did not know he wasn't a citizen! I figured since he's been there forever now that he would have gotten dual citizenship. I'll gladly admit I don't know the first thing about dual citizenship so if I'm just living in a land of make believe where people can obtain dual citizenship wherever whenever then fuck my ass I am destined to work shitty entry-level jobs for the rest of my life because I am a stupid retard.
It's a pain to get citizenship. As far as I know, you're eligible to apply for citizenship after living here for five years (three if married to a Japanese national), but there are lots of holes you have to jump through. Also Japan only allows you to hold citizenship in one country, so if you apply to become a Japanese citizen you're required to renounce any other citizenships you may have.

If I planned on staying here long-term, I'd apply for permanent residency instead, simply so I wouldn't have to renew my visa anymore. Thing is, to apply for permanent residency you must have lived here for 5+ years if married to a Japanese national or 10+ years if you're not.