Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
User Journal

Journal Journal: WTF? 1

leto:/stuff% mkdir mp3
mkdir: cannot create directory `mp3': No space left on device
leto:/stuff% mkdir qwe
leto:/stuff% mv qwe mp3
leto:/stuff% ls -ld mp3
drwxrwxr-x. 2 tet tet 4096 Dec 22 20:53 mp3
leto:/stuff% df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/leto-stuff 30G 9.9G 19G 35% /stuff
leto:/stuff% df -hi .
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/leto-stuff 1.9M 322 1.9M 1% /stuff

This appears to be 100% repeatable behaviour.

Power

Journal Journal: "They Are About Power" 11

"American Senators tell us that Brazil should not worry, because this is not "surveillance," it's "data collection." They say it is done to keep you safe. They're wrong. There is a huge difference between legal programs, legitimate spying, legitimate law enforcement -- where individuals are targeted based on a reasonable, individualized suspicion -- and these programs of dragnet mass surveillance that put entire populations under an all-seeing eye and save copies forever. These programs were never about terrorism: they're about economic spying, social control, and diplomatic manipulation. They're about power."
http://pastebin.com/2ybz27UE

User Journal

Journal Journal: Mini rant: Stupid code (2)

More on the stupid code:

Some_Func, which is called at the end, INSERTs the new batch number to the log TABLE and includes an EXCEPTION block catching DUP_VAL_ON_INDEX and OTHERS.

IOW, this PROCEDURE makes a best guess at what the batch number will be, writes it to a bunch of files, and only then attempts to put it into the log. If putting it into the log encounters any errors, it logs that and exits without any record in the log of the job! The job currently takes about an hour or two to run. Seriously, what were they thinking?

The current situation can be remedied via a SEQUENCE. As long as noone breaks the rule that all ids be popped off it (which can be enforced by removing rights to the TABLE and forcing all writes to go through a stored PROCEDURE) everything will be fine until the SEQUENCE runs out of numbers.

Of course, this entire approach is just plain wrong. The correct way to log a run with a generated number which is used in the output, is to start by logging first. This garantees the number is recorded and lets others job easily use a further number. This is basic stuff.

To use a SEQUENCE (or even the MAX() hack), INSERT the number, and find out what it is, just use the RETURNING clause:

INSERT INTO Log(Id, Name) SELECT Log_SEQ.NEXTVAL, 'Moo' FROM Dual RETURNING Id INTO Batch;

Robotics

Journal Journal: GOOGLE'S REAL PLAN 8

It's so f*cking crazy, that you'll think I'm the one gone bonkers, for saying it...

They are batshit billionaires, convinced that enough capital and technology can have them produce physical immortality. They want to upload their beautiful minds into replaceable robots, forever.

That's the ultimate aim behind those difficult to fathom investments and acquisitions.

But the human mind? It's an effect not an artifact. It cannot be preserved independent of its "emitter". The superficial characteristics of the effect can be recorded and even simulated. No matter HOW good the recording, there's no VHS player that will ever BE Grandma.

But these are fools - who in a world of madness, are heralded as visionary.

User Journal

Journal Journal: Mini rant: Stupid code 2

Not only does this code have stupid constants, it has stupid code:

BEGIN
                SELECT NVL(MAX(XXX_BATCH_JOB_R),0) INTO nBatchNo FROM XXX_BATCH_JOB_CONTROL WHERE XXX_BATCH_JOB_N = sBatchName;
            IF nBatchNo = 0 THEN
                nBatchNo := 0;
            END IF;

        EXCEPTION
                WHEN NO_DATA_FOUND THEN
                        nBatchNo := 0;
        END;
              preBatchNo := nBatchNo;
              nBatchNo := nBatchNo + 1;

8 similar references to these variables:

LPAD (NVL (preBatchNo,0),6,0) ||
LPAD (NVL (nBatchNo,0),6,0)

Some_Func(sBatchName, nBatchNo, v_updtPgm, nretcode);

There are no other references to these variables.

What is wrong with this code? Let me count the ways:

  1. The IF statement checks the 0 condition, even though 0 will work just fine.
  2. If it equals 0, it sets it to 0. Why?
  3. An EXCEPTION clause is used.
  4. The EXCEPTION is impossible, as MAX() is an aggregate function, and aggregate functions always return data
  5. .

  6. The return is stored in one variable then immediately moved to another variable.
  7. The new new variable has a non-sensical name.
  8. The new variable breaks the Hungarian notation used elsewhere.
  9. The new variable is used eight times with formatting, and no where else. But the formatting is not done in the variable tiself.
  10. The new variable is always used with the old variable, for formatted output, yet they are kept separate.
  11. Both variables are NVL()ed over and over again, even though that was handled at the beginning.

There are other issues, such as the lack of a SEQUENCE to truly have unique numbers. But, those are trivial compared to the absolute stupidity of the block itself.

So, how should that code have been written?

SELECT NVL(MAX(XXX_BATCH_JOB_R), 0) INTO nBatchNo FROM XXX_BATCH_JOB_CONTROL WHERE XXX_BATCH_JOB_N = sBatchName;
preBatchNo := LPAD(preBatchNo, 6, 0) || LPAD(nBatchNo + 1, 6, 0)

Between the block and the NVL()s, i feel that the original coder was a blockhead that added no value at all.

User Journal

Journal Journal: Mini rant: Stupid constants

I am looking at a stored PROCEDURE as it takes too long to run. Besides the CURSORs, DECODE()s where NVL() should be used, and a UNION, there exists this stupidity up front:

csSpace CONSTANT CHAR(1) :='';
cnZero CONSTANT NUMBER(1) :=0;

How many things can you spot that is just plain wrong with that?

  1. It uses the misunderstanding of Hungarian notation.
  2. It uses Hungarian notation for a constant
  3. The constant is not an uppercase
  4. The contant says what its value is, as opposed to it itself is
  5. It uses CHAR(1) (In Oracle VARCHAR2 there is no benefit to CHAR over VARHAR2)

Why is it that good programmers exist only in forums and newgroups, but not in the real world?

User Journal

Journal Journal: Chronicle: Got a new job 2

I was looking for a job and an interview required references. I decided to put down an erstwhile supervisor and coworker, but only after aksing their permission. They both agreed, and i never heard back from that (first) place. (Not because of bad reviews, the head hunter explained they were excellent.)

A bit later, the supervisor called back with yet another supervisor, ready to hire me. He strongly recommended me to her, and she was willing to go with that. Asked if i wanted to be hired or contracted, i wanted to wait to answer, but they realized that as i only have a BA and not a BS, it would be better to contract and perhaps ask to be hired later. Fair enough.

I went for the interview which was toned down due to the recommendation, and the three supervisors (large project) seemed okay with me. Then the technical guy came in and asked me if i knew the things that the supervisor knew i did not know, and i answered accordingly. The idea was, since it's database related, i can learn it (quickly). I have a good track record learning the tools, and actually understanding what is going on.

Well, he nixed me. The supervisor was still going to hire me for an as-of-yet unknown position, after she got back from her two-week vacation. Indeed she did, and i started yesterday.

As she had no position for me, the other supervisor (the one i have worked for in the past) decided to pull me onto his project. The application was slow to begin with, expansion to Mexico made it even slower, and now with Europe on the map, it'll probably be redesigned, mostly because the database was not designed for it. Being that is my expertise, he wants me to do the redesign. Pretty kewl.

So, he (old supervisor) asked her (new supervisor) to move me to his project. Alas, she has finally found something for me to do. So, it's 50/50; working on two projects. The sense seems to be that she will hire anew, and i will switch to working for him 100%.

--

I was supposed to meet the two supervisors at 9am on Monday. I rented a car for the week, drove down the familiar road, and forgot one turn (different building). I called him after 9 asking for help, and he asked who was supposed to meet me. Well, that's kind of good. Noone "realizes" i am late on the first day. When i entered the building, he was waiting for me, he showed me to the other supervisor, drove me to get my badge, and showed me to my seat.

Getting the badge was simply enough Sit down and have her take a picture of me. She asked if i wanted to see it. As i didn't care, she went on to print the card.

I don't remember what it was, but my supervisor made some comment and i smirked. As soon as the lady saw that, she said something like, "ok, sit back down, we're taking your picture again, just keep smiling." She showed me the first picture too. I was less concerned about my facial expression, but my shirt and coat seemed a bit out of order. It's better on the second card, but i'm uneasy about that ridiculous smile.

---

Yesterday, i was asked to help someone with the website taking over a minute to load a particular page. When i asked to see the query, he said it was handled by toplink and he could turn on logging. While we saw which actions took time but the queries were still hidden. We were not getting anywhere.

When it was time for lunch, i explained our two options. One was to guess what the queries would be, see if they are slow and tune them, create an SP or VIEW, and have toplink call that instead. Or, find out where the appropriate loggin option is. I gave him my email address (work) and cell phone (personal, as i didn't have a work yet) to contact me when he wanted to continue, and i haven't heard from him since.

--

I got my phone, but am waiting for the computer to be replaced with the one i am supposed to be using. In the meanwhile, i cleaned the desk, drawers, keyboard, mice, and anything else with 409, and tidied up the wires with rubberbands. Other than that, there isn't much to do. When i get my computer, i'll have to customize it heavily, especially to get Windows 7 to be more like XP, which, for me, has increased functionality in the start menu and explorer. I'll probably install Libre Office so as to avoid the Office 2010 ribbons, which moved things sround so i can't find anything anymore. I'm so happy i switched to the mac at home.

--

I brought my Kindle to read during this expected downtime. I am a bit scared that i will lose it. Amazon will not track or deactivate ir (so i have read) and there really isn't a good way of identifying the device. With a cell phone you can at least call someone in the phone book asking them whose phone it is, but the Kindle has a first name. Even with a full name, it wouldn't say how to contact the owner. Perhaps i ought to put a sticky note on it. For now, i bascially leave it in my coat pocket.

Updating the Kindle here, though, is harder. Tryng to connect to the wifi results in an error, "Enterprise or peer-to-peer Wi-Fi networks are not supported." I guess i would just bring a USB cable here, But it really isn't that important.

User Journal

Journal Journal: Chronicle: Emailed Walmart about confusing item description 4

Walmart has a Slinky for $3.00. The description says: Clearance! Was $1.86. That seemed backwards.

So, i sent an email from their website:

Metal Slinky http://www.walmart.com/ip/Metal-Slinky/882938#Q%26A+Exchange

says the price is $3.00. The description says "Clearance! Was $1.86" Isn't that backwards? Because it went to clearance the price went up?

The response i received was

Can you please send us the link where you found the promotion.

To answer the question, i sent back

The site is Walmart.com: http://www.walmart.com/ip/Metal-Slinky/882938#Q%26A+Exchange

In red letters where it says Clearance! Was $1.86"

to which i received:

We sincerely apologize for the inconvenience but we are unable to do price match at this moment, please email us at christmasadmatch@walmart.com.

Did i miss something?

United States

Journal Journal: Mayflower Pedigree: Slavery and Sodomy 2

"This daily inebriation led their governor, William Bradford, to comment on his people's 'notorious sin,' which included their 'drunkenness and uncleanliness' and rampant 'sodomy.'"

http://www.blackagendareport.com/content/end-american-thanksgivings-cause-universal-rejoicing

The American colony differs in origin from the Australian, only in the sanctimonious pretense by its criminal founders.

Slashdot Top Deals

Remember, UNIX spelled backwards is XINU. -- Mt.

Working...