text:
Q: Provisioning Package does not apply changes, even though it appears in Provisions folder after MDT Deployment I have created a provisioning package for deploying Windows 10 1709 to our organization. I have created a task in my task sequence that successfully applies the Package during Post-Install.
The desired change is a custom Start menu layout. I had originally tried to also add default local accounts and some other minor tweaks, but have since narrowed down to just the start menu for the sake of testing.
None of the customization items have been applied, and I instead get a default start menu with all of the annoying Windows Store apps.
Here is my customizations.xml from Window Config Designer (WICD):
<?xml version="1.0" encoding="utf-8"?>
<WindowsCustomizations>
  <PackageConfig xmlns="urn:schemas-Microsoft-com:Windows-ICD-Package-Config.v1.0">
    <ID>{97a60676-1678-46f3-b45a-7aead27c9711}</ID>
    <Name>OrgName</Name>
    <Version>1.2</Version>
    <OwnerType>ITAdmin</OwnerType>
    <Rank>0</Rank>
    <Notes></Notes>
  </PackageConfig>
  <Settings xmlns="urn:schemas-microsoft-com:windows-provisioning">
    <Customizations>
      <Common>
        <Policies>
          <Start>
            <StartLayout><LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
                  <LayoutOptions StartTileGroupCellWidth="6" />
                  <DefaultLayoutOverride>
                    <StartLayoutCollection>
                      <defaultlayout:StartLayout GroupCellWidth="6">
                        <start:Group Name="Communications">
                          <start:DesktopApplicationTile Size="1x1" Column="0" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Outlook 2016.lnk" />
                          <start:DesktopApplicationTile Size="1x1" Column="1" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Skype for Business 2016.lnk" />
                        </start:Group>
                        <start:Group Name="Tools and Tips">
                          <start:Tile Size="1x1" Column="0" Row="0" AppUserModelID="Microsoft.WindowsCalculator_8wekyb3d8bbwe!App" />
                          <start:Tile Size="1x1" Column="2" Row="0" AppUserModelID="Microsoft.Getstarted_8wekyb3d8bbwe!App" />
                          <start:DesktopApplicationTile Size="1x1" Column="1" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Accessories\Snipping Tool.lnk" />
                          <start:Tile Size="1x1" Column="3" Row="0" AppUserModelID="Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App" />
                        </start:Group>
                        <start:Group Name="Office 2016">
                          <start:DesktopApplicationTile Size="1x1" Column="1" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Excel 2016.lnk" />
                          <start:DesktopApplicationTile Size="1x1" Column="2" Row="1" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Access 2016.lnk" />
                          <start:DesktopApplicationTile Size="1x1" Column="1" Row="1" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\OneNote 2016.lnk" />
                          <start:DesktopApplicationTile Size="1x1" Column="2" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\PowerPoint 2016.lnk" />
                          <start:DesktopApplicationTile Size="1x1" Column="0" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Word 2016.lnk" />
                          <start:DesktopApplicationTile Size="1x1" Column="0" Row="1" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Publisher 2016.lnk" />
                        </start:Group>
                        <start:Group Name="Browse the Web">
                          <start:DesktopApplicationTile Size="1x1" Column="0" Row="0" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk" />
                          <start:Tile Size="1x1" Column="2" Row="0" AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
                          <start:DesktopApplicationTile Size="1x1" Column="3" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Google Chrome.lnk" />
                          <start:DesktopApplicationTile Size="1x1" Column="1" Row="0" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Firefox.lnk" />
                        </start:Group>
                      </defaultlayout:StartLayout>
                    </StartLayoutCollection>
                  </DefaultLayoutOverride>
                  <CustomTaskbarLayoutCollection PinListPlacement="Replace">
                    <defaultlayout:TaskbarLayout>
                      <taskbar:TaskbarPinList>
                        <taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\Accessories\Internet Explorer.lnk"/>
                    <taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk"/>
                    <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Outlook 2016.lnk"/>
                    <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Word 2016.lnk"/>
                    <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Excel 2016.lnk"/>
                    <taskbar:DesktopApp DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\PowerPoint 2016.lnk"/>
                      </taskbar:TaskbarPinList>
                    </defaultlayout:TaskbarLayout>
                  </CustomTaskbarLayoutCollection>
                </LayoutModificationTemplate></StartLayout>
          </Start>
        </Policies>
      </Common>
    </Customizations>
  </Settings>
</WindowsCustomizations>

Here is my apply command from MDT:
DISM.exe /Image:%OSDisk%\ /Add-ProvisioningPackage /PackagePath:%DEPLOYROOT%\ProvPackages\DefaultPackage.ppkg

The following website gave me reference on how to get this far, but I have been unable to proceed and unable to find other web resources to figure out why things aren't applying:
https://docs.microsoft.com/en-us/windows/configuration/customize-windows-10-start-screens-by-using-provisioning-packages-and-icd

A: The XML layout you imported is broken. It appears you manually added content improperly.
You added the <taskbar:TaskbarPinList> section and didn't declare it at the beginning of the file:     xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
Here is the sample XML file, and yours should follow the same format.
<?xml version="1.0" encoding="utf-8"?>
<LayoutModificationTemplate
    xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"
    xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
    xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"
    xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
    Version="1">
  <LayoutOptions StartTileGroupCellWidth="6" StartTileGroupsColumnCount="1" />
  <DefaultLayoutOverride>
    <StartLayoutCollection>
      <defaultlayout:StartLayout GroupCellWidth="6" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout">
        <start:Group Name="Life at a glance" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout">
          <start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
          <start:Tile Size="2x2" Column="4" Row="0" AppUserModelID="Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI" />
          <start:Tile Size="2x2" Column="2" Row="0" AppUserModelID="Microsoft.BingWeather_8wekyb3d8bbwe!App" />
        </start:Group>
      </defaultlayout:StartLayout>
    </StartLayoutCollection>
  </DefaultLayoutOverride>
    <CustomTaskbarLayoutCollection>
      <defaultlayout:TaskbarLayout>
        <taskbar:TaskbarPinList>
          <taskbar:UWA AppUserModelID="Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" />
          <taskbar:DesktopApp DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk" />
        </taskbar:TaskbarPinList>
      </defaultlayout:TaskbarLayout>
    </CustomTaskbarLayoutCollection>
</LayoutModificationTemplate>

https://docs.microsoft.com/en-us/windows/configuration/configure-windows-10-taskbar#sample-taskbar-configuration-added-to-start-layout-xml-file


text:
Q: How to send $_POST data in jmeter? I am trying to load test the login functionality for my server. Login form sends the data to the server in $_POST array in the following format.
Array(
     [LoginForm] => Array(
           [username] => siddhant@gmail.com
           [password] => 123456
           [rememberMe] => 0
     )
)

The problem I am facing is that how to send these parameters in jmeter. I have tried to send them in a json payload as below.
{"LoginForm":{"username":"siddhant@gmail.com","password":"123456","rememberMe":"0"}}

and I have sent the username, password and rememberMe parameters in name value pairs in the request but I am unable to login this way.
Also, after authentication the system redirects to another URL. Will jmeter do that automatically so that I can add assertions in the response. Or, will I have to add another HTTP request for that?

A: It sounds like you're using PHP on the backend, I believe if you structure your POST parameters in the JMeter HTTP sampler in the format:
    LoginForm[username] = siddhant@gmail.com
    LoginForm[password] = 123456
    LoginForm[rememberMe] = 0

The backend should be able to read them as an array.
Take a look at the HTML source of the login form using something like Chrome debugging tools and locate the "name" attributes of the form input elements on the login form, those are the parameter names you need to pass in the HTTP sampler, e.g.
    <input type="text" name="LoginForm[username]" />
    <input type="password" name="LoginForm[password]" />

To answer your second question, there is a flag on the HTTP sampler to follow redirects which means you can apply the assertions to the HTTP POST sampler and it will be looking at the content of the page you are redirected to.
Vikas' comment is also true, you will likely need a Cookie manager added to your test which will automatically save and send cookies in subsequent requests just like a browser would.
Use the View Results Tree listener to see the request and responses to help with debugging your test.

A: I believe the fastest and the easiest way is to record a JMeter test using built-in HTTP(S) Test Script Recorder - it will capture the traffic between browser and application under test and store it in form of JMeter HTTP Request samplers.
References:

*

*Apache JMeter Proxy Step by Step

*How To Use JMeter For Login Authentication
Also consider adding HTTP Cookie Manager and HTTP Cache Manager to your test plan to make your test more realistic.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to pass parameter to exe downloaded from web? I have .Net desktop app which users can download from my website. I want to customize this app to per user basis.
Is there way to modify exe before downloading, just to change few strings with appropriate for the users downloading ?
Or it is possible to pass command line parameters to this exe via URL ?

A:
The .exe file needs to be customized for it to behave differently for certain downloads.

Skip below to find the solution I found tolerable.
Add section to the .EXE file – Not ideal.
The .exe file has sections one after the other. You could add a section with your data in it, which the executable would then read. This requires you to modify (have access to) the source code of the executable for it to do anything meaningful with the data. Also getting familiar with the .exe file format and modifying it on the web server side as well al playing with it in the program's source code is somewhat tedious.
Change resources section of the .EXE file – Not ideal.
A dedicated "resources" section exists in the executable. You could add custom strings or blob of data to it. Same cons as the first one.
Overwrite data in the .EXE at a fixed position – Passable.
Have the executable read data from itself from a fixed position in the file, which is overwritten with the customization data when serving the .exe file. Requires modifying the executable's source code.
Append data to the .EXE – Passable.
Append data to the executable. Again, reading it and doing anything special with it requires the executable itself doing so.

☑ Wrap the .EXE in another .EXE and append your data to it – Tolerable.
Create a program to which the original executable and the custom data will be appended to. When this custom program is then executed, it will extract the embedded executable and launch it with the custom data as it arguments.
This kind of a bundle-executable is also easy to produce on most server-side (scripting) languages. When the download is requested, the server sends the wrapper-exe, the original exe, the customized data and of course some statically-sized data fields denoting the sizes of both of those data blocks so it can extract them.
Cons: Requires such a wrapper program to be created, unless someone already has.
Related links:
1. Best practices to let my web users download custom .exe from my site using PHP
2. Modifying executable upon download (Like Ninite)

