text:
Q: Can 3 distinct, non-parallel planes form 3 distinct, parallel intersection lines? Consider 3 distinct, non-parallel planes. Each pair of planes intersect at an intersection line, thus forming 3 intersection lines (which may or may not be distinct and which may or many be parallel).
My question is this: Can the 3 intersection lines be distinct and parallel?
If not, how would one prove this?

A: Yes.
Take the following planes:
$z=0$, $y=1$ and $y=z$.
They intersect forming the lines:
$(x,1,0)$, $(x,0,0)$, and $(x,1,1)$ which are all distincts and parallel.


text:
Q: In Xcode, How Can I Add A Tutorial Window to My Mac App, Which Opens Only On First Launch I'm designing a MacOS app, for which I'd like to have a second window appear on the first time the app is launched (similar to what Apple does on the first time you open iMovie or Pages). I've tried a couple things to no avail. So far, I've created a second group as a target of the original app. The new group contains the tutorial storyboard I designed and a custom class called OnboardingWindowController (a subclass of NSWindowController). I gave the window controller the Storyboard ID of OnboardingWindowController, and added the following method:
class func loadFromNib() -> OnboardingWindowController {
        let vc = NSStoryboard(name: "Onboarding", bundle: nil).instantiateController(withIdentifier: "OnboardingWindowController") as! OnboardingWindowController
        return vc
    }

I'm not sure, however, how to get this to launch without prompting the first time the app is launched and then never again. Thanks in advance!

