Where exactly is the “off-by-one” difficulty bug?


I read through How is difficulty calculated? and want to understand where the "off-by-one" bug is in calculating difficulty. Here is a Matlab snipet I wrote to calculate difficulty. What are the correct block step intervals that I should use? Note: minv and maxv are the block heights (plus 1) of the interval. Thus, time stamps from block heights 0 and 2015 are used in the first difficulty calculation.

% Calculate difficulty num = floor(length(block_chain)/2016); minv = 1; maxv = 2016; target = 1209600; difficulty = ones(num,4); delta = zeros(num,1); timedif = delta; for i = 1:num if i == 1 difficulty(1,3) = 1; timedif(i) = block_chain(maxv,2) - block_chain(minv,2); else timedif(i) = block_chain(maxv,2) - block_chain(minv,2); delta(i) = max(0.25,min(target/timedif(i),4)); difficulty(i,3) = max(1,difficulty(i-1,3)*delta(i)); end difficulty(i,:) = [block_chain(minv,1), block_chain(maxv,1),... difficulty(i,3), timedif(i)]; minv = maxv + 1; maxv =...
0 0
The most difficult class of bug I've had to fix is a non-fatal Heisenbug.

Heisenbugs are bugs that vanish when you go looking for them. Because debug flags add padding, bugs that are caused by very specific buffer overflows (typically, but not always, off-by-one errors) where any attempt to add symbols or modify the code (such as to print values) that results in a slightly different alignment or a spare byte becoming available can cause the bug to apparently vanish.

Non-fatal bugs are equally horrific. There are a few different varieties, but the two painful ones are those that show no visible symptoms at the time but which results in some transaction (possibly including where the bug is) corrupting completely unrelated data, and those where the data is correct when examined incorrectly but incorrect when examined correctly.

The first sort of non-fatal bug arises when two blocks of memory overlap. By setting one, the other (sometimes) changes. The second is often a...

0 0

Can anyone tell me the EXACT location of Fang's taming pole? I can't seem to find it. I'm in Oerba and I've been everywhere except for the yellow event marker on the map that is within a house/after a save point, which I assume is the trigger to end the chapter since it's a dead end.

I know it's in Oerba but looking at guides and other threads about it has me running in circles.

You know what they say about 'assume'...

A Vetala is guarding it halfway across the rusty bridge.

its right before the boss of chapter 9

It IS at that place. There's a floating treasure ball on the bridge right before you reach the event marker.

Actually that yellow marker leads you to a stairs which is within the house, which leads up to a long pathway. The path leads to the end boss of the chapter, but along the way there is a treasure box which has the taming pole.

Well I do believe you're in the wrong area first of all :P

It is in "Oerba" but not...

0 0

Yesterday afternoon, I was peacefully coding some stuff you know but I couldn’t make my code working. As usual, in those type of situations you fire up your debugger in order to understand what is going on under the hood. That was a bit weird, to give you a bit of context I was doing some inline x86 assembly, and I’ve put on purpose an int3 just before the piece of assembly code I thought was buggy. Once my file loaded in OllyDbg2, I hit F9 in order to reach quickly the int3 I’ve slipped into the inline assembly code. A bit of single-stepping, and BOOM I got a nasty crash. It happens sometimes, and that’s uncool. Then, I relaunch my binary and try to reproduce the bug: same actions and BOOM again. OK, this time it’s cool, I got a reproducible crash in OllyDbg2.

I like when things like that happens to me (remember the crashes I’ve found in OllyDbg/IDA here: PDB Ain’t PDD), it’s always a nice exercise for me where I’ve to:

pinpoint the bug in the application: usually not...
0 0

I filed a bug report about this exact issue yesterday. Everything you

are describing aligns 100% with what I'm experiencing too. I can use

the exact same smb.conf with 3.0.24 and it works fine. The bug report

is at


(down for

maintenance as I type this).

Jeremy Allison requested that I generate some level 10 debug logs which
I have done, just waiting for bugzilla to come back online so I can
submit my logs.

Please keep an eye on the bug report and add anything you feel might be

Tom Schaefer

-----Original Message-----
From: samba-bounces+tom=[hidden email]
[mailto:samba-bounces+tom=[hidden email]] On Behalf Of David
F. Severski
Sent: Friday, June 01, 2007 10:51 AM
To: [hidden email]
Subject: [Samba] Difficulty w/Offline Files and Samba 3.0.25

Good morning,

I have a working Offline...

0 0

Sand flies, sweat bees, eighty-metre high trees...Hell for most of us, yes, but all in a day's work for Charlotte Uhlenbroek. She moves as elegantly through the lounge of London's Savoy hotel as she does through the Amazon jungle. But while she loves the adventure, she is also glad to be back in "civilisation"; at least for the moment.
She's just finished filming a TV series called "Jungle" - a gruelling nineteen-week job that involved her exploring the dense jungles of the Congo, the Amazon and Borneo. She says that it was fascinating but daunting as well. So what was her most challenging experience? "Definitely climbing an eighty-metre high tree in Borneo, when I'm petrified of heights! I had to keep going up and up, when a voice inside me was saying, "Down! Down!!" I kept thinking the ropes were going to break and send me plummeting down below."
And "down below" was where the bugs were - clinging, stinging, sucking beasts. Apart from the usual mosquitoes, in the Amazon...

