What Are the Ideas Behind Variations of the Coin Change Problem?


Problem: given a set of n coins of unique face values, and a value change, find number of ways of making change for change.

Assuming we can use a denomination more than once, here’s the pseudocode I came up with

1. NUM-WAYS(denom[], n, change) 2.   dp = [change + 1][n + 1] 3.   for i = 0 to n 4      dp[i][0] = 1 5.   xs = denom.sorted  6.   for i = 1 to change 7.     for j = 1 to n 8.       if xs[j - 1] > i 9.         dp[i][j] = dp[i][j - 1] 10.      else 11.        dp[i - xs[j - 1]][j] + dp[i][j - 1]  12.  return dp[change][n] 

The above algorithm is clear to me. However, if we are only allowed to use a denomination once, then line 11 changes to dp[i - xs[j - 1]][j - 1] + dp[i][j - 1], as if we are not allowed to use the current denomination at all. I’m failing to wrap my head around this. Can you explain this?

Here’re some test runs:

Change: 3, denominations: [8, 3, 1, 2] 11111 01111 01222 01233  // use once Change: 3, denominations: [8, 3, 1, 2] 11111 01111 00111 00122  Change: 4, denominations: [3, 1, 2] 1111 0111 0122 0123 0134  // use once Change: 4, denominations: [3, 1, 2] 1111 0111 0011 0012 0001 

Need some ideas to achieve data marketplace through hyperledger

I am trying to create a data marketplace where a party can transact with other parties, agree on the set of terms and sell data from one to another.

Here data security is of utmost concern. A party makes data available on the hyperledger, this data should be secured and no one should get hold of it. If an interested party wants this data, they have to transact with data owner party and agree on the set of terms. Only then the interested party will get the data. And now only two parties should have hold of this data. Everyone else should not get hold of it.

I would like to know what components of hyperledger can be used here. I have an idea of private data concept in hyperledger, but not sure how and where it would fit.

Would love to hear some comments from experts regarding this.

I’m looking for ideas and suggestions for an ideal to create programming company?

I’m looking for ideas and suggestions for an ideal to create programming company?

How to treat the programmer to make him/her comfortable in the company?

Salary, commission, bonus etc ..

I would like to know similar models in the leading Western and whole world companies and how they done it?

Please leave any ideas and suggestions 🙂

Best regards

Wadani

Linux bridge broken after upgrade, out of ideas / places to look (now 4.20.0-arch1-1-ARCH) (also using LXC 3.1.0)

The Question: What else should I check to try and isolate and fix this so that bridged networking to LXC ‘vm’s work again?

For debugging this problem, I’ve disabled normal LXC container startup. Instead I’m running them manually with additional logging.

lxc-start –logfile=/var/log/lxc/debug.$ (date +%Y%m%d-%H%M%S).log –logpriority=DEBUG -F -n containername

LAN hosts can ping/talk to HOST HOST can ping/talk to LAN hosts

Two different traces

On the bridge: as expected

tcpdump -pi bridge port 67 or port 68 or icmp[icmptype] == icmp-echo or icmp[icmptype] == icmp-echoreply  (time) IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from (mac) (oui Unknown)... 

Yet it doesn’t get relayed/forwarded to the physical network device:

tcpdump -i bridge_IF  port 67 or port 68 or icmp[icmptype] == icmp-echo or icmp[icmptype] == icmp-echoreply (no dhcp packets) 

The bridge looks correct

# brctl show bridge name     bridge id               STP enabled     interfaces br0             8000.bridgemac          no              enpNs0                                                         enpNs0                                                         vethXXXXXX 

Everything looks mostly as expected there.

(provided by iptables-nft) ebtables -L Bridge table: filter  Bridge chain: INPUT, entries: 0, policy: ACCEPT  Bridge chain: FORWARD, entries: 0, policy: ACCEPT  Bridge chain: OUTPUT, entries: 0, policy: ACCEPT  nft list ruleset table bridge filter {         chain INPUT {                 type filter hook input priority -200; policy accept;         }          chain FORWARD {                 type filter hook forward priority -200; policy accept;         }          chain OUTPUT {                 type filter hook output priority -200; policy accept;         } } table ip filter {         chain INPUT {                 type filter hook input priority 0; policy accept;         }          chain FORWARD {                 type filter hook forward priority 0; policy accept;         }          chain OUTPUT {                 type filter hook output priority 0; policy accept;         } } 

Also sysctl and module config items.

# cat /etc/sysctl.d/* net.bridge.bridge-nf-call-iptables=0 kernel.unprivileged_userns_clone=1  # lsmod | grep table nf_tables             147456  2 nft_reject_ipv6,nft_reject nfnetlink              16384  1 nf_tables x_tables               49152  1 ip6t_REJECT  # cat /etc/modprobe.d/* blacklist ip_tables blacklist iptable_filter blacklist iptable_nat blacklist ip6_tables blacklist ip6table_filter blacklist x_tables install br_netfilter 