A: Add a key to userdefaults check it's value, if it's false then show the tutorial else don't.
if UserDefaults.standard.bool(forKey: "didShowTutorial") {
    // Code to proceed without showing tutorial
} else {
    UserDefaults.standard.set(true, forKey: "didShowTutorial")
    // Code to show the tutorial
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Issue while implementing drawable right click event of edittext I have added cross icon for drawable right to edittext, I want to show drawable right icon only when I enter something in edittext and I want to perform click event on cross icon if there is any entered text it should remove. How can I do it ?

A: XML code `
                    <EditText
                        android:id="@+id/et_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ems="12"
                        android:hint="Text"
                        android:singleLine="true" />

                <ImageButton
                    android:id="@+id/ib_clear"
                    style="?android:buttonBarButtonStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="-50dp"
                    android:layout_marginStart="-50dp"
                    android:src="@drawable/ic_cancel_black_24dp" />
            </LinearLayout>`

you can change the visibility of the cross icon(image button) in Java code. you can add onclicklistener to image button for clickevent.
Do following to hide or display cross icon
 et_text.addTextChangedListener(new TextWatcher(){
public void afterTextChanged(Editable s) {}
public void beforeTextChanged(CharSequence s, int start, int count, int after){}
public void onTextChanged(CharSequence s, int start, int before, int count){if(et_text.getText().toString().length()>0){et_text.setVisibility(VIEW.VISIBLE);}else{et_text.setVisibility(VIEW.GONE);}
}});

A: <RelativeLayout
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">

  <LinearLayout
    android:id="@+id/linearLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_toLeftOf="@+id/crossButton"
    android:orientation="vertical" >

     <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <EditText
            android:id="@+id/editTextField"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            />
    </RelativeLayout>
</LinearLayout>

<ImageButton
    android:id="@+id/crossButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_centerVertical="true"
    android:visibility="gone" />
</RelativeLayout>

After creating your xml like above where you have edittext and image; I have also set your close image visibility to gone. Now inside code implement FocusChangeListener where you will be enabling your button visibility when text is entered.
editTextField.setOnFocusChangeListener(new OnFocusChangeListener(){
@Override
        public void onFocusChange(View view, boolean hasFocus) {
            if(hasFocus && editTextField.getText().toString().length() > 0){
                crossButton.setVisibility(View.VISIBLE);
            }
            else{
                crossButton.setVisibility(View.GONE);
            }

            crossButton.invalidate();
        }
    });

I have wrote a sample code for your reference purpose,Hope this will be answer your query.

*

*One xml having EditText with Image Button.

*Inflate this xml and apply code to enable/disable visibility status logic.

A: You cant make drawble listen to events in case of drawble left and drawble right. however using this dynamically can help.
So thing you need to do is  add textwatcher to your editext and in bafter text
changed listener of your editext You need to hide and show your drawble left
and right dynamically
.
Adding drawble dynamically :
Drawable icon = getContext().getResources().getDrawable(R.drawable.smiley );

  icon.setBounds( 0, 0, 60, 60 );
 editext.setCompoundDrawables( icon, null, null, null );

or
Drawable img = getContext().getResources().getDrawable( R.drawable.smiley );

editext.setCompoundDrawablesWithIntrinsicBounds( img, null, null, null);

or
editext.setCompoundDrawablesWithIntrinsicBounds( R.drawable.smiley, 0, 0, 0);


text:
Q: Recreate the /portals/community site We deleted the domain.sharepoint.com/portals/community Site Collection. How do we recreate it?

A: SharePoint 2013 On Premise
Create a Community Site

*

*Verify that you have the following administrative credentials:

To create a site collection by using the Community Site template, you must be a member of the Farm Administrators group on the computer running the SharePoint Central Administration website or a service application administrator. If you are a service application administrator, you must also have permission to create site collections in the web application in which you create the Community Site.

*In Central Administration, click Application Management, and then
click Create site collections.

*On the Create Site Collection page, in the Web Application section, ensure that the selected web application is the web application in which you want to create the Community Site. If it is not, expand the list, and then click Change Web Application. In the Select Web Application dialog box, select a different web application.

*In the Title and Description section, type a title and description for the site collection.

*In the Web Site Address section, select the URL where you want this site collection created.

*In the Template Selection section, in the Select experience version list, select 2013. Then, on the Collaboration tab, click Community Site.

*In the Primary Site Collection Administrator section, and optionally
in the Secondary Site Collection Administrator section, type an
account in the format domain\username to specify an administrator
for the site collection.

*Optionally, in the Quota Template section, select a quota template.

*Click OK.

*Verification: After the site collection is created successfully,
    click the link to open the Community Site.

Reference:
https://technet.microsoft.com/en-us/library/jj219543.aspx
For Office 365

*

*Go to > Admin > Service settings > Sites > Create site collection.

*In Title, enter the name of your community. This title will appear
on the community home page and in the global navigation across the
top of the page. If you choose to include a link to the community on
the parent site Quick Launch or global navigation bar, this title
will be displayed.

*In Select a language, choose the primary language for the site. User
interface text, including menu names and titles, will be displayed
in the language you choose.

*In Select a template, choose Community Site.

*In Time Zone, your current zone is detected and displayed by
default. Change it if necessary.

*In Administrator, enter the name of the person or persons who will
administer the community site. These names (separated by commas)
must already exist in the company address list.

*In Storage Quota, enter the amount of storage space on the server to
dedicate to this site collection.

*In Server Resource Quota, enter the amount of server resources to
dedicate to this site collection. The default value is 300.

Reference: https://support.office.com/en-us/article/Create-a-community-8b6bb936-7ebc-4e60-b8ab-2d4897499af9


text:
Q: Import library creation, C++/VisualStudio2013 I create a set of C++ DLLs and their import libraries in VisualStudio (2013). So far, these were all generated at the same time by linker. My DLLs use symbols from other libraries, which are included as additional dependencies in properties/link edition.
Sometimes, the DLL generation fails because of missing importation libraries, which is fine to me, but in such case there's no generated .lib file either. I would like to generate the import libs (of my DLLs) even if the DLLs cannot be done, in order to allow other projects to rely on the symbols I shall export before I'm able to provide the whole stuff.
I found a workaround through a pre-link event command line, with:

*

*LIB /DEF:(...)\myLib.def /OUT:(...)\myLib.lib $(IntDir)*.obj
This generates exactly what I need, when I do have a .def file.
The problem is, I most often don't have such a .def file but rely on __declspec(dllexport) instructions instead, and in such case I didn't find a way to get a correct result.
I tried:

*

*LIB /OUT:(...)\myLib.lib $(IntDir)*.obj (#1)
This creates a (static ?) lib file, not an import library, not what I need.

*LIB /DEF /OUT:(...)\myLib.lib $(IntDir)*.obj (#2)
This fails on error 1104 because of missing (other) import libraries.
What's more puzzling to me is, the command line (#2) fails on libraries that should be here (they are found by the linker, actually). I'm wondering whether I am supposed to provide the complete LINK command line arguments to the LIB command, in which case it would be a no-go.
I'm not much of a specialist of the compilation/link tools, I fear, I'm probably doing pretty wrong stuff...
Does anyone know of a simple way to fulfill my need without using a .def file ? Is there an option in the linker to ask for import library creation from the declared __declspec(dllexport) symbols and generate it even when the DLL cannot link ?

A:
This fails on error 1104 because of missing (other) import libraries.

Edit: oh, I get it. .obj files have /DEFAULTLIB: inside them and lib complains. Use /NODEFAULTLIB
hasunresolved.c:
#pragma comment(lib, "missinglib.lib")

void missingfunc();

__declspec(dllexport)
void dllfunc() {
    missingfunc();
}

usedll.c
__declspec(dllimport)
void dllfunc();

int main() {
    dllfunc();
    return 0;
}

in VS command prompt:
cl -c hasunresolved.c

lib /def /OUT:test.lib hasunresolved.obj
rem this prints: LIB : fatal error LNK1104: cannot open file 'missinglib.lib'

lib /NODEFAULTLIB /def /OUT:test.lib hasunresolved.obj

cl usedll.c test.lib
dumpbin /IMPORTS:test.dll usedll.exe

output:
Dump of file usedll.exe
    test.dll
                    0 dllfunc


text:
Q: Generated binary file from elf file explodes if NOLOAD is removed from section We have a linker script with a custom section that was added for some IEC compliance test reasons. However, ever since adding this section the binary size created via objcopy -O binary input output has exploded from ~150kbytes to ~ 512Mbytes.
I've traced it down to the section missing the (NOLOAD) attribute. And I also can somewhat reason on why the binary was 512Mbytes.
Our memory is as follows:
MEMORY
{
    rom    (rx)  : ORIGIN = 0x00000000, LENGTH = 0x00040000
    ram    (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00007580

    CUSTOM_SECTION (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00001000
}

The section as originally defined is:
    CUSTOM_LOCATION:
    {
        CUSTOM_BEGIN = .;
        KEEP(*(CUSTOM_LOCATION));
        CUSTOM_END = .;

    } > CUSTOM_SECTION AT > ram

If CUSTOM_LOCATION: is replaced with CUSTOM_LOCATION (NOLOAD): the generated binary is of normal sice. Without the (NOLOAD) the binary size is ~512Mbytes.
I am looking for the reason why this binary becomes so large. What does (NOLOAD) (or the absence of it) mean for objcopy in generating a binary file?
Secondary question, at the end of the section we say } > CUSTOM_SECTION AT > ram can we do without this directive? Can it just be replaced with } > ram? (And this can I remove the CUSTOM_SECTION from the MEMORY part?
I've seen no differences in the generated map file

A: When objcopy creates a binary file it basically does the same job as the OS ELF loader: it writes the loadable ELF file sections into a file that represents the memory at run-time.
The binary file will contain every byte of your code and data, from the base address to the uppermost byte. If the memory image is sparse (there are areas of "nothing"), then the binary file will also contains large areas of nothing. This can only be represented in a dumb binary file as zeros.
Your elf file has data from address 0x00000000 (the base of ROM), to 0x20000fff (the top of CUSTOM_SECTION), which is a range of just over 500MB, so it stands to reason that the binary file must have that many bytes to hold it all. By making the section non-loadable you're saying that the data is not needed at run-time and therefore need not be in the binary image. This is normally the case for debug information, comments, and other non-program ELF data.
The good news is that a) many file-systems will only use disk space for the non-zero portions of the file, so it doesn't use as much disk as it appears (a "sparse file"), and b) the binary will be readily compressible.


text:
Q: Timer to reset Closing button once clicked back to it's "Before" state after 2 seconds Hey there i've been having some difficulties with trying to figure out how to reset a button back to its previous state once its been clicked on. I know it involves a javascript timing, Can anyone help ive been trying all morning now.
    function clickMute()
    { if (document.Mute.src=='http://www.showandtell.com/TRUMusicControl/images/BeforeClickMute.png'){

    document.Mute.src='http://www.showandtell.com/TRUMusicControl/images/AfterClickMute.png';
    }
    else if (document.Mute.src=='http://www.showandtell.com/TRUMusicControl/images/AfterClickMute.png'){

    document.Mute.src='http://www.showandtell.com/TRUMusicControl/images/BeforeClickMute.png';
    }
    }

A: Firstly, remove the a (anchor) tag surrounding the image (mute button). Then just use the following code (to replace your function):
function clickMute(){
    var strPath = "http://www.showandtell.com/TRUMusicControl/images/",
        arrSrc = ["BeforeClickMute.png","AfterClickMute.png"],
        button = document.getElementById("Mutebutton"),
        index = (/Before/i.test(button.src)) ? 1 : 0;
    button.src = strPath + arrSrc[index];

    /* If you need the button to reset itself after a certain time... */
    if (index) setTimeout(clickMute,2000);
}


text:
Q: Get different theming in bootstrap in different views I would like to theme pages with bootstrap but in some of the pages I would like to theme only the buttons and leave the input fields like they are, while in others I would like to do it the other way around and only theme the input fields and not the buttons.
I would like to be able to write something like that
In page1:
@import input-theming.css
... use default styling for buttons
In page 2:
@import button-theming.css
... use default styling for inputs
I have already thought about modularizing my custom.scss in components such that I in each component I theme a different part, like inputs, buttons, tables , ... etc. But then I would have to create a custom.scss file for each combination of those modules which seems complicated.
What I would like is a way to get back to the default behavior of some parts of bootstrap although I themed them differently in the custom.scss. Is that possible without generating different custom.scss files that theme only different parts of bootstrap?

A: SASS allows you to nest imports. Therefore, you could use a parent class for each "theme" (combination of customizations) and then add the appropriate theme CSS class to the HTML parent container of each page (html,body,.container etc...). This allows you to keep all of the SASS overrides/changes in one custom.scss file.
@import "bootstrap/functions";
@import "bootstrap/mixins";
@import "bootstrap/variables";

.theme-1 {
    /* change the button style */
    .btn-primary {
        @include button-variant(green, green);
    }
}

.theme-2 {
    /* change the input style */
    $input-bg: #ddd;
    @import "bootstrap/forms"
}

@import "bootstrap"

HTML Page 1 (custom buttons)

                    <input type="text" class="form-control" placeholder="Username">

                        <button class="btn btn-primary" type="button" id="addon">Button</button>

HTML Page 2 (custom inputs)

                    <input type="text" class="form-control" placeholder="Username">

                        <button class="btn btn-primary" type="button" id="addon">Button</button>

Demo


text:
Q: dns forwarding for specific zone not working - bind In bind we created specific zone and got set a forward options, but it fails to resolve.
Details as follow,
For mydomain.com dns working fine.
but we use developer site called mydomain.com.dev
we have forwarded for dev. but still not working.
It works well with windows dns.
we tried with two forward scenarios as below, still no luck.
we have also tried on centos and ubuntu.
scenario 1 :
zone "dev" {
    type forward;
    forwarders { x.x.x.x;};

};

scenario 2:
zone "mydomain.com.dev" {
    type forward;
    forwarders { x.x.x.x;};

};

A: You probably do not have recursion enabled for the view these zone definitions are in.  Recursion is required for forwarding to work properly.
You might also try with a stub zone.  Stub zones are less brittle over time but assume correctly setup and advertised authoritative DNS servers to learn the current set (not always the case, unfortunately).


text:
Q: Using const in es6 for of loop While x is not a constant, how the following code runs without any errors?
for (const x of [1,2,3]){
console.log(x);
}

A: It works on compliant browsers like Chrome because they create a new, different, constant variable at each iteration:
var arr = [];
for (const x of [1,2,3])
  arr.push(() => x);
arr.map(f => f()); // [1,2,3] on Chrome

Some non-compliant browsers reuse the same variable instead:
var arr = [];
for (let x of [1,2,3])
  arr.push(() => x);
arr.map(f => f()); // [3,3,3] on non-compliant browsers

Therefore, they throw an error if in the example above you use const.

Runtime Semantics: ForIn/OfBodyEvaluation says:

*Repeat

*Else

*

*Assert: lhsKind is lexicalBinding.

*Assert: lhs is a ForDeclaration.

*Let iterationEnv be NewDeclarativeEnvironment(oldEnv).

*Perform BindingInstantiation for lhs passing iterationEnv as the argument.

So each iteration should create a new binding. Chrome is correct.


text:
Q: Java:HashMap storing same value as key and value.? I am getting this strange output in HashMap.
I have two ArrayList<String> one containing the key and another containing value.
My HashMap<String,String> will store only string as key and value pair. But key itself is getting stored in value. I have checked my value arraylist, it's printing the value. But during putting it's setting it as key itself.
Code snippet is:
public HashMap<String,String> getLstBarring()
    {
        ArrayList<String> temparrLst=setPreParameters(fetchPreDetails, 1);
        System.out.println("KEY"    +  temparrLst);

        ArrayList<String> tempArrLstId=setPreParameters(fetchPreDetails, 14);
        System.out.println("VALUE"      +tempArrLstId);
        int length=tempArrLstId.size();

        for(int index=0;index<length;index++)
        {
            System.out.println("VALUE IN KEY"   +  temparrLst.get(index));
            System.out.println("VALUE IN VALUE"   +   tempArrLstId.get(index));
            this.lstBarring.put(temparrLst.get(index), tempArrLstId.get(index));
        }
        System.out.println("INSIDE ODB....>>>>>>>>>>>>>>"   + lstBarring);

    return this.lstBarring;
    }

Problem is:

*

*1st SOP is KEY-printing all the key correctly.

*2nd SOP is VALUE-printing all the value correctly.

*3rd SOP is VALUE IN KEY----printing all the values.

*4th SOP is VALUE IN VALUE--printing all the values.

Hence after ever iteration I am getting value,value in HashMap whereas it should be key,value.
Here's look at my Method:-
public ArrayList<String> setPreParameters(HashMap<Integer,String> fetchPreDetails,int index)
    {
        switch(index)
        {

        case 1:
        {
            arrLstData.clear();
            splittedString=fetchPreDetails.get(1).split(",");
            Collections.addAll(arrLstData, splittedString);
            break;

        }

return arrLstData;

Please guide me as to where am I going wrong.

A: My guess is that either fetchPreDetails is a collection being mutated by setPreParameters() or else setPreParameters() is mutating some other shared state so that the collection referenced by your temparrLst is being changed on the second call to setPreParameters(). I.e.
List<String> strings = new ArrayList();
strings.add("a");
strings.add("b");
List<String> otherStrings = strings;
otherStrings.add("c");

I expect your code assumes that strings would contain "a" and "b" and that otherStrings would contain "a", "b", and "c". This isn't how object references work in Java. The line List<String> otherStrings = strings; makes both strings and otherStrings point to the same collection, and thus changes made using either name affect the same thing.
Edit: Your newly-posted code seems to prove my hypothesis. You have a variable called arrLstData that you clear, populate, and return on each call to setPreParameters(). You're returning the same collection every time you call this method. Therefore you just have multiple handles to the same collection instead of multiple collections. You need to create a new collection and return it each time you call setPreParameters().
Edit again: Maybe this will make it clearer. Here's what you're doing:
public static void main(String[] args) {
    Foo f = new Foo();
    List<String> list1 = f.getList("a", "b");
    System.out.println(list1);
    List<String> list2 = f.getList("c", "d");
    System.out.println(list2);
    System.out.println(list1);
}

static class Foo {
    private List<String> myList = new ArrayList<String>();
    public List<String> getList(String... strings) {
        myList.clear();
        myList.addAll(Arrays.asList(strings));
        return myList;
    }
}

Note that this exhibits exactly the behavior that you're describing, and the correct way to solve it is something like this:
public static void main(String[] args) {
    Foo f = new Foo();
    List<String> list1 = f.getList("a", "b");
    System.out.println(list1);
    List<String> list2 = f.getList("c", "d");
    System.out.println(list2);
    System.out.println(list1);
}

static class Foo {
    public List<String> getList(String... strings) {
        List<String> result = new ArrayList<String>();
        result.addAll(Arrays.asList(strings));
        return result;
    }
}

A: You are reusing the same List over and over at your setPreParameters Method.
The List in arrLstData is returned and stored in temparrLst, now you are clearing the the Lists content, putting new stuff in it and storing it to tempArrLstId.
Now the three variables all contain the very same list (they are not equals, its the same!).
There is only one List object at the whole example!
Its like you got a box and label it "A" on one side put stuff in it, label it "B" on another side and wondering why the box "B" is empty when you turn box "A" upside-down.

A: Did you maybe mean something like this?
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class GlobalsMess {

    private Map<String, String> lstBarring = new HashMap<String, String>();
    private Map<Integer, String> fetchPreDetails = new HashMap<Integer, String>();

    public GlobalsMess() {
        fetchPreDetails.put(1, "john,vikam,david");
        fetchPreDetails.put(14, "1,2,3");
    }

    public Map<String, String> getLstBarring() {

        List<String> tempKeys = setPreParameters(fetchPreDetails.get(1));
        System.out.println("KEY" + tempKeys);

        List<String> tempIds = setPreParameters(fetchPreDetails.get(14));
        System.out.println("VALUE" + tempIds);

        for (int index = 0; index < tempIds.size(); index++) {
            System.out.println("VALUE IN KEY" + tempKeys.get(index));
            System.out.println("VALUE IN VALUE" + tempIds.get(index));
            this.lstBarring.put(tempKeys.get(index), tempIds.get(index));
        }
        System.out.println("INSIDE ODB....>>>>>>>>>>>>>>" + lstBarring);

        return this.lstBarring;
    }

    public List<String> setPreParameters(String fetchPreDetailsValue) {
        List<String> arrLstData = new ArrayList<String>();
        Collections.addAll(arrLstData, fetchPreDetailsValue.split(","));
        return arrLstData;
    }

    public static void main(String[] args) {
        new GlobalsMess().getLstBarring();
    }
}

Output:
KEY[john, vikam, david]
VALUE[1, 2, 3]
VALUE IN KEYjohn
VALUE IN VALUE1
VALUE IN KEYvikam
VALUE IN VALUE2
VALUE IN KEYdavid
VALUE IN VALUE3
INSIDE ODB....>>>>>>>>>>>>>>{david=3, vikam=2, john=1}


text:
Q: compiled gdb doesn't show debug symbol in Tui mode? I compiled gdb source code from scratch on wsl2 in windows 11. And i got lots of errors about the macros and some function interface.I just solved them by hand. Finally i  got a gdb elf file,and it work well without Tui mode, but it doesn't show symbol info in Tui mode.
some pics record them. The color of tui mode also seems a little unstrange comparing to original one in wsl2.
The first three figures are compiled GDB(tui mode)
https://i.stack.imgur.com/IFmj0.png
https://i.stack.imgur.com/bVxGA.png
https://i.stack.imgur.com/QSNRE.png
The last one is original GDB(wsl2)
https://i.stack.imgur.com/KWc6D.png


text:
Q: Tips on creating a upstart script I have a few questions that I'm looking for some pointers for.

*

*Once I create my upstart .conf file, how exactly do I "install" it and activate it?

*How do you go about debugging the script while developing it?  Example, I may be looping to form a list of files in the script, is it possible to output the result to console so I know its working?

A: Once you've created your conf file, simply put it in /etc/init/ for system jobs, or in ~/.init for user job. For more info:

*

*http://upstart.ubuntu.com/cookbook/#job-configuration-file

*http://upstart.ubuntu.com/cookbook/#console-log
By default the console output of your script is in /var/log/upstart/file.log.


text:
Q: Why is the size of my PyQt5 window different on different resolutions? So I made a PyQt5 app and it works on one computer but when I try to run it on another one with a bigger resolution it doesn't work. I tried:
PyQt5.QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)

but it just makes the window bigger, without that line the window is a little smaller and the font size is messed up.
high resolution without command:

high resolution with command:

low resolution and low resolution without command works the same and it looks like this(normal):

A: I had this bug and I have fixed it.
But I'm not sure this will 100% work as when you tried:
 PyQt5.QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)

It didn't work.
But for me, wrapping it in an if statement worked:
if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'):
    QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)

if hasattr(QtCore.Qt, 'AA_UseHighDpiPixmaps'):
    QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True)

Give it a go, but I'm not 100% certain it'll work.


text:
Q: Is it possible to add webpart zone in sitepages? I had a SharePoint site where I created a page (not a webpart page).  Can I add webpart zone on this page?

A: Sure you can.
Just open the page in SharePoint Designer and add web part zone on it.
Designer will automatically add the web part manager tag on the page too.

A: U just add your webpart in sharepoint site.
Then open your site in sharepoint designer.Find your webpart zone you added like so
  <WebPartPages:SPUserCodeWebPart runat="server" Description="My WebPart" Title="ContactUsWebpart"
          AssemblyFullName="XTILTON.WEB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f58f965830ac0890"
          SolutionId="a10addc4-93e8-4b4d-9bd3-41bd166e30de"
          ID="g_c659e549_13c5_4c1c_8db9_c80e6d00fb88" ChromeType="None" TypeFullName="XTILTON.WEB.ContactUsWebpart.ContactUsWebpart" ></WebPartPages:SPUserCodeWebPart>

after that copy that webpartzone in your .aspx page. that's it.

A: Please make sure that all mandatory ContentPlaceHolder from SharePoint master-page is linked to your custom page.
Maybe you should start design/create your custom page from native SharePoint web-part page, not start from scratch, to make sure all SharePoint functionality works well.

A: Register your webpart at the top of the page using sample code below
<%@ Register tagprefix="VotingButton"
             namespace="xx.org.SharePoint.WebParts.VotingButton"
             assembly="xxx.org.SharePoint, Version=1.0.0.0, Culture=neutral,PublicKeyToken=ff75f32512e6d74c" %>

Next, add the web part to the web part zone area of page as below
<VotingButton:VotingButton runat="server"
                           Description="VotingButton"
                           Title="VotingButton"
                           __MarkupType="vsattributemarkup"
                           __WebPartId="{58eb6642-70ed-450e-af72-e6062d07da2f}"
                           WebPart="true"
                           __designer:IsClosed="false"
                           partorder="2"
                           id="g_58eb6642_70ed_450e_af72_e6062d07da2f">
</VotingButton:VotingButton>


text:
Q: Three dots operator "..." for initializing an array Consider the following example which initialize an array with a default value:
static unsigned int array[10] = { [ 0 ... 9 ] = 5 };

What exactly this operator does?
It is related to variadic macro __VA_ARGS__?

A: In standard C, since C99, designated initializers allow to initialize individual elements of an array in the form:
int array[4] = {[1] = 42};

The syntax you stumbled upon is a range initializer, it is a GNU extension to initialize all elements between 0and 9 to the given value, thus strictly equivalent to:
static unsigned int array[10] = { [0] = 5, [1] = 5, [2] = 5, [3] = 5, [4] = 5, [5] = 5, [6] = 5, [7] = 5, [8] = 5, [9] = 5};

only less a burden to type and read.
Reference

A: Nothing in ISO C. It's a nonstandard construct.
In GNU C (gcc/clang) it appears to initialize each of elements 0 through 9 to 5, i.e., it's shorthand for (C99)
static unsigned int array[10] = { [0]=5, [1]=5, [2]=5, /*...*/ [9]=5 };

or (C89)
static unsigned int array[10] = { 5, 5, 5, 5, /*...*/ };

The ... extension also works for cases:
_Bool lowercase_eh(char c)
{
    switch(c) case 'a' ... 'z': return 1;
    return 0;
}

Apart from using the same ... token, it is unrelated to variadic macros or fucntions.


text:
Q: Object Detection on Cloud using React-Native Expo Complete React Native noobie here. I am trying to make an app in React Native Expo that will send an image to a cloud platform (still haven't decided on which one). The cloud will then recognize the objects in the image, put them in a square, and then return the image to the phone. I've been researching for days and I found APIs like Google Vision, and I found that Google has a module for  multiple object detection. This is exactly what I need to do but I don't know how to implement it. I've been looking online and found a project that seems to be similar but is lacking object detection it rather has image labeling which is not what I need.

*

*Are there any 3rd party APIs I can use in my project that can be used in i.e. Firebase?

*How do I connect my app with i.e. Firebase? Can someone give me an example?

*The picture needs to be manipulated on the cloud thus the squares need to be added on the cloud. Is this possible? I've checked out Google Vision but it seems to just return a JSON file (might be wrong)?

*What would be the best cloud service that already has the API I need?


text:
Q: hmac(вывод ключа) RandomNumberGenerator c#    string[] variants = { "Камень", "Ножницы", "Бумага" };
    var key = new byte[128];
    var pc = new byte[4];
    var gen = RandomNumberGenerator.Create();
    gen.GetBytes(key);
    gen.GetBytes(pc);
    var hmac = new HMACSHA256(key);
    var ipc = BitConverter.ToUInt32(pc, 0) % (variants.Length);
    var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(variants[ipc]));
    Console.WriteLine("Компьютер сделал ход\nHMAC : " + (BitConverter.ToString(hash, 0)));
    Console.WriteLine("Ваш выбор:\n0 : Выход");
    for (int i = 0; i < variants.Length; i++)
        Console.WriteLine((i + 1) + " : " + variants[i]);
    int player = 0;
    if (!int.TryParse(Console.ReadLine(), out player) || player < 0 || player > variants.Length)
    {
        Console.WriteLine("Некорректный ввод");
        return;
    }
    else if (player == 0) return;
    player -= 1;
    if (ipc == player)
    Console.WriteLine("Ничья");
    else if (((ipc + player) % 2 == 0 && ipc > player)
            || ((ipc + player) != 0 && player > ipc))
        Console.WriteLine("Вы выйграли!");
    else
        Console.WriteLine("Вы проиграли!");
    Console.WriteLine("Ключ : " + (BitConverter.ToUInt32(key, 0)));
    Console.ReadLine();

Вывод ключа неверный, в чем может быть проблема?


text:
Q: REST - model state transitions In REST - revertable DELETE a nice introduction on howto model state changes in REST was given. Basically, if you have a resource with a field status, you just put a new version of that resource with an update status field.
In this topic, I would like to extend this model. Say you have a resource which can be in two states: 1 and 2. In contrast with the simple model as described in the cited post, there are three transitions to traverse from state 1 to state 2, instead of just one.
My question is: how would you model state transitions in REST?
I myself cannot come up with an RPC-like POST, which isn't very RESTian probably:
POST http://server/api/x
     target_state=2&transition=3

This changes resource x from state 1 to state 2 by using transition 3.

A: This isn't really limited to REST; it's more a basic question about state machines. The state machine should encapsulate all of the state, so that if you find yourself creating multiple transitions from one state to another, and the difference is significant, then that difference must also be captured in the state.
For example, say I have no home. I can move from the "homeless" state to the "home" state in three ways: I can rent one, I can buy one, I can steal one. Three transitions from "homeless" to "home"? Not in the world of machines. Either the differences are significant, or they're not. If they're not, then to the machine there's no point in making a distinction at all. Merely PUT the new status of "home". If they are, then we need to expand our concept of state to encompass the differences. For example:
         homeless
        A    A   A
       /     |    \
      V      |     V
possessor <--|---  renter
       A     |    /
        \    |   /
         V   V  V
           owner

I can move from homeless to possessor by stealing a house. If I squat on it long enough, I might become the owner. Or I could be homeless and rent a house, or even rent-to-own. Or I could buy one outright. All three paths get me to the "owner" state, but they use intermediate states to represent the significantly different transitions.
If you then want to represent "homeless" vs. "in a home" (possessor|renter|owner), there's no problem exposing that as a read-only, calculated resource in its own right. Just don't let anyone PUT/POST to it, since the transition is ambiguous. There's also no problem keeping the history of state transitions as an additional set of resources, if that state is significant.


text:
Q: Set visibility on single tab in tabcontrol (winforms) Is there a way to set the visibility of a single tab in a tabcontrol?  I thought something simple like this should work, but does not seem to to anything.
tabControl1.TabPages[1].Visible = false;
tabControl1.Refresh();

There will be a main tab that always shows but I want to have other tabs that I can "turn on\off".  I don't want to remove the tabs since I may need to show then again.
fk

A: Times haven't changed since 2.0:
StackOverflow - How to hide TabPage from TabControl

A: You can remove the tabControl page
this.tControl1.TabPages.Remove(this.tControl1.TabPages["tabPageName"]);

A: It's obviously not part of the standard Windows Forms library, but the Infragistics UltraTabControl has (among other features) a Visible property for each tab page.


text:
Q: Expectation of number of balls drawn when it depends on the amount of green balls drawn on the last step We have 60 green balls and 40 white balls in an urn.
Let $X_n$ be the number of balls drawn on step n defined as $ X_1 = 10 $ and $X_n =$ the number of green balls drawn in step $n-1$. The balls are then returned to the urn.
I need to calculate $\mathbb{E}(X_n)$ and show that $\lim_{n \to +\infty} \mathbb{E}(X_n) = 0 $. Suggestion: Find a suitable r.v. to condition $X_n$.
Intuitively it makes sense to me that the limit would be 0 since with high probability we're drawing each balls each time but I can't seem to find anything not convoluted for $\mathbb{E}(X_n)$.

Here's my work:
Let $Y_n$ be the amount of green balls drawn in step n. So we have that $X_n = Y_{n-1}$. $X_2 = Y_1 \sim Bi(10,0.6)$ so $\mathbb{E}(X_2) = 6$.
In general $\mathbb{E}(X_n) = \sum_{k=0} ^{10} k \frac{6}{10} P(Y_{n-2} = k)$
But I'm not sure how to go forward since each step depends on all the steps before and it gets very convoluted.
Any help would be greatly appreciated.

A: The idea is the same as in this other answer. Instead of drawing only as many green balls as were drawn previously, perform the following operation ten times: draw until you get a white ball. Given this scheme, the probability that you get to step $n$, where you then draw a green ball, is $(3/5)^n$, so the expected number of green balls drawn in step $n$ of the original formulation is $10(3/5)^n$, i.e. $E(X_n)=10(3/5)^{n-1}$. It is clear that this goes to zero as $n\to\infty$.


text:
Q: Is it possible to provide UI selectable options to custom msbuild tasks? I have built a custom msbuild task that I use to convert 3D models in the format I use in my engine. However there are some optional behaviours that I would like to provide. For example allowing the user to choose whether to compute the tangent array or not, whether to reverse the winding order of the indices, etc.
In the actual UI where you select the Build action for each file, is it possible to define custom fields that would then be fed to the input parameters of the task? Such as a "Compute Tangents" dropbox where you can choose True or False?
If that is possible, how? Are there any alternatives besides defining multiple tasks? I.e. ConvertModelTask, ConvertModelComputeTangentTask, ConvertModelReverseIndicesTask, etc.

A: Everything in a MsBuild Custom Task, has to have "settable properties" to drive behavior.
Option 1.
  Define an ENUM-esque to drive you behavior.
From memory, the MSBuild.ExtensionPack.tasks and MSBuild.ExtensionPack.Xml.XmlFile TaskAction="ReadElementText" does this type of thing.
The "TaskAction" is the enum-esque thing.  I say "esque", because all you can do on the outside is set a string.  and then in the code, convert the string to an internal enum.
See code here:
http://searchcode.com/codesearch/view/14325280
Option 2: You can still use OO on the tasks.  Create a BaseTask (abstract) for shared logic), and then subclass it, and make the other class a subclass, and the msbuild task that you call.
SvnExport does this.  SvnClient is the base class.  And it has several subclasses.
See code here:
https://github.com/loresoft/msbuildtasks/blob/master/Source/MSBuild.Community.Tasks/Subversion/SvnExport.cs

