Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for countBits (0.15 sec)

  1. pkg/registry/core/service/allocator/utils.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package allocator
    
    import (
    	"math/big"
    	"math/bits"
    )
    
    // countBits returns the number of set bits in n
    func countBits(n *big.Int) int {
    	var count int = 0
    	for _, w := range n.Bits() {
    		count += bits.OnesCount64(uint64(w))
    	}
    	return count
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 01 15:09:56 UTC 2021
    - 816 bytes
    - Viewed (0)
  2. pkg/registry/core/service/allocator/utils_test.go

    		n        *big.Int
    		expected int
    	}{
    		{n: big.NewInt(int64(0)), expected: 0},
    		{n: big.NewInt(int64(0xffffffffff)), expected: 40},
    		{n: bigN, expected: 1},
    	}
    	for _, test := range tests {
    		actual := countBits(test.n)
    		if test.expected != actual {
    			t.Errorf("%s should have %d bits but recorded as %d", test.n, test.expected, actual)
    		}
    	}
    }
    
    func BenchmarkCountBits(b *testing.B) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 01 15:08:36 UTC 2021
    - 1.5K bytes
    - Viewed (0)
  3. src/internal/fuzz/coverage.go

    // also set in base.
    func hasCoverageBit(base, snapshot []byte) bool {
    	for i := range snapshot {
    		if snapshot[i]&base[i] != 0 {
    			return true
    		}
    	}
    	return false
    }
    
    func countBits(cov []byte) int {
    	n := 0
    	for _, c := range cov {
    		n += bits.OnesCount8(c)
    	}
    	return n
    }
    
    var (
    	coverageEnabled  = len(coverage()) > 0
    	coverageSnapshot = make([]byte, len(coverage()))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  4. pkg/registry/core/service/allocator/bitmap.go

    	r.lock.Lock()
    	defer r.lock.Unlock()
    
    	if r.rangeSpec != rangeSpec {
    		return errors.New("the provided range does not match the current range")
    	}
    
    	r.allocated = big.NewInt(0).SetBytes(data)
    	r.count = countBits(r.allocated)
    
    	return nil
    }
    
    // Destroy cleans up everything on shutdown.
    func (r *AllocationBitmap) Destroy() {
    }
    
    // randomScanStrategy chooses a random address from the provided big.Int, and then
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  5. src/internal/fuzz/fuzz.go

    								result.entry.Path,
    								result.entry.Parent,
    								result.entry.Generation,
    								countBits(keepCoverage),
    								countBits(c.coverageMask),
    								inputSize,
    								result.entryDuration,
    							)
    						}
    					}
    				} else {
    					if shouldPrintDebugInfo() {
    						c.debugLogf(
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  6. src/main/webapp/js/admin/plugins/form-validator/location.js

    module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("location"),a.formUtils.addValidator({name:"country",validatorFunction:function(b){return a.inArray(b.toLowerCase(),this.countries)>-1},countries:["afghanistan","albania","algeria","american samoa","andorra","angola","anguilla","antarctica","antigua and barbuda","argentina","armenia","aruba","australia","austria","azerbaijan","bahamas","bahrain","bangladesh","barbados","belarus","...
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Mon Jan 01 05:12:47 UTC 2018
    - 5.2K bytes
    - Viewed (0)
  7. src/main/webapp/js/admin/plugins/form-validator/sweden.js

    m%10===0},errorMessage:"",errorMessageKey:"badSecurityNumber"}),a.formUtils.addValidator({name:"swecounty",validatorFunction:function(b){return b=b.toLowerCase(),a.inArray(b,this.counties)!==-1||"län"!==b.substr(-3).toLocaleLowerCase()&&a.inArray(b+"s län",this.counties)>-1},errorMessage:"",errorMessageKey:"badCustomVal",counties:["stockholms län","uppsala län","södermanlands län","östergötlands län","jönköpings län","kronobergs län","kalmar län","gotlands län","blekinge län","skåne län","hallands län","västra...
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Mon Jan 01 05:12:47 UTC 2018
    - 6.4K bytes
    - Viewed (0)
  8. tests/error_translator_test.go

    		return
    	}
    
    	DB.Migrator().DropTable(&City{}, &Museum{})
    
    	if err = db.AutoMigrate(&City{}, &Museum{}); err != nil {
    		t.Fatalf("failed to migrate countries & cities tables, got error: %v", err)
    	}
    
    	city := City{Name: "Amsterdam"}
    
    	err = db.Create(&city).Error
    	if err != nil {
    		t.Fatalf("failed to create city: %v", err)
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jul 12 13:21:22 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  9. LICENSE

      12. If the distribution and/or use of the Library is restricted in
    certain countries either by patents or by copyrighted interfaces, the
    original copyright holder who places the Library under this License may add
    an explicit geographical distribution limitation excluding those countries,
    so that distribution is permitted only in or among countries not thus
    excluded.  In such case, this License incorporates the limitation as if
    Registered: Wed Jun 12 15:45:55 UTC 2024
    - Last Modified: Mon Jan 18 20:25:38 UTC 2016
    - 25.8K bytes
    - Viewed (0)
  10. apache-maven/src/main/appended-resources/licenses/CDDL+GPLv2-with-classpath-exception.txt

    8. If the distribution and/or use of the Program is restricted in
    certain countries either by patents or by copyrighted interfaces, the
    original copyright holder who places the Program under this License may
    add an explicit geographical distribution limitation excluding those
    countries, so that distribution is permitted only in or among countries
    not thus excluded. In such case, this License incorporates the
    Registered: Wed Jun 12 09:55:16 UTC 2024
    - Last Modified: Fri May 17 19:14:22 UTC 2024
    - 38.5K bytes
    - Viewed (0)
Back to top