A: Not like that, No.
You could however automatically zip (on your server) your exe with a custom app.config file for each user.
Update
Point your download location to a custom HttpHandler that zips together your exe (using http://www.sharpdevelop.net/OpenSource/SharpZipLib/) with a generated (for the current user) application configuration file ( http://generally.wordpress.com/2007/09/27/using-appconfig-for-user-defined-runtime-parameters/).
The user then unzips the two files (MyApp.exe & MyApp.exe.config) to any location and run MyApp.exe.
This method does not work if you have an installer.

A: If the application is ClickOnce deployed, passing URL parameters is an option in the ClickOnce options dialog. However, I have not yet used this feature.
EDIT
You might want to change some user settings in your configuration depending on the user that actually runs the application. You could also make sure this is done only once per user by adding an appropriate SettingsNeedUpdate setting you set to true after the initial initialization.
Example:
Add new setting "Option1", "Option2" and "SettingsNeedUpdate" which are user settings. In Main you could add something like:
...
try
{
    if (Properties.Settings.Default.SettingsNeedUpdate)
    {
        Properties.Settings.Default.Option1 = ...;
        Properties.Settings.Default.Option2 = ...;
        Properties.Settings.Default.SettingsNeedUpdate = false;
        Properties.Settings.Default.Save();
    }
}
catch (Exception exp)
{
    ...
}

...

A: You could write a library which can modify an assembly resources (here string table).
This library could benefit from reflection.
When a user asks for your file, asp.net page could customize the exe (using your library) and send it to client.


text:
Q: Running SQL Azure as a Cluster Node Seeing as to how I can't find anything at all about it on the interwebs, I suspect that the answer is no, but I figured I'd ask...
Does anyone know (for certain) if you can run SQL Azure as a node in a cluster of servers? Essentially, we've invested in a SQL server and are looking at adding another node to the cluster. However, it would be really cool if instead of purchasing another box, we could instead just tack on SQL Azure as a part of our cluster. This would allow us to "test the waters" with Azure in our production environment until we feel more confident in it's dependability.

A: I wonder why are you looking to adding a node to the cluster, since clustering is only for high availability not for scalability. Adding a node adds higher redundancy in case of disaster, but 0 extra performance and 0 extra throughput.
And to answer the question: no, you cannot. SQL clusters work by sharing a drive on a SCSI bus. Even is SQL Azure would be capable of participating in a cluster, you would need a pretty long bus to reach into the clouds...


text:
Q: Licensed File Geodatabase to unlicensed Geodatabase? Can anyone help me how to convert a licensed File Geodatabase "Export Deny" encrypted in ArcGIS to "allow export" if i have only File Geodatabase and  file without license definition  file.
I am in great trouble because maximum feature is disabled in the licensed File Geodatabase.

A: That is the point with licensing of file geodatabases in ArcGIS 10.3.
The author protects the geodatabase by creating first a license definition file (.licdef file, which will provide settings for the licensing) and generating a licensed file geodatabase (by copying the source file geodatabase and its data and modifying some of its properties).
Thereafter, the author generates a data license file (.sdlic) for distribution. The geodatabase and this file will be shared to users. They install the data license and access the geodatabase with those restrictions that were defined by the author.
The .licdef file is an XML file which contains unique GUID for the datasets stored within the file geodatabase. Without knowing those IDs, you cannot re-generate the .sdlic file (which is a binary file) using the GP tool Generate File Geodatabase License.
If this would be possible, then anyone could re-generate the license file and protecting file geodatabase would become useless.

A: In short, you can't: "Licensing is ideally suited to mature datasets that will be shared or licensed under a use agreement and do not require further editing. The output licensed file geodatabase cannot be unlicensed to return it to its original unlicensed format." [emphasis added]
source: https://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/generate-licensed-file-geodatabase.htm


text:
Q: Simple way to compare two objects with unknown stuctures Let's say I have object which describes expected result:
{
"property1" : "value1",
"property2" : "value2",
    "property3" :{
        "property4" : "value4"
    }
}

I don't care about all the extra properties. For example,in this case, I get actual result like this, and it will be a match, as all expected properties are present and have expected values:
{
   "property1":"value1",
   "property2":"value2",
   "property3":{
      "property4":"value4",
      "property5":"value5"
   },
   "property6":"value6"
}

And this will not be a match:
{
   "property2":"value20",
   "property3":{
      "property4":"value4"
   }
}

Difficult part here is that I don't know structure in advance; I need a function that would match any objects.
My best idea so far is to use lodash merge to flatten both objects so they look like this:
{
       "property1":"value1",
       "property2":"value2",
       "property3.property4":"value4",
       "property3.property5":"value5",
       "property6":"value6"
}

After which I can just cycle on all expected properties. This solution feels awkward, though; is there a simpler, easier way to accomplish this?

A: Iterate recursively over the object's properties and checking if any of the properties are themselves objects. If an object is found, the function will call itself with the nested object as input and then iterate over its properties.

function flattenObject(obj, parentKey = "") {
  let flattened = {};

  for (let key in obj) {
    if (obj.hasOwnProperty(key)) {
      let newKey = parentKey ? parentKey + "." + key : key;

      if (typeof obj[key] === "object") {
        let nestedObj = flattenObject(obj[key], newKey);
        flattened = { ...flattened,
          ...nestedObj
        };
      } else {
        flattened[newKey] = obj[key];
      }
    }
  }

  return flattened;
}
const myObj = {
  "property1": "value1",
  "property2": "value2",
  "property3": {
    "property4": "value4",
    "property5": "value5"
  },
  "property6": "value6"
};

const flattenedObj = flattenObject(myObj);
console.log(flattenedObj);

A: Simple way using Lodash's by transform function to iterate over each key-value pair in the input object, and checks if the value is an object using isObject. If the value is an object, the implementation creates a nested object using transform again, with a function that concatenates the key with the nested key using dot notation. The nested object is then merged with the result object using assign:
const _ = require('lodash');
const flattenedObj = _.transform(myObj, function (result, value, key) {
  if (_.isObject(value)) {
    const nestedObj = _.transform(value, function (nestedResult, nestedValue, nestedKey) {
      nestedResult[key + '.' + nestedKey] = nestedValue;
    });
    _.assign(result, nestedObj);
  } else {
    result[key] = value;
  }
});


text:
Q: connect Cloud SQL to Data Fusion through sqlproxy with private IP It is my first question in this community I hope that I won't be off-topic. I'm trying to connect data fusion to Cloud SQL for MySQL Instance on Private IP. Here is what I have done so far:

*

*Creating a private data fusion instance (VPC peering seems to be working fine)

*Creating a Cloud SQL for MySQL instance

*Creating a VM with Proxy SQL installed

I've run multiple connectivity test running the Network Intelligence module and here are the result:

*

*from Cloud SQL to Proxy SQL => ok

*from Proxy SQL to Cloud SQL => ok

*from cloud data fusion to Proxy SQL => ok

*from Proxy SQL to Cloud data fusion => not ok  (0/50 packets delivered)

I'm not a network engineering. Sorry If I'm making any obvious mistakes.

A: Cloud Data Fusion is using a network that needs to allow ingress from the source ip address of the vm instance on which proxy is running. This needs to be changed in firewall policy for that network. The official doc of Cloud Datafusion 1 suggests that protocol and port number should be tcp:22 for this firewall rule.


text:
Q: CakePhp : Cake bake doesn't work on Ubuntu. (PDOException) I'm trying to run Cake Bake on Ubuntu.
To be clear :

*

*The Environment, Filesystem, Database and the DebugKit are Ok as it is mentioned on the first page generated by CakePhp.

*The "bin/cake bake" shows this message :

    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_intl.dll' - /usr/lib/php/20151012/php_intl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0

    Welcome to CakePHP v3.4.5 Console
    ---------------------------------------------------------------
    App : src
    Path: /opt/lampp/htdocs/quizz/src/
    PHP : 7.0.18-1+deb.sury.org~xenial+1
    ---------------------------------------------------------------
    The following commands can be used to generate skeleton code for your application.

    Available bake commands:

    - all
    - behavior
    - cell
    - component
    - controller
    - fixture
    - form
    - helper
    - mailer
    - migration
    - migration_diff
    - migration_snapshot
    - model
    - plugin
    - seed
    - shell
    - shell_helper
    - task
    - template
    - test

    By using `cake bake [name]` you can invoke a specific bake task.

*

*Everytime I run 'bin/cake bake model questions' or 'bin/cake bake all' I get this output :

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_intl.dll' - /usr/lib/php/20151012/php_intl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0

Welcome to CakePHP v3.4.5 Console
---------------------------------------------------------------
App : src
Path: /opt/lampp/htdocs/quizz/src/
PHP : 7.0.18-1+deb.sury.org~xenial+1
---------------------------------------------------------------
One moment while associations are detected.
Exception: SQLSTATE[HY000] [2002] No such file or directory in [/opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php, line 47]
2017-05-07 14:24:47 Error: [PDOException] SQLSTATE[HY000] [2002] No such file or directory in /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php on line 47
Stack Trace:
#0 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php(47): PDO->__construct('mysql:host=loca...', 'root', '', Array)
#1 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php(104): Cake\Database\Driver\Mysql->_connect('mysql:host=loca...', Array)
#2 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Schema/BaseSchema.php(45): Cake\Database\Driver\Mysql->connect()
#3 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Dialect/MysqlDialectTrait.php(63): Cake\Database\Schema\BaseSchema->__construct(Object(Cake\Database\Driver\Mysql))
#4 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Schema/Collection.php(52): Cake\Database\Driver\Mysql->schemaDialect()
#5 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php(42): Cake\Database\Schema\Collection->__construct(Object(Cake\Database\Connection))
#6 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Connection.php(367): Cake\Database\Schema\CachedCollection->__construct(Object(Cake\Database\Connection), true)
#7 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Database/Connection.php(386): Cake\Database\Connection->getSchemaCollection()
#8 /opt/lampp/htdocs/quizz/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(959): Cake\Database\Connection->schemaCollection()
#9 /opt/lampp/htdocs/quizz/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(911): Bake\Shell\Task\ModelTask->_getAllTables()
#10 /opt/lampp/htdocs/quizz/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(207): Bake\Shell\Task\ModelTask->listAll()
#11 /opt/lampp/htdocs/quizz/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(127): Bake\Shell\Task\ModelTask->getAssociations(Object(Cake\ORM\Table))
#12 /opt/lampp/htdocs/quizz/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(110): Bake\Shell\Task\ModelTask->getTableContext(Object(Cake\ORM\Table), 'answers', 'Answers')
#13 /opt/lampp/htdocs/quizz/vendor/cakephp/bake/src/Shell/Task/ModelTask.php(97): Bake\Shell\Task\ModelTask->bake('Answers')
#14 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Console/Shell.php(472): Bake\Shell\Task\ModelTask->main('answers')
#15 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Console/Shell.php(465): Cake\Console\Shell->runCommand(Array, false, Array)
#16 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(230): Cake\Console\Shell->runCommand(Array, true, Array)
#17 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(182): Cake\Console\ShellDispatcher->_dispatch(Array)
#18 /opt/lampp/htdocs/quizz/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(128): Cake\Console\ShellDispatcher->dispatch(Array)
#19 /opt/lampp/htdocs/quizz/bin/cake.php(34): Cake\Console\ShellDispatcher::run(Array)
#20 {main}

*

*The Cake Bake run when I put 'bin/cake bake controller questions'.

I didn't figure out what's the problem after passing hours trying to solve it. I have been using cake bake on windows and I never find such difficulty to run cake bake.
I really appreciate any help you can provide.

A: Finally ....
Just replace localhost by 127.0.0.1
'Datasources' => [
    'default' => [
        'className' => 'Cake\Database\Connection',
        'driver' => 'Cake\Database\Driver\Mysql',
        'persistent' => false,
        'host' => 'localhost',
        /**
         * CakePHP will use the default DB port based on the driver selected
         * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
         * the following line and set the port accordingly
         */
        //'port' => 'non_standard_port_number',
        'username' => 'root',
        'password' => '',
        'database' => 'quizz_db',
        'encoding' => 'utf8',
        'timezone' => 'UTC',
        'flags' => [],
        'cacheMetadata' => true,
        'log' => false,

By :
'Datasources' => [
    'default' => [
        'className' => 'Cake\Database\Connection',
        'driver' => 'Cake\Database\Driver\Mysql',
        'persistent' => false,
        'host' => '127.0.0.1',
        /**
         * CakePHP will use the default DB port based on the driver selected
         * MySQL on MAMP uses port 8889, MAMP users will want to uncomment
         * the following line and set the port accordingly
         */
        //'port' => 'non_standard_port_number',
        'username' => 'root',
        'password' => '',
        'database' => 'quizz_db',
        'encoding' => 'utf8',
        'timezone' => 'UTC',
        'flags' => [],
        'cacheMetadata' => true,
        'log' => false,

A: Mine worked when I changed
'host' => '127.0.0.1', in app.default.php default dataresources
and in app.php
I hope it'll help
Thanks


text:
Q: Do I _have to_ use a pointer here? I've run into this problem time & again, and I've always had to resolve it using a forward declaration and a pointer.
It seems wrong that C++ requires a work around to get objects to co-operate.  Is there any way to get this to compile WITHOUT making Mesh* a pointer in class Shape (or, the vector<Tri> into vector<Tri*>?
Shape.h
#ifndef S
#define S

#include "Mesh.h"
//class Mesh ; //delete line above, uncomment this to make it work
class Shape // a mathematical shape
{
    Mesh mesh ; // the poly mesh repr' this math shape
    //Mesh *mesh ; // make it work

    // a shape must be intersectable by a ray
    //virtual Intersection intersects( const Ray& ray )=0 ;
} ;

#endif

Mesh.h
#ifndef M
#define M

#include <vector>
using namespace std;
#include "Triangle.h"

struct Mesh
{
    vector<Triangle> tris ; // a mesh is a collection of triangles
} ;

#endif

Triangle.h
#ifndef T
#define T
#include "Shape.h"
class Triangle : public Shape
{
    // a triangle must be intersectable by a ray
    // a triangle's mesh is simple but it is still a mesh (1 poly)
} ;
#endif

A: You seem basically to be saying a Shape is implemented using a Mesh and a Mesh is implemented using shapes  (specifically triangles). This obviously doesn't make sense.

A: You cannot declare a incomplete type as an member.
When you forward declare a type, all the compiler know is that this type exists; it does not know anything about the size or members or methods. It's called an Incomplete type
Unless you include Mesh.h, Mesh is a Incomplete type and you cannot declare incomplete type as a member.
But, You can have a pointer to Incomplete type as a member and so If you forward declare class Mesh, your member will have to be Mesh*
So in conclusion, what you have said is correct.

A: You've always done it right and there's no other way to do it.

A: You could define your mesh in terms of a different, simple, low-level triangle struct. Your high-level Triangle "shape" can share collision code with the low level one while still being a separate class. Thus Mesh.h needn't include Triangle.h. This will break your cyclic dependency and let you have a Mesh member in the Shape class.

A: It works for me without a pointer (there are, naturally, pointers used inside std::vector).  You just have to analyze your dependencies carefully.  Triangle inherits Shape, therefore Shape's definition is above Triangle's.  Shape contains a Mesh, therefore Mesh's definition precedes Shape's.  This gives the order: Mesh, Shape, Triangle, which compiles without errors.
Naturally, some meshes will have to have empty vectors, since every triangle inside the vector itself requires a mesh.


text:
Q: Range of cell rows to column base on first row values in excel I have range of cells in excel like
A   A   A   B   B   B
A1  A2  A3  B1  B2  B3

Is there any idea how to convert this range of cell into -
A   B
A1  B1
A2  B2
A3  B3

I tried to do it with Kutools addon in excel but it can't solve my problem.
I don't mind if I have to use VBA for this.

A: Use this formula in cell A7. Enter it with CTRL+SHIFT+ENTER combination, then drag below your table.
=IFERROR(INDEX($A$1:$F$2,2,SMALL(IF((A$6=$A$1:$F$1), COLUMN($A$1:$F$1)-MIN(COLUMN($A$1:$F$1))+1, ""),ROWS($A$1:A1))),"")

A: Here is what I have managed to do, using dictionaries. I am using the following additional functions:
This one loops through the values in the first row and returns the unique ones as array. It will be the "title" of the list:
Public Function getUniqueElementsFromArray(elementsInput As Variant) As Variant

    Dim returnArray     As Variant
    Dim element         As Variant
    Dim tempDict        As Object
    Dim cnt             As Long

    Set tempDict = CreateObject("Scripting.Dictionary")

    For Each element In elementsInput
        tempDict(element) = 1
    Next element

    ReDim returnArray(tempDict.Count - 1)
    For cnt = 0 To tempDict.Count - 1
        returnArray(cnt) = tempDict.Keys()(cnt)
    Next cnt

    getUniqueElementsFromArray = returnArray

End Function

This one gets the lastRow of a given column:
Function lastRow(Optional strSheet As String, Optional colToCheck As Long = 1) As Long

    Dim shSheet  As Worksheet

    If strSheet = vbNullString Then
        Set shSheet = ActiveSheet
    Else
        Set shSheet = Worksheets(strSheet)
    End If

    lastRow = shSheet.Cells(shSheet.Rows.Count, colToCheck).End(xlUp).Row

End Function

This one takes a single row range and returns a 1D array:
Public Function getArrayFromHorizontRange(rngRange As Range) As Variant

    With Application
        getArrayFromHorizontRange = .Transpose(.Transpose(rngRange))
    End With

End Function

This is the main "engine":
Option Explicit

Public Sub TestMe()

    Dim keyValues       As Variant
    Dim keyElement      As Variant
    Dim keyElementCell  As Range
    Dim inputRange      As Range
    Dim outputRange     As Range
    Dim outputRangeRow  As Range
    Dim colNeeded       As Long

    Set inputRange = Range("A1:K2")
    Set outputRange = Range("A10")
    Set outputRangeRow = outputRange

    keyValues = getUniqueElementsFromArray(getArrayFromHorizontRange(inputRange.Rows(1)))

    For Each keyElement In keyValues
        Set outputRangeRow = Union(outputRangeRow, outputRange)
        outputRange.value = keyElement
        Set outputRange = outputRange.Offset(0, 1)
    Next keyElement

    For Each keyElementCell In inputRange.Rows(2).Cells
        colNeeded = WorksheetFunction.match(keyElementCell.Offset(-1), outputRangeRow, 0)
        Set outputRange = Cells(lastRow(colToCheck:=colNeeded) + 1, colNeeded)
        outputRange.value = keyElementCell
    Next keyElementCell

End Sub

And this is the input and the output:


text:
Q: Models for binary response that appear like logit/probit regression but never approach 1 I'm reading the textbook "Introduction to Econometrics" by Stock and Watson. Chapter 11 discusses regression with a binary response and it teaches the logit/probit models mostly. These seem to make sense when the plots show an S shaped relationship between X and Y, but what if I'm working with a dataset where the model calculates a probability in the shape of a "hill".
For example what if my continuous predictor X ranges from 0-100 and my response Y is only equal to 1 for X's at values of 30-70 but gets more concentrated at X's around 50. So lets say around X=50 we could have a 40% probability of Y=1, and then at X=40, X=60 we'd have 25% probability of Y=1 until the probability of Y=1 dissipates around 30-70. I cant find any models that model such a relationship through google - Are there any models that are more appropriate than logit/probit for this type of relationship?

A: What you are a describing suggests that there is not a complete relationship between X & Y. If only 40% of all X's equal to 50 associate with Y=1, then there is some unexplained variance in Y not explained by X.
That means this simple model is not enough, there is some other variable (or variables) needed to properly predict Y.

A: Logistic regression is a fine approach even in this case.  The problem is that a simple linear relationship (on the log odds scale) is insufficient to model this relationship.  You need to introduce non-linearity into the conditional mean, and this is most easily done with a spline.
Rather than let
$$\operatorname{logit}(p) = \beta_0 + \beta_1 x $$
let the linear predictor be
$$\operatorname{logit}(p) = \beta_0 + f(x)$$
Where $f(x)$ is some spline function.  Because splines can be represented as linear combinations of non-linear functions, we can estimate this using the same machinery we do for linear models.
Shown below is an example.  In red is the true conditional mean, which was used to generate the black dots.  In black is the estimated conditional mean using a natural spline.

A: The logit/probit function is the cdf of the conditional mean. So by definition, in a linear function of some variable, say x, the probability must approach 1 for some value.
Now, you can add some sort of non-linearity into your model of the conditional mean. That will allow you to have a "hill". Note that it will not truly be a hill, rather it will be an S-shaped curve in a curved space, so that when you "flatten" out the curved space and look at it from that "flat" perspective, it doesn't look S-shaped any more. A very simple and fairly standard way to do this is to add polynomial terms to your conditional mean. At that point, you are relying on the fact that you can create an arbitrary Taylor-expansion of any function.
Generally, we don't see people do that in an inferential setting as this complicates the marginal interpretation of the coefficients, which is already very messy with discrete choice models due to the non-linearities from the probability distribution.


text:
Q: Unable to POST Multipart Form in Robot Framework Using Request Library I have the following request in postman:

I have been using request library since the beginning automation on API: https://marketsquare.github.io/robotframework-requests/doc/RequestsLibrary.html#POST%20On%20Session
I tried to automate based on the postman request above with several trial and errors:

It always return 400 although the headers value set already correct:

What did I miss in the steps above?
Thank you in advance!

A: You should pass file descriptor not dictionary and "POST On Session" accepts file as "data" argument not "files". Try this
${file_stream} =    Get File For Streaming Upload    ${file_path}
${response} =    POST On Session    ${alias}    ${URI}    data=${file_stream}

On the second line you should add the rest arguments.
P.S. Next time please don't post code as screenshot, it makes hard for someone to copy and run it.

A: this is a false-negative due to the framework used by developers.
The developer has updated their framework and it works fine now.
No issues on the Robot Framework Request Library
Thank you.


text:
Q: How do I automate text display from a .json file based on the current date? My team is trying to build a basic app that displays different text depending on what day of the year it is. The information that needs to be displayed is currently in the form of .json files, but any solution (involving manually inputting the data) would work for our purposes. We have three different tabs in our app that display the text for today, tomorrow, and for the week as a whole. Currently the string variables in  the string.xml are hard coded, and used in the tab_fragment.xml to provide a text output to the different tabs. How can I use Android Studio to automate the displayed text depending on the date?

A: You can do this with SimpleDateFormat. You pass in a Date object, and it can format it into the correct text, such as Friday.
Date now = new Date();

SimpleDateFormat simpleDateformat = new SimpleDateFormat("E"); // the day of the week abbreviated
System.out.println(simpleDateformat.format(now));

simpleDateformat = new SimpleDateFormat("EEEE"); // the day of the week spelled out completely
System.out.println(simpleDateformat.format(now));

new Date() will return the current date of the device. If you want to display other days, you need to create multiple Date objects.


text:
Q: Replace output of a command using sed On a running a customised kubectl command in bash terminal, it opens a yaml file in the vim editor, but i'm trying to replace a string without having to open an editor. (command is part of a bash script.)
kubectl deploy apps edit namespace | sed  -i "s/version-tag:2.4.0.9/version-tag:2.4.0.10/"

Error:

sed: no input files
Vim: Warning: Output is not to a terminal

    kubectl deploy apps edit namespace | sed  -i -e "s/version-tag:2.4.0.9/version-tag:2.4.0.10/"

Error:
sed: -e expression #1, char 1: unknown command: `-' and no replacement happens.

I tried other options, by referring the suggestions on the forums, no luck though.. Where am I going wrong.

A: Remove the -i in the sed command. This should work:
kubectl deploy apps edit namespace | sed "s/version-tag:2.4.0.9/version-tag:2.4.0.10/"


text:
Q: RadComboBox SelectedIndexChanged event not firing when using inplace editing in a RadGrid I am using inplace editing on a RadGrid that is built using a class file. Everything is working well except I am having an issue the SelectedIndexChanged event not firing when the grid is in edit mode. Any thoughts?
private void RadGrid_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        try
        {
            if ((e.Item as GridDataItem) == null) { return; }
            ((RadNumericTextBox) (e.Item as GridDataItem)["Percentage"].Controls[0]).Width = Unit.Pixel(75);
            ((TextBox) (e.Item as GridDataItem)["Code"].Controls[0]).Width = Unit.Pixel(75);

            RadComboBox _participantList = (e.Item as GridEditableItem)["ID"].Controls[0] as RadComboBox;
            if (null == _participantList) { return; }

            _participantList.Width = Unit.Pixel(120);
            _participantList.DataValueField = "ID";
            _participantList.DataTextField = "ID";
            _participantList.AutoPostBack = true;
            _participantList.DataSource = MAASBaseInterface.ParticipantAPI.GetParticipants();
            _participantList.DataBind();
            _participantList.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(_participantList_SelectedIndexChanged);

            if (!(e.Item.DataItem is GridInsertionObject))
                _participantList.SelectedValue = ((Participant) (e.Item.DataItem)).ID.ToString();
            if (e.Item.DataItem is GridInsertionObject)
                _participantList.EmptyMessage = "-- Select --";
        }
        catch (Exception ex)
        {

            string _ex = ex.Message;
        }
    }
}

void _participantList_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    //first reference the edited grid item through the NamingContainer attribute
    GridEditableItem editedItem = (sender as RadComboBox).NamingContainer as GridEditableItem;
    int _selectedValue = Convert.ToInt32((editedItem["ID"].Controls[0] as RadComboBox).SelectedValue);
    ParticipantList _participants = MAASBaseInterface.ParticipantAPI.GetParticipants();
    Participant _participant = _participants.Where(a => a.ID == _selectedValue) as Participant;
    RadTextBox _code = editedItem["Code"].Controls[0] as RadTextBox;
    _code.ReadOnly = false;
    _code.Text = _participant.Code;
}

A: You need a button that has the CommandName="Select" set. Without that the event doesn't trigger. Could that be the problem?
This link gives more detail
EDIT:
The problem might be that the dropdown list is dynamically added to the grid so that the event needs to be added each time the row is bound. In my experience the radGrid and the GridView works in the same way with respect to the event model so this SO answer might sort you out. Good luck - my initial thoughs were that this couldn't be don't but there may be a way forward

A: The problem was that I was only setting the Value property of the RadComboBox and not the Text property. Even though text value was showing in the RadComboBox in edit mode apparently it was displaying the Value property. As soon as it was set it started posting back just like it was supposed to do.
                if (!(e.Item.DataItem is GridInsertionObject))
                {
                    _participantList.SelectedValue =
                        ((ReinsuranceAgreementParticipant) (e.Item.DataItem)).LegacyReinsurerID.ToString();
                    // I added this line
                    _participantList.Text = ((ReinsuranceAgreementParticipant)(e.Item.DataItem)).LegacyReinsurerID.ToString();
                }
                if (e.Item.DataItem is GridInsertionObject)
                    _participantList.EmptyMessage = "Select Reinsurer";


text:
Q: MSBuild error code 9009 when trying to post a http request using curl Im trying to post a http request to "new relic" by using the "Publish" button in Visual Studio.
In my publishing profile I choose "web deploy" and then finnish my setup. After that I'll go in to my ".pubxml"-file and add a target at the bottom:
 <Target Name="AfterBuild">
 <Exec Command="curl -H "x-api-key:mykey"
 -d "deployment[application_id]=appId"
 -d "deployment[description]=MSbuild deploy using curl"
 -d "deployment[revision]=0"
 -d "deployment[changelog]=Deployed using MSBuild"
 -d "deployment[user]=User"
 -d http://api.newrelic.com/deployments.xml"/>
 </Target>
</project>

In the error list in visual studio I get this:
Severity Code Description Project File Line Suppression State Error The command
"curl
-H "x-api-key:APPKEY"
-d "deployment[application_id]=APPID"
-d "deployment[description]=MSbuild deploy using curl"
-d "deployment[revision]=1"
-d "deployment[changelog]=Deployed using MSBuild"
-d "deployment[user]=User"
http://api.newrelic.com/deployments.xml"
exited with code 9009

If I run the curl command in curl.exe it works (the post succeeds) but not during msbuild.
As you can see above there are quotes around everything accept the url, (have tried that also)
I have tried specifying the path to curl like this
"C:\WINDOWS\system32\curl.exe"

but that doesent work eather.
I have removed the "ItemGroup" since I dont want the web config to be included (Have set the buildaction to "none" on the web config)
What can I try?
Updated
<Target Name="AfterBuild"> and <Message Text="Test"/>..

This runns successfully but I cant see the text "Test" in the build output.
 <Target Name="AfterBuild">
 <Exec WorkingDirectory="C:\Windows\System32\" Command="curl http://www.google.com"/>

This returns error 9009.
Proof that its in the correct directory:

A: When trying to reproduce your problem I tried a couple of things (running curl, running 64bit curl, running when it's in the PATH, running with specifying full path, running an executable from the system32 diretory), but the one thing I didn't try out of principle is copying curl to the system32 directory: doing that is almost never the correct solution for a problem, for a variety of reasons which can be found on the internet. And yes, today we found yet another reason why it's bad :]
MsBuild's Exec task works by creating a temporary file including the Command to run, and then launching cmd.exe /q /c <path/to/tempfile>. The task does not just start cmd.exe though, but specifies the the full path by prepending it with Environment.GetFolderPath(Environment.SpecialFolder.System). Which returns C:\windows\SysWOW64 or similar when called from a 32bit process (i.e. msbuild) on a 64bit system.
As a result msbuild starts the 32bit cmd from C:\windows\SysWOW64\cmd.exe. Being a 32bit process, the file system redirection gets invoked: if you tell a 32bit process to look in c:\windows\system32 it won't do that, but look in c:\windows\SysWOW64. And curl.exe is not there since you put it in system32. And so you get a code 9009.
Long story short: be a good Windows citizen and don't put curl.exe in sSystem32 or SysWOW64, and then either specify the full path to it when using Exec or add the directory where it is located to your PATH.

A: curl is 64-bit if you call it like this works; %windir%\sysnative\curl


text:
Q: How do I disable Home button in Android 4.4.2 In my app i have to disable device's Home key, my tab supports android 4.4.2
I know how to disable back button functionality, i used below lines for that
@Override
public void onBackPressed() {
}

but i am concern about How to disable Home button functionality ?
I tried below code to disable home button but did not get any help
// to disable home button -- START --
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
    if(keyCode == KeyEvent.KEYCODE_HOME)
    {
        return true;
    }
    return super.onKeyDown(keyCode, event);
}
// to disable home button -- END --

A: Try overriding onKeyDown()
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
    if(keyCode == KeyEvent.KEYCODE_HOME)
    {
        Log.d("Test", "Home button pressed!");
        return true;
    }
    return super.onKeyDown(keyCode, event);
}

A:
No.... You cannot override home button for Android4.0 and above

This is for security reasons.

Check this answer from Commonsware for more information

A: @Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
    // put your logic here.
     }
return true;
}