A: You can probably dive deep with EnvDTE or UITypeEditor but since you already have a custom task why not keep it simple with a basic WinForm?
namespace ClassLibrary1
{
    public class Class1 : Task
    {
        public bool ComputeTangents { set { _computeTangents = value; } }

        private bool? _computeTangents;

        public override bool Execute()
        {
            if (!_computeTangents.HasValue)
                using (var form1 = new Form1())
                {
                    form1.ShowDialog();
                    _computeTangents = form1.checkBox1.Checked;
                }

            Log.LogMessage("Compute Tangents: {0}", _computeTangents.Value);

            return !Log.HasLoggedErrors;
        }
    }
}


text:
Q: How to write the Hamiltonian for the free fermion on the plane? On a cylinder, the Hamiltonian and mode expansion for the (periodic) free fermion are
$$H=\sum_{n\ge \frac12} \omega n\,\, c_n^\dagger c_n, \quad \psi(x)=\sum_{n\ge\frac12}i\left(c_n e^{-iknx}-c_n^\dagger e^{iknx}\right) \ .$$
Since $e^{iHt}c_ne^{-iHt}=c_ne^{-i\omega t}$ and $e^{iHt}c_n^\dagger e^{-iHt}=c_n^\dagger e^{i\omega t}$ the Heisenberg representation of $\psi(x)$ reads
$$\psi(x,t)=\sum_{n\ge\frac12}i\left(c_n z^{-n}-c_n^\dagger z^n\right)\ ,$$
where $z=e^{ikx+i\omega t}$. So far so good. Now let's map the model to the plane. The standard procedure is to use the conformal property of $\psi(z)$ to write $\psi_{plane}(w)=\left(\frac{\partial w}{\partial z}\right)^{\frac12}\psi_{cylinder}(z)$, where $w=e^{z}$ maps cylinder to the plane. The result is
$$\psi_{plane}(x,t)=\sum_{n\ge\frac12}i\left(c_n w^{-n-1/2}-c_n^\dagger w^{n-1/2}\right)\qquad (1)$$
My problem is that I do not see how this Heisenberg representation can be obtained from $\psi(x,t=0)$. Indeed, $w(z,t=0)=e^{ikx}$ and hence
$$\psi_{plane}(x)=\sum_{n\ge\frac12}i\left(c_n e^{-ik(n+\frac12)x}-c_n^\dagger e^{-ik(n-\frac12)x}\right)$$
However, if we assume the same Hamiltonian for the plane as for the cylinder, turning on the Heisenberg evolution does not yield (1), instead
$$\psi_{plane}(x,t)=\sum_{n\ge\frac12}i\left(c_n w^{-n}e^{-ikx/2}-c_n^\dagger w^{n}e^{-ikx/2}\right) \ .$$
What am I doing wrong here? How to write the Hamiltonian on the plane so that the Heisenberg time-dependence is in agreement with (1)?


