Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
User Journal

Journal Journal: Silliness: Commenting the wrong way

In middle of redacting a VIEW that deals with groups, members, and precedence, i fixed a bug, and explained a line in greater detail with (what i think is) the correct logic. (The actual COLUMN name has been shortened):

-- Match this record:
                        -- To match INDIVUDAL, check P_ as C_ will be NULL (INDIVUDALs have no children).
                        -- To match GROUP, check C_ for the children; parents can be ignored.
                        -- (Note: Checking the NULL child or irrelevant parent should not be a problem.)
                      AND PHC_1.C_ IN (PHC_2.P_, PHC_2.C_)

Some comments just seem wrong.

User Journal

Journal Journal: Verbiage: eBay javascript silliness 3

Having a free moment, i decided to search for something on eBay when the following message popped up on my screen:

Please enable JavaScript

Our new search experience requires JavaScript to be enabled. Please enable JavaScript on your browser, then try again.

To use our basic experience which does not require JavaScript, click here.

The "basic experience which does not require JavaScript" seems fine to me, so i clicked on the link and the same page and modal error message came up.

Even without the non-working old-experience link, there is something wrong with using a modal window to tell me that i can't appreciate the experience.

If you ask me what version of FF i'm using, you're already a lost cause.

User Journal

Journal Journal: In Passing: Prepay before pumping

This morning i went to put gas in the car. I switched gas stations because i don't like answering three-million questions before being able to start the gas pumping. Sheesh, ask if if i want a receipt after it starts, why waste so much precious time (in the freezing weather)!

So, i went to a Valero station as they tend to be a little cheaper. They are not on the corner either, making them harder to get to; i'll see if i continue going there. A couple cents a gallon isn't something to get inconvenient over.

Anyway, on the pump there was a sign, "Please pre-pay before pumping".

User Journal

Journal Journal: Verbiage: Cisco phone time to ring setting is global

I use Google Voice to ring my cell phone and office phone (amongst others). The problem is, the office phone picks up after two rings. It's a Cisco CP-7942G, an ip phone. The time to ring setting is global. Seriously?!

So, the office phone picks up first. This isn't usually a problem, because i am by the office phone during the hours i set Google Voice to use it. But yesterday, for example, was a Monday that i was not in the office, it still picked up first because i forgot to turn it off.

User Journal

Journal Journal: Game: Battle Monkeys (rules)

Been playing Battle Monkeys.

Learning what each icon does and proc-order is important, but i haven't seen it explained in detail in one place. So, i decided to place a start, here, so as to have it somewhere:

Each Item can be used once. When used, the icon disappears.

Names appearing on four-part screen before game starts are colored based on rank.

Players can have between 1 and 100 Health.
        - If avatar receives health that would give it more than 100 Health, it is set to 100 Health.
        - If avatar receives damage that would give it less than 1 Health, it is removed from the game.

Avatars take turns:
        - By default, turns are taken in order, from left to right. (i.e. avatar with lowest ranking to highest ranking)
        - Order of actions can change the order of turns, which becomes the new order for subsequent rounds.

If two avatars qualify for an action as a result of a rule, the avatar affected is chosen at random. (Perhaps it is in the same as turn order, that round.)

If an action applies to more than one turn, it is also applied to the current turn.
        - Therefore, even though an action is shown as "+2", the board will show it as if it was 3.

Order of actions on a turn is:
        - Push (Where applicable)
        - Mace (If player is still in Mace from previous turn)
        - Poison (If player is still in Poison from previous turn)
        - Debonus
        - Health, Full Health, Shield, Vanish, Extra Jump
        - The rest (including new Mace and Poison)

Order is very important. For example:
        - An avatar in Poison with 10 (or less) Health, has no recourse for more health.
                - (If all other other avatars are in the same predicament, and go first, player can still win.)
        - Being in Mace and landing on Mace, means Mace actions twice on that turn.
        - An avatar in Poison that lands on a Vanish square, applies Vanish after the poison.
                - So, the damage received from Poison will not affect Vanish.
                - Poison on the next turn will affect Vanish.