or you can try this:
ActionBar actionBar;
    actionBar = getActionBar();
    actionBar.setHomeButtonEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(false);


text:
Q: Use gtag.js to track virtual pageviews I have a multipage registration form and I want to track user's path through  the form using Google Tag Manager. My page uses a recommended code snippet in the header to track page view:
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXX');

According to documentation I generate a virtual page view when a user clicks a certain button in the form:
gtag('js', new Date());
gtag('config', 'UA-XXXXX', {
     'page_title' : 'User registration',
     'page_path': '/registration/page2'
});

However, this code doesn't add a new page view. It overrides the original one. What am I doing wrong? I want a new pageview to be generated when the user clicks a button.

A: It doesn't look like you're using GTM, but gtag.js instead.
You'll need to trigger it on click events. Something like:
<button onclick="formStep2()">Click me</button>

Then for the formStep2() function:
function formStep2(){
    gtag('config', 'UA-XXXXX', {
     'page_title' : 'User registration',
     'page_path': '/registration/page2'
    });
}

Of course, you can setup the function to be more generic/useful by passing in a parameter indicating the path/title as well.


text:
Q: how to add array in variable and send it in url by get method I want to send multiple values in one parameter
// from client side will be like
var x= [1,2,3]

after sending the parameters, how to retrieve it the like this
def func1()
    y=params[:x] // [1,2,3]
    .....