text:
Q: I am trying Jquery Ui Autocomplete with Images. Its not bringing any response I want to get a response of User Details with their Names and Profile Images:
For Example. Facebook is using the Same thing i am trying to do. That is, When you type a Name in Search of Facebook. It returns a User with his Profile Picture and His Name in the Drop Down, When you click a specific User it redirects you to his Profile. Same is the thing i am trying to do. And i am not getting any response from Php page too. No jquery Errors in Console.
Here is my JS code:

Here is my Html Code

Tags:
<input id="data_images" />

Please give me a proper solution.

A: jQuery UI Autocomplete expects data from the server in a certain format so we cannot tell what is wrong with your code without the PHP source code in user_data.php.
If you cannot post this, can you at least give us a data sample of exactly what it is sending back to jQuery?


text:
Q: Convert nested array of objects into nested property template object I have an array of objects created that I would like to convert into a nested property template object. The nested object will be created based on items that are checked.
The first level of objects have their 'checked' key set to null as they will always be added as the beginning of the property template object.
If the first level objects have no properties, or the none of the properties are checked, then it should look like this:
{staff: true}

However, if the objects have properties and some of the properties are checked, it will look like this:
{staffedLocation: ['schedulingGroup',
                   {property: 'staff', subProperties: ['description']}
                  ]
}

This is a very simple example and in some cases the array of nested objects can go further down, so I know I need to create a recursive function. However, I'm getting tripped up as to how I can go about creating it recursively when the first level of the object is entirely different from the rest of it.
An example of the array of objects on hand looks like this:
[
    {checked: null, name: "staffedLocation", properties: [
        {checked: null, name: "oid", properties: null, toggle: null, type: "integer"},
        {checked: null, name: "_class", properties: null, toggle: null, type: "string"},
        {checked: true, name: "schedulingGroups", properties: null, toggle: null, type: "list"},
        {checked: null, name: "staff", properties: [
            {checked: null, name: "oid", properties: null, toggle: null, type: "integer"},
            {checked: null, name: "_class", properties: null, toggle: null, type: "string"},
            {checked: true, name: "description", properties: null, toggle: null, type: "string"},
            {checked: null, name: "limits", properties: null, toggle: null, type: "list"},
            {checked: null, name: "weeklyMaxHours", properties: null, toggle: null, type: "integer"}

        ], toggle: true, type: "list"},
    ], toggle: true, type: "staffedLocation"},
    {checked: null,
    name: "staff", properties: [
        {checked: null, name: "oid", properties: null, toggle: null, type: "integer"},
        {checked: null, name: "_class", properties: null, toggle: null, type: "string"},
        {checked: null, name: "description", properties: null, toggle: null, type: "string"},
        {checked: null, name: "limits", properties: null, toggle: null, type: "list"},
        {checked: null, name: "weeklyMaxHours", properties: null, toggle: null, type: "integer"}
    ], toggle: true, type: "staff"},
    {checked: null, name: "assignedShifts", properties: null, toggle: null, type: "shiftForEmail"},
    {checked: null, name: "editedShifts", properties: null, toggle: null, type: "shiftForEmail"},
    {checked: null, name: "deletedShifts", properties: null, toggle: null, type: "shiftForEmail"},
    {checked: null, name: "unassignedShifts", properties: null, toggle: null, type: "shiftForEmail"},
    {checked: null, name: "rangeStart", properties: null, toggle: null, type: "timestamp"},
    {checked: null, name: "rangeEnd", properties: null, toggle: null, type: "timestamp"}
]

And I would like it to then be converted into a nested object like so:
{
    staffedLocation: ['schedulingGroup',{property: 'staff',subProperties: ['description']}],
    staff: true,
    assignedShifts: true,
    editedShifts: true,
    deletedShifts: true,
    unassignedShifts: true,
    rangeStart: true,
    rangeEnd: true
}

A: What you actually need is to apply your recursive function only to the properties of the topmost object, and not to the topmost object itself:
// No ES6 sugar
function convert(content) {

function convertValues(props) {
    if (!(props && props.length && props.length > 0)) {
        return true;
    }
    var convertedProps = [];

    props.forEach(function(prop) {
       // Recursive
       var values = convertValues(prop.properties);
       if (prop.checked || values.length) {

           convertedProps.push(prop.name, values);
       }
    });

    return convertedProps;
}

var convertedContent = {};

content.forEach(function(obj) {
    convertedContent[obj.name] = convertValues(obj.properties);
});

return convertedContent;

}
I don't think that's the exact code you want, but hope it gives you direction.

A: With Alexey's help I was able to convert everything properly. The function below now correctly converts everything.
$scope.convertToPropertyTemplate = function(content) {
    function convertValues(props) {

        if (!(props && props.length && props.length > 0)) {
            return true;
        }
        var convertedProps = [];

        props.forEach(function(prop) {
            // Recursive
            var convertedObj = {};
            var values = convertValues(prop.properties);
            if (prop.checked) {
                convertedProps.push(prop.name);
            }

            if (values.length){
                convertedObj["property"] = prop.name;
                convertedObj["subProperties"] = values;
                convertedProps.push(convertedObj);
            }
        });

        return convertedProps;
    }

    $scope.convertedContent = {};

    content.forEach(function(obj) {
        $scope.convertedContent[obj.name] = convertValues(obj.properties);
    });
}


