text:
Q: Cannot read property 'getElementsByTagName' of null while printint content in a hidden div using ngxPrint
*

*My html

  <button printTitle="MyTitle"  printSectionId="print-section" ngxPrint>print</button>

*

*My .ts

ngOnInit() {
  this.isShown = false;
}

Why can't the div content be printed if I set isShown to false.

A: The *ngIf is a syntactic sugar for the directive [ngIf]. So your template would actually be expanded to
<ng-template [ngIf]="isShown">

</ng-template>

The ng-template is Angular specific implementation of more generic HTML template tag. So as you see when the condition is false, the div isn't hidden like you say but rather not rendered yet. So when you attempt getElementsByTagName, the element isn't available yet.
As a workaround, you could use CSS to hide the element instead of *ngIf. Try the following

A: Use [hidden]="true" instead of *ngIf="isShown" and it will work.
app.component.html -

HELLO WORLD!!!

<button printTitle="MyTitle"  printSectionId="print-section" ngxPrint>print</button>

app.component.ts -
export class AppComponent { }

app.module.ts -
@NgModule({
declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxPrintModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

package.json -
"dependencies": {
    "@angular/animations": "~10.1.3",
    "@angular/common": "~10.1.3",
    "@angular/compiler": "~10.1.3",
    "@angular/core": "~10.1.3",
    "@angular/forms": "~10.1.3",
    "@angular/platform-browser": "~10.1.3",
    "@angular/platform-browser-dynamic": "~10.1.3",
    "@angular/router": "~10.1.3",
    "ngx-print": "^1.2.0-beta.5",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1001.3",
    "@angular/cli": "~10.1.3",
    "@angular/compiler-cli": "~10.1.3",
    "@types/node": "^12.11.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.0.2"
  }

Output -


text:
Q: Is there any pre-built sample of iphone like bottom navigation using CSS 3? Is there any pre-built sample of iphone like bottom navigation using CSS 3? is it possible to make these icons in CSS3, without images?

A: You may want to check out Sencha Touch, they provide a full HTML5 version of many common UI components for mobile web site development, including tab bars.

A: I think this is possible to reproduce the basic icon with basic shapes in css
For the moment I havec make the most basic look hat http://frommelt.fr/exos/icon.html
Of curse I don't lets go and I will make the other :)

A: Actually, in ChocolateChip-UI we use SVG images as background image masks and CSS3 background gradients to exactly recreate the iPhone toolbar icons. Webkit background image masks with with background images and background colors. Since CSS3 gradients are rendered by the browser as a canvas background image, they work just fine. The svg images are just black and transparent because they were created to use as masks with background colors.
That said, yes you could reproduce the images with just HTML elements and CSS. It would require a bunch of pieces, using a mix of relative and absolute positioning and would be very, very tedious to get all the pieces positioned properly and get the background gradients to match up perfectly. And then you would have to write some really complicated CSS to handle the hover state. I could do that but would I want to? Hell no! Using the SVG image masks is just so much easier. And because the SVG is just text, it's easy to edit them at any time. Oh yeah, and SVG is vector-based so you can scale them to any size without pixelation.

A: Try my itabbar www.itabbar.com
Here a full css tabbar with jquery to change button color on click
http://jsfiddle.net/onigetoc/4CgxM/ (View on Chrome or Safari)

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to open a file in MySQL event scheduler? I am currently creating my first event in MySQL:
CREATE EVENT check_for_uploads
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE
ON COMPLETION PRESERVE
DO
   // I would like to open a .php file here

However I cannot find information on if its possible to open a file from there. I think I have seen it in some tutorial.
Thank you very much!

A: You cannot or should not manipulate files within a store procedure (which is basically the same as an event, but with a schedule) due to scope and security reasons.
MySQL events and stored procedures are supposed to only modify or read data using SQL, and not go outside of the database server responsibilities. If MySQL server could read or execute arbitrary files, that would be considered a vulnerability and would be patched (with the exception of LOAD DATA or very few other very specific commands). While certain plugins allow accessing or executing arbitrary data, that is considered an exception, and not the normal way of using MySQL.
Normally PHP applications access MySQL as a resource, not the other way round. You may want to setup a UNIX cron or Window task scheduler at your OS to do what you are trying to do (executing PHP code) instead, rather than using the database.


text:
Q: Laravel multi image upload I am trying to save multiple images but I get the error show in the image at the bottom of the post.
I have tried doing a request of the name, but I get another error, I have a one to many relationship between property and images, I am trying to save many images of a property.
If I am receiving the image, if I make a dd before the creation I receive the image.
store method
public function store(Request $request)

{
  /*--from this session you start to save the properties with all their attributes  --*/

    $properti = new Propertie;

    $detail = new Detail;

    $detail->antiquity = $request->antiquity;
    $detail->furnished = $request->furnished;
    $detail->floor = $request->floor;

    $detail->save();

    $properti->details_id = $detail->id;

    $properti->name = $request->name;
    $properti->price = $request->price;
    $properti->description = $request->description;

    $properti->departaments_id = $request->departaments;
    $properti->municipalities_id = $request->municipalities;

    $properti->property_type_id = $request->type_property;
    $properti->offer_type_id = $request->type;

    $properti->details_id = $detail->id;

    $properti->lat = $request->lat;
    $properti->lng = $request->lng;
    $properti->address = $request->address;

    if (isset($request->property_id)) {
        $property_type = $request->property_id;
    } else {
        $property_type = null;
    }

    $properti->save();

    $image->name = $request->name;

        foreach($request->file('images') as $image ){
            $name = $image->getClientOriginalName();
            $image->move('image',$name);
        }

    $properti->images()->create(['name' => $name ]);

    $piso_id = $properti->id;
    $space = new Space;

    $space->property_id = $piso_id;
    $space->bedrooms = $request->bedrooms;
    $space->bathrooms = $request->bathrooms;
    $space->parking = $request->parking;
    $space->area = $request->area;

    $space->save();

    $properti->spaces_id = $space->id;

    foreach ($request->input('characteristic') as $characteristic) {

        $charc = new Characteristic;

        $charc->property_id = $piso_id;
        $charc->characteristic = $characteristic;
        $charc->save();
    }

    Session::flash('message', 'Se ha registrado su propiedad De forma exitosa');

    return redirect()->action('PropertyController@index',compact('name'));
    // return view('properties.index',compact('properties'));
}

File input
<div class="custom-file">
                    <input required type="file" class="form-control" name="images" placeholder="Imagenes" multiple>
                </div>

A: Looks like this error happens only if there are no images attached. You should attach the image while looping over the request data:
foreach ($request->file('images') as $image) {
    $name = $image->getClientOriginalName();
    $image->move('image', $name);
    // v- TO HERE -v
    $properti->images()->create(['name' => $name ]);
}

// MOVE THIS: $properti->images()->create(['name' => $name ]);

A: as i see, you are calling a variable $name defined inside a foreach loop which mean it's not defined outside the loop, and that's what the error said.


text:
Q: org.xml.sax.SAXParseException: 'GovernmentIDType' is already defined I a trying to generate Java classes from XSDs provided by third party. However I am getting the error as

[ERROR]
file:/Users/sanket/eblock/code/eblock-graphql/eblock-integration/autotec-auction-access-sqs/src/main/resources/xsd/COMP9.xsd[243,16]
org.xml.sax.SAXParseException: 'GovernmentIDType' is already defined

I am getting same errors for other elements too. I tried adding unique namespace to XSDs but that didn't work. The definition of this particular element 'GovernmentIDType', is different in both XSDs but name is similar.
COMP9.xsd
    <?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2009 sp1 (http://www.altova.com) by Charles Redden (AutoTec, LLC) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
        <xs:include schemaLocation="Header9.xsd"/>
        <xs:annotation>
            <xs:documentation>Company Message</xs:documentation>
        </xs:annotation>
        <xs:element name="BondingCompany">
            <xs:annotation>
                <xs:documentation>Name of bonding company.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="75"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="BondExpirationDate">
            <xs:annotation>
                <xs:documentation>Expiration date of bond.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:union memberTypes="xs:date">
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value=""/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>
        </xs:element>
        <xs:element name="BondNumber">
            <xs:annotation>
                <xs:documentation>Bond number as it appears on bond.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="50"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="BusinessStartDate">
            <xs:annotation>
                <xs:documentation>Date company came into business.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:union memberTypes="xs:date">
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value=""/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>
        </xs:element>
        <xs:element name="CommercialAccountType">
            <xs:annotation>
                <xs:documentation>Type of commercial account.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="Bank / Credit Union"/>
                    <xs:enumeration value="Financial Services Company"/>
                    <xs:enumeration value="Insurance Company"/>
                    <xs:enumeration value="Manufacturer"/>
                    <xs:enumeration value="Rental Car Company"/>
                    <xs:enumeration value="Captive Finance Company"/>
                    <xs:enumeration value="Fleet Company"/>
                    <xs:enumeration value="Government Agency"/>
                    <xs:enumeration value="Salvage/Scrap Company"/>
                    <xs:enumeration value="Other Business Organization"/>
                    <xs:enumeration value="Auction"/>
                    <xs:enumeration value="Non-Profit Company"/>
                    <xs:enumeration value="Public"/>
                    <xs:enumeration value="Title Loan Company"/>
                    <xs:enumeration value="Subprime Finance Company"/>
                    <xs:enumeration value="Transporter"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="CompanyID">
            <xs:annotation>
                <xs:documentation>AutoTec Company ID</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:maxInclusive value="8999999"/>
                    <xs:minInclusive value="5000000"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="CompanyInformation">
            <xs:complexType>
                <xs:sequence>
                    <xs:element ref="CompanyID"/>
                    <xs:element ref="DBAName"/>
                    <xs:element ref="LegalName" minOccurs="0"/>
                    <xs:element ref="CompanyType"/>
                    <xs:element ref="GovernmentID" minOccurs="0"/>
                    <xs:element ref="GovernmentIDType" minOccurs="0"/>
                    <xs:element ref="GovernmentIDCountry" minOccurs="0"/>
                    <xs:element ref="EntityType" minOccurs="0"/>
                    <xs:element ref="PublicSaleOnly" minOccurs="0"/>
                    <xs:element ref="NICBNumber" minOccurs="0"/>
                    <xs:element ref="DunandBradstreetNumber" minOccurs="0"/>
                    <xs:element ref="InsuranceCompany" minOccurs="0"/>
                    <xs:element ref="PolicyNumber" minOccurs="0"/>
                    <xs:element ref="InsuranceExpirationDate" minOccurs="0"/>
                    <xs:element ref="BondingCompany" minOccurs="0"/>
                    <xs:element ref="BondNumber" minOccurs="0"/>
                    <xs:element ref="BondExpirationDate" minOccurs="0"/>
                    <xs:element ref="RIN" minOccurs="0"/>
                    <xs:element ref="GST" minOccurs="0"/>
                    <xs:element ref="BusinessStartDate" minOccurs="0"/>
                    <xs:element ref="OutOfBusiness" minOccurs="0"/>
                    <xs:element ref="OutOfBusinessDate" minOccurs="0"/>
                    <xs:element ref="MembershipExpirationDate" minOccurs="0"/>
                    <xs:element ref="CommercialAccountType" minOccurs="0"/>
                    <xs:element ref="ParentCompanyID" minOccurs="0"/>
                    <xs:element ref="Courier" minOccurs="0"/>
                    <xs:element ref="CourierAccount" minOccurs="0"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        <xs:element name="CompanyType">
            <xs:annotation>
                <xs:documentation>Indicates company's tax classification.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="Sole Proprietorship"/>
                    <xs:enumeration value="General Partnership"/>
                    <xs:enumeration value="Limited Partnership"/>
                    <xs:enumeration value="Sub C Corporation"/>
                    <xs:enumeration value="Sub S Corporation"/>
                    <xs:enumeration value="LLC-Sole"/>
                    <xs:enumeration value="LLC-Partnership"/>
                    <xs:enumeration value="LLC-Corporation"/>
                    <xs:enumeration value="Business Corporation"/>
                    <xs:enumeration value="Limited Liability Company"/>
                    <xs:enumeration value="Unlimited Liability Corporation"/>
                    <xs:enumeration value="Government Agency"/>
                    <xs:enumeration value="Unknown"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="Courier">
            <xs:annotation>
                <xs:documentation>Type of courier.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="No Courier"/>
                    <xs:enumeration value="Federal Express"/>
                    <xs:enumeration value="DHL"/>
                    <xs:enumeration value="United Parcel Service"/>
                    <xs:enumeration value="United States Postal Service"/>
                    <xs:enumeration value="Purolator"/>
                    <xs:enumeration value="Other"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="CourierAccount">
            <xs:annotation>
                <xs:documentation>Courier Account number and information.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="25"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="DBAName">
            <xs:annotation>
                <xs:documentation>Company's Doing Business As name.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="50"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="DunandBradstreetNumber">
            <xs:annotation>
                <xs:documentation>ID issued to company by Dun and Bradstreet</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="9"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="EntityType">
            <xs:annotation>
                <xs:documentation>Indicates kind of entity in message.  Note: The EntityType enumerations are consistent across all messages. The only values that pertain to this message are: Dealership and Commercial Account.  Transporter is a future enhancement and may or may not be relevant to this message in the future.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="Dealership"/>
                    <xs:enumeration value="Transporter"/>
                    <xs:enumeration value="Commercial Account"/>
                    <xs:enumeration value="Company Association"/>
                    <xs:enumeration value="Person"/>
                    <xs:enumeration value="Bank"/>
                    <xs:enumeration value="Bank Account"/>
                    <xs:enumeration value="Third Party Remarketing"/>
                    <xs:enumeration value="Customer Customization"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="GovernmentID">
            <xs:annotation>
                <xs:documentation>Unique id issued by government.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="50"/>
                    <xs:minLength value="1"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="GovernmentIDCountry">
            <xs:annotation>
                <xs:documentation>Issuing country of government id</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="50"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="GovernmentIDType">
            <xs:annotation>
                <xs:documentation>Indicates type of government id.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="GovtPersonalID"/>
                    <xs:enumeration value="GovtID"/>
                    <xs:enumeration value="Passport"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="GST">
            <xs:annotation>
                <xs:documentation>Goods and Services Tax number issued for Canadian companies.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:union>
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:pattern value="[0-9]{9}"/>
                        </xs:restriction>
                    </xs:simpleType>
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value=""/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>
        </xs:element>
        <xs:element name="InsuranceCompany">
            <xs:annotation>
                <xs:documentation>Insurance company.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="75"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="InsuranceExpirationDate">
            <xs:annotation>
                <xs:documentation>Expiration date of insurance policy.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:union memberTypes="xs:date">
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value=""/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>
        </xs:element>
        <xs:element name="LegalName">
            <xs:annotation>
                <xs:documentation>Legal Name of company based on licensing documents.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="50"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="MembershipExpirationDate">
            <xs:annotation>
                <xs:documentation>Expiration date for company's AutoTec membership.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:union memberTypes="xs:date">
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value=""/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>
        </xs:element>
        <xs:element name="Message">
            <xs:complexType>
                <xs:sequence>
                    <xs:element ref="Header"/>
                    <xs:element ref="CompanyInformation"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        <xs:element name="NICBNumber">
            <xs:annotation>
                <xs:documentation>ID issued to company by National Insurance Crime Bureau.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="9"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="OutOfBusiness">
            <xs:annotation>
                <xs:documentation>Indicates whether a company is out of business.  A 'Y' value will always be accompanied by an OutOfBusinessDate.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="Y"/>
                    <xs:enumeration value="N"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="OutOfBusinessDate">
            <xs:annotation>
                <xs:documentation>Date company went out of business.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:union memberTypes="xs:date">
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value=""/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>
        </xs:element>
        <xs:element name="ParentCompanyID">
            <xs:annotation>
                <xs:documentation>The AutoTec id of any group of which the company is a member.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:int">
                    <xs:maxInclusive value="1200000000"/>
                    <xs:minInclusive value="1000000"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="PolicyNumber">
            <xs:annotation>
                <xs:documentation>Insurance policy number.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:maxLength value="50"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="PublicSaleOnly">
            <xs:annotation>
                <xs:documentation>Indicates company is allowed to purchase in public sales only.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="Y"/>
                    <xs:enumeration value="N"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:element>
        <xs:element name="RIN">
            <xs:annotation>
                <xs:documentation>Registrant Identification Number issued by Canada to Ontario dealerships.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:union>
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:pattern value="[0-9]{9}"/>
                        </xs:restriction>
                    </xs:simpleType>
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value=""/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:union>
            </xs:simpleType>
        </xs:element>
</xs:schema>

person.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2009 sp1 (http://www.altova.com) by Charles Redden (AutoTec, LLC) -->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="Header9.xsd"/>
    <xs:annotation>
        <xs:documentation>Person Message</xs:documentation>
    </xs:annotation>
    <xs:element name="CardSentToLocation">
        <xs:annotation>
            <xs:documentation>Location last card was mailed to</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="35"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="CardSequence">
        <xs:annotation>
            <xs:documentation>Sequence Number of currently active card.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:pattern value="[0-9]{1,2}"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="DateMostRecentCard">
        <xs:annotation>
            <xs:documentation>Date most recent card printed.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:union memberTypes="xs:date">
                <xs:simpleType>
                    <xs:restriction base="xs:token">
                        <xs:enumeration value=""/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:union>
        </xs:simpleType>
    </xs:element>
    <xs:element name="Deceased">
        <xs:annotation>
            <xs:documentation>Deceased status.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="Y"/>
                <xs:enumeration value="N"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="DOB">
        <xs:annotation>
            <xs:documentation>Date of Birth.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:union memberTypes="xs:date">
                <xs:simpleType>
                    <xs:restriction base="xs:token">
                        <xs:enumeration value=""/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:union>
        </xs:simpleType>
    </xs:element>
    <xs:element name="FirstName">
        <xs:annotation>
            <xs:documentation>Individual's first name.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="20"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="GovernmentID">
        <xs:annotation>
            <xs:documentation>Unique identification issued by government.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="25"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="GovernmentIDCountry">
        <xs:annotation>
            <xs:documentation>Issuing country of government ID.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="50"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="GovernmentIDType">
        <xs:annotation>
            <xs:documentation>Indicates type of government id.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="None"/>
                <xs:enumeration value="Social Security Number"/>
                <xs:enumeration value="Taxpayer Identification Number"/>
                <xs:enumeration value="CURP"/>
                <xs:enumeration value="Passport"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="IDVerificationScore" type="xs:int"/>
    <xs:element name="LanguagePreference">
        <xs:annotation>
            <xs:documentation>Preferred language for communication.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="English"/>
                <xs:enumeration value="Spanish"/>
                <xs:enumeration value="French"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="LastName">
        <xs:annotation>
            <xs:documentation>Individual's last name.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="30"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="MembershipExpirationDate">
        <xs:annotation>
            <xs:documentation>AutoTec renewal date for individual.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:union memberTypes="xs:date">
                <xs:simpleType>
                    <xs:restriction base="xs:token">
                        <xs:enumeration value=""/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:union>
        </xs:simpleType>
    </xs:element>
    <xs:element name="Message">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Header"/>
                <xs:element ref="PersonInformation"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="MiddleName">
        <xs:annotation>
            <xs:documentation>Individual's middle name.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="30"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="NickName">
        <xs:annotation>
            <xs:documentation>Individual's nickname.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="15"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="PersonID">
        <xs:annotation>
            <xs:documentation>AutoTec Individual ID.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:int">
                <xs:minInclusive value="100000001"/>
                <xs:maxInclusive value="199999999"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="PersonInformation">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="PersonID"/>
                <xs:element ref="FirstName"/>
                <xs:element minOccurs="0" ref="MiddleName"/>
                <xs:element ref="LastName"/>
                <xs:element minOccurs="0" ref="Prefix"/>
                <xs:element minOccurs="0" ref="Suffix"/>
                <xs:element ref="GovernmentID"/>
                <xs:element ref="GovernmentIDCountry"/>
                <xs:element minOccurs="0" ref="GovernmentIDType"/>
                <xs:element minOccurs="0" ref="DOB"/>
                <xs:element minOccurs="0" ref="DateMostRecentCard"/>
                <xs:element minOccurs="0" ref="CardSentToLocation"/>
                <xs:element minOccurs="0" ref="NickName"/>
                <xs:element ref="MembershipExpirationDate"/>
                <xs:element ref="Deceased"/>
                <xs:element ref="LanguagePreference"/>
                <xs:element minOccurs="0" ref="PublicSaleOnly"/>
                <xs:element minOccurs="0" ref="IDVerificationScore"/>
                <xs:element ref="CardSequence"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Prefix">
        <xs:annotation>
            <xs:documentation>Individual's name prefix.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="10"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="PublicSaleOnly">
        <xs:annotation>
            <xs:documentation>Indicates individual may only purchase at a public sale.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="Y"/>
                <xs:enumeration value="N"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
    <xs:element name="Suffix">
        <xs:annotation>
            <xs:documentation>Individual's name suffix.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:maxLength value="10"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>
</xs:schema>

pom.xml
<build>
        <plugins>
            <!-- Plugin required to build java classes from XSD using XJC -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.5</version>
                <dependencies>
                    <dependency>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-commons-lang</artifactId>
                        <version>2.3</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packageName>com.sqs.dto</packageName>
                    <schemaDirectory>src/main/resources/xsd</schemaDirectory>
                    <arguments>-Xcommons-lang</arguments>
                </configuration>
            </plugin>

        </plugins>
    </build>

I need some solution for this.
UPDATE: I tried adding Binding file as follow but still same error:
PER.xjb
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               version="2.1">
    <jaxb:bindings schemaLocation="../xsd/PER.xsd">
        <jaxb:bindings node="//xs:element[@name='GovernmentIDType']/xs:simpleType">
            <jaxb:property name="GovernmentIDTypePER" />
            <!--<jaxb:factoryMethod name="GovernmentIDTypePER"/>-->
        </jaxb:bindings>
        <jaxb:bindings node="//xs:element[@name='GovernmentID']/xs:simpleType">
            <jaxb:factoryMethod name="GovernmentIDPER"/>
            <!--<jaxb:property name="GovernmentIDPER" />-->
        </jaxb:bindings>
    </jaxb:bindings>
</jaxb:bindings>


text:
Q: Cannot set Max Screen Resolution of 2560x1440 with DELL U2711 Monitor I have a DELL U2711 Monitor (27" Inches) with a Nvidia GTX 460 video card. The monitor can reach 2560 x 1440 max and the Video card 2560 x 1600 max. But The monitor only reaches 1680x1050. If I use a higher resolution all the screen looks scramble (like the image below).
I have search the Internet and they say the solution was to use a DVI-D (Dual Link DVI) cable. I have been using that cable, but I got a new one just in case and the problem stills the same.
As an extra data for the problem: The DELL Monitor has its own "on screen" Menu, used to choose its settings. In it you can see the info about the resolution. When the resolution is at 1680x1050 or less the Resolution on the Display Menu will show the same. But if I choose the 2560 x 1440 resolution on Windows 7 the Display Menu will show 1280x1440 (as also the image will look as I describe above, please use the link).
Any suggestions?

A: Check the cable and make sure it's Dual Link as the behavior your seeing suggests it is not. The graphics card is listed as having two Dual Link DVI ports so either port should work.

Image from Wikipedia article on DVI.

A: I had this problem myself, and it was indeed due to not using a DVI dual link cable. And on top of that, the first videocard I tried on didn't support the resolution 2560x1440, but that was at work just to test. At home, I thought to make it quick and just replaced my monitor, and kept the cable I was using for years.
Luckily the monitor comes with a dual-link cable so just hooking that one up should do the trick.
Alternatively (and if possible, my suggestion as well) use a DisplayPort cable.

A: I have a u2713hm and had the same problem.  I am using a DVI-D cable but it was a cheap one so have ordered something more premium, i'll try that when it arrives.  In the meantime I managed to get a decent picture by going into the Nvidia control panel > change resolution > customise and dropped the refresh rate 1Hz at a time and testing the new setting.  Eventually got a good picture at 40Hz, not perfect for gaming but fine for everything else.
GTX 550ti on Win 10, screen worked perfectly on Win 7 at 60Hz.

A: The bandwith can be a problem. Because the crt monitors died out, the refresh rate isn't a real important thing. I suggest try to reduce it so low as it is possible (if you use windows, it is in the advanced properties of your display settings). If it works, you can set higher refresh rate, if the very realtime graphics is to you important.
If it worked, please don't forget to accept my answer. :-)

A: I had the exact same issue. Using a high-end 27-inch monitor I was getting that same blurry effect. By creating a custom resolution and reducing the refresh rate to 40 Hz was able to get a crisp clear picture.
However applications like Photoshop suffer when rendering, there is a noticeable delay. Can't have it all I guess.

A: I had  the same problem with my u2711, i just bought used u2711 and find the very same problem, since i dont have any display port, i use hdmi and it can reach the highest resolution (with create new custom resolution) but it appears with blurry and un-crisp display, and i tried with cheap dvi-d dual link cable and again it can reach the highest resolution (native) but not even better, blurry just like pics above. But since i got a new hi-quality-premium dvi-d dual link cable and it makes the display can reach highest 2560 x 1440 native resolution with very amazing sharp, crisp and lovely display.
So in my case, the problem is the poor quality of the DVI-d Dual Link cable.


text:
Q: Agrupar registros según fecha días, noches espero que me puedan ayudar con poco con lo siguiente, la idea es lograr agrupar los registros usando mysql promediando y tenerlo por rangos de 1 minuto, 5 minutos, 15 minutos, 30 minutos, 60 minuts etc.
Actualmente estoy trabajando con un proyecto de arduino e iot donde es un jardín inteligente este envía un registro sobre sus sensores cada 10 segundos a la base de datos todo el tiempo, tengo una plataforma escrita en laravel para poder leer esos datos y representarlos en gráficas basados en el promedio estoy intentando lo siguiente
un ejemplo de mi tabla sensor_data
id, sensor_id, value, created_at
1, 1, 20, 2020-05-05 16:00:23
2, 1, 23, 2020-05-05 16:00:33
3, 1, 25, 2020-05-05 16:00:43
4, 1, 23, 2020-05-05 16:00:53
5, 1, 20, 2020-05-05 16:01:03
y mi consulta para obtenter el promedio en intervalos de 1 minuto es la siguiente
SELECT sensor_id, ROUND(AVG(value)) as average, DATE_FORMAT(created_at, '%Y/%m/%d %H:%i')) as created FROM sensor_data WHERE value > 0 AND value < 1024 AND sensor_id=1 GROUP BY created ORDER BY created DESC

Y con esto obtengo el promedio de cada minuto, pero la duda aqui es que otra forma exise o me recomiendan para poder tener intervalos de 5, 15 o 30 minutos? ya que no puedo agruparlos con el created debido a que uso la fecha para separarlos.
Espero haberme explicado.

A: Te propongo algo así:
SELECT sensor_id, ROUND(AVG(value)) as average,
  CONCAT(
    DATE_FORMAT(created_at, '%Y/%m/%d %H:'),
    ROUND(MINUTE(created_at)/15)*15
  ) as created
  FROM sensor_data
  WHERE value > 0 AND value < 1024 AND sensor_id=1
  GROUP BY created ORDER BY created DESC;

De 00 a 15 te lo agrupa en 00, de 15 a 30 en 15 y así sucesivamente
Para 1, 5, 30 y 60, sustituye el 15 por estas cantidades


text:
Q: How to use .* in MATLAB multiplication? I am trying to visualize the probability distribution function of Rayleigh distribution by implementing it myself in MATLAB, instead of using the inbuilt raylpdf function.
PDF of Rayleigh distribution :

This is my attempt:
function pdf = rayleigh_pdf(x)
    exp_term = -1*power(x,2)/(2*std(x))
    pdf = (x*exp(exp_term))/std(x)
end

But when I try to run it I get an error:
x = linspace(-10,10,100);
plot(x,rayleigh_pdf(x))

Error:
Error using  *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise
multiplication, use '.*'.

I am not sure why I am getting this error. Where should I use .*? And why is it required?

A: The dot-before-operator allows one to do element-wise operations instead of the default matrix operations. If you write your code without dots, chances are high that you'll either run into dimension errors (because you're trying to do matrix multiplication with non-matching dimensions for instance), or get very weird results due to automated broadcasting, making you end up with matrices in sizes you hadn't anticipated.
function pdf = rayleigh_pdf(x)
    exp_term = -x.^2./(2.*std(x).^2);
    pdf = (x.*exp(exp_term))./(std(x).^2)
end

Two small things: sigma-squared usually denotes variance, i.e. standard deviation squared. So either use std(x).^2 or var(x).
Instead of writing the very verbose power(x,2) operation, you can simply use .^ to obtain the element wise power.
Note that some of the dots are superfluous, such as when you're sure that you are dealing with integers (also known as 1 -by- 1 matrices in MATLAB). You can thus write the following, which is equivalent:
function pdf = rayleigh_pdf(x)
    exp_term = -x.^2/(2*std(x)^2);
    pdf = (x.*exp(exp_term))/(std(x)^2)
end

i.e. dots are only required when working on arrays, x and exp_term here, and not on scalars like 2 or std(x).


text:
Q: If you separate the typescript classes by files, then an error occurs. How can this be? In what there can be an error?
When all classes are in the same file, the error does not appear.
But as soon as I place the classes in different files, the following errors appear:

/index2.ts(8,13): error TS2345: Argument of type '{ name: string;
  value: number; }' is not assignable to parameter of type 'ConfigOption
  | ConfigOption[]'.   Type '{ name: string; value: number; }' is not
  assignable to type 'ConfigOption[]'.
      Property 'length' is missing in type '{ name: string; value: number; }'.
/index2.ts(14,12): error TS2345: Argument of type '{ name: string;
  value: string; }[]' is not assignable to parameter of type
  'ConfigOption[]'.   Type '{ name: string; value: string; }' is not
  assignable to type 'ConfigOption'.
      Property 'comment' is missing in type '{ name: string; value: string; }'. 17:36:36 - Compilation complete. Watching for file
  changes.

interface IOption {
    name: string;
    value?: any;
    comment?: string;
}

class ConfigOption {
    name: string;
    value: any;
    comment: string;
    constructor(data: IOption) {}
}

type TOptionArray = (IOption | ConfigOption)[];

class Config {
    constructor(options?: TOptionArray) {}
    push(data: ConfigOption | IOption | TOptionArray) {}
}

// Test example:

const config = new Config;

config.push({
    name: 'name',
    value: 0
});

new Config([{
    name: 'role',
    value: 'camelcase(this.element.name)'
}]);

https://www.dropbox.com/s/u0ergcw4pt88oeu/typescriptproblem.zip?dl=0
Layout of the code by files:
// config/Config.ts

import IOption from './option/ConfigOption';
import ConfigOption from './option/ConfigOption';

export type TOptionArray = (IOption | ConfigOption)[];

export default class Config {
    constructor(options?: TOptionArray) {}
    push(data: ConfigOption | IOption | TOptionArray) {}
}

// config/option/ConfigOption.ts

import Config from '../Config';

export interface IOption {
    name: string;
    value?: any;
    comment?: string;
}

export default class ConfigOption {
    name: string;
    value: any;
    comment: string;
    constructor(data: IOption) {}
}

// index2.ts

import Config from './config/Config';

const config = new Config;

config.push({
    name: 'name',
    value: 0
});

new Config([{
    name: 'role',
    value: 'camelcase(this.element.name)'
}]);

A: You are not importing correctly.
You should change config/option/ConfigOption.ts to remove the default export:
export class ConfigOption { // Removed the `default` keyword.

And in config/Config.ts, import like this:
import { IOption, ConfigOption } from './option/ConfigOption';

In my own code I've completely banished default exports to avoid mistakes like this. You could keep the default export but I don't recommend it.

The way you had it, was like this:
import IOption from './option/ConfigOption';
import ConfigOption from './option/ConfigOption';

This imports the default export from ./option/ConfigOption.ts and assigns it locally to both to IOption and ConfigOption. So your IOption did not correspond to the IOption in ./option/ConfigOption.ts but instead it was corresponding to the default export of that module which is ConfigOption.

A: You can just leave out the export and import keywords, those are not necessary, even if you work with separate .ts files.
Unless you want to work with modules or namespaces, but it seems that you don't want that?


text:
Q: Break through TCP/IP port exhaution (on Windows) I'm searching for a setup where one Windows with one ethernet card is able to handle more then 65k open IPv4 TCP connections -- yes, it's not possible per default by the specification.
I've found a nice tutorial how to setup How to tune the TCP/IP stack for high volume of web requests Windows and Linux regarding maximum usable ports.
My idea would be to setup multiple IP address per ethernet controller (MAC address) and let the DNS server round robin over CNAME Resource Records.
The server application running on the Windows machine would bind to multiple IP addresses attached to the same MAC address (ethernet controller).
The clients would be redirected to different IP address by DNS server served by the same server.
Where is defined -- official Microsoft documentation in printed or online appreciated -- how many IP addresses can be set per ethernet controler? (Try it out is not reliable)
Are there any other ideas how to solve the limitations without using additional infrastructural changes e.g. visualization or additional nic?

A: You probably have misunderstood the limitation. If you are running a server with listening sockets, you are not affected by the port limit. The service just listens on one or several ports (e.g. port 80 for a web server) and does not "use up" more than that.
Only with the service's clients the picture is different. They need to "reserve" a port for each connection request to serve as the connection's endpoint. Usually you will not run out of ports unless the client is creating a huge number of connections for some reason or is rotating them very fast so the system runs out of ports before TIME_WAIT timers expire.

One client opens and hold multiple TCP connections but there are multiple 1000 workstations running this client in my scenario

You are not seeing port exhaustion then. If you are experiencing problems, it will be due to something else. There is a thing like the memory limit for the non-paged-pool which would mainly apply for 32-bit systems and effectively limit the number of connections at around 44.000 - see section 4.8 of the Winsock FAQ for details. You might be hitting a number of other limits too. This smallvoid.com article explains some of them.


text:
Q: Not another one: EOF error message in LeetCode, works fine in Visual Studio I am brand new to Python3 coding, so I hope you bear with me and my question. I have found similar questions on stackoverflow and other sites but I still wasn't able to solve the issue:
When I run the following code in Visual Studio, everything is fine, no error message, nothing.
In LeetCode on the other hand, I get an EOF error pointing at the very first input line.

Error message:EOFError: EOF when reading a line
num = input("Enter a number: ")
Line 4 in intToRoman (Solution.py)
ret = Solution().intToRoman(param_1)
Line 56 in _driver (Solution.py)
_driver()
Line 67 in  (Solution.py)

The code is as follows:
class Solution:
num = ""
def intToRoman(self, num: int) -> str:
    num = input("Enter a number: ")
    while True:
        try:
            num = int(num)
            if num < 0 or num > 3999:  # if not a positive int or inout larger than 3999 print message and ask for input again
                print("Sorry, input must be a positive integer and smaller than 3999, try again")
                continue
            break
        except ValueError:
            return("That's not an int!") # else all is good, number is >=  0 and an integer

Ones = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", ""] # list of single digit roman numbers
Tens = ["X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", ""] # list of double digit roman numbers
Hundreds = ["C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", ""] # list of three digit roman numbers
Thousands = ["M", "MM", "MMM", "", "", "", "", "", "", ""] # list of four digit roman numbers
if (len(str((num)))) == 1:
    print (Ones[int(repr(num)[-1]) - 1])
if (len(str((num)))) == 2:
    print (Tens[int(repr(num)[-2]) - 1] + Ones[int(repr(num)[-1]) - 1])
if (len(str((num)))) == 3:
    print (Hundreds[int(repr(num)[-3]) - 1] + Tens[int(repr(num)[-2]) - 1] + Ones[int(repr(num)[-1]) - 1])
if  (len(str((num)))) == 4:
    print (Thousands[int(repr(num)[-4]) - 1] + Hundreds[int(repr(num)[-3]) - 1] + Tens[int(repr(num)[-2]) - 1] + Ones[int(repr(num)[-1]) - 1])

Thanks for any kind of feedback, including what to optimise in this code.


text:
Q: Typesetting \prime vs ' I'm trying to figure out how to best typeset primed values. It seems that, e.g.
$f'$ and $f\prime$ give off a slightly different result:

I like the right ($a\prime$) version better, but I'm not sure if that's correct.
EDIT after going over my preamble, I found the "culprit" - it was the package unicode-math, which I added to be able to use \Colon. After removing it, my primes rendered exactly like in Mico's answer.

A:
It seems that, e.g. $f'$ and $f\prime$ give off a slightly different result

First off, the item on the left-hand side of the screenshot you posted does not appear to have been created by either $f'$ and $f\prime$ -- at least not by either TeX or LaTeX. See also the screenshot below and the associated LaTeX code.
The item on the right-hand side could have been created by either $f'$ or $f^{\prime}$, since the two methods are entirely equivalent.
In math mode, x' and x^{\prime} are equivalent. The former is a lot easier to type, though. This becomes especially evident for higher-order derivatives: Speaking for myself, I'd much rather type $f'''$ than $f^{\prime\prime\prime}$.

\documentclass{article}
\begin{document}
$f' \quad f^{\prime} \quad f\prime$
\end{document}


text:
Q: C# WInForms TextBox DataBinding refresh TetxtBox.Text if bindings property change class Class1
{
   public string val {get;set;}
}
Class1 cl;
private void Form1_Load(object sender, EventArgs e)
{
cl = new Class1();
            textBox1.DataBindings.Add("Text",cl,"val",false,DataSourceUpdateMode.OnPropertyChanged,);
            textBox2.DataBindings.Add("Text", cl, "val", false, DataSourceUpdateMode.OnPropertyChanged);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            cl.val += "11";
        }

I change value in textBox1, at textBox2 value changes immediatly too.   If I click button, bindings value cl.val changed from code, but both textBox value stay unchanged.
How to refresh data on textbox form if cl.val change from code?
PS: if after row
cl.val += "11";  - add
textBox1.Text = cl.val;
then value refresh at both textBoxs
why is that?

A: In order to make data binding work when data source property is changed by a code, the data source (Class1 in your case) must provide some sort of a property change notification. The possible choices are events called PropertyNameChanged where PropertyName is the name of the property for which the change notification applies, or more general approach is to implement INotifyPropertyChanged Interface.
Here is an example using the second approach. Since the C# auto properties cannot be used anymore, people usually create a base class to reduce repetitive boilerplate code needed like this
public abstract class BindableObject : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
    protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        var handler = PropertyChanged;
        if (handler != null)
            handler(this, new PropertyChangedEventArgs(propertyName));
    }
    protected static bool SetProperty<T>(ref T field, T value, [CallerMemberName] string propertyName = null)
    {
        if (EqualityComparer<T>.Default.Equals(field, value)) return false;
        field = value;
        OnPropertyChanged(propertyName);
        return true;
    }
}

and then use it as follows
class Class1 : BindableObject
{
    private string _val;
    public string val
    {
        get { return _val; }
        set { SetProperty(ref _val, value); }
    }
}

Once you do this, everything will work as expected.
If as you said your class is auto generated by EF, then you need to create a wrapper class (usually referred as ViewModel) to be used for UI data binding. In general, DTOs, Entities etc. classes are not for direct use in the UI.
Update While all the above is the right way to go, for the sake of completeness, here is a quick and dirty approach.
Helper function:
public static class DataBindingUtils
{
    public static void RefreshBindings(this BindingContext context, object dataSource)
    {
        foreach (var binding in context[dataSource].Bindings.Cast<Binding>())
            binding.ReadValue();
    }
}

Sample usage:
private void button1_Click(object sender, EventArgs e)
{
    cl.val += "11";
    BindingContext.RefreshBindings(cl);
}

A: Try this:
cl.val+="11";
textBox1.ResetBindings();
textBox2.ResetBindings();

Update
The fact is that when you change the class value, you must notify the UI that the underlying data has changed, so you must implement INotifyPropertyChanged in your class. Define your class Class1 like this and try it:
class Class1:INotifyPropertyChanged
    {
        private string _val;
        public string val
        {
            get
            {
                return this._val;
            }
            set
            {
                if (this._val != value)
                {
                    this._val = value;
                    NotifyPropertyChanged("");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(String propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

Update 2
As Ivan and me has explained, the way to do it is implementing INotifyPropertyChanged. But if you want a dirty way of doing it,you could clear databindings and add them again, something like:
cl.val += "11";

foreach (Control c in this.Controls)
{
       if (c is TextBox)
       {
            c.DataBindings.Clear();
            c.DataBindings.Add("Text", cl, "val", false, DataSourceUpdateMode.OnPropertyChanged);

        }
 }


text:
Q: POST command (PHP) refuses to concatenate So I'm trying to design a website that will allow the user to input data to design a tower. When it comes to the dimensions of basic parts of the tower (the height, width, and depth), I want to present them in a H x W x D format (i.e. 3 x 2 x 2). Trouble is, I'm having problems with concatenation in the PHP file for the second page of the website where everything's displayed.
Here's what my code looks like so far:
<!DOCTYPE html>

    <title>Results for tower design</title>

    Pillar base shape: <?php echo $_POST["tBase"]; ?>

    Pillar dimensions: <?php echo ($_POST["tHeight"];)." x ".($_POST["tWidth"];)." x ".($_POST["tDepth"];) ?>

It's highly possible that I might be making a common beginner error. If so, I want to know where I went wrong and how to avoid it.

A: You have some extra semicolons in improper places. A semicolon indicates the end of a PHP statement. You should not use them in the middle of building a string.
($_POST["tHeight"];)

Remove them and make sure you sanitize your output (or you'll be open to XSS attacks)
htmlspecialchars($_POST["tHeight"])." x ".htmlspecialchars($_POST["tWidth"])." x ".htmlspecialchars($_POST["tDepth"])

Running this, would have thrown you: Parse error: syntax error, unexpected ';' in...
Use error reporting during testing.

*

*http://php.net/manual/en/function.error-reporting.php
Plus, make sure your POST arrays contain values and that your form uses a post method with matching named attributes.

A: Fun fact, you can have it all showed as a single line:
Pillar dimensions: <?php echo "{$_POST["tHeight"]} x {$_POST["tWidth"]} x {$_POST["tDepth"]}"; ?>

Every echo that is wrapped with double quotes can have variable been echoed just wrapping with {}.

A: Remove semicolumns
<?php echo ($_POST["tHeight"] ." x ".$_POST["tWidth"] ." x ".$_POST["tDepth"]); ?>


text:
Q: Xcode4 Core Data Model Editor Display Problem I've had this problem ever since upgrading to xcode 4.  In the core data model editor, I can't see my diagram view.   Everything else seems to work, but mostly the graphic view is just blank.  If I click around on entities in the list, I get a screen that looks like this:
http://imgur.com/zE1Ci

A: I hit this problem, here is how I fixed it:

*

*Quit Xcode

*In a terminal or finder, remove the file myapp/myapp.xcdatamodeld/myapp.xcdatamodel/layout

*Restart Xcode and open your project

Note: No guarantees you won't lose any work product.  This solution allowed me to return to a working graphical state at the point just before the graphical problem began and I didn't lose any work.

A: I did something similar to Chris:

*

*quit xcode

*in finder, locate your datamodel file

*copy the file to a safe place (I used my desktop)

*delete the file from your project folder

*open your project in xcode

*right click in the navigator and "Add files"

*select the datamodel in the safe place from step 3

*tell it to copy the files if necessary

*click "Add"

A: Check your 'inverse' relationships. A mismatch in these can make the 'Graph' view go blank.
For example, if entities A and B have a relationship, ensure relationship 'ab' has the proper inverse 'ba' and vice-versa. The Xcode UI will enable you to manually enter non-matching inverses and then it's only a matter of time before you see the blank graph.

A: I`m using Xcode 4.2.1 and I have found the same problem. I had to open the file "contents" on vi and edit the positions at the end of the file. Maybe because some bug, there was big negative values. Once the file was edited, everything was put into place again.

A: In XCode 4.2.1, the file you need to edit is the "contents" one people have mentioned in other answers. I also noticed really strange negative values in my contents file, but changing to positive values didn't fix anything, and then clamping them to smaller values didn't help either.
Eventually I quit Xcode, backed up my model file, and then just deleted all the entries in the  section at the end of the contents file. I then launched XCode and added and deleted an Entity. It worked for a minute, but reverted to the strange state after I moved a few entities around.
What finally fixed it for me was deleting an Entity I had just created before the problems started. It was a child of another entity, and I think I had created a loop of some sort that was confusing the parser. I had a different entity altogether with relationships to both the parent and child entities. Deleting the child entity finally fixed things right up and I just had to lay out the existing entities again in the editor.

A: For me, with Xcode 4,3,2, the issue is even if I fix the location of entities on the graphical view of the model, if I switch to edit a text file and then go back to the model, it has already lost the location of many, but not all entities.
What helped, is to make sure to manually save the file before I edit anything else. Otherwise the changes were not persisted. Unnerving that apple's tooling can be so unreliable.

A: In Xcode 4.5, deleting the myapp/myapp.xcdatamodeld/myapp.xcdatamodel/contents file did not fix anything--rather, it made my data model completely unusable.
Instead, I changed all the wild negative values in the contents to 0. Then they showed up again in the model editor, and I manually repositioned them. However, positioning them in certain arrangements would cause the model editor to freeze, so I would just undo the last change and arrange them differently.
Here's to hoping Apple debugs the editor in 4.6. Best to file a bug report

A: For xcode 4.5.2 (4G2008a), I simply went over all my relationships, as noted by Jaysen Marais, and ensured they were all correct with matching/appropriate reverse entities.
That made the graph display again.
Also typically this will happen when you are adding new entities or changing them, so ensure to look at those.


text:
Q: Basecamp 3 API : How to get comments created by the authorized user? I am in the process of integrating my webapp with Basecamp 2 (solved, see edit) and 3, and I want to get all of the comments for a todo item for the authorized user.
First I make a call to https://launchpad.37signals.com/authorization.json which returns json that includes the user's identity, something like {"identity":{"id":99999999,  ..... }}.
Then I make a call to the URL to get the comments for the item in question and go through them one by one matching the identity.id from above (99999999) with the creator.id for the comment.
The problem is, they don't match! I am working with one Basecamp2 project and one Basecamp3 project. When testing, using comments I wrote, Basecamp2 and Basecamp3 each have different values for creator.id (even though I wrote both comments!), and neither of them match the identity.id from authorization.json.
How do I link them to find which comments were made by the authorized user
Thanks
EDIT: I figured it out for Basecamp2 - I need to get /people.json which has a mapping from the identity_id of each user to the id for that user in that project. Still not sure how to do it for Basecamp3, which does not include identity_id in people.json!

A: The correct way to do this for Basecamp2 is to get:
https://basecamp.com/{project_id}/api/v1/people/me.json - the id node contains the id of the authorized user for project {project_id}.
for Basecamp3:
https://3.basecampapi.com/{project_id}/my/profile.json - the id node contains the id of the authorized user for project {project_id}.


text:
Q: Include graphic in title page I have been trying to figure out how to include a picture in my title page. I have used multiple suggestions found in forums but somehow none of them seems to work.
The picture is either included on a separate page or is not included at all.
I would like the picture to be included underneath the date (please see the code below).
Hopefully, someone of you will be able to help me.
Thanks a lot already in advance.
So this is my Latex code:
\title{Bildungshub}

\author{Langhoff Charly (1172857)

\and Pokrivka Helena (01460370)}

\date{Klagenfurt, am \today{}}

%%%%Here is where I would like my picture to be inserted

\begin{document}

\thispagestyle{empty}

\pagenumbering{roman} %% small roman page numbers

 \maketitle

A: Here is a code, with the titling package, which makes customising the maketitle command easy:
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
 \usepackage{tabularx}
\usepackage{titling}
\usepackage{amsmath}

\setlength\droptitle{-3cm}
\pretitle{\begin{center}\LARGE\bfseries}
\title{Bildungshub}
\posttitle{\end{center}\vskip 8ex}
 \preauthor{\begin{center}
\large%
\begin{tabular}[t]{l}}
\author{Langhoff Charly (1172857)\\[1ex]
 Pokrivka Helena (01460370)}
\postauthor{\end{tabular}\end{center}\vskip3ex}
\date{Klagenfurt, am \today{}}
\renewcommand{\maketitlehookd}{\centering\vfill\includegraphics{pepe-le-pew2}\vfill}

\begin{document}

\maketitle

 \end{document}


text:
Q: how to set background color of qlineedit when it's a widget in qgraphics scene Using PyQt, I'm trying to use a stylesheet to set the background color of a QLineEdit that I've added to a QGraphicsScene.  Problem is the background color is the only property I can't seem to change.  For example:
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QGraphicsView, QGraphicsScene, QLineEdit

if __name__ == '__main__':
  app = QApplication(sys.argv)
  myWidget = QWidget()
  myWidget.graphicsView = QGraphicsView(myWidget)
  scene = QGraphicsScene()

  lineEdit = QLineEdit()
  lineEdit.setStyleSheet("QLineEdit { background-color : black; color : gray; }")
  widgetItem = scene.addWidget(lineEdit)

  myWidget.graphicsView.setScene(scene)
  myWidget.show()
  sys.exit(app.exec_())

will set the text color of the line edit to gray, but the background color remains white.
What am I doing wrong?


text:
Q: How to get Pandas to create new sheet instead of overwriting? I am building a little automatic reporting tool for my job. I am trying to make my code work to create another sheet every time (each day) that I run the program and generate the report.
date_time = time.strftime('%b %d %Y')

writer = pd.ExcelWriter('BrokerRisk.xlsx', engine='xlsxwriter')
df.to_excel(writer,'DataFrame-' + date_time)
sums.to_excel(writer,'TotalByCounterparty-' + date_time)
sums_sort.to_excel(writer,'SortedRank-' + date_time)

workbook  = writer.book
worksheet1 = writer.sheets['DataFrame-' + date_time]
worksheet2 = writer.sheets['TotalByCounterparty-' + date_time]
worksheet3 = writer.sheets['SortedRank-' + date_time]
writer.save()

I tried implementing the date feature so that it would change the name technically every day, but this doesn't seem to work either. Can anyone suggest a simple fix?

A: Using engine=openpyxl as writer will do what you want, for instance:
from openpyxl import load_workbook
from copy import copy
import time

class CopyWorkbook(object):
    def __init__(self, fname):
        self.fname = fname
        self.wb = load_workbook(fname)

    def save(self):
        self.wb.save(self.fname)

    def copy_worksheet(self, from_worksheet):
        # Create new empty sheet and append it to self(Workbook)
        ws = self.wb.create_sheet( title=from_worksheet.title )

        for row, row_data in enumerate(from_worksheet.rows,1):
            for column, from_cell in enumerate(row_data,1):
                cell = ws.cell(row=row, column=column)
                cell.value = from_cell.value
                cell.font = copy(from_cell.font)

date_time = time.strftime('%b %d %Y')
writer = pd.ExcelWriter('dummy.xlsx', engine='openpyxl')
df.to_excel(writer,'DataFrame-' + date_time)
# ... Other DataFrame's .to_excel(writer, ...

wb = CopyWorkbook('BrokerRisk.xlsx')
for ws_new in writer.book.worksheets:
    wb.copy_worksheet(ws_new)

wb.save()

Tested with Python: 3.4.2 - openpyxl: 2.4.1 - LibreOffice: 4.3.3.2


text:
Q: Vue styling components I have a basic vue  component. It looks like this:

<template>

 this is some text

</template>

What I struggle to achieve is, when I load the component in the parent that looks something like this:
<imageItem :source="source" />

I want to be able to customize the component styles. For example something like this:
<imageItem :source="source" :textColor="red" />

I'm guessing I should do it with props also but its not working as expected.
Can someone share a proper way to do this ?

A: Try this:

<template>

 this is some text

</template>

And then in the prop: "color:red"
<imageItem :source="source" :style="color : red" />


text:
Q: How to achieve Expandablelistview child custom layout? I can't figure out how to achieve this in android. I have a layout like this:

I want it such that on click of the plus button it will display the full layout like this:

This layout is the child of an expandablelistview item. So when the expandablelistview item is clicked it shows a short lost of items in that category. Then, if the user wants to see all, he will click the plus button.
Any help will be appreciated.

A: Create an XML layout with the name expandable_list_layout
<ExpandableListView
    android:id="@+id/data_list"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_below="@id/dynamicHeadingTxt"
    android:layout_marginTop="3dp"
    android:layout_weight="8"
    android:cacheColorHint="#00ffffff"
    android:childDivider="@drawable/child_separator"
    android:divider="@drawable/child_separator"
    android:groupIndicator="@null" >
</ExpandableListView>

Create a custom adapter. Let`s call it InboxExpandableListAdapter. This class should extend BaseExpandableListAdapter and override
public class ada extends BaseExpandableListAdapter{

@Override
public Object getChild(int groupPosition, int childPosition) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public long getChildId(int groupPosition, int childPosition) {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public View getChildView(int groupPosition, int childPosition,
        boolean isLastChild, View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public int getChildrenCount(int groupPosition) {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public Object getGroup(int groupPosition) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public int getGroupCount() {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public long getGroupId(int groupPosition) {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public View getGroupView(int groupPosition, boolean isExpanded,
        View convertView, ViewGroup parent) {
    // TODO Auto-generated method stub
    return null;
}

@Override
public boolean hasStableIds() {
    // TODO Auto-generated method stub
    return false;
}

@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
    // TODO Auto-generated method stub
    return false;
}
}

If you look here, the overriden method takes two arguments i.e., a groupposition and a childposition. These suggest that we should supply the adapter with some kind of list which must contain groups and their child. I am creating a constructor for the class
public InboxExpandableListAdapter(Activity context, List<String> data, List<String> data_secondry,
        List< List<String>> dataCollections) {
    this.context = context;
    this.dataCollections = dataCollections;
    this.data = data;
    this.data_secondry = data_secondry;
}

Now getChildView method and getGroupView populates the view for each item. So inside these methods, inflate the layout which you want to show for group and their respective child
public View getChildView(final int groupPosition, final int childPosition,
        boolean isLastChild, View convertView, ViewGroup parent) {
    final String data = (String) getChild(groupPosition, childPosition);
    LayoutInflater inflater = context.getLayoutInflater();

    if (convertView == null) {
        convertView = inflater.inflate(R.layout.child_item, null);
    }

    TextView item = (TextView) convertView.findViewById(R.id.data);

    item.setText(data);
    return convertView;
}

public View getGroupView(int groupPosition, boolean isExpanded,
        View convertView, ViewGroup parent) {

    String laptopName = (String) getGroup(groupPosition);
    if (convertView == null) {
        LayoutInflater infalInflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = infalInflater.inflate(R.layout.group_item,
                null);
    }

    TextView item = (TextView) convertView.findViewById(R.id.data);
    item.setTypeface(null, Typeface.BOLD);
    item.setText(laptopName);
    return convertView;
}

A: CoordinatorLayout is the thing which designed for such cases. Have a look at the example in Android Developers blog
Alternatively, you might have two layouts grouped - one is the topmost upper row and another one - other rows beneath it. Then handle "+" button Click event on which you'd reveal the latter one (with possible animation).
I'd proceed with CoordinatorLayout as this is preferable approach, however feel free to try both and see what suits you better.


text:
Q: Space after the title of the table of content I want to ask if there is a way to add a space after the title of the table of content (Like the space indicated by the red arrow) without affecting the space of other section's headers?!
Class type:
\documentclass[12pt]{article}

The code used to print the table of content:
\tableofcontents{}

A: Use eg
\addtocontents{toc}{\vspace{5cm}}

right after \tableofcontents to add 5cm vertical space below the ToC header.

Code:
\documentclass{article}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\addtocontents{toc}{\vspace{5cm}}
\blinddocument
\end{document}


text:
Q: Email alerts on failure in Airflow without turning on "Allow less secure apps" To send email failure alerts, Airflow needed an SMTP username and password for authentication. I am using google mail for that but google treats all apps that use username and password as less secure. So to make it work, I need to enable "Allow less secure apps" in the google account settings.
Is there a way to use google SMTP mail without turning on "Allow less secure apps" settings?

A: You can create a google app password for a specific application and then disable "Allow less secure apps".This google documentation may help you google answer.
You can use the app password instead of your account password.


text:
Q: Azure App Service download blob "access to path denied" I have an MVC 5 web app hosted on Azure App Service. The application communicates with Azure blob storage and lists the blobs from each container. The application also allows users to download blobs to their local drive. All this works fine using IIS.
However, when I publish the app to Azure App Service, I receive access to this path is denied.
So my question is; how can I enable permissions on App Service to allow write access to a specific folder on a users PC?
I need to be able to download the blob contents to a users local drive.

A: If you granted the IIS App pool permissions to the download folder, you mean you download the files to the server machine right?
Your server has no access to the user's PC drive. You have to return the file as a result from your controller to initiate download via the user's browser.

A: I resolved this by creating a shared access signature for each of the blobs and appending this to the blob URI. This allows direct access to the blobs on Azure Blob Storage for authorised users.


text:
Q: How to give Optional validation in formArray of formgroup in angular? Component.ts:(Here I have two formArray in formGroup. I need to make optional validation for both formArray. For Example, If i select agent_id in AgentArray, manufacturer_id in manArray is optional, same like if i select manufacturer_id in manArray,agent_id in AgentArray is optional. Could you please help me to do this??)
   manArray: FormArray;
  agentArray: FormArray;
 ngOnInit() {

    this.MaterialForm = new FormGroup({
      'myCode': new FormControl(null),
      'title': new FormControl(null, Validators.required),
      'AgentArray': new FormArray([]),
       'ManufacturerArray': new FormArray([]),
      'remarks': new FormControl(null, Validators.required)
})
   this.manArray = this.MaterialForm.get('ManufacturerArray') as FormArray;
    this.agentArray = this.MaterialForm.get("AgentArray") as FormArray;
}
 createItem(): FormGroup {
    return this._formBuilder.group({
      iss: new FormControl(null),
      iss_expiry_date: new FormControl(null),
      manufacturer_id: new FormControl(null, Validators.required)//I need to make this validation optional.. based on agent_id selection in createAgentItem function.. same like manufacturer also means vice-versa..
    });
  }

  createAgentItem(): FormGroup {
    return this._formBuilder.group({
      iss: new FormControl(null),
      iss_expiry_date: new FormControl(null),
      agent_id: new FormControl(null, Validators.required)
    });
  }
addItem(){
 this.manArray.push(this.createItem());
    this.manufacturerUploader[this.manArray.length - 1] = new FileUploader({
      isHTML5: true,
    });
}
addAgentItem(){
 this.agentArray.push(this.createAgentItem());
    this.agentUploader[this.agentArray.length - 1] = new FileUploader({
      isHTML5: true,
    });
}

html:(Here I have Two formArray in formGroup.. I need to make optional validation for both formArray... For Example If i select agent_id in AgentArray, manufacturer_id in manArray is optional, same like if i select manufacturer_id in manArray,agent_id in AgentArray is optional.. Could you please help me to do this??)

                        <mat-form-field>

                            <mat-label>Select Agent</mat-label>
                            <mat-select formControlName="agent_id" required>
                                <mat-option *ngFor="let agent of listOfAgents" [value]="agent.id"
                    [disabled]="agent.disabled!=undefined || agent.disabled!=null">
                                    {{agent.company_name}}
                                </mat-option>
                            </mat-select>
                        </mat-form-field>

                        <mat-form-field>

                            <mat-label>Select Manufacturer</mat-label>
                            <mat-select formControlName="agent_id" required>
                                <mat-option *ngFor="let manufacturer of listOfManufacturer"
                    [disabled]="manufacturer.disabled!=undefined || manufacturer.disabled!=null"
                              [value]="manufacturer.id">
                                    {{manufacturer.company_name}}
                                </mat-option>
                            </mat-select>
                        </mat-form-field>

A: Here you can add  validation and remove validation dynamically in formGroup with the help of setValidators().

In the Below code, whenever you select the agent at that time validation.required is added to agentArray and validation.required removed from the manufacturerArray and vice versa .

html code

        <mat-form-field>

            <mat-label>Select Agent</mat-label>
            <mat-select (change)="agentSelect($event.target.value)" formControlName="agent_id" required>
                <mat-option *ngFor="let agent of listOfAgents" [value]="agent.id"
                [disabled]="agent.disabled!=undefined || agent.disabled!=null">
                {{agent.company_name}}
            </mat-option>
        </mat-select>
    </mat-form-field>

        <mat-form-field>

            <mat-label>Select Manufacturer</mat-label>
            <mat-select (change)="manufacturerSelect($event.target.value)" formControlName="agent_id" required>
                <mat-option *ngFor="let manufacturer of listOfManufacturer"
                [disabled]="manufacturer.disabled!=undefined || manufacturer.disabled!=null"
                [value]="manufacturer.id">
                {{manufacturer.company_name}}
            </mat-option>
        </mat-select>
    </mat-form-field>

In Html code, i added the Change event so that we get to know about the value alteration.

.ts File
agentSelect(value) {
   let agentArray =  this.form.get('AgentArray') as FormControl;
   let ManufacturerArray =  this.form.get('ManufacturerArray') as FormControl;
    this.agentArray.valueChanges.subscribe(checked => {
      if (checked) {
        this.agentArray.setValidators([Validators.required]);
        this.ManufacturerArray.setValidators(null);
      }
      this.ManufacturerArray.updateValueAndValidity();
      this.agentArray.updateValueAndValidity();
    });
  }
  manufacturerSelect(value) {
    let agentArray =  this.form.get('AgentArray') as FormControl;
   let ManufacturerArray =  this.form.get('ManufacturerArray') as FormControl;
    this.ManufacturerArray.valueChanges.subscribe(checked => {
      if (checked) {
        this.ManufacturerArray.setValidators([Validators.required]);
        this.agentArray.setValidators(null);
      }
      this.ManufacturerArray.updateValueAndValidity();
      this.agentArray.updateValueAndValidity();
    });
  }

You can also get the help from the below link

A: first condition we could check the values of agent and manufacuter if its null give an alert else save the form.. this is the solution for my question.

save(){ if((<FormArray>this.MaterialForm.get('AgentArray')).at(this.indexSelected).value.agent_id == null &&
    (<FormArray>this.MaterialForm.get('ManufacturerArray')).at(this.indexSelected).value.agent_id == null){
           alert("Form should have either agent or manufacturer")
    }
    else{
// save the form
}
}


text: Q: symplectic form, tautological 1-form and DeRham cohomology There's a question in Lee's Introduction to Smooth Manifold that asks to prove that the Grassmannian product of a symplectic form is not exact. However, isn't this incorrect if there exists a tautological 1-form on the manifold ?


text:
Q: Tabify / Beautify HTML in Texmate? How can I "tabify" HTML in Textmate?
I've tried selecting all, and then using Cmd+option+[ but it comes out a little weird...
If it's not possible to do this in TextMate, if someone could help me write a PHP function to do it, I could potentially make my own TextMate plugin.

  Reversal System, 1 kit

   3.9

(based on
    7 reviews)

      link

        Distribution

            5 Stars

              (3)

                4 Stars

                  (2)

                    3 Stars

                      (1)

                        2 Stars

                         (0)

                           1 Stars

                             (1)

83%

of respondents would recommend this to a friend.

If I use this web page: http://tools.arantius.com/tabifier
It comes out like this:

  Reversal System, 1 kit

  3.9

   (based on 7 reviews)

   link

     Distribution

       5 Stars

       (3)

       4 Stars

       (2)

       3 Stars

       (1)

       2 Stars

       (0)

       1 Stars

       (1)

   83%

   of respondents would recommend this to a friend.

That's a whole lot nicer. How can I make TextMate do that?

A: The HTML bundle includes HTML Tidy (Control-Shift-H).  It does more than format (e.g. closing tags, fixing bad nesting), so if you want it to format-only go into Bundles > Bundle Editor > Show Bundle Editor, and duplicate/customize that command as you see fit.

*

*Tidy overview

*Tidy quick reference

*Tidy full documentation

A: I came here by "googling" textmate beautify and cczona's answer helped, but I faced a problem by using Bundle > HTML > Tidy as it was replacing my <!DOCTYPE html> with different document type. I started digging into the bundle code, however I found out that there's another way to do indention cleanup only: All you have to do is select the text and click on Indent Selection under Text menu.
So it's ⌘+a and then left alt+⌘+[ by default
This answer is for people in 2014 and plus, using version 2 and higher of TextMate


text:
Q: tail not providing output in bash script i have written a bash script that will filter 'tail' output, which the entire command
 tail -f /var/log/asterisk/messages | awk 'match($12, /[^0-9]91([0-9]{10})@default/, a) {print a[1]}'

works fine from the CLI but not when placed in the bash script:
 #!/bin/bash

 phonenumber=$(tail -f /var/log/asterisk/messages | awk 'match($12, /[^0-9]91([0-9]{10})@default/, a) {print a[1]}')
 echo "$phonenumber >> test.log"

which doesn't output anything, (2135551234, is the expected output string) i have tried writing to the log file and writing just the stdout but neither work.
i have tried the script using 'cat' instead of 'tail' and that works fine. but i dont want to dump the output of the entire file, hence the use of 'tail'.
I have also tried using 'tee' but to no avail
the end goal of this script with be to send the phone number as it comes into the PBX to a serial device to another system and used as the CID.
thanks for all your help in advance

A: Try this:
phonenumber=$(tail -f /var/log/asterisk/messages | awk 'match($12, /[^0-9]91([0-9]{10})@default/, a) {print a[1]; exit}')

Your version doesn't work because tail -f and awk are in an infinite loop. Adding exit to the awk script terminates the loop when the first phone number is found. awk exits immediately and its output is put into the variable, and tail -f gets a SIGPIPE signal when it tries to write the next line to the pipe, which causes it to exit.


text:
Q: While redirecting all pages with .htaccess my codes are conflicting I am trying to redirect to

https://example.com from https://www.example.com, http://example.com, http://www.example.com

------------------ and ------------------

https://example.com/sub_page/pages from
https://www.example.com/sub_page/pages, http://example.com/sub_page/pages,
http://www.example.com/sub_page/pages

on .htaccess but my sub_pages are not redirecting properly. probably because of conflicting codes below. I read many articles on Internet but do not fount useful.

my .htaccess file

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteEngine On
RewriteCond %{HTTP_HOST} !^example.com$
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

I think you got my whole point. In short, I want to redirect all requests to non=www and https. Please help me with this,

A: This probably is what you are looking for:
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^example\.com$
RewriteRule ^ https://example.com%{REQUEST_URI} [R=301,L]

That should work in the actual http server configuration or, if you have no access to that, in a distributed configuration file (".htaccess) located in the http hosts's document root.


text:
Q: BigQuery make a table/view from json data column I have installed the firebase extension for streaming data to bigquery.
After that i have backfilled the table with historical data.
One thing I struggle with is that the table is build on changelogs, so that the data of each streamed event is contained as an nested json object in one column called 'data'.
I'm wondering if there is an easy function which creates a view/table out of this json object.
So that it takes the keys seperatly as columns and then fills it with the values for each row.
One difficulty is that different event types contain different json objects which are nested differently.
That's why I want to create an table/view for each event.

A:
I'm wondering if there is an easy function which creates a view/table
out of this json object. So that it takes the keys seperatly as
columns and then fills it with the values for each row.

Yes you can use the fs-bq-schema-views script as explained in the Extension documentation.
The script generates a BigQuery view of your raw changelog based on a schema configuration that you write in JSON format. It's very easy, just follow the instructions.

One difficulty is that different event types contain different json
objects which are nested differently.

You could create two different views based on two differents schemas, one for each type of event and filter the records when querying the views.


text:
Q: RxJava2, Android, Webview Create Observable in Kotlin Just getting started with trying to "Rx-ify" some of Android's Webview events.
class PageStartData(val url: String, val favicon: Bitmap?)

myWebview.webViewClient = object: WebViewClient() {

   val pageStartEvents: Observable<PageStartData> = Observable.create{ emitter->
      override fun onPageStarted(view: WebView, url: String, favicon: Bitmap){
          emitter.onNext(PageStartData(url, favicon))
      }
   }

}

And I have found that the onPageStarted function is out of scope in the emitter lambda function. Very simple, I'm sure. How to fix?
All help appreciated.

A: Check this:
sealed class WebViewEvent {
    data class PageStartData(val url: String?,
                             val favicon: Bitmap?) : WebViewEvent()
}

...
class RxWebViewWrapper(private val webView: WebView) : ObservableOnSubscribe<WebViewEvent> {
    override fun subscribe(emitter: ObservableEmitter<WebViewEvent>) {
        webView.webViewClient = object :WebViewClient(){
            override fun onPageStarted(view: WebView?,
                                       url: String?,
                                       favicon: Bitmap?) {
                super.onPageStarted(view, url, favicon)
                emitter.onNext(WebViewEvent.PageStartData(url, favicon))
            }
        }
    }
}

...
val source = Observable.create<WebViewEvent>(RxWebViewWrapper(myWebview))

A: It can be done via PublishSubject
myWebview.webViewClient = object : WebViewClient() {
        private val pageStartSubject = PublishSubject.create<PageStartData>()
        val pageStartEvents: Observable<PageStartData> = pageStartSubject

        override fun onPageStarted(view: WebView, url: String, favicon: Bitmap) {
            pageStartSubject.onNext(PageStartData(url, favicon))
        }
    }


text:
Q: XTerm Control Sequences for backward/forward word deletion? I believe this article should help me find the control sequence for backward/forward word deletion.
My understanding is that the control sequence would start with \u001b[ since that is "the control sequence introducer" (I got this from this other answer), but don't really know what the full string should be.
Context (as per the other SO question): My goal is to issue the control sequence for deleting words in the VSCode terminal from a keyboard shortcut (keybinding)

A: I've never seen such a sequence.  If you think about it, deleting a word is quite complex, more complex than other operations, and I don't think that any other operation cares about what's on the screen in any way.
For instance,  what terminates a word? '_'?  '-'? '.'?

A: There's no such thing, you can see the ctlseq document doesn't have any single mention of the word word. There's also the question of what background color to use to erase and whether to shift what's to the right of the word to the left or not. You may have to consider words that are wrapped at the right margin of the terminal.
Some of your options are:

*

*send as many BS characters as there are cells in the word you want to erase, followed by as many SPC (beware it uses the current background colour) followed by as many BS characters again (to move the cursor back again):
$ printf 'foo bar\b\b\b   \b\b\b+\n'
foo +

that one should work on virtually all terminals.

*same but use tput cub x (where x is the number of cells) to move the cursor back by that amount instead of using a sequence of BS. And you can use tput ech x to erase those cells (with the current background color or not depending on the terminal)
$ printf 'foo bar'; tput cub 3; tput ech 3; printf '+\n'
foo +

*instead of tput ech x, you can use tput el to erase to the end of line, or tput dch x to delete x cells (and shift what's after that to the left).
(tput here is the shell interface to the terminfo database, the idea being to avoid hard coding escape sequences, use the equivalent for your language).
Looking at the backward-kill-word widgets of some shells (using script for instance to log their output), I see readline uses BS for motion and dch to delete, while zsh uses a combination of BS and cub and rewrite. tcsh seems to be doing some absolute column positioning (hba) and use dch to delete, ksh93 sends a CR and rewrites the whole line.


text:
Q: Did the Government know that Syndrome was killing supers? Mr Incredible had a Government handler, so I would assume all the supers had one. And when those supers started disappearing one by one they would get nervous. Are they going back to being a super hero? Becoming a super villain? When you consider just how many supers Syndrome took out, they had to have tracked it back to the source.
But what if Syndrome was providing tech to the government? What if he pointed out just how much money they were costing the government? How much time and resources wasted monitoring them? And especially how they are still a threat to the government if they or especially  their children were to turn against it?

A: It's not clear what the feds knew but there's absolutely no indication that the govt knew that Syndrome was killing supers, nor that they wouldn't have immediately tried to stop him if they'd found out.

As to the question of why the National Supers Agency aren't doing something about it, the people tasked with hiding the supers (notably Rick Dicker) do appear to have knowledge of their secret identities but only seems to involve itself in their affairs when they accidentally reveal their powers, and then only to help the supers to remain hidden rather than investigating what they're up to.
Beyond that, the detection of mysterious superhero disappearances appears to be a simple police matter, one dealt with by "local authorities".

There's also a few other things to take into account:

*

*The implication is that the "Supers" department has been heavily de-funded since the supers were forced underground. Rick Dicker complains about the extravagance of having to relocate the family again.

*The disappearances have happened over an extended period of time (certainly years and potentially decades), making any sort of pattern hard to spot.

*The missing superheroes are likely to be from all over the US, meaning that there's less chance for the connection to be made by local police.

*Mirage actively encourages the supers to lie to their loved ones about their movements. The police are far less likely to assume foul play if they find that the disappeared person has been leading a double life.

*The supers lack any sort of centralised communication among each other. The winnowing of their numbers has evidently gone unnoticed.