end

A: Since the question is not very clear I assume you are asking about sending parameters using a form
In view,
= text_field_tag 'array_field', '1,2,3,4,5'

In controller,
params[:array_field].split(',')
#=> ['1','2','3','4','5']

Tried this example in console
irb > "1,2,3".split(',')
#=> ["1", "2", "3"]

Hope that helps!

A: You Can send the parameters like this
http://url?x[]=1&x[]=2&x[]=3

and will receive the parameter as an array in the backend
arr = params[:x] /// [1,2,3]


text:
Q: How to pass event parameters to AWS Lambda function using API Gateway? I have an AWS Lambda function written in python that is initiated by a Zapier trigger that I set up. As I pass some input parameters to the function in the Zapier trigger, I can access to the input parameters in my python code by using variables such as event[parameter1]. It perfectly works.
I'm trying to access the same Lambda function in Airtable Scripting environment. In order to do it, I set up an API Gateway trigger for the Lambda function, but I can't figure out how to pass input parameters in the vanilla JS environment. Below is the code that I have, which gives me "Internal Server Error".
Your help would be definitely appreciated!
const awsUrl = "https://random-id.execute-api.us-west-2.amazonaws.com/default/lambda-function";
let event = {
    "queryStringParameters": {
        "gdrive_folder_id": consFolderId,
        "invitee_email": email
    }
};