text:
Q: ofstream << operator doesn't write correct size to file I'm very unsure of file IO when it comes to this, and I'm really confused. When I use the insertion stream operator to push some short integers into the file the size of the file is not what I expect:
std::ofstream outFile("myFile.raw", std::ios::binary | std::ios::out);

std::vector<short> list;
for (int i = 0; i < 100; ++i) list.push_back(1);
for (auto i : list) outFile << i;
outFile.close();

This creates a file that is 100 bytes big. I'm not understanding, the short is supposed to be two bytes. The documentation shows that the << operator is overloaded for many different types, so I thought that this writes the correct data type. I guess not.
Thanks.

A: You are using formatted output.
The short ints are written as digits. Each digit is 1 which is a single char of a single byte.
So the total is 100. If you had short ints containing double digit numbers, say 22, then the size would be 200.

As an alternative you could either use unformatted output or you could cast the data to chars, which together with the binary flag you have set will write the data without formatting it. Something to keep in mind when writing raw chars is that you will have to consider how many bytes and how you want to order the bytes in the file.

Formatted output and input could be more convenient in general. As an alternative to writing the file with raw chars it would be better to look into serialization.

A: The reason is - as mentioned in the comments an in the previous answer - that operator << is formatted output and writes value 1 as a single digit (which consists of only one character).
Just for the sake of showing how a short int could be written as binary, see the following code:
std::ofstream outFile("myFile.raw", std::ios::binary | std::ios::out);

std::vector<short> list;
for (int i = 0; i < 100; ++i) list.push_back(1);
for (auto i : list) outFile.write((const char*)&i, sizeof(i));
outFile.close();

std::ifstream in("myFile.raw", std::ifstream::ate | std::ifstream::binary);
std::cout << "File size: " <<  in.tellg() << std::endl;
// prints out: File size: 200
in.close();


text:
Q: Syntax error , insert "EnumBody" to complete EnumDeclaration I was in middle of coding and accidentally put the following line of code at the part of class where we declare instance variables. but i checked and it gives the same error anywhere by anywhere i mean : inside a static block, inside constructor, inside any class method. except when private; is put as the first line of the class it gives
Syntax error, insert "EnumBody" to complete ClassBodyDeclarations (as written by @chaitanya10 in comments below and also verified by me on my workspace) error in eclipse tooltip when we hover cursor over it.
I understand there is error.
but I dont understand the error message when i hover cursor over the error. what is the meaning of this message?
why does it expecting EnumBody ?
Below is the screenshot.

A: For what it's worth, the following:
public class Foo;

Error: Syntax error, insert "ClassBody" to complete ClassBodyDeclarations
public enum Foo;

Error: Syntax error, insert "EnumBody" to complete ClassBodyDeclarations
public interface Foo;

Error Syntax error, insert "InterfaceBody" to complete ClassBodyDeclarations
Anyway, I think what happens is, in this
org.eclipse.jdt.internal.compiler.parser.Parser.consumeEnumConstantHeader(), it tries to recover when it gets the parsing error with this code:
if(this.currentToken == TokenNameSEMICOLON) {
    RecoveredType currentType = currentRecoveryType();
    if(currentType != null) {
        currentType.insideEnumConstantPart = false;
    }
}

So it correctly figures out that we're not inside an enumeration, so we get an error like above, but it doesn't realize that we don't even know if it is an enumeration. You can look at the source here:
In other words, it's probably a bug that the Eclipse team introduced when they added Enumerations, it's handled slightly differently than some of the other tokens, which causes it to be Recovered in a different way and therefore shows up in the compiler errors.

A: For a real explanation, someone would need to do a detailed analysis of the syntax checking, and the syntax error recovery and reporting components of the Eclipse Java compiler front end.  But the most likely explanation is that your "unusual" syntax error has "confused" the compiler's syntax error recovery code.
In short it is a minor compiler bug (or feature).
It is possible that the developers know about this, but have refrained from fixing it because of one or more of the following:

*

*It doesn't happen often enough to be prioritized.

*It might be hard to do a better job without affecting other error recovery cases.

*Any change could break1 a number of compiler error regression tests.

*There are other higher priority issues to deal with.

1 - Break ... in the sense of causing tests to fail because of assumptions in the test rather than problems in the code being tested.  Fixing these regressions could be burdensome.

A: This was happening to me in Eclipse too even though my code  was correct. Happened because I wrote some code without adding a jar first (aspectJ JARs) and after I added the JAR this issue came about.
At first I copied the code, deleted it, and pasted it back in and thought that worked as the red line went away but errors were thrown at runtime. I did however get it to work by deleting the class, recreating it, and typing the same exact code again and it worked. Copy paste probably would have worked after deleting the class, but I typed it out to be sure.
Definitely a weird problem. I knew the code was right because I was copying it out of a book (Spring in action 4th edition - a good read btw). Anyway, hope this helps you or someone in the future! drove me crazy for about an hour


text:
Q: How do I join 3 tables in this way I have 3 tables:

And I want a resulting table that displays Movies.title, SUM(Bookings.price) and COUNT(BookingId).
I tried the code below, but keep getting the error:

Column 'Movies.Title' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

SELECT Movies.Title, SUM(Bookings.Price) ASnewPrice, COUNT(Bookings.BookingId) AS Quantity
FROM ((Orders
INNER JOIN Bookings ON Orders.BookingId = Bookings.BookingId)
INNER JOIN Movies ON Movies.MovieId = Bookings.MovieId)
WHERE UserId = @UserId AND Completed = @Completed
ORDER BY Bookings.BookingId

A: you can try with this:
SELECT
  Movies.Title, SUM(Bookings.Price) AS newPrice,COUNT(Bookings.BookingId) AS Quantity
FROM Orders
INNER JOIN Bookings ON (Orders.BookingId = Bookings.BookingId)
INNER JOIN Movies ON (Movies.MovieId = Bookings.MovieId)
WHERE UserId = @UserId AND Completed = @Completed
GROUP BY Movies.Title
ORDER BY Bookings.BookingId


text:
Q: How to set the gradle outout folder for the kotlin2JS plugin? I have a KotlinJs only project which I use official kotlin2js gradle to build, and no problems there.
How to setup the output folder, currently, the building of subproject will result in a build which locates inside the subproject folder, how to set it to somewhere else? I tried:
sourceSets {
      main {
          kotlin.outputDir = new File('./out/')
      }
}

and
sourceSets {
      main.kotlin.outputDir = new File('./out/')

}

No luck.
What I want is to no matter how many subprojects are there, the output folder should be in some path like ./build/projectA and ./build/projectB, rather than all in their own folder. How to do this?

A: Currently, it's done through the task configuration, namely setting its kotlinOptions.outputFile:
compileKotlin2Js.kotlinOptions.outputFile = "out/output.js"

It's briefly mentioned in the tutorial: Getting Started with Kotlin and JavaScript with Gradle