All icons have a color:
        Green Health to self
        Red Damage to self
        Blue No Health or Damage to self or others.
        Yellow (potential) Damage to others

Push (event) - Avatar is moved off the current square.
          - When more than one avatar lands on the same square, a die is rolled for each.
                - The same number will not appear on more than one die.
                - The avatar with the highest number applies Push to each of the other avatars.
        - Push moves the avatar to an adjacent square. The avatar receives 10 damage.
        - An avatar on an edge square may land off the board. That avatar receives 100 damage.
        - If as a result of Push, an avatar lands on a square occupied by another avatar:
                        - In Single Player mode, the process runs again, for the new square.
                        - In Multiplayer mode, both avatars occupy the same square:
                                - The avatar that landed on the square first treats the square normally.
                                - The other avatar does not make use of the square, but can receive damage.

Health (heart, green) - Player receives 35 - 45 health

Lava (8 pointed star with outline, red) - Player receives points 35 - 45 damage

Extra Jump (up arrow with line through it, blue) - Player receives 4 (turns) to Extra Jump.
        - During Extra jump, player can move 4 squares (instead of the usual 3.)

Vanish (8 lines in circle around dot, blue) - Player receives 2 (turns) to Vanish.
        - Vanish ends prematurely if player takes any damage.
        - If player stays in Vanish for 10 turns, player receives Ninja Achievement.
        - During Vanish player becomes untargetable and avatar is not shown (mace and shield are)

Mace (mace, yellow) - Player receives 2 turns to Mace.
        - Players in Mace target all targetable avatars within one square of player.
        - Target receives 35 damage.

Shield - (double-lined shield, blue) - Player receives 2 turns to shield.
        - Players in Shield (and not in Sleep) are protected from all damage except Smackdown and Push.
        - Player in Shield can still receive Sleep.
        - If player is also in Sleep, Shield is not active, but does consume a turn.

Sleep (Zzz, blue, targeted) - Target receives 1 (turn) to Sleep.
        - Sleep end prematurely if target takes any damage.
        - Target is avatar closest to player.
        - During Sleep target does not consume any square's icons.

Debonus (encircled x, blue) - All avatars other than player are put in normal state. (Does not affect Health.)

Poison (skull with two injectors through it, yellow, targeted) - Target receives 2 (turns) to Poison.
        - During poison, player receives 10 damage.
        - Target is Avatar with highest health.

Meteor (circle with 3 circles inside of it, and 3 triangles outline of it, yellow, targeted)
        - Target receives 30-35 (usual), 40 ("Big"), or 50 ("Epic") damage.
        - If target has a shield, target takes no damage.
        - Target is avatar that player received the most damage from.
        - If no other avatars are targetable, player becomes target, even if in Vanish.

Lightning (lightning bolt, yellow, targeted) - Targets receive 30 damage.
        - All targetable avatars (other than player) receive 30 damage.

Shotgun (rifle, yellow) - Avatars in the row or column of player receive 40 damage.
        - Avatars with Shield or behind an avatar in Shield (relative to player), are exempt.

Shockwave (circle with 2 jagged outlines, yellow) - Avatars within 3 squares of player receive damage.
        - Avatars within 1 square receive 40 damage, within 2 receive 30 damage, within 3 recieve 20 damage.

Special (star with outline, white) - Special changes by avatar type.
        - Monkey - No special. (Icon is still consumed.)
        - Chimp - Banana bombs.
                - Avatars in every column other than player's column receive 45 damage.
                - Avatar in Shield, or behind an avatar in Shield (relative to bottom of field) are exempt.
        - Baboon - Smackdown (targeted) - Target receives 45 damage.
        - Orangutang - Full Health
                - Player's Health set to 100, even if game is Special: No Health.
                - Player receives 3 (turns) to Shield.
                - If player is in Poison, it is removed.
        - Gorilla - Machine Gun (targeted) - Avatar receives 75 damage.

