Questions About 11011

How to find the number of binary numbers with the following constraints:

Given a binary digit count of n, and a maximum consecutive occurrence count of m, find the number of different possible binary numbers. Also, the leftmost and rightmost bit must be 1.

For example n = 5, and m = 3.

The count is 7: 10001 10011 10101 10111 11001 11011 11101

Notice we excluded 11111 because too many consecutive 1's exist in it.

This was an interview question I had recently, and It has been bothering me. I don't want to brute force check each number for legitimacy because m can be > 32.

Ignoring the first bit using bitwise compare with permission model

I have the bits 101 and 110. I want to compare using some bitwise operator ignoring the first bit like 01 and 10.


I have:
01 & 10 <- How I want to consider
x00 <- The result I want


0110 & 1011 <- How I want to consider
x0010 <- The result I want

How could I achieve this using bitwise operators in java?


  • The first bit will always be 1.
  • The other bits are variable. Both sides of the comparison will have the same number of bits.
  • I want to detect just how to make the comparison considering the other bits and ignoring the first.

Use case:

  • I have 2 permission values. The first is 5/101 (The permission required) and the second is 6/110 (The permission the user has).
  • Excluding the first block, which will always be 1, I want to compare the third block that represents a ce

How do you get people to look at a network marketing opportunity.?

I have joined a new network marketing company but after getting 4 people in I'm out of people i know well to talk to I was wondering how to reach out to more people. I have a web site for people to look at and I understand the business and really do love the products they sell if anyone can help pleases do. I would really like to know how to reach people on the net.

FreeBSD Jail with Loopback IP, IPFW, and natd - Outbound connections fail from jail

I've got a FreeBSD 9.0 server. It has several jails, but they all have this same issue. They can not initiate connections to the outside world. They communicate with each other and the host fine.

relevant rc.conf settings:

firewall_enable="YES"                   # IPFW
firewall_type="/etc/ipfw.rules"         # Rule script for IPFW

natd_enable="YES"                       # NAT for Internet Routing
natd_interface="wan0"                   # NAT Card
natd_flags="-f /etc/natd.conf -dynamic" # NAT Conf



From sysctl.conf


From ipfw.rules

# XXX 00050 divert natd ip4 from any to any via wan0
add 00060 check-state

# Allow me out
add 00135

In python, what is more efficient? Modifying lists or strings?

Regardless of ease of use, which is more computationally efficient? Constantly slicing lists and appending to them? Or taking substrings and doing the same?

As an example, let's say I have two binary strings "11011" and "01001". If I represent these as lists, I'll be choosing a random "slice" point. Let's say I get 3. I'll Take the first 3 characters of the first string and the remaining characters of the second string (so I'd have to slice both) and create a new string out of it.

Would this be more efficiently done by cutting the substrings or by representing it as a list ( [1, 1, 0, 1, 1] ) rather than a string?

Canshaft/Head Max lift with roller rockers?

So I am a little confused about something. when I am window shopping on places like and am looking at heads and camshafts they will say what the max lift is. For example, when looking at a camshaft it will say it has a max lift of .510 and the heads will have a max lift of .600. Now are the heads max lift with roller rockers at 1.5, 1.6, 1.7. are 1.5 roller rockers considered stock. When I look at heads they never include the roller rockers. Do you even need roller rockers on heads when building an engine. Can somebody please explain this to me. Thanks john. So I might be building a blown 496 later this year if the money comes up and I am wondering if these heads would work with this camshaft and 1.7 roller rockers. I have been told 1.7 is pretty much stock for big block chevys.