text:
Q: Show that a functional is differentiable Show that the following functionals are differentiable in following spaces:
(1): $J\left[y\right] = y(a)\ \ \ in \ \ \ C\left[a,b\right];$
(2): $J\left[y\right] = y(a)\ \ \   in \ \ \ C^{'}\left[a,b\right];$
(3): $J\left[y\right] = \sqrt{1+y^{'2}(a)}\ \ \   in \ \ \ C^{'}\left[a,b\right];$
(4): $J\left[y\right] = \left|y(a)\right|\ \ \   in \ \ \ C\left[a,b\right].$
For (1) and (2) it's clear: $\Delta J=J\left[y+\delta y\right]-J\left[y\right]=\delta y$. It's differentiable, because $\Delta J$ equals to Linear functional of $\delta y$. But, for (3) and (4) it's not very clear. If for (4) I can write: $\Delta J=J\left[y+\delta y\right]-J\left[y\right]=\left|y(a)+\delta y\right|-\left|y(a)\right|$ - here we can see that the first term is a linear functional of $\delta y$ , but second term does not goes to 0, thus it's not differentiable. Book says (3) is differentiable, I have no idea how to show it.


text:
Q: Explanation of and alternative proof for Cantor's Theorem I'll state the Cantor's theorem proof as is it is in my study texts:
Theorem (Cantor): Let $X$ be any set. Then $|X|<|\mathcal{P}(X)|$
Proof: Define map $\varphi:X\rightarrow\mathcal{P}(X)$ by $\varphi:x\mapsto\{x\}$. $\varphi$ is injective, thus $|X|\leq|\mathcal{P}(X)|$. Now suppose there is a bijection (surjection) $\psi:X\rightarrow\mathcal{P}(X)$. Denote the set $A=\{x\in X, x\notin \psi(x)\}$. By assumption, $\psi$ is surjection so we find some $a\in X$ such that $\psi(a)=A$. Then we have two cases, either $a\in A$, but the, by definition of $A$: $a\notin \psi(a)$ which is a contradiction. So $a\notin A$ but then $a\in \psi(a)=A$ which is a contradiction aswell thus such surjection cannot exist.
So now, for my question. The definition of $A$ seems really weird to me. Because, in the first place. Assume $X=\{1,2\}$ then $\mathcal{P}(X)=\{\{1,2\},\{1\},\{2\},\emptyset\}$. In the proof $A$ is supposed to be the set of all members of $X$ (thus numbers) that are not in the range of $\psi$ but, the range of $\psi$ are sets, aren't they? Thus $A=\{1,2\}$ and the case is $\forall a\in X:a\in{A}$ thus the second case of the proof applies. Basically this leads me to the following idea: instead of constructing this set $A$, we can say that:
Estabilish injection and thus $|X|\leq|\mathcal{P}(X)|$ by $\varphi:x\mapsto\{x\}$ thus $\forall{S}\in\varphi(x):|S|=1$, but for any set $X:$ $\emptyset\subset\mathcal{P}(X)$ but $|\emptyset|=0$ so $\emptyset\notin ran(\varphi)$ thus $\varphi$ is not surjective.

A:
In the proof $A$ is supposed to be the set of all members of $X$ (thus numbers) that are not in the range of $\psi$

No, this is not quite true. The construction is more subtle than that. For any $x \in X$, the value $\psi(x) \in \mathcal P(X)$ is some set -- a subset of $X$ to be precise. Note that this is not the range of $\psi$, it is the value of $\psi(x)$ for a single $x$.
Then we have either $x \in \psi(x)$ or $x \notin \psi(x)$, and we add $x$ to the set $A$ if and only if $x \notin \psi(x)$.

A: That the specific mapping $ \varphi$ is not surjective, hence not bijective,  is clear.
To prove that $|X|<|\mathcal{P}(X)|$ , it is enough to show that each(!) mapping $\psi:X\rightarrow\mathcal{P}(X)$ cannot be surjective.
In the proof above it is assumed that there is a surjective mapping $\psi:X\rightarrow\mathcal{P}(X)$ . But this leads to a contradiction....

A: Mees de Vries' answer gives an explanation of where your misunderstanding of the usual proof was.
To address your alternative proof attempt: you show that there is a particular injection from $X$ to $\mathcal{P}(X)$, but that it's not surjective. This isn't enough to prove that $|X|<|\mathcal{P}(X)|$. For example, we can define a function from $\mathbb N$ to $\mathbb N\times \mathbb N$ by $\varphi(n)=(n,1)$, which is injective but not surjective. However, $|\mathbb N|=|\mathbb N\times \mathbb N|$ because other, more complicated, functions exist which are both injective and surjective (e.g. $\psi(n)=(a,b)$ where $a,b$ are the unique positive integers such that $n=(2a-1)2^{b-1}$).


text:
Q: How to store an NSMutableArray to another NSMutableArray in Objective-C Here is my JSON and source-code which I tried:
JSON:
{
    "total": 2,
    "floorplans": [
        {
            "_id": {
                "$id": "57fdd13e368e728c278328f6"
            },
            "indoor_map_name": "Building 1",
            "geo_coords": {
                "lat": "42.0912000000000010",
                "long": "-71.2643390000000070"
            },
            "map_community_id": 20316,
            "map_drawing_id": 31728,
            "map_level_id": 53146,
            "organization": [
                "org-57d67a986edc6182458466"
            ],
            "drawings": [
                {
                    "map_drawing_id": "21419",
                    "levels": [
                        {
                            "map_level_id": "53136",
                            "min_height": "70",
                            "max_height": "75"
                        }
                    ]
                },
                {
                    "map_drawing_id": "31728",
                    "levels": [
                        {
                            "map_level_id": "53146",
                            "min_height": "70",
                            "max_height": "86"
                        },
                        {
                            "map_level_id": "53149",
                            "min_height": "86",
                            "max_height": "96"
                        },
                        {
                            "map_level_id": "53150",
                            "min_height": "96",
                            "max_height": "110"
                        }
                    ]
                }
            ],
            "uuid": "mapgroup-57fdd13e25afd890493911"
        }
    ]
}

Code:
-(void)getAllDrawingsandLevels:(NSDictionary *)dict
{
    int total = [[dict objectForKey:@"total"] intValue];
    if (total >0) {
            arrFloorplans =[dict objectForKey:@"floorplans"];
            if (arrFloorplans!=nil) {
                for (int i=0; i<[arrFloorplans count]; i++) {
                    arrFloorplans1 = [arrFloorplans objectAtIndex:i];
                    //NSLog(@"arrDrawings1 %@",arrFloorplans1);

                NSString *srtCommID = [arrFloorplans1 valueForKey:@"map_community_id"];
                if ([[NSString stringWithFormat:@"%@",srtCommID] isEqualToString:[NSString stringWithFormat:@"%@",[kCommunityid objectAtIndex:i]]]) {
                    arrDrawings = [arrFloorplans1 valueForKey:@"drawings"];
                    if (arrDrawings !=nil) {
                        for (int j = 0; j<[arrDrawings count]; j++) {
                            arrDrawings1 = [arrDrawings objectAtIndex:j];
                            NSString *StrDrwaingID = [NSString stringWithFormat:@"%@",[arrDrawings1 valueForKey:@"map_drawing_id"]];
                            [arrDrawingsID addObject:StrDrwaingID];
                            //[arrLevelsID removeAllObjects];
                            arrLevels = [arrDrawings1 valueForKey:@"levels"];
                            for (int k = 0; k< [arrLevels count]; k++) {
                                arrLevels1 = [arrLevels objectAtIndex:k];
                                NSString *StrLevelID = [NSString stringWithFormat:@"%@",[arrLevels1 valueForKey:@"map_level_id"]];
                                [arrLevelsID addObject:StrLevelID];
                            }
        [arrFinalLevelID addObjectsFromArray:arrLevelsID];
                          }
                        NSLog(@"arrDrawingsID %@",arrDrawingsID);
                        NSLog(@"arrLevelsID %@",arrLevelsID);
                        NSLog(@"arrFinalLevelID %@",arrFinalLevelID);

                    }
                }
            }
    }
}

I want Two arrays
1) arrDrawingsID = [21419][31728]  which I got successfully and Second one
2) arrFinalLevelID = [53136][53146,53149,53150] But with this code my output is
[53136,53136,53146,53149,53150]
Thanks in Advance,
Mihir

A: The problem is in this line [arrFinalLevelID addObjectsFromArray:arrLevelsID]; it should be [arrFinalLevelID addObject:arrLevelsID]; also you need to reinitialized arrLevelsID before loop.
arrLevelsID = [NSMutableArray alloc] init]; //reinitialized Array for removing previous value
arrLevels = [arrDrawings1 valueForKey:@"levels"];
for (int k = 0; k< [arrLevels count]; k++) {
    arrLevels1 = [arrLevels objectAtIndex:k];
    NSString *StrLevelID = [NSString stringWithFormat:@"%@",[arrLevels1 valueForKey:@"map_level_id"]];
    [arrLevelsID addObject:StrLevelID];
}
[arrFinalLevelID addObject:arrLevelsID]; //instead of addObjectsFromArray:


text:
Q: Using insert and update on the 'when matched then' // merge Is it possible to use an INSERT AND an UPDATE on the When matched then ?  ? I saw on the web that it's note possible so my question is : how can i do something like below ?
create table target_table(a, b, c, d, e) as (
   select 1, 2, 'NO',  100,'MDE' from dual union all
   select 1, 3, 'NO',  100,'AGC' from dual union all
   select 1, 4, 'NO',  100,'MDE' from dual union all
   select 1, 6, 'YES',  100,'MDE' from dual union all
   select 1, 5, 'NO',  100,'MDE' from dual );

create table source_table(a, b, c, d, e) as (
   select 1, 0, 'NO',  200,'AGC'  from dual union all
   select 1, 1, 'NO',  200,'MDE'  from dual union all
   select 1, 3, 'YES', 200,'AGC'  from dual union all
   select 1, 4, 'NO',  200,'MDE'  from dual union all
   select 1, 5, 'YES', 200,'MDE'  from dual );

merge into target_table t
using source_table s
on (t.a = s.a and t.b = s.b)
when matched then
case
      when t.c = 'NO' and s.c = 'YES' and t.e = 'MDE' and s.e = 'MDE' then update set t.d = s.d, t.c = s.c
      when t.e <> 'MDE' and s.e <> 'MDE' then insert values (s.a, s.b, s.c, s.d, s.e)
end
when not matched then insert values (s.a, s.b, s.c, s.d, s.e);

A: Let's sort things out.
First https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/MERGE.html#GUID-5692CCB7-24D9-4C0E-81A7-A22436DC968F

*

*matched     -> update/delete

*not matched -> insert

No mixing allowed.
So you want to insert when t.e and s.e are != 'MDE' or (t.a = s.a and t.b = s.b)
And the update only when  t.c = 'NO' and s.c = 'YES' and t.e = 'MDE' and s.e = 'MDE'
So did you try:
merge into target_table t
using source_table s
on (t.a = s.a and t.b = s.b and not ( t.e <> 'MDE' and s.e <> 'MDE'))
when matched then
    update set t.d = s.d, t.c = s.c
    where t.c = 'NO' and s.c = 'YES' and t.e = 'MDE' and s.e = 'MDE'
when not matched then insert values (s.a, s.b, s.c, s.d, s.e)


text:
Q: I have an alert prompt string written on Wordpress JS file but where is the info stored after they answer the popup? 1.) I have an alert and prompt string written on my Wordpress Javascript file but where is the users information stored after they answer the popup question?
alert("Hello " + prompt("What is your name"));

The Javascript shows up running on here : http://izaguirre.me/contact/
My other questions are :
2.) Why does this javascript function only run on this page http://izaguirre.me/contact/ ?
Is there a way to add something to dictate which pages the prompt is supposed to run on ?
3.) Someone on another forum told me "its stored in javascript memory so no real way to 'see' it.  "
If what they said is completely true then whats the point of having someone type there name or information if its going to be erased as soon as they close the pop-up box? is it just for a temporary welcome message ?

A: You'll need to change your code if you want to get the name variable.
var name = prompt("Please enter your name");

if (person != null) {
     alert("Hello " + name);
}

The person on the forum was correct, it is temporary. There is hardly a point to it.

A: JavaScript is client side, therefore the information does not get stored anywhere other than the user's browser. You need to use a server-side language, such as PHP if you want to store it on your server.
Currently, the JavaScript will only remain in the memory until they refresh or leave the page. For example, the JavaScript can validate a form by making sure that all the input fields are less than 5000 characters, that the user entered a valid looking email address, that the user filled out all the required fields. But JavaScript does not send the form or save the information or send the information to you (the server). The form is sent with PHP, and the text that the client writes is then often stored in a database such as mySQL.


text:
Q: How many parallel threads i can run on my nvidia graphic card in cuda programming? Operating System:   Windows 8.1 Single Language, 64-bit
DirectX version:    11.0
GPU processor:      GeForce 840M
Driver version:     353.06
Direct3D API version:   11.2
Direct3D feature level: 11_0
CUDA Cores:     384
Core clock:     1029 MHz
Memory data rate:   1800 MHz
Memory interface:   64-bit
Memory bandwidth:   14.40 GB/s
Total available graphics memory:    4096 MB
Dedicated video memory: 2048 MB DDR3
System video memory:    0 MB
Shared system memory:   2048 MB
Video BIOS version: 82.08.14.00.64
IRQ:            Not used
Bus:            PCI Express x4 Gen2
Device Id:      10DE 1341 2281103C
Part Number:        2701 0000

A: That depends on the CUDA Version used I think.
                Compute capability(version)            V1.0     V1.2     V2.x      V3.0-X.X
 Maximum number of resident threads per multiprocessor  768     1024    1536    2048
 Amount of local memory per thread                      16 KB           512 KB
 Maximum number of threads per block                    512             1024

If found this peace of Information on CUDA - Wikipedia.
For more informations look under

Version features and specifications

I Hope I could help :)


text:
Q: PHP json_encode fails from https My php script fails when served as a secure page and json_encode() is called, but not otherwise. The code is distilled from a larger script called from XHR. PHP Version 5.2.0., Apache/1.3.34 (Unix).
Is the problem source: PHP, my ISP, or me?
To demo, call this script 4-ways:
https://www.camdenac.com/test_json_encode.php?encode=0  => works, secure protocol, does not call json_encode().
https://www.camdenac.com/test_json_encode.php?encode=1  => fails, secure protocol, calls json_encode().
In the first case you will see some html and then php echoes the results.
In the second case you will see only the html; no php output.
/*
Try these 2 links also from non-secure protocol.
http://www.camdenac.com/test_json_encode.php?encode=0  => works.
http://www.camdenac.com/test_json_encode.php?encode=1  => works.
*/

<?php
$encode= 0;
if( isset($_GET['encode']) ){
    $encode= substr(trim($_GET['encode']),0,1);
}

$dummy= array(1,2,3,4,5);
$json="We did not call json_encode.";

if($encode){
    $json= json_encode($dummy);
}

