I want to know where there is the flaw in my argument

I came across following problem to finding whether the following language is decidable or semi-decidable or not even a semi-decidable.

$ L: \{\langle M\rangle: M\space is\space a\space TM\space and\space |L(M)| \ge3\}$

Now thinking intuitively I conjectured that this language is semi-decidable. We can say yes when the input does belong to $ L$ . But, we can not say no when the input does not belong to $ L$ .

Now, I formulated following reduction from complement of halting problem $ \overline{HP}$ which is not semi-decidable (non $ RE$ ).

$ \overline{HP}: \{\langle M, w\rangle : M\space is\space TM\space and\space it\space does\space not\space halt\space on\space string\space w.\}$

$ \tau(\langle M,x\rangle) = \langle M’\rangle$ .

$ M’$ on input $ w$ works as follows. It erases w, puts $ M$ and $ x$ on its tape, and runs $ M$ on $ x$ and accepts if $ M$ doesn’t halt on x. Otherwise it rejects.

Proof of validity of reduction:

$ \langle M,x\rangle \in \overline{HP} \implies M\space does\space not\space halt\space on\space x \implies M’\space accepts\space all\space inputs\space \implies|L(M’)| \ge 3\implies M’ \in L$

$ \langle M,x\rangle \notin \overline{HP} \implies M\space does\space halt\space on\space x \implies M’\space rejects\space all\space inputs\space \implies|L(M’)| < 3\implies M’ \notin L$

According to above reduction $ \overline{HP}$ should be recursively enumerable$ (RE)$ which it is not. So, $ L$ should not be $ RE$ but it indeed is $ RE$ . So, my reduction must be flawed.

Please point out where I messed up.

Language independent protocols describing argument passing and parsing?