0 0

Often when trying to solve a problem involving Binary Search or 2-Pointer Technique, I make off by one errors, and/or fail to handle edge cases. Even if I know that my solution might fail on a particular edge case, to correct it takes a lot of time. I would like to know a method/implementation, such that I can code up the solutions without having to worry about edge cases, etc. For Binary Search, I know of one such method where to avoid infinite loop, we can use the following code: Say we want to find the maximum index in an array which satisfies certain property -->

while(hi-lo>1) { int mid=(lo+hi)/2; int chk=check(mid); if(chk==1) lo=mid; else hi=mid-1; } int ans; if(check(hi)==1) ans=hi; else ans=lo;

If any better approach is available(for Binary Search), you are welcome to comment. Also, can you give a good implementation for 2 — Pointer Technique.

Thanks in...

0 0

The attack allows a group of miners with more than 50% of the network's computational power to change difficulty arbitrarily.

When difficulty is adjusted, only the times of the first and last blocks in a retarget period (i.e., the first and last blocks with a certain difficulty) are considered. This attack works by manipulating the timestamp of one of these two blocks.

Blocks are considered valid if their time is greater than the median of the last 11 blocks and less than currentTime + 2 hours, so it's legal for an attacker to create a new version of an old block with a time far in the future. If this is the first block in a retarget period, then the difficulty will quadruple after that period. If it's the last block, then the difficulty will be divided by four. (Difficulty adjustments are limited to *4 or /4.)

Note that it is not possible to do these major changes with recent blocks because the time would be more than two hours in the future. It needs to be...

0 0
0 0

This portal leads to a mysterious destination. Many adventurers have entered, few have left.

— In-game description

Fractals of the Mists is a special type of dungeon that consists of an array of mini-dungeons called fractals, where each fractal has its own story and environment. Characters are adjusted to level 80 within the dungeon. The dungeon is one of the primary sources of ascended equipment and provides materials for crafting infused equipment and attuned equipment.

The dungeon has some unique mechanics and design. The party can choose the difficulty scale prior to entering the dungeon or from within the observatory. This difficulty scale starts at 1 and can be increased. The personal reward level tracks the current position of the account on the difficulty scale. You can use any character to progress the personal reward level, as it has been made account-wide on the fractured release (november 13th 2013). To increase the personal reward level,...

0 0
0 0

It’s not just reality TV fodder: Hoarding is real-life drama that takes a heavy toll on people and their homes. According to the American Psychiatric Association, an estimated 2 to 5 percent of the population suffers from hoarding disorder. These individuals have difficulty parting with possessions and “stuff” of all kinds. The resultant clutter becomes disruptive to everyday living and creates ideal conditions for pest infestations.

Chris Crone of CNJ Pest Management in New York City, who finds hoarding mostly in multi-family buildings, describes a typical scenario: “One of the apartments we’ve treated is a unit occupied by an elderly gentleman with limited mobility who has been living in his apartment, and accumulating junk, for 40 years. He was staying in the living room because he had basically walled himself off from other areas of the unit with stack upon stack of books, papers and other clutter.”

Travis Morton of Morton’s Pest Control in Huntsville, Ala., finds...

0 0

Yes, the fancy new HTC One M8 is out now, but the HTC One isn’t going anywhere fast. You can check out our HTC One review for the full story, but every smartphone has its flaws. In this article, we’ll round up the most commonly reported HTC One problems and try to offer up some solutions for anyone suffering from this beautiful phone’s known issues.

Updated on 07-18-2014 by Simon Hill: Added no sound through headphones problem, random reboots, and the won’t turn on problem.

Related: HTC One review, our favorite HTC One cases, helpful HTC One tips and tricks.

Click on an issue to jump to it:


Problem: No sound through headphones

Quite a few people seem to have run into a problem with the earphones or headphones not working with their HTC One. They plug in as usual, but no sound will come through them. The sound through the speaker remains unaffected. First of all you should try the headphones in a different device to make sure they...

0 0

The HTC One (M8) is a fantastic smartphone, showcasing HTC’s continued commitment to build quality and design, along with a much improved software experience that packs its fair share of useful features. With top of the line specifications and a lighter Sense UI, performance on this device is absolutely amazing. However, like any other smartphone, this device is not without its issues. Today, we’ll be addressing some of the most common problems that users face with the HTC One (M8), and offer potential solutions on how to fix them.

Disclaimer: The HTC One (M8) is a great smartphone and chances are that you will not experience any of the problems listed below.

Problem #1 – Cannot read SIM card

Users have found their phone occasionally struggling to detect the SIM card. This error can arise randomly with no discernible pattern.

Potential Solutions:

Take the SIM card from the tray, re-adjust it to make sure that it placed properly, and place...
0 0