echo '
IT WORKS!
';
echo '
Host protocol is: '.$_SERVER['HTTP_HOST'].'
';
echo '
Query string is: '.$_SERVER['argv'][0].'
';
echo '
HTTPS is: '.$_SERVER['HTTPS'].'
';
echo '
json encoding is: '.$json.'
';
echo '
Array dump follows:
';

var_dump($dummy);
?>

A: I think your version of php is to old and does not contain the json_encode function. You may need to update your php version if you want to use it.


text:
Q: How to I add contents from one object to another? I have two objects, one has more content then the other
let obj1 = [
{title: 'title one'},
{title: 'title four'}
]

let obj2 = [
{title: 'title one', img:'..'},
{title: 'title two', img:'..'},
{title: 'title three', img:'..'},
{title: 'title four', img:'..'}
]

I want to be able to merge those two objects so that I get something like this
let newObject = [
{title: 'title one', img:'..'},
{title: 'title four', img:'..'}
]

Basically get all the objects within obj2 that match the object of obj1

A: to get all the elements from obj2 which are also present in obj1
   obj1.forEach((ele)=>{objInObj1AndObj2[ele.title]=1}); newObject = obj2.filter((ele)=>{return objInObj1AndObj2[ele.title] })

A: Try this example to start.
const object1 = {
  a: 1,
  b: 2,
  c: 3
};

const object2 = Object.assign({c: 4, d: 5}, object1);

console.log(object2.c, object2.d);
// expected output: 3 5

Good luck!


text:
Q: How to bind a dynamic value inside a visualstate In a Universal Windows App how to bind a value inside a visual state in XAML. For the sake of easy understanding I removed the other states except checked state under VisualStateGroups in the code below.
  <Page.Resources>
   <converters:UriToImageBrushConverter x:Key="cnvt"/>
    <Style x:Key="RadioButtonStyletest" TargetType="RadioButton">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{ThemeResource RadioButtonContentForegroundThemeBrush}"/>
        <Setter Property="Padding" Value="1,4,0,0"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RadioButton">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckGlyph"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                                <VisualState x:Name="Indeterminate"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="29"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid VerticalAlignment="Top">
                                <Ellipse x:Name="BackgroundEllipse" Height="23" Fill="{Binding Imgsrc, Converter={StaticResource cnvt}}" Stroke="{ThemeResource RadioButtonBorderThemeBrush}" StrokeThickness="{ThemeResource RadioButtonBorderThemeThickness}" UseLayoutRounding="False" Width="23">

                                </Ellipse>
                                <Ellipse x:Name="CheckGlyph" Fill="{ThemeResource RadioButtonForegroundThemeBrush}" Height="13" Opacity="0" UseLayoutRounding="False" Width="13"/>
                                <Rectangle x:Name="FocusVisualWhite" Height="29" Opacity="0" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1" Width="29"/>
                                <Rectangle x:Name="FocusVisualBlack" Height="29" Opacity="0" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1" Width="29"/>
                            </Grid>
                            <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" Grid.Column="1" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</Page.Resources>

In the above code i tried to bind the BackgroundEllipse backgroud its not happening.
c# code:
private String imgsrc;

    public String Imgsrc
    {
        get
        {
            return imgsrc;
        }
        set
        {
            imgsrc = value;
        }
    }

    public MainPage()
    {
        this.InitializeComponent();

        Imgsrc = "/Assets/yes.png";

    }

The Converter
class UriToImageBrushConverter : IValueConverter
{

    public object Convert(object value, Type targetType, object parameter, string language)
    {
        try
        {
            return new BitmapImage(new Uri((string)value));
        }
        catch
        {
            return new BitmapImage();
        }
    }

    public object ConvertBack(object value, Type targetType, object parameter, string language)
    {
        throw new NotImplementedException();
    }
}

}
Please advice me where I went wrong.

A: Binding in xaml looks for properties in DataContext by default. However, ImageBrush is not FrameworkElement and does not have DataContext.
Try this:
<Ellipse x:Name="BackgroundEllipse"
         Fill="{Binding Imgsrc, Converter={StaticResource UriToImageBrushConverter}}" />

UriToImageBrushConverter is a simple class that implements IValueConverter, I'm sure you don't need me to write it.
Also make sure, that DataContext of BackgroundEllipse element is MainPage. Otherwise you could use RelativeSource:
<Ellipse x:Name="BackgroundEllipse"
         Fill="{Binding Imgsrc, RelativeSource={RelativeSource AncestorType=Page}}
                        Converter={StaticResource UriToImageSourceConverter}}" />


text:
Q: Doesn't see popup menu on combobox I'm trying to set a new style to comboBox in qml and get in trouble my combobox doesn't want to show me drop-down list everything else is fine, here is code
The code I took from Internet
T.ComboBox {
      id: _comboBox
      anchors.bottom: _borderedTextboxPoints.top
      anchors.horizontalCenter: _borderedTextboxPoints.horizontalCenter
      anchors.bottomMargin: 10

      delegate: T.ItemDelegate {  //! Changing style of items in list
             width: _comboBox.width
             contentItem: Text {
                 text: modelData
                 color: "black"
                 font: _comboBox.font
                 elide: Text.ElideRight
                 verticalAlignment: Text.AlignVCenter
             }
             highlighted: _comboBox.highlightedIndex === index
         }

         indicator: Canvas {  //! Changing style of indicator
             id: canvas
             x: _comboBox.width - width - _comboBox.rightPadding - 5
             y: _comboBox.topPadding + (_comboBox.availableHeight - height) / 2
             width: 12
             height: 8
             contextType: "2d"

             Connections { //! Changing style on pressed
                 target: _comboBox
                 function onPressedChanged() { canvas.requestPaint(); }
             }

             onPaint: {
                 context.reset();
                 context.moveTo(0, 0);
                 context.lineTo(width, 0);
                 context.lineTo(width / 2, height);
                 context.closePath();
                 context.fillStyle = _comboBox.pressed ? "#722ed1" : "#531dab";
                 context.fill();
             }
         }

         contentItem: Text {
             leftPadding: 5
             rightPadding: _comboBox.indicator.width + _comboBox.spacing

             text: _comboBox.displayText
             font: _comboBox.font
             color: "black"
             verticalAlignment: Text.AlignVCenter
             elide: Text.ElideRight
         }

         background: Rectangle {
             implicitWidth: 120
             implicitHeight: 40
             border.color: _comboBox.pressed ? "#2f54eb" : "#1d39c4"
             border.width: _comboBox.visualFocus ? 2 : 1
             radius: 10
         }

         popup: T.Popup { //! Changing style of drop-down list
             y: _comboBox.height - 1
             width: _comboBox.width
             implicitHeight: contentItem.implicitHeight
             padding: 1

             contentItem: ListView {
                 clip: true
                 implicitHeight: contentHeight
                 model:_comboBox.popup.visible ? _comboBox.delegateModel : null
                 currentIndex: _comboBox.highlightedIndex

                T.ScrollIndicator.vertical: T.ScrollIndicator { }
             }
         }
      }

That's look like this

A: In the popup code add a z and use an index higher than 1
popup: T.Popup { //! Changing style of drop-down list
         ...
         padding: 1
         z: 4
         ...

I used 4 as the z, here because I knew 4 will definitely work. But maybe 2 too would have worked.
This usually happens when you are showing the combo box in a popup.


text:
Q: Update not all Bootstrap grid breakpoints I have 2 questions:
1. What the $container-max-width Bootstrap variable is used for?
2. How should I override the variables if I need the following resolutions?
 sm: 0px -> 768px - tablet portrait
 md: 769px -> 1442px - tablet landscape and laptop
 lg: 1443px -> 1920px - large screens

A: Just import your variables before bootstrap import, because those variables are define with !default flag, so when your scss will be transforming to css it will use your override values.
$grid-breakpoints: (
  xs: 0,
  sm: 0,
  md: 769px,
  lg: 1443px,
  xl: 1921px
);

$container-max-widths: (
  sm: 540px,
  md: 720px,
  lg: 960px,
  xl: 1140px
) !default;

@import 'bootstrap'

A: You just need to override $grid-breakpoints and $container-max-widths. Write these codes before where you import bootstrap.
Grid break-points

// Define the minimum dimensions at which your layout will change,
// adapting to different screen sizes, for use in media queries.

$grid-breakpoints: (
        sm: 0,
        md: 769px,
        lg: 1443px,
) !default;

Grid containers

// Define the maximum width of `.container` for different screen sizes.

$container-max-widths: (
        sm: 768px,
        md: 1442px,
        lg: 1920px,
) !default;


text:
Q: Changing a dom related element upon event My document has multiple dom elements with class "vatcheckbox" (checkbox) that, when changed/clicked, should disable a dom-related element with "vatfield" class (input field).
I have tried the following :
document.querySelector('.vatcheckbox').addEventListener('change', function()
  { this.parentElement.parentElement.parentElement.querySelector('.vatfield').disabled = this.checked;
    }
    )

It does work if there is a single instance of .vatcheckbox. But when there is multiple instances of .vatcheckbox the changes append to the first .vatcheckbox element only.

A: This should work without any library
document.querySelectorAll('.vatcheckbox').forEach(checkbox => {
    checkbox.addEventListener('change', function() {
      this.parentElement.parentElement.parentElement.querySelector('.vatfield').disabled = this.checked;
    })
  });

A: Try to wrap the event listener in a JQuery each:
$('.vatcheckbox').each(function(idx) {
  this.addEventListener('change', function() {
    this.parentElement.parentElement.parentElement.querySelector('.vatfield').disabled = this.checked;
  });
});

A: Use HTMLFormElement and HTMLFormControlsCollection interfaces to reference form controls. Use Event Delegation to control the behavior of all checkboxes that have the same [name] attribute when a specific checkbox is checked.
In the demo, all checkboxes are wrapped in a form tag. All checkboxes with [name=ver] will be disabled when the checkbox with #id of #vat is checked and vice versa. Details commented in demo.

// Reference form
const form = document.forms['main'];
// Reference all form controls
const x = form.elements;
// Reference all input[name=ver]
const vers = x.ver;

/** onOff()
//A - Pass Event Object
//B - Iterate through all input[name=ver]...
//C - if the origin of event is checked...
//D - disable each input[name=ver]...
//E - Otherwise enable each input[name=ver]
*/
function onOff(e) { //A
  for (let ver of vers) { //B
    if (e.target.checked) { //C
      ver.disabled = true; //D
    } else {
      ver.disabled = false; //E
    }
  }
  return false;
}

// Register input#vat to the change event -- call onOff on change event
x.vat.onchange = onOff;
<form id='main'>
  <input id='vat' type='checkbox'> VAT
  <input name='ver' type='checkbox'> verify

  <input name='ver' type='checkbox'> verify

  <input name='ver' type='checkbox'> verify

  <input name='ver' type='checkbox'> verify

  <input name='anything' type='checkbox'> Anything
  <input name='else' type='checkbox'> Else

  <input name='ver' type='checkbox'> verify

  <input name='ver' type='checkbox'> verify

  <input name='anything' type='checkbox'> Anything
  <input name='else' type='checkbox'> Else
  <input name='ver' type='checkbox'> verify

  <input name='ver' type='checkbox'> verify

  <input name='ver' type='checkbox'> verify

  <input name='anything' type='checkbox'> Anything
  <input name='else' type='checkbox'> Else

</form>


text:
Q: How to parse json object to update HANA table?
I have a HANA table with 2 columns and I am trying to update one column for instance. I am really new to jSON/HANA and I am trying to parse a json array by using a SQL query to loop through the json object and update my table with the updated values.
function updateData(){
     var param1 = $.request.parameters.get('param1');
     var param2 = $.request.parameters.get('param2');
     var conn = $.db.getConnection();
     var pstmt;
     var rs;

     var data = getJSON("URL");
       var arr = [data];
        arr.forEach(function(d)){
            if (param1 !=null){
             console.log(d.param2);
            }
         });

         query = 'UPDATE schema.tableName SET param1=? WHERE param2=?';
         pstmt = conn.prepareStatement(query);
         pstmt.setString(1, param1);
         pstmt.setString(2, param2);
         rs = pstmt.executeQuery();
         conn.commit();
         rs.close();
         pstmt.close();
         conn.close();
}