I wrote a powershell installation script that passes a line of arguments to a .jar file through the command line. It comes down to:

  1. Converting an object into a list of strings
  2. Concatenating them into a single single string:
  3. Executing the `java -jar .jar
  4. Parsing the back into an object inside Java.

Several design choices I face are:

  • When I update the list of features, I will have changed the number of options the java parser should convert into the features property of the installation object. It might be wise to pass an explicit argument that contains the number of features, so that, in the future the script will immediately throw an error, if for some reason I/someone has forgotten to update the number of features that the argument parser should facilitate.
  • It feels like a work around of implementing a proper integration. It might be better to store the object as a temporary configurations.txt file that is read explicitly by the custom java parser.
  • Do I prepend every argument value with an -<argument name> or just hardCode the argument order into the argument order in both in the .ps1 script, as well as in the .jar script.

Since this is such a wide range of questions, I was wondering whether:


What are the language-independent argument passing protocols?

Magento 2 – Passing argument from backoffice in Category Layout Update XML field to frontend module or phtml

In Magento 1 I sometimes used this way to pass an argument to a category, directly from the back office

Category > Custom Design tab > XML Design Update

<reference name="product_list">     <action method="setData"><key>giftCardId</key><value>955</value></action> </reference> 

Could you tell me what will be the equivalent syntax in Magento 2, Using the same way:

Category > Design > Layout Update XML

The main idea is to pass a value for a specific category, that could be retrieved in a custom module in frontend.

Edit: I know that I can add a custom category attribute to do that too, but the point is really, does an equivalent syntax exists.

ZAP Proxy unable to launch browser invalid argument: can’t kill an exited process

  • Using OWSAP ZAP 2.8.0
  • On Ubuntu 19.04
  • With openjdk version 11.0.3 installed

When clicking the “Launch Browser” button on ZAP to launch the HUD enabled browser for ZAP no browser is launched and an error is printed in the terminal (full output below).

I have already tried Chromium and Firefox, both have the same issue.

Another issue I’ve been experiencing, although potentially unrelated, is that when trying to use ZAP in Firefox I am unable to visit HTTPS sites due to the certificate not working correctly (even though it’s installed on Firefox).

I have also tried launching it with sudo zaproxy (as apposed to just zaproxy)

While writing this I restarted ZAP and now the “Enable HUD” checkbox unchecked and is disabled (greyed out), clicking “Launch Browser” does nothing and prints the same error.

1564053694462   mozrunner::runner   INFO    Running command: "/usr/lib/firefox/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.RrRH7dDl2ZK7" 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: mozillaAddons 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: telemetry 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: resource://pdf.js/ 1564053694915   addons.webextension.screenshots@mozilla.org WARN    Loading extension 'screenshots@mozilla.org': Reading manifest: Invalid extension permission: about:reader* ExceptionHandler::GenerateDump cloned child 4758 ExceptionHandler::SendContinueSignalToChild sent continue signal to child ExceptionHandler::WaitForContinueSignal waiting for continue signal... 59660 [ZAP-BrowserLauncher] ERROR org.zaproxy.zap.extension.quickstart.launch.ExtensionQuickStartLaunch  - invalid argument: can't kill an exited process Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'my-ubuntu', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '5.0.0-21-generic', java.version: '11.0.3' Driver info: driver.version: FirefoxDriver remote stacktrace:  org.openqa.selenium.WebDriverException: invalid argument: can't kill an exited process Build info: version: 'unknown', revision: 'unknown', time: 'unknown' System info: host: 'my-ubuntu', ip: '', os.name: 'Linux', os.arch: 'amd64', os.version: '5.0.0-21-generic', java.version: '11.0.3' Driver info: driver.version: FirefoxDriver remote stacktrace:      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)     at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$  new$  0(W3CHandshakeResponse.java:57)     at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$  getResponseFunction$  2(W3CHandshakeResponse.java:104)     at org.openqa.selenium.remote.ProtocolHandshake.lambda$  createSession$  0(ProtocolHandshake.java:123)     at java.base/java.util.stream.ReferencePipeline$  3$  1.accept(ReferencePipeline.java:195)     at java.base/java.util.Spliterators$  ArraySpliterator.tryAdvance(Spliterators.java:958)     at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)     at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)     at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)     at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)     at java.base/java.util.stream.FindOps$  FindOp.evaluateSequential(FindOps.java:150)     at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)     at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)     at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)     at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)     at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)     at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)     at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)     at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)     at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)     at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriverImpl(ExtensionSelenium.java:777)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriver(ExtensionSelenium.java:700)     at org.zaproxy.zap.extension.selenium.internal.BuiltInSingleWebDriverProvider.getWebDriver(BuiltInSingleWebDriverProvider.java:62)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriverImpl(ExtensionSelenium.java:639)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getWebDriver(ExtensionSelenium.java:509)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowser(ExtensionSelenium.java:602)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowserByName(ExtensionSelenium.java:566)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowserByName(ExtensionSelenium.java:552)     at org.zaproxy.zap.extension.selenium.ExtensionSelenium.getProxiedBrowserByName(ExtensionSelenium.java:542)     at org.zaproxy.zap.extension.quickstart.launch.ExtensionQuickStartLaunch$  2.run(ExtensionQuickStartLaunch.java:227)     at java.base/java.lang.Thread.run(Thread.java:834)  

Settle an Argument: String vs. Array? [on hold]

True or False: A string is the same thing as an array.

I had an interview the other day and the above question was asked. I said false, but the interviewer said it was actually true. I explained to her that a string is a data type and an array is an object that holds multiple instances of a variable, and that they aren’t even similar concepts. But, she was an HR person who was just reading tech questions that were handed to her, so she couldn’t elaborate or relate to my point.

A coworker later explained the True answer by stating that a string is actually a character array… thus, a string is an array. Now, if a string is a character array, that doesn’t mean that document arrays or integer arrays qualify as strings. Thus, a string is not the same thing as an array.

But even so, (considering C#) a string isn’t even a character array. In order to do character manipulation on a string (without using concatenation methods), you have to convert the string to a character array. Now, if a string was synonymous with a character array, why would you need to convert it? Wouldn’t you just be able to call each character in the string implicitly as you would a character array? No! Why? Because a string is not a character array!

I liken it to asking, “Is a primary key the same as a unique identifier?” The answer is false. Reason being: A primary key is a unique identifier, but you can have unique identifiers in a table without setting them as keys. What do you all think? Is a string (data type) the same thing as an array (object type)? If so, why?

Define method declaration which argument is a implementation type

I have a class Calculator which extends a function. The function argument type is a trait called InputData and the function output type another trait OutputData.

I need to override the apply method. The problem is, I can’t have as argument a case class which extends InputData.

class Calculator extends (InputData => OutputData) {   override def apply(data: Numbers): MathResult = { ... } }  case class Numbers(x1: Int, x2: Int) extends InputData  case class MathResult(y: Int) extends OutputData 

When I try to do like this, I get Method 'apply' overrides nothing.

Invalid argument supplied for foreach() – Crud Generator

estoy usando Laravel Crud Generator y al momento de querer insertar un registro me aparece el siguiente error se que esta en el foreach pero no se como corregirlo

Invalid argument supplied for foreach() (View: C:\laragon\www\sistema\resources\views\admin\perfil\form.blade.php) 

el codigo de mi vista es:

<div class="form-group {{ $  errors->has('category') ? 'has-error' : ''}}">     <label for="category" class="control-label">{{ 'Category' }}</label>     <select name="category" class="form-control" id="category" >     @foreach (json_decode('[multi-empresa: Multi-empresa, empresa: Empresa]', true) as $  optionKey => $  optionValue)         <option value="{{ $  optionKey }}" {{ (isset($  perfil->category) && $  perfil->category == $  optionKey) ? 'selected' : ''}}>{{ $  optionValue }}</option>     @endforeach </select>     {!! $  errors->first('category', '<p class="help-block">:message</p>') !!} </div>