let response = await fetch(awsUrl, {
    method: "POST",
    body: JSON.stringify(event),
    headers: {
        "Content-Type": "application/json",
    }
});
console.log(await response.json());

[Edited] Plus, here's the code of the Lambda function and the latest cloudwatch log after a successful execution invoked by Zapier. It's a simple code that automates Google Drive folder sharing based on 2 inputs. (Folder ID + email address) Please bear with me for the poor code quality!
from __future__ import print_function
from googleapiclient.discovery import build
from google.oauth2 import service_account

SCOPES = ['https://www.googleapis.com/auth/drive']
SERVICE_ACCOUNT_FILE = 'service.json'

def lambda_handler(event, context):
    """Shows basic usage of the Drive v3 API.
    Prints the names and ids of the first 10 files the user has access to.
    """
    # 2-legged OAuth from Google service account
    creds = service_account.Credentials.from_service_account_file(
        SERVICE_ACCOUNT_FILE, scopes=SCOPES)

    drive_service = build('drive', 'v3', credentials=creds)

    # change multiple permissions with batch requests
    folder_id = event['gdrive_folder_id']
    email_address = event['invitee_email']

    def callback(request_id, response, exception):
        if exception:
            # Handle error
            print(exception)
        else:
            print("Permission Id: {}".format(response.get('id')))

    batch = drive_service.new_batch_http_request(callback=callback)
    user_permission = {
        'type': 'user',
        'role': 'writer',
        'emailAddress': email_address
    }
    batch.add(drive_service.permissions().create(
            fileId=folder_id,
            body=user_permission,
            fields='id',
    ))
    batch.execute()

A: I'm not a Python expert and I don't know how you've setup your API Gateway integration with Lambda but I believe your code can have two issues:
1.) Internal Server Error as a response from the API Gateway endpoint also often refers to a problem in the integration between the API Gateway and your Lambda function. In this case here I can not see where you are returning a valid response back to the API Gateway. In your example the return value of batch.execute() is probably returned, right? However, by default the API Gateway expects an object that contains a statusCode and body and optionally headers. You can have a look at the AWS Lambda handler documentation for Python and their examples. Also this documentation page might be of interest for you.
2.) In your function you are accessing the event data like event['gdrive_folder_id']. However, I can not see that you are parsing the event data somewhere. Are you using a custom integration between your API Gateway? Because in case of a proxy integration the API Gateway sends an object that has a body field and from there you'd need to read the HTTP body. See examples on this documentation page.
Here are some more thing you can check on your own:
Have you also checked what you get when you just print the event data? Also, is the batch.execute() waiting for the batch processing or does it return anything? If so, what does it return?
One note here: You haven't told us anything about the integration between your API Gateway and your Lambda function. Since you can do some mapping between the API Gateway and AWS Lambda, it could be possible that you are converting the request and response outside of the Lambda function and hence, my suggestions above are wrong. Let me know if this is true or not and we can further investigate it.


text:
Q: JQuery-Ajax script not working in ie on second click but working in FF and Chrome on second click I have another weird little jquery-ajax problem. The script below works perfectly upon multiple clicks in FF and chrome, but only works the first click in ie. I have viewed it in firebug and no problems. I have similar jq scripts that can repeat infinately just fine, but can't figure out why this one won't.
Now that I think of it the other scripts are POST requests, FYI. ANY IDEAS?
JQuery-AJAX script below:
$('.activity').on('click', '.tip', function(e){
    e.preventDefault();
    var tip = $(this);
    var class_tips = tip.parent();
    var actID = class_tips.find('.value').val();
    $.ajax({
        type: "GET",
        data: "captip=" + actID,
        url: "includes/tips.php",
        success: function(msg){
            class_tips.find('.tips_right').html(msg);
        }
    });
    return false;
})

A: I think if you return true on success it should reset
the e.preventDefault();
$('.activity').on('click', '.tip', function(e){
    e.preventDefault();
    var tip = $(this);
    var class_tips = tip.parent();
    var actID = class_tips.find('.value').val();
    $.ajax({
        type: "GET",
        data: "captip=" + actID,
        url: "includes/tips.php",
        success: function(msg){
            class_tips.find('.tips_right').html(msg);
            return true;
        }
    });
    return false;
})


text:
Q: I cannot find a "button onclick" element using Selenium and Python I am automating a process using Selenium and python. Right now, I am trying to click on a button in a webpage (sorry I cannot share the link, since it requires credential to login), but there is no way my code can find this button element. I have tried every selector (by id, css selector, xpath, etc.) and done a lot of googling, but no success.
Here is the source content from the web page:
<button onclick="javascript: switchTabs('public');" aria-selected="false" itemcount="-1" type="button" title="Public Reports" dontactassubmit="false" id="public" aria-label="" class="col-xs-12 text-left list-group-item tabbing_class active"> Public Reports </button>

I also added a sleep command before this to make sure the page is fully loaded, but it does not work.
Can anyone help how to select this onclick button?
Please let me know if you need more info.
Edit: you can take a look at this picture to get more insight (https://ibb.co/cYXWkL0). The yellow arrow indicates the button I want to click on.

A: The element you trying to click is inside an iframe. So, you need to switch driver into the iframe content before accessing elements inside it.
I can't give you a specific code solution since you didn't share  a link to that page, even not all that HTML block. You can see solutions for similar questions here or enter link description here. More results can be found with google search


text:
Q: how insert foreach function in html? I'm a newbie who's been looking for a solution regarding inserting a PHP foreach output in HTML,
there is my query code:
$qr = $this->db->query("select journalDetail.COA_CODE, COA_TITLE, COA_TYPE from t_journal_detail journalDetail left join r_coa coaTitle on journalDetail.coa_code=coaTitle.coa_code where journalDetail.JOURNAL_ID = '".$journalId."'");
$coaTitle = $qr->result_array();

    foreach ($coaTitle as $coa) {
        echo ''.$coaTitle[0]['COA_CODE'].'
';
    }

and there is my html code:
$detailJournal = '<!DOCTYPE html>

                                    '.$coaTitle[0]['COA_CODE'].'
                                    '.$coaTitle[0]['COA_TITLE'].'
                                    IDR
                                    '.$journalDetail[0]['ORIG'].'
                                    0
                                    '.$journalDetail[0]['SUM'].'

                        ';

    return $detailJournal;

}

the question is how insert foreach in html?

A: In your foreach, rather than echoing the value, build it up into a string
 (adding each part with .=) which you can then insert into your larger HTML...
$qr = $this->db->query("select journalDetail.COA_CODE, COA_TITLE, COA_TYPE from t_journal_detail journalDetail left join r_coa coaTitle on journalDetail.coa_code=coaTitle.coa_code where journalDetail.JOURNAL_ID = '".$journalId."'");
$coaTitle = $qr->result_array();
$htmlTable = "";
foreach ($coaTitle as $coa) {
    $htmlTable .= '
';
    $htmlTable .= ''.$coa['COA_CODE'].'
';

    //  Continue adding fields using `$coa['FIELD NAME']` and $htmlTable .= ...

    $htmlTable .= '
';
}

$detailJournal = '<!DOCTYPE html>

'
                              .$htmlTable.'

                        ';

    return $detailJournal;

}

You just need to use the line
$htmlTable .= ''.$coa['COA_CODE'].'
';

as a template to add in the other columns.

A: try this:
$qr = $this->db->query("select journalDetail.COA_CODE, COA_TITLE, COA_TYPE from t_journal_detail journalDetail left join r_coa coaTitle on journalDetail.coa_code=coaTitle.coa_code where journalDetail.JOURNAL_ID = '".$journalId."'");
$coaTitle = $qr->result_array();

    foreach ($coaTitle as $coa) {
        echo ''.$coa[0]['COA_CODE'].'
';
    }

in foreach($coaTitle as $coa) you must use $coa instead $coaTitle

A: if you want to add php code in html file then, you can add directly by adding  php tag, and save file with .php extension
$detailJournal = '<!DOCTYPE html>

                <?php
                foreach ($coaTitle as $coa) {
                ?>

                        '.$coa['COA_CODE'].'
                        '.$coa[0]['COA_TITLE'].'
                        IDR
                        '.$journalDetail[0]['ORIG'].'
                        0
                        '.$journalDetail[0]['SUM'].'

                <?php
                }
                ?>


text:
Q: Is simultaneity in SR only a pedagogical tool? In a very recent post here I recently learned that simultaneity has no meaning in general relativity; I can accept the answer and explanation that was given for that question.
But then Harry Johnston replied to my comment saying that the concept of simultaneity also has no place in special relativity - that it's just a pedagogical tool.
Is that right - simultaneity - what I take as two observers in separate reference frames not necessarily agreeing on when events happen, or even the order in which they happen - is just a pedagogical tool?
To what end? How does that prepare them for understanding general relativity?
I only have a cursory understanding of both SR and GR - but now I'm really confused.

A: While I'm not a relativist I think that the notion is perfectly well defined (if frame dependent). After all, Einstein told us how to synchronize space-like separated clocks presuming that they are mutually at rest and that these clocks define the time coordinate for that frame.
Thus I don't see how you can avoid the conclusion that simultaneity is defined.
Perhaps harry just means that the frame dependence renders the notion less generally useful than it is in Galilean relativity.

A: Here's the original comment:

@docscience: IMO, simultaneity has no real meaning in SR, either. It is only used for pedagogical purposes - basically, to explain SR to someone who is used to thinking in Newtonian terms. By the time you get to explaining GR, the student is expected to be knowledgeable enough to cope without it. –  Harry Johnston