Berserker (clenched fist, blue) - Player receives 3 turns to Berserker.
        - During Berserker all received damage from player, except Push, is doubled.
        - Initial damage of each Poison is doubled. Subsequent damage is not.
        - Special: Berserker triple damage causes triple damage instead of double.

User Journal

Journal Journal: Question: URL monitoring 5

I was asked by a not very technical friend, who was asked by another, to help them track where their son is going on the Internet. They are not technical at all, but they suspect their son may be visiting inappropriate websites, and if so, they want to talk to him, but first they want to capture the urls surreptitiously to see if their concerns are valid.

Well, truthfully, i do not know what to suggest. I searched and found OpenDNS which seems to have some services that allow URL monitoring (no timestamp thopugh). What would you suggest?

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;

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?

User Journal

Journal Journal: Verbiage: Apologizing

In response to a MakeUseOf post on apologies, i posted the following comment:

I use apologies, sorriness, and remorsefulness as three different things.

Apology is an explanation, as in Plato's The Apology. The sign in the image above that explains what happened is an apology. The usefulness of an apology is that the apologizer felt a need to give one, that is, he values the person he is apologizing to, and respects them enough to explain himself.

Sorriness is saying you feel bad that the other person was affected adversely, not that you would have done otherwise. The " This is much better" message is an example of it. The usefulness is to let the person know that you care.

Remorsefulness is (explaining that you are) feeling bad about what you did. The usefulness is to let the person know that you are humbling yourself by admitting guilt.

These three things are very important as not all situations call for all three. Indeed, sometimes using the wrong one can made a matter worse.

Apologizing is excellent when coming late (the first time), not doing things as expected, or any time the person on the receiving end feels belittled. When it is obvious that the apologizer does not care, does it quite often, or thinks apologies make everything better as if whatever-it-was never happened, the apology tends to infuriate the person.

Sorriness is to let people know you care. For example, when hearing something bad happened to someone else that you had nothing to do with "i'm sorry" means you care and means a lot to the receiver. Doing something you think is correct but adversely affects the other person, for example, a doctor taking blood or giving a shot that hurts might say "i'm sorry but this will hurt". In other words, i do not regret the action, but i feel bad that it will hurt you.

Remorsefulness is expected when people have their values slighted. A convict may be given a more lenient sentence if he shows remorse, a child may be forgiven if he really does feel bad that he broke the friend's toy, a relationship can be salvaged this way as well. Remorsefulness is the hardest of the bunch because the person must humble himself, a quality not often found in society.

The method of remorse is really based on the relationship the two parties have. The idea is not the words but the conveyance of actual humility. As this is based on many factors including the people involved, the amount of time taken between the offensive action and the expression of remorse, and the gravity of the offense, no real guidelines can be explained. Some can be via email, some cannot, though perhaps it can be a first step.

User Journal

Journal Journal: Looking for Galen's De Temperamentis in English (2)

Moving slowly along in trying to read Galen's De temperamentis in English, i came across Distributed Proofreaders which aims to proofread texts for Project Gutenberg. They have groups of people, some willing to type in projects before the proofread, though those projects are slow and not always accepted.

I was pointed to a page on proofing old texts which addresses some of the issues i thought were typographical errors. There are still those, but knowing the conventions of the time helps quite a bit.

The Kickstarter ideas seems to be a no go, though it seems is doable on Amazon's Mechanical Turk (sandboxed job). There is difficulty in the conventions used, and that many are not too acquainted with Latin. Typing it in as is seems okay, except the accented letters which are not on everyone keyboard. The Mac makes it easier with Characters (cmd-ctrl-space) which allows to save favorites and is easy to work with, but still it would encumber a fast typist. Learning the rules seems complicated and hard to check if done correctly, but perhaps using the base letter (English alphabet) plus a semicolon would work, much like the "q;" as a "que mark".

I was about ready to go there when i was pointed to the Distributed Proofreads possibility, which is where i am stalled. If that doesn't work out it is possible i may yet turn back to Amazon Turk.

Slashdot Top Deals

Even bytes get lonely for a little bit.

Working...