So far everything looks like it should work, but it isn’t.

(container) # ip addr add x.x.x.x/y dev z (container) # ping VMHOST Works, ping reply. (container) # ping ROUTER-GW Nope, Destination Host Unreachable 

HOWEVER, now something really unexpected happens (rather, doesn’t happen).

(VHMOST) # ping ROUTER-GW Nope, Destination Host Unreachable Also, the connection to the VMHOST (often) times out at this point. 

This last twist seems to point towards an issue in something that I haven’t checked so far, I’m not sure if anything in the Linux namespaces relates to this problem.

Looking at the LXC logs don’t offer anything obvious, but I copied everything that I though MIGHT have been related. Nothing actually says it, but I do wonder if the namespaces got messed up somehow.

lxc-start VM TIMESTAMP.390 DEBUG    network - network.c:setup_hw_addr:2767 - Mac address "REDACTED" on "eth0" has been setup lxc-start VM TIMESTAMP.393 INFO     conf - conf.c:mount_entry:2039 - No such file or directory - Failed to mount "/sys/fs/fuse/connections" on "/usr/lib/lxc/rootfs/sys/fs/fuse/connections" (optional) lxc-start VM TIMESTAMP.510 INFO     utils - utils.c:lxc_mount_proc_if_needed:1239 - I am 1, /proc/self points to "1" lxc-start VM TIMESTAMP.536 WARN     conf - conf.c:lxc_setup_devpts:1641 - Invalid argument - Failed to unmount old devpts instance lxc-start VM TIMESTAMP.536 DEBUG    conf - conf.c:lxc_setup_devpts:1678 - Mount new devpts instance with options "gid=5,newinstance,ptmxmode=0666,mode=0620,max=1024" lxc-start VM TIMESTAMP.537 INFO     conf - conf.c:setup_personality:1741 - Set personality to "0x0" lxc-start VM TIMESTAMP.537 DEBUG    conf - conf.c:setup_caps:2550 - Dropped mac_admin (33) capability lxc-start VM TIMESTAMP.537 DEBUG    conf - conf.c:setup_caps:2550 - Dropped mac_override (32) capability lxc-start VM TIMESTAMP.537 NOTICE   conf - conf.c:lxc_setup:3745 - The container "VM" is set up  Linux salt 4.20.0-arch1-1-ARCH #1 SMP PREEMPT Mon Dec 24 03:00:40 UTC 2018 x86_64 GNU/Linux # pacman -Qs lxc local/lxc 1:3.1.0-1 

High School Mathematical Research Project Ideas

i am currently looking out for some possible topics i could study for my research project in high school. Algebra, trigonometry, Pythagoras’ theorem, geometry, circles and their properties, etc. and perhaps combined with a little knowledge from Physics i.e. Kinematics, Gravity, etc. could interest me.

Another particularly interesting one i stumbled upon was the Rubik’s cube since i myself do enjoy solving it. I am not very sure what type of research topics i could come up with that could be geared towards and tied with the math behind solving Rubik’s cube? Any suggestions or advices are greatly appreciated 🙂

Best website money making ideas for $2000?

Here's the situation. I've been given a bit of money from my mother $ 2000, to create a website(s) to generate a bit of income. She also gave me the money because she knows I've had a number of website ideas over the years, but hadn't had the funds to get them going, so she wants to help with that as well.

My initial idea was to setup a website which I've wanted to do for years which is a digital games store similar to indiegamestand.com but after looking into the development costs it seems…

Best website money making ideas for $ 2000?

Creating a list of website ideas

I am doing a research on website ideas. I have come up with Four main types of websites, and correct me if I'm wrong:

  • Blogs
  • Forums
  • Web Applications
  • eCommerce

If you have any other types please share.

For blogs, I am gonna come up with main and sub niches.
For forums, I am only gonna come up with main niches.
For web applications, I am only gonna describe the business model.
For eCommerce, I am gonna suggest some niches also.

Please suggest to me…

Creating a list of website ideas

ideas and code resources on user assistance/help documentation needed (like apple.com)

For my site, I’d like to implement a stylish and fancy (ideally responsive) user assistance/help documentation. I just stumbled over Apple’s website where they provide an overview on Mac Basics: https://help.apple.com/macOS/mojave/mac-basics. This is exactly what I’m looking for. Very stylish, neat and clean. The thing is I like the way the represent information: quick info on the left, visual content on the right. If you want more detailed information, you can go to a link. The step-by-step walk through the new features is fantastic. Long story short: do you have other ideas on how to best represent such user help? And more importantly: do you know (free) repositories where I can find templates etc. to get started quickly. Thx