What Harry meant was that the concept of absolute simultaneity--that is, every observer agrees on whether event A happened before, after, or simultaneously with event B--is a useful idea to contrast with relativistic notions of observers in different reference frames. A common teaching technique is to take a familiar concept (absolute simultaneity) and show how the concept to be learned (relativity) is different.
In Galilean relativity (and our everyday life), absolute simultaneity exists. A student first learning relativity needs to learn that, for different observers, event A happening before event B and B happening before A can both be correct observations for different observers. Furthermore, there is no correct truth of the matter. Both observers are correct in their conclusions.

A: In most introductions to Special Relativity, students learn a special procedure for setting up coordinates which involves synchronizing clocks with light pulses. This leads to a natural definition of simultaneous events as events which occur at the same coordinate time. The notion of simultaneity basically stems from a preference for a particular set of coordinates.
Its a fundamental principle in Relativity that the choice of coordinates is arbitrary (so long as you preserve the space time interval). The whole point of the subject is that there isn't a preferred reference frame. There is no coordinate invariant notion of simultaneity, so it doesn't make sense to talk about it in from this perspective, except to emphasize that its not a thing.


text:
Q: Is it possible to load JSON data in Wordpress without using AJAX? So, I'm diving head first into something I have little knowledge about; Wordpress and using AngularJS to display custom data in a custom page within a theme. Most of what I have just stated, I've been able to find proper documentation on how to make it work, however, all of it references the JSON gathering using AJAX. Is it possible to pull JSON data from WP using a bootstrap (not sure if this is the correct term) method?
For example, as soon as the page loads, the <head> would contain all of the necessary JSON data available to the application without having to make an AJAX request to get it:
<head>
    <script>
       var jsonData = {
          "prop" : "value"
       }
    </script>
</head>

So far I've learned that WP has a JSON REST API available to display data in JSON, however, can it be used as it is displayed above as opposed to using an HTTP request to get the data and assign it to an Angular model?


text:
Q: R Boxplot From Filtered Data I have a data frame that is formatted like the below:
| user_id | ans_id | key_name | prec_pause | trail_pause |
|---------|--------|----------|------------|-------------|
| 1       | 4      | Period   | 62.0       | 625.0       |
| 1       | 4      | Spacebar | 172.0      | 156.0       |
| 1       | 5      | Period   | 1235.0     | 218.0       |
| 1       | 5      | Spacebar | 218.0      | 141.0       |
| 1       | 8      | Comma    | 125.0      | 844.0       |
| 1       | 8      | Comma    | 129.0      | 800.0       |

## User-friendly form
dat <- structure(list(user_id = c(1L, 1L, 1L, 1L, 1L, 1L), ans_id = c(4L,
4L, 5L, 5L, 8L, 8L), key_name = c("Period", "Spacebar", "Period",
"Spacebar", "Comma", "Comma"), prec_pause = c(62, 172, 1235,
218, 125, 129), trail_pause = c(625, 156, 218, 141, 844, 800)), .Names = c("user_id",
"ans_id", "key_name", "prec_pause", "trail_pause"), class = "data.frame", row.names = c(NA,
-6L))

I would like to create a box plot for each pair of pauses, so one pair for Period_prec_pause and one for Period_trail_pause. In the example above, there would be 3 such pairs.
Ideally, there would be extra spacing between pairs, but this is optional.

A: Melt your data and boxplot it:
library (reshape2)
m = melt(dat[,c(3:5)])
boxplot(value ~ variable * key_name, data = m, col=(c("gold","darkgreen")))


text:
Q: How to iterate through dynamic JSON keys using scala? I am beginner to scala.
I have a list that contains following data:
"Commands" : {
"system1" : "Name-ABC;IP-null; CPU-16;Mem-4096;id-1",
"system2" : "Name-XYZ;IP-null;CPU-4;Mem-2048;id-2",
"system3" : "Name-PQR;IP-null;CPU-2;Mem-2048;id-3",
"system4" : "Name-LMN;IP-192.168.20.22;CPU-2;Mem-1600;id-4"
"someotherkey":"some other value"
}

In above json, keys system1,2,3... are dynamic keys. I don't know exact number of keys (system) also.
After iterating I want to split value by ';' and then by '-' in order to access value of key.
e.g. I want to access 'Name'='ABC' from above json
How do I iterate through json with dynamic keys using scala?
Is it possible to use map?


text:
Q: 2 divs not willing to display next to each other I have 2 div I need to position next to each other, with eventually a 3rd to be added. I've tried floating them, I've tried display and position options.
also checked other websites copied that code but it still won't work.
html:

Ontruimingsoefening

Wij verzorgen diverse ontruimingsoefeningen die afgestemd zijn op zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden en detailhandel. De ontruimingsoefeningen kunnen zowel theoretisch (Table Top) als praktisch toegepast worden waarbij wij gebruik maken van professionele hulpmiddelen om de ontruimingsoefening zo realistisch mogelijk te maken.

beheer brandmeldinstallatie

Wij verzorgen de verplichte maandelijkse en viermaandelijkse beheerderstaken van de brandmeldinstallatie conform NEN 2654 op professionele wijze voor zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden, kantoorgebouwen en detailhandel. Het onderhoud van de brandmeldinstallatie bestaat uit het testen van de doormelding naar de brandweer van automatische rookmelders en handbrandmelders, het testen van de doormelding van storingen aan de brandmeldinstallatie, een visuele controle van de aangesloten componenten, het bijwerken en onderhouden van het logboek.

css:
.diensten h2 {
    padding-top: 40px;
}

.diensten p, h2 {
    font-family: Gotham, "Helvetica Neue", Helvetica, Arial, "sans-serif";
    padding: 20px;
}

.diensten {
    position: relative;
    display: inline-block;
    height: 500px;
    background-color: #FFFFFF;
    margin: auto;
}

#dienst1 {
    margin-left: 90px;
    height: 500px;
    width: 500px;
    box-shadow: 0px 0px 30px 0px #000;
}

#dienst2 {
    margin-left: 900px;
    height: 500px;
    width: 500px;
    box-shadow: 0px 0px 30px 0px #000;
}

#dienst2 img{
    height: 300px;
    width: 450px;
}

A: Add display: flex to the parent, and remove the huge margin-left on #dienst2 - or don't, isn't necessary, but I did since you want them to be beside one another. Any other elements you put adjacent to them will display in the same row.

.diensten h2 {
    padding-top: 40px;
}

.diensten p, h2 {
    font-family: Gotham, "Helvetica Neue", Helvetica, Arial, "sans-serif";
    padding: 20px;
}

.diensten {
    position: relative;
    height: 500px;
    background-color: #FFFFFF;
    margin: auto;
  display: flex;
}

#dienst1 {
    margin-left: 90px;
    height: 500px;
    width: 500px;
    box-shadow: 0px 0px 30px 0px #000;
}

#dienst2 {
    height: 500px;
    width: 500px;
    box-shadow: 0px 0px 30px 0px #000;
}

#dienst2 img{
    height: 300px;
    width: 450px;
}

Ontruimingsoefening

Wij verzorgen diverse ontruimingsoefeningen die afgestemd zijn op zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden en detailhandel. De ontruimingsoefeningen kunnen zowel theoretisch (Table Top) als praktisch toegepast
      worden waarbij wij gebruik maken van professionele hulpmiddelen om de ontruimingsoefening zo realistisch mogelijk te maken.

beheer brandmeldinstallatie

Wij verzorgen de verplichte maandelijkse en viermaandelijkse beheerderstaken van de brandmeldinstallatie conform NEN 2654 op professionele wijze voor zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden, kantoorgebouwen
      en detailhandel. Het onderhoud van de brandmeldinstallatie bestaat uit het testen van de doormelding naar de brandweer van automatische rookmelders en handbrandmelders, het testen van de doormelding van storingen aan de brandmeldinstallatie, een
      visuele controle van de aangesloten componenten, het bijwerken en onderhouden van het logboek.

A: You should add display:inline;and remove margin
#dienst1 {
    margin-left: 90px;
    height: 500px;
    width: 500px;
    box-shadow: 0px 0px 30px 0px #000;
    display:inline;
}

#dienst2 {

   height: 500px;
   width: 500px;
   box-shadow: 0px 0px 30px 0px #000;
   display:inline;
}

A: You just need to add
position: relative;
display: inline-block;

to the child divs, and
position: absolute;

to the parent div.  Here is a working example (with 3 paragraphs side by side -- I reduced the width just so you can see them in the small window).  You can also remove or reduce the margin if you want.

.diensten h2 {
    padding-top: 40px;
}

.diensten p, h2 {
    font-family: Gotham, "Helvetica Neue", Helvetica, Arial, "sans-serif";
    padding: 20px;
}

.diensten {
    position: absolute;
    display: inline-block;
    height: 500px;
    background-color: #FFFFFF;
    margin: auto;
}

#dienst1 {
    margin-left: 90px;
    position: relative;
    display: inline-block;
    height: 500px;
    width: 100px;
    box-shadow: 0px 0px 30px 0px #000;
    overflow: hidden;
}

#dienst2 {
    margin-left: 90px;
    position: relative;
    display: inline-block;
    height: 500px;
    width: 100px;
    box-shadow: 0px 0px 30px 0px #000;
    overflow: hidden;
}

#dienst3 {
    margin-left: 90px;
    position: relative;
    display: inline-block;
    height: 500px;
    width: 100px;
    box-shadow: 0px 0px 30px 0px #000;
    overflow: hidden;
}

#dienst2 img{
    height: 300px;
    width: 450px;
}

Ontruimingsoefening

Wij verzorgen diverse ontruimingsoefeningen die afgestemd zijn op zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden en detailhandel. De ontruimingsoefeningen kunnen zowel theoretisch (Table Top) als praktisch toegepast worden waarbij wij gebruik maken van professionele hulpmiddelen om de ontruimingsoefening zo realistisch mogelijk te maken.

beheer brandmeldinstallatie

Wij verzorgen de verplichte maandelijkse en viermaandelijkse beheerderstaken van de brandmeldinstallatie conform NEN 2654 op professionele wijze voor zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden, kantoorgebouwen en detailhandel. Het onderhoud van de brandmeldinstallatie bestaat uit het testen van de doormelding naar de brandweer van automatische rookmelders en handbrandmelders, het testen van de doormelding van storingen aan de brandmeldinstallatie, een visuele controle van de aangesloten componenten, het bijwerken en onderhouden van het logboek.

beheer brandmeldinstallatie

Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text .

A: Divs are initially block level elements. This means, among other things, that they each appear on their own lines. There are several ways to put two divs along side each other. Which one you choose will come down to the desired effect (and side effects) you want. Here are some options:

*

*Float them (float: left)

*Make them inline block (display: inline-block)

*Use flexbox (apply display: flex to their parent)

*Make them grid items (apply display: grid to their parent; very new feature and requires fallbacks)

