Making complex boolean circuits that give true as output only for a specific combination of boolean inputs

This is my first question on a stack exchange website so please bear with me. I am making challenges for a jeopardy style capture the flag event in my college and I had come across the minetest challenge in the hardware section of google CTF qualifier conducted last year. A clean and organized solution to this problem has been provided by liveoverflow.

I would like to design a simpler version of this problem for my college’s CTF event but I am unable to design a complex circuit that gives true output only for a specific combination of inputs. I know that a circuit with this functionality is not very difficult to implement and just needs to represent the following logic:

trueinput1 AND trueinput2 AND ... NOT falseinput1 AND NOT falseinput2 ...  

However I want it to be vast and complicated so that participants cannot decode its functionality just by doing a visual analysis. Is there any technique to complicate the boolean logic above and to design a corresponding circuit that looks ugly even for a small number of inputs(32/64).

wordpress output numbers from an array of checkboxes

I’m not a php expert at all, but I’ve just started to learn it. I’m using a function on wordpress which creates a xml file after pressing send button on a contact form (with contact form 7). That’s my code for the moment:

add_action( 'wpcf7_before_send_mail', 'CF7_pre_send' );  function CF7_pre_send($  cf7) {     $  output = "";     $  output .= "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";     $  output .= "<cf>" . $  _POST['codicefiscale'] . "</cf>";     $  output .= "<cognome>" . $  _POST['cognome'] . "</cognome>";      .......      $  output .= "<aree_tematiche>";     $  output .= "<area><macroarea>1</macroarea><subarea>" . implode(', ', $  _POST['area1']) . </subarea></area>";       $  output .= "</aree_tematiche>";     .......     file_put_contents("wp-content/uploads/cf7outputtest.xml", $  output); } 

Which is a really simple code. I’d like that if the user selects on the frontend a checkbox, his selection is displayed as a number and not with the entire string (as I’m doing now with the implode function). Furthermore if the user selects 2 checkboxes, I’d like that in the xml file the text is displayed as a loop like that, assuming that he has selected for instance checkbox 3 and 5:

<aree_tematiche>             begin of the loop  <area>                       first element of the loop, which shows checkbox n. 3 <macroarea></macroarea> <subarea>3</subarea>          </area>  <area>                       first element of the loop, which shows checkbox n. 5 <macroarea></macroarea> <subarea>5</subarea>          </area>  </aree_tematiche>            end of the loop 

So basically I want that based on my selection is displayed the selection integer number and not the string! Thanks, Luca

Halting problem – What if the halting algorithm gave more than one output?

Sorry I don’t know how silly a question this might be, but i’ve been reading up on the halting problem lately, and understand the halting problem cannot possibly output a value that is “correct” when fed a machine that does the opposite of itself. This therefore proves the halting problem cannot be solved by contradiction.

What if you were to give the halting algorithm 3 possible outputs, something like:

  • Yes
  • No
  • Non-deterministic (for paradox’s like this one)

You could argue then that for a non-deterministic output it would then do something entirely different, but this would be okay because it is still non-deterministic behavior. For a simple algorithm input, such as a while True: pass it would be incorrect to output non-determinism, since it will always be No.

I was wondering if this would change its solve-ability, or would it still be un-solvable?

Thanks for any responses

Creating Loss Ports For Multiple Output Neural Net

I am making a multi-classfication neural net for a set of data. I have created the net but i think i need to specify a loss port at for each classification

Here are the labels for the classification and the encoder & decoders.

labels = {"Dark Colour", "Light Colour", "Mixture"} sublabels = {"Blue", "Yellow", "Mauve"} labeldec = NetDecoder[{"Class", labels}]; sublabdec = NetDecoder[{"Class", sublabels}]; bothdec = NetDecoder[{"Class", Flatten@{labels, sublabels}}]  enc = NetEncoder[{"Class", {"Dark Colour", "Light Colour", "Mixture",      "Blue", "Yellow", "Mauve"}}] 

Here is the Net

SNNnet[inputno_, outputno_, dropoutrate_, nlayers_, class_: True] :=   Module[{nhidden, linin, linout, bias},   nhidden = Flatten[{Table[{(nlayers*100) - i},       {i, 0, (nlayers*100), 100}]}];   linin = Flatten[{inputno, nhidden[[;; -2]]}];   linout = Flatten[{nhidden[[1 ;; -2]], outputno}];   NetChain[    Join[     Table[      NetChain[       {BatchNormalizationLayer[],        LinearLayer[linout[[i]], "Input" -> linin[[i]]],        ElementwiseLayer["SELU"],        DropoutLayer[dropoutrate]}],      {i, Length[nhidden] - 1}],     {LinearLayer[outputno],      If[class, SoftmaxLayer[],       Nothing]}]]]  net = NetInitialize@SNNnet[4, 6, 0.01, 8, True];  

Here are the nodes that are used for the Netgraph function

nodes = Association["net" -> net, "l1" -> LinearLayer[3],     "sm1" -> SoftmaxLayer[], "l2" -> LinearLayer[3],     "sm2" -> SoftmaxLayer[],    "myloss1" -> CrossEntropyLossLayer["Index", "Target" -> enc],    "myloss2" -> CrossEntropyLossLayer["Index", "Target" -> enc]]; 

Here is what i want the NetGraph to do

connectivity = {NetPort["Data"] ->      "net" -> "l1" -> "sm1" -> NetPort["Label"],    "sm1" -> NetPort["myloss1", "Input"],    NetPort[sublabels] -> NetPort["myloss1", "Target"],     "myloss1" -> NetPort["Loss1"],    "net" -> "l2" -> "sm2" -> NetPort["Sublabel"],    "myloss2" -> NetPort["Loss2"],    "sm2" -> NetPort["myloss2", "Input"],    NetPort[labels] -> NetPort["myloss2", "Target"]}; 

The data will diverge at “net” for each classifcation and pass through the subsequent linear and softmax layer and to the relevant NetPort The problem im having is at loss port which diverges at each softmax layer.

When i run this code

NetGraph[nodes, connectivity, "Label" -> labeldec,   "Sublabel" -> sublabdec] 

I recieve the error message: NetGraph::invedgesrc: NetPort[{Blue,Yellow,Mauve}] is not a valid source for NetPort[{myloss1,Target}].

Could anyone tell me why this occurring?

Thanks for reading.

nmap script “smb-os-discovery.nse” does not output information about the host OS?

I was following this Lynda course.

The instructor used this script to detect the OS of the target system.

nmap --script /usr/share/nmap/scripts/smb-os-discovery.nse 

I have a OWASP box vm and Kali Linux running in a host only network in VirtualBox. is the IP of OWASP. I’m running the above command from the Kali linux.

The output is

Starting Nmap 7.70 ( ) at 2020-04-21 01:00 CDT mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers Nmap scan report for Host is up (0.00045s latency). Not shown: 991 closed ports PORT     STATE SERVICE 22/tcp   open  ssh 80/tcp   open  http 139/tcp  open  netbios-ssn 143/tcp  open  imap 443/tcp  open  https 445/tcp  open  microsoft-ds 5001/tcp open  commplex-link 8080/tcp open  http-proxy 8081/tcp open  blackice-icecap MAC Address: 08:00:27:FE:F6:AC (Oracle VirtualBox virtual NIC) 

A port scan is done but the OS detection part in the script is not performed.

For example this is the output shown in the tutorial

enter image description here