The result should include the updated new values of param2 in the table but it's not working.

A: On HANA database you can use "JSON_TABLE" to parse JSON data into a table.
After you have your data in a tabular way, you can use it inserteing or updating a database table


text:
Q: Bootstrap toggle button not showing all nav-right items I played around with the navbar and have  situated it below the header pic. Everything looks ok on full screen. But on mobiles the navbar-right items are hidden in the toggle.  Can anyone tell me why?
Bootply:  http://www.bootply.com/zmpMWqSmyU
html:

          <button type="button" class="navbar-toggle"
          data-toggle="collapse"    data-target="#myNavbar">

                </button>

Home

About us

Products

Lily

Blog

Testimonials

Contact us

  css

  .nav {
    font-size: 35px;
    color: black;
    margin-top: 520px;
  }

   .navbar-toggle .icon-bar {
    display: block;
    background-color: blue;

   }

    .navbar-brand {
      color: #ff5bae;
       text-align: center;
       position: absolute;
       margin-top: 6.0%;
        left: 50%;
    margin-right: -50%;
    transform: translate(-50%, -50%) }

    }

    .navbar-brand:hover{
  color:#bcaacf;
   }

  #myNavbar li>a:hover{
    color: #ffe6d7;
    background-color: #bcaacf;
    }

   .nav.navbar-nav li>a {
    color: black;
     }

A: The problem is both your myNavbars have the same id.
You can't give multiple elements the same id; the javascript that does the collapsing/un-collapsing will only ever get one of them. So, when you click your button:
<button type="button" class="navbar-toggle" data-toggle="collapse"    data-target="#myNavbar">
It will only show one of the two:

You can fix this by using classes instead. Multiple items can have the same class. First, change your data-target in your button to .myNavbar. Like so:
<button type="button" class="navbar-toggle" data-toggle="collapse"    data-target=".myNavbar">
Then, change both of your navbars. Remove the id and add it to the class list. Like so:

Additionally, you have malformed html in one of your myNavbars:

Home

About us

Products

Should be:

Home

About us

Products


text:
Q: Latest VMPlayer 7.1.4 will not run in Mint 18.2 I installed VM player 7.1.4-3848939.x86_64 onto Mint 18.2 (an Ubuntu fork) and it will not start. The wheel turns for a while (20 seconds) and then nothing. Clearly its looking for something that isn't there. I got no dependency errors and when I run the VMPLAYER command in terminal there are no errors, it simply returns a new command prompt almost instantly.
Of course I googled it and searched here and while there are plenty of VM Player related problems I seem to be the only one with this particular problem. I did find something from 2015 but since I don't understand the solution (it involved manipulating libraries) I am reluctant to do that on the current version.
I have 23 gigabytes of memory and 4 terabytes of storage space.

    H/W path           Device      Class          Description
=========================================================
                               system         MS-7821 (To be filled by O.E.M.)
/0                             bus            Z87-G55 (MS-7821)
/0/0                           memory         64KiB BIOS
/0/3d                          processor      Intel(R) Core(TM) i5-4430 CPU @   3.
/0/3d/3e                       memory         1MiB L2 cache
/0/3d/3f                       memory         256KiB L1 cache
/0/3d/40                       memory         6MiB L3 cache
/0/41                          memory         24GiB System Memory
/0/41/0                        memory         8GiB DIMM DDR3 Synchronous 1333 MH
/0/41/1                        memory         4GiB DIMM DDR3 Synchronous 1600 MH
/0/41/2                        memory         8GiB DIMM DDR3 Synchronous 1333 MH
/0/41/3                        memory         4GiB DIMM DDR3 Synchronous 1600 MH
/0/100                         bridge         4th Gen Core Processor DRAM Control
/0/100/2                       display        Xeon E3-1200 v3/4th Gen Core Proce
/0/100/3                       multimedia     Xeon E3-1200 v3/4th Gen Core Proce
/0/100/14                      bus            8 Series/C220 Series Chipset Famil
/0/100/14/0        usb3        bus            xHCI Host Controller
/0/100/14/0/9                  bus            USB2.0 Hub
/0/100/14/0/9/2                bus            USB2.0 Hub
/0/100/14/0/9/2/2              input          Gaming keyboard
/0/100/14/0/9/3                input          USB Receiver
/0/100/14/1        usb4        bus            xHCI Host Controller
/0/100/16                      communication  8 Series/C220 Series Chipset Famil
/0/100/1a                      bus            8 Series/C220 Series Chipset Famil
/0/100/1a/1        usb1        bus            EHCI Host Controller
/0/100/1a/1/1                  bus            USB hub
/0/100/1b                      multimedia     8 Series/C220 Series Chipset High
/0/100/1c                      bridge         8 Series/C220 Series Chipset Famil
/0/100/1c.3                    bridge         8 Series/C220 Series Chipset Famil
/0/100/1c.3/0      enp2s0      network        RTL8111/8168/8411 PCI Express Giga
/0/100/1d                      bus            8 Series/C220 Series Chipset Famil
/0/100/1d/1        usb2        bus            EHCI Host Controller
/0/100/1d/1/1                  bus            USB hub
/0/100/1f                      bridge         Z87 Express LPC Controller
/0/100/1f.2                    storage        8 Series/C220 Series Chipset Famil
/0/100/1f.3                    bus            8 Series/C220 Series Chipset Famil


text:
Q: wkhtmltopdf - Strange Behavior in multiple page because of Bing Maps I have a little problem in pdf generation... When in wkhtmltopdf i execute with an Html page that have Bing Maps, and that PDF occupies more than 1 page, the second and third page came an strange image...
Let me show the examples:

*

*With the Bing Maps (And with the problem...): http://pdfcast.org/download/html-with-bing-maps.pdf

*Without the Bing Maps: http://pdfcast.org/download/html-without-bing-maps.pdf
For construction of Bing Maps i use this API:
http://msdn.microsoft.com/en-us/library/gg427611.aspx
var defaultOptions = {
    credentials: "myCredential",
    enableClickableLogo: false,
    enableSearchLogo: false,
    showDashboard: false,
    showCopyright: false,
    tileBuffer: 0
};
var mapOptions = {
    center: { latitude: latitude, longitude: longitude },
    zoom: 14,
    move: function(address) {...},
    beforeMove: function() {...}
};

var map = new Microsoft.Maps.Map(document.getElementById(divId), $.extend({}, this.defaultOptions, options))

Anyone had this problem before? Anyone knows the probable solution for this?
Thanks

A: Have you tried --disable-smart-shrinking switch. Check the extended help on http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf_0.10.0_rc2-doc.html


text:
Q: Using pgfkeys to make a custom tikzpicture command with multiple use of addplot Consider this MWE:

\documentclass{article}
\usepackage{tikz,pgfplots}
\usepackage{pgfkeys}
\usepackage{xparse}
\usepackage{filecontents}

% DATA 1
\begin{filecontents*}{data1.txt}
1 1
2 4
3 9
4 16
5 25
\end{filecontents*}

% DATA 2
\begin{filecontents*}{data2.txt}
1 15
2 10
3 7
4 5
5 2
6 1
\end{filecontents*}

% see https://tex.stackexchange.com/questions/393622/using-key-values-in-newdocumentcommand
\pgfkeys{/myplot/.is family, /myplot,
    filename/.initial=data.txt,
    linecolor/.initial=black,
}
\newcommand\myplotvals[1]{\pgfkeysvalueof{/myplot/#1}}

\NewDocumentCommand\myplot{m} {
    \begin{tikzpicture}
    \pgfqkeys{/myplot}{#1}% keep key changes local
        \begin{axis}
        \addplot [\myplotvals{linecolor},mark=none] table {\myplotvals{filename}};
        \end{axis}
    \end{tikzpicture}
}

\begin{document}

\myplot{filename=data1.txt,linecolor=red}

\end{document}

Using pgfkeys I've created a command called \myplot which takes data from a .txt as an input and you can optionally set the line color.
This works well for 1 data set. My question is, does anyone know how I could adapt this method to allow adding multiple data sets.
In my MWE, I've included a second data set called data2.txt. What I want the command to do is essentially generate something like this:
\begin{tikzpicture}
\begin{axis}
\addplot [red,mark=none] table {data1.txt};
\addplot [blue,mark=none] table {data2.txt};
\end{axis}
\end{tikzpicture}

Basically, it would be great if I could specify a second .txt file (or potentially n text files) and it would automatically add more \addplot commands as required. Is this even possible to do? I don't know what the input would have to look like, maybe something like \myplot{filename={data1.txt,data2.txt},linecolor={red,blue}} ? But perhaps that doesn't work?
Update
Just to be clear, although in my MWE the file names are sequential, in my real example the file names do not iterate numerically. Therefore I have to specify each file name individually.


text:
Q: How to set current date in CalendarExtender Requirement is simple.
How to set current date in CalendarExtender control.
<cal:CalendarExtender ID="calDate" runat="server" SelectedDate="2008-01-01" TargetControlID="txtDate" CssClass="CalendarExtender" Format="yyyy/MM/dd">

Here the selected date is 2008-01-01. I need to show current date instead of 2008-01-01
Appreciate your assistance

A: You just need to assign it in codebehind, for example in Page_Load:
if(!IsPostBack)
   calDate.SelectedDate = DateTime.Today;

A: Another example using @Hutchonoid approach: example below illustrate how to correctly use ajaxcontrolTookKit CalendarExtender.
<ajaxControlToolKit:CalendarExtender runat="server"
           id="cal1"
           TargetControlID="txtDateFrom"
           CssClass="MyCalendar ajax__calendar ajax__calendar_hover"
           Format="dd/MM/yyyy"
           PopupButtonID="imgControl"
           PopupPosition="BottomRight"
           SelectedDate="<%# DateTime.Today %>"  >
           </ajaxControlToolKit:CalendarExtender>
           <asp:TextBox  Type="text" ID="txtDateFrom" runat="server"></asp:TextBox>
           <asp:ImageButton ID="imgControl" runat ="server"  ImageUrl
           ="~/_icons/ajaxcalendar.png" />

Hope the above code snip-it helps or at least clarify the concept.