I suggest you read up on CSS layout methods. Each method is a useful tool, and none is a one-size-fits-all solution. You should try to get familiar with them all. A great resource to get started is learnlayout.com. Once you get the basics down, if you want to dive deeper, you can check out my book.

A: If you are going to add 3 divs next to each other you need to reduce the width of each div.
500px for each one aint gonna work unless your target audience is that of large desktop;
anyway I reduced it to 300px for both height and width, and made the overflow to
scroll for y axis.
If you want to remove the scroll. (remove overflow-y: scroll; and all the styling) and specify the height so that the content of all the divs is visible)
View in Fullscreen(Stackoverflow forces resize)

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

.diens{
  width:300px;
  height:300px;
  font-family:sans-serif;
  box-shadow:0px 1px 3px rgba(0,0,0,.6);
  padding:20px;
  float:left;
  overflow-y: scroll;
  margin-right:10px;
}

.diens h2{
  margin: 20px 0px;
}

.diens p{
  font-size:14px;
}

.diens::-webkit-scrollbar-track
{
 -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
 background-color: #F5F5F5;
}

.diens::-webkit-scrollbar
{
 width: 10px;
 background-color: #F5F5F5;
}

.diens::-webkit-scrollbar-thumb
{
 background-color: #373737;
 border: 2px solid #F5F5F5;
}

Ontruimingsoefening

Wij verzorgen diverse ontruimingsoefeningen die afgestemd zijn op zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden en detailhandel. De ontruimingsoefeningen kunnen zowel theoretisch (Table Top) als praktisch toegepast worden waarbij wij gebruik maken van professionele hulpmiddelen om de ontruimingsoefening zo realistisch mogelijk te maken.

beheer brandmeldinstallatie

Wij verzorgen diverse ontruimingsoefeningen die afgestemd zijn op zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden en detailhandel. De ontruimingsoefeningen kunnen zowel theoretisch (Table Top) als praktisch toegepast worden waarbij wij gebruik maken van professionele hulpmiddelen om de ontruimingsoefening zo realistisch mogelijk te maken.

beheer brandmeldinstallatie

Wij verzorgen de verplichte maandelijkse en viermaandelijkse beheerderstaken van de brandmeldinstallatie conform NEN 2654 op professionele wijze voor zorginstellingen, onderwijsinstellingen, kinderdagverblijven, horecagelegenheden, kantoorgebouwen en detailhandel. Het onderhoud van de brandmeldinstallatie bestaat uit het testen van de doormelding naar de brandweer van automatische rookmelders en handbrandmelders, het testen van de doormelding van storingen aan de brandmeldinstallatie, een visuele controle van de aangesloten componenten, het bijwerken en onderhouden van het logboek.


text:
Q: non noetherian rings There are many questions about Examples of a non-Noetherian rings on this site, but this is a bit different.
Let $f:R\to S$ be a homomorphism and R be Noetherian. If $f$ is surjective, then $S$ is also
Noetherian. But there are examples (on the site) that $f$ is 1-1, while $S$ is non-Noetherian.
What if $f$ is not surjective and not 1-1? is there examples that $S$ is non-Noetherian?
Thank you.


text:
Q: Is it possible to distinguish the calls based on data type in ASP.NET MVC? I've two action methods one with parameter as integer and other as parameter as string. Is there any way to make these work?
Both methods have id as parameter but different data type.

A: You can use [ActionName("smt")]
            public ActionResult Add(int id)
            {
                return View();
            }

            [ActionName("another")]
            public ActionResult Add(string id)
            {
                return View("index");
            }

A: You can do that by providing datatype for the parameters passed to the method as shown below
    [HttpGet, Route("SomeMethod/{id}")]
    public string SomeMethod(string Id)
    {
        return "string";
    }

    [HttpGet, Route("SomeMethod/{id:int}")]
    public string SomeMethod(int Id)
    {
        return "int";
    }

The second method had {id:int} component in the route that tells it that the id parameter has to be of datatype int to match this method. The caveat here is that you cannot pass strings that could be passed into int. For eg. if you wish to pass string Id "1", it will bind to the int method instead of the string  method.
Here is some more info on attribute routing in MVC


text:
Q: Mathematica won't maximize my function I am trying to maximize two functions. For the first one, the code runs correctly and returns the desired answer:
Maximize[{
    ax (Log[a] - Log[ax + cy]) +
    bx (Log[b] - Log[bx + dy]) +
    cy (Log[c] - Log[ax + cy]) +
    dy (Log[d] - Log[bx + dy]),
    x >= 0, y >= 0, x + y == 1
  },
  {x, y}]

{ax Log[a] + bx Log[b] + cy Log[c] - ax Log[ax + cy] - cy Log[ax + cy] +
      dy Log[d] - bx Log[bx + dy] - dy Log[bx + dy],
 {x -> 1/2, y -> 1/2}}

But for the second one,
Maximize[{
    (1/2) (x Log[x] + y Log[y] + u Log[u] + v Log[v]) -
    (1/2) (x + u) Log[(1/2) (x + u)] -
    (1/2) (y + v) Log[(1/2) (y + v)],
    x >= 0, y >= 0, u >= 0, v >= 0,
    x + y == 1, u + v == 1
  },
  {x, y, u, v}]

I just get the same thing I wrote as an input.
What am I doing wrong? How should I fix it?

A: Did you check the answer with NMaximize command?
NMaximize[{(1/2) (x Log[x] + y Log[y] + u Log[u] + v Log[v])
            - (1/2) (x + u) Log[(1/2) (x + u)] - (1/2) (y + v) Log[(1/2) (y + v)],
           x >= 0, y >= 0, u >= 0, v >= 0, x + y == 1, u + v == 1}, {x, y, u, v}]

NMaximize::nnum: "The function value Indeterminate is not a number at
 {u,v,x,y} = {2.89263*10^-8,1.,1.,0.} >>

{0.693147, {u -> 5.00551*10^-9, v -> 1., x -> 1., y -> 3.92799*10^-8}}


text:
Q: Python---loop over a dictionary with dataframes I have a dictionary of dataframes
list_of_dfs={'df1:Dataframe','df2:Dataframe','df3:Dataframe','df4:Dataframe'}

Each data frame contains the same variables (price, volume, price,"Sell/Purchase") that I want to manipulate to end up with a new subset of DataFrames. My new dataframes have to filter the variable called "Sell/Purchase" by the observations that have "Sell" in the variable.
sell=df[df["Sale/Purchase"]=="Sell"]

My question is how do I loop over the dictionary in order to get a new dictionary with this new subset?
I dont know how to write this command to do the loop. I know it has to start like this:
 # Create an empty dictionary called new_dfs to hold the results
new_dfs = {}
# Loop over key-value pair
for key, df in list_of_dfs.items():

But then due to my small knowledge of looping over a dictionary of dataframes I dont know how to write the filter command. I would be really thankful if someone can help me.
Thanks in advance.

A: Try this,
dict_of_dfs={'df1':'Dataframe','df2':'Dataframe','df3':'Dataframe','df4':'Dataframe'}

# Create an empty dictionary called new_dfs to hold the results
new_dfs = {}
# Loop over key-value pair
for key, df in dict_of_dfs.items():
    new_dfs[key] = df[df["Sale/Purchase"]=="Sell"]

Explanation:
new_dfs = {} # Here we have created a empty dictionary.
# dictionary contains keys and values.
# to add keys and values to our dictionary,
# we need to do it as shown below,
new_dfs[our_key_1] = our_value_2
new_dfs[our_key_2] = our_value_2
.
.
.

A: You can map a function:
lambda df: df[df["Sale/Purchase"] == "Sell"]
HOW:
Syntax = map(fun, iter)
map(lambda df: df[df["Sale/Purchase"] == "Sell"], list_of_dfs)
You can map it on the a list, or set
For dict:
df_dict = {k: df[df["Sale/Purchase"]=="Sell"] for k, df in list_of_dfs.items()}

A: Something like:
sells = {k: v for (k, v) in list_of_df.items() if v["Sale/Purchase"] == "Sell"}

This pattern is called dictionary comprehension. According to this question this is the fastest and most Pythonic approach.
You should provide an example of the data you are dealing with for more precise answer.


text:
Q: Kind of complicated custom UITableViewCell I have a particular goal in mind here, searching for it is a little hard.  I am trying to accomplish this (This is a photoshopped screenshot):

I have everything in this view working, except for the split row for the Company Name/ Beginning of the field row.  The "Company Name" field is just a textfield, all I really want to do is shrink that neato cell background to just go behind the right side.

A: Create a custom table view cell that has two subviews: the text field on the left and a UITableViewCell on the right as a subview of the main table view cell.  A UITableViewCell is just a UIView so you can actually add it as a subview of any view.  The main table view cell will have it's background color set to transparent.

A: So totally complicated custom cell comes with a totally ridiculous solution.  I built a view for the cell that has the one field...and another UITableView.
That second UITableView has the "Beginning of the field" text, and its cell gets the background, and I hide the background of the main cell.
I had to play around with the nested table's size and position to get the row to display properly, and make sure that the lines in the background don't shift when it hits the nested table, but it came out perfect

A: You could try setting the frame property of your cells backgroundView to cover only have your cell's width. Address Book handles complex forms like this with a nice look and feel--you might want to see what they've done there..

A: One approach would be to define a custom table view cell, set its background transparent and add the UITextField on the left and a UIButton on the right (customize it to look like your other cells), as in your screenshot.


text:
Q: Define conditional probability on an event given conditional probability on a $\sigma$-algebra? Let $(\Omega, \Sigma, P)$ be a probability space and $A, B \in \Sigma$ events. If $\Pr (B) = 0$ then there is no coherent definition for $\Pr (A | B)$. As Kolmogorov states, "the concept of a conditional probability with regard to an isolated given hypothesis [namely $B$ here] whose probability equals zero is inadmissible" [1, p.67]. This is the Borel-Kolmogorov paradox.
Kolmogorov resolved this paradox (at least to his own satisfaction -- the debate is still ongoing [2]) by giving a precise definition of conditional probability via the Radon-Nikodym theorem. The downside is that the Radon-Nikodym theorem does not define the probability conditioned on an event  -- such as $\Pr (A | B)$ -- but rather it defines a probability $ \Pr (A | \mathcal F) \in L^1 (\Omega, \mathcal F, P)$ conditioned on a sub-$\sigma$-algebra $\mathcal F \subset \Sigma$.
It is my impression that, under a fixed sub-$\sigma$-algebra $\mathcal F$, there is a coherent definition for $\Pr (A | B)$ when $B \in \mathcal F$. That is, the Borel-Kolmogorov paradox does not arise if we fix the conditioning sub-$\sigma$-algebra $\mathcal F$. Is this true? If it is not true, then how could Kolmogorov claim to have resolved the paradox?
Secondly -- if it is true -- then how exactly is the paradox resolved? That is, how do we coherently define $\Pr (A | B)$ using $\Pr (A | \mathcal F)$?
I know that
$$ \int_B \Pr (A | \mathcal F)(\omega) d P(\omega) = \Pr (A \cap B),$$
for any $B \in \mathcal F$. Further, if $B$ is an atom of $\mathcal F$, then $\Pr (A | \mathcal F)$ is a.e. constant on $B$ and equal to $\frac{\Pr (A \cap B)}{\Pr (B)}$. So I am able to recover the elementary definition of conditional probability $\Pr (A | B) = \frac{\Pr (A \cap B)}{\Pr (B)}$ from $\Pr (A | \mathcal F)$ when $\Pr (B) > 0$. But how can I derive a conditional probability $\Pr (A | B)$ from $\Pr (A | \mathcal F)$ when $\Pr (B) = 0$?

[1] Rao, M.M. Conditional Measures and Applications. Revised second edition. Boca Raton, FL: Chapman and Hall/CRC, 2005. https://doi.org/10.1201/9781420027433.
[2] Gyenis, Z., G. Hofer-Szabó, and M. Rédei. 'Conditioning Using Conditional Expectations: The Borel–Kolmogorov Paradox'. Synthese 194, no. 7 (1 July 2017): 2595–2630. https://doi.org/10.1007/s11229-016-1070-8.

A: $\Pr (A | \mathcal F) $ does not coherently define $\Pr (A | B)$ when $P(B) = 0$. This is because the conditional expectation $\Pr (A | \mathcal F)$ is only defined almost everywhere. For example, suppose $\mathcal F$ is generated by a countable partition $\{B_i\}_{i=1}^\infty$ of $\Omega$. It is straightforward to prove that
$$ \Pr (A | \mathcal F)(\omega) = \begin{cases} \frac{P(A \cap B_i)}{P(B_i)} & \text{ if } \omega \in B_i \text{ with } P(B_i) \ne 0, \\ x & \text{ if } \omega \in B_i \text{ with } P(B_i) = 0, \end{cases}$$
-- where $x$ is arbitrary -- is a version of $\Pr (A | \mathcal F)$. This version $\Pr (A | \mathcal F)$ gives a natural definition of the conditional probability
$$\Pr (A | B_i) := \Pr (A | \mathcal F)(\omega),$$
where $\omega \in B_i$. This is consistent with the elementary definition of conditional probability for positive-probability events.
Now we can change $x$ and obtain another version of $\Pr (A | \mathcal F)$. But the conditional probability $\Pr(A | B_i)$ for zero-probability $B_i$ is different under this new version. So the conditional probability $\Pr (A | \mathcal F)$ on a sub-$\sigma$-algebra $\mathcal F$ cannot consistently define a conditional probability $\Pr (A|B)$ on a zero-probability event $B$. If we fix a version of $\Pr (A | \mathcal F)$, we can define $\Pr (A|B)$ -- but that definition is necessarily relative to our choice of version.
Thus, fixing a sub-$\sigma$-algebra $\mathcal F$ does not resolve Borel's paradox. We still get incoherent definitions of $\Pr (A | B)$ even when working under the same sub-$\sigma$-algebra.


text:
Q: JAXB marshall/unmarshall using propOrder and null values I have a class that looks like this:
public class Word {
      String text;
      String root;
      int id;
      String definition;
...
}

I am trying to read/write it using marshal/unmarshal and it worked fine until I wanted to determine a prop order:
   @XmlType( propOrder = {"text", "root", "id", "definition"} )

Now it is failing when root is empty (which it is sometimes).  Any ideas?


text:
Q: svn: E155000 as maven tries to commit As I run the maven goal release:prepare i get the svn error:
svn: E155000 No write-lock in ...
I tried different versions of SVN and maven. Tried to check out using tortoisesvn and command line. Asked out resident maven expert.
Checked and re-checked settings.xml.
Anyone with a idea where to look?
ADD: It however seems like maven done the checkin. But the working copy still flagged as having local changes.
Complete message:
`[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3:prepare (default-cli) on project <project>: Unable to commit files
[ERROR] Provider message:
[ERROR] SVN commit failed.
[ERROR] Command output:
[ERROR] svn: E155000: Commit failed (details follow):
[ERROR] svn: E155000: No write-lock in 'C:\path...'
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException`

A: The problem was at the end related to the settings.xml file. Rewrote it from scratch and got things to work. Probably something fishy with the setup of scm in the pom.
Thanks


text:
Q: Are there any file-copy deployable web servers that can serve Asp.Net MVC content? I have been using the Uniform Server for doing local development without any huge commitment or any server-style footprint on my dev box.
I'd like to enable a similar experience for Asp.Net MVC 3 and Razor development.  But I'd like to avoid installing IIS, SQL Server, and Visual Studio.  I'd like to avoid installing any server software, except via a file copy.  The express versions of VS aren't an improvement, for example.
I can deal with having to install frameworks, like the .Net Framework 4.0, MVC3, etc.
Questions:
Is there any existing software capable of this?  Is it possible to bend my existing Apache file-copied deployment to do this and work with the .Net Framework?
If not, what is the least I could get away with?  Is it possible to install some version of the Asp.Net Development Server without installing full IIS, SQL Server, and Visual Studio?
Reason:
My hosting provides PHP and Asp.Net support only, and I don't really want to use PHP.  I don't want my in-development or throw-away projects to be public, so I'm not going to use my hosting for development.  I also want to enable the whole "wipe it clean and start fresh by wiping a directory" development workflow.

A: On the web server side, the closest approach I know of to what you're suggesting is probably IIS Express.
For the database, have a look at SQL Server Compact Edition -- it's an embedded version that shouldn't require installation.

A: I believe Cassini is what you are looking for. While I haven't got around to using it, for exactly the same target (MVC 3), it has been sitting in my findings a while now, so please report back if you actually use it with MVC3!
As for a database solution, I would go with an embedded sql ce 4


text:
Q: Use get_the_tag_list outside loop I´m trying to use get_the_tag_list outside the loop to display all tags used on the current page. I want to use
<?php echo get_the_tag_list('

Tags:

', '
'); ?>

and also put the tag slug as class. Is this possible to do outside of the loop.
I´ve also tried this
<?php $tag = wp_tag_cloud('format=array' );
    foreach($tag as $tagkey => $tagvalue)
        {
        $cleanedup = strip_tags($tagvalue);
        echo "
".$cleanedup."
";
        }
?>

It pretty much does it for what i want to display, but I want to return the slug as the class.
Am I on the right path or just walking in circles?


text:
Q: Error ajax and PHP "Undefined index" I'm a new to AJAX so I'm sorry if the solution is obvious.
I must send the dates to a MySQL table without refreshing the page and I currently have a problem doing this.
The code gives
me the following error:

" Notice: Undefined index: post in inserisci.php on line 6"

FORM
 <form id="form" class="form-horizontal shadow-z-1" action="includes/inserisci.php" method="post">
        <fieldset>
            <legend style="text-align: center; position: relative; top: 8px;">Inserisci un Post</legend>

                Titolo

                    <input type="text" class="form-control" id="inputText" name="titolo" placeholder="Scrivi qui il Titolo">

                Messaggio

                    <textarea id="messaggio"></textarea>

                    File

                      <input type="text" readonly="" class="form-control" placeholder="Browse..." pmbx_context="19E61A0C-3526-4E51-8535-935982C4C335">
                      <input type="file" id="inputFile" multiple="" pmbx_context="1D2BCAEA-08CC-476A-8F4A-EF6BD51B9102">

                      <button type="button" class="btn btn-default" onclick="document.getElementById('modalposta').style.display = 'none';">Cancel</button>
                      <button type="submit" class="btn btn-primary" onClick='send(); return false;' >Submit</button>

        </fieldset>
    </form>

INSERISCI.JS
  function send(){
var content = $.ajax({
        type: "POST",
        url: "index.php",
        data: {titolo:titolo & post:testo}
  })
  .done(function() {
    alert( "success" );
  })
  .fail(function() {
    alert( "error" );
  })
  .always(function() {
    alert( "complete" );
  });
}

INSERISCI.PHP
<?php

include('../core.php');

$titolo=$_REQUEST ['titolo'];
$post=$_REQUEST ['post'];

$sql = mysql_query("");

mysql_close();

?>

Other question.
I need to reload the content of this without refresh the page.
INDEX.PHP
<?php $sql = mysql_query("")  or die ("Nessun errore");
    if (mysql_num_rows($sql) > 0)
    {

        while ($row = mysql_fetch_assoc($sql))
        {
            echo '

        bookmark

'.$row ['titolo'].'

'.Markdown($row ['contenuto']).'

                            alice
                            story
                            blog
                            personal
                            Warning
                            Danger

                    <input type="text" class="form-control inputcomment" placeholder="Lascia un Commento.."/>

         ';
        }

    }

Thanks everyone.

A:
Notes:

*

*Please do not use mysql_* functions. They are deprecated.

*Your code is vulnerable to SQL Injection Attacks. Please make sure you address them.

That's a syntax error. That's not a valid JavaScript Object. Change your data object to:
data: {titolo:titolo, post:testo}

Also you need to close the $.ajax before you are using .done.
  var content = $.ajax({
        type: "POST",
        url: "index.php",
        data: {titolo:titolo & post:testo}           // Should be closed here.
  })
  .done(function() {
    alert( "success" );
  })                                                 // Should not be closed. Remove ;
  .fail(function() {
    alert( "error" );
  })                                                 // Should not be closed. Remove ;
  .always(function() {
    alert( "complete" );
  });
  // });                                                Remove this!

If nothing works out, please change these lines:
$titolo = $_POST['titolo'];
$post = $_POST['post'];

And wait, did you get the values for those two?
var titolo = $('input[name="titilo"]').val();
var testo = $('input[name="testo"]').val();

A: This is because the data you are passing in your AJAX request is not a valid javascript object and you are not getting the variables from the form:
data: {titolo:titolo & post:testo}

You should instead do something like:
var titolo = $('form input[name="titolo"]').val();
var testo = $('form input[name="testo"]').val();
data: {
   titolo:titolo,
   post:testo
}

Also, as a side note, when accessing array elements, its not good form to put a space between the variable and the bracket. I'm surprised that even works.
$_REQUEST ['titolo']

Should be
$_REQUEST['titolo']

A: If you want to use ajax form submit, Update your form definition with
<form id="form" class="form-horizontal shadow-z-1" action="#" method="post">

use following updated javascript
function send() {
    var content = $.ajax({
        type: "POST",
        url: "process.php",
        data: {
            titolo:  "Value for titolo",
            post: "Value for post"
        }
    }).done(function() {
        alert( "success" );
    }).fail(function() {
        alert( "error" );
    }).always(function() {
        alert( "complete" );
    });
}