text:
Q: Python: Delete multiple variables if they exist First, I import between one and 25 files named file_1, ..., file_25; if I import seven, it can be file_1 till file_7, but also any of the other files.
Next, I merge them to one. I do this by
files = ["file_1","file_2","file_3","file_4","file_5","file_6","file_7","file_8","file_9","file_10","file_11","file_12","file_13","file_14","file_15","file_16","file_17","file_18","file_19","file_20","file_21","file_22","file_23","file_24","file_25"]
all_files = pd.DataFrame()
for file in files:
    if file in globals():
        print("Merging", file)
        all_files = all_files.append(eval(file))
    else:
        print(file, "not in globals")

(Note for future readers: the list files can easily created by Excel; no need to type it all)
To avoid memory errors, I then want to delete all existing files. I was thinking about something like
a = 1
b = 2
c = 3

l = [a,b,c]

for l in l:
    del l

but it doesn't work (I know that there is no condition for checking the existence in yet, but it also does not work if all files in the list exist.
How can this be solved?

Edit:
Full example:
file_1 = pd.read_csv("path/file_1")
file_2 = pd.read_csv("path/file_2")
file_3 = pd.read_csv("path/file_3")
file_4 = pd.read_csv("path/file_4")
file_5 = pd.read_csv("path/file_5")
file_6 = pd.read_csv("path/file_6")
file_7 = pd.read_csv("path/file_7")
file_8 = pd.read_csv("path/file_8")
file_9 = pd.read_csv("path/file_9")
file_10 = pd.read_csv("path/file_10")
file_11 = pd.read_csv("path/file_11")
file_12 = pd.read_csv("path/file_12")
file_13 = pd.read_csv("path/file_13")
file_14 = pd.read_csv("path/file_14")
file_15 = pd.read_csv("path/file_15")
file_16 = pd.read_csv("path/file_16")
file_17 = pd.read_csv("path/file_17")
file_18 = pd.read_csv("path/file_18")
file_19 = pd.read_csv("path/file_19")
file_20 = pd.read_csv("path/file_20")
file_21 = pd.read_csv("path/file_21")
file_22 = pd.read_csv("path/file_22")
file_23 = pd.read_csv("path/file_23")
file_24 = pd.read_csv("path/file_24")
file_25 = pd.read_csv("path/file_25")

files = ["file_1","file_2","file_3","file_4","file_5","file_6","file_7","file_8","file_9","file_10","file_11","file_12","file_13","file_14","file_15","file_16","file_17","file_18","file_19","file_20","file_21","file_22","file_23","file_24","file_25"]
all_files = pd.DataFrame()
for file in files:
    if file in globals():
        print("Merging", file)
        all_files = all_files.append(eval(file))
    else:
        print(file, "not in globals")

# How to simplfy the following?
del file_1
del file_2
del file_3
del file_4
del file_5
del file_6
del file_7
del file_8
del file_9
del file_10
del file_11
del file_12
del file_13
del file_14
del file_15
del file_16
del file_17
del file_18
del file_19
del file_20
del file_21
del file_22
del file_23
del file_24
del file_25

I want to be able to import a subset of the files, but still have the following steps (putting them into one varibale and deleting individual files) automated. I succeeded for the first following step (putting them into one varibale), but not for the second following step (deleting individual files).
I'd like to somehow loop trough the variables and check if they exist; and if they do, delete them. How to do this?


text:
Q: Where I can delete custom HTML attributes? I somehow created custom HTML attributes and now I need to delete them but I can't find it anywhere in the settings list of my custom HTML attributes, so that I could delete them...
Can someone say the place where the attributes are stored?

A: please see Custom HTML tag attributes: option in Settings | Editor | Inspections, HTML | Unknown HTML tag attribute

redpajama_set_name: RedPajamaStackExchange


text:
Q: App sandboxing issue with Apple Mac app store I am creating the entitlement keys for my app's sandbox.  I'm having some issues with the entitlement key com.apple.security.temporary-exception.sbpl.  There are five exceptions that I need to add to this key and they are ipc-posix-sem, file-issue-extension, mach-lookup, file-write-create, and file-read-data.  Because I am making this application outside of Xcode (I'm using Python), I have to manually create the entitlement file.  I already 'succeeded', but Apple doesn't seem to like my formatting.
Here is the original code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.temporary-exception.sbpl</key>
    <string>
            (begin
                (allow ipc-posix-sem)
                (allow file-issue-extension)
                (allow mach-lookup)
                (allow file-write-create)
                (allow file-read-data))
        </string>
</dict>
</plist>

After being rejected for com.apple.security.temporary-exception.sbpl, I made the following revision:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
    <key>com.apple.security.temporary-exception.sbpl</key>
    <array>
        <string>(allow ipc-posix-sem)</string>
        <string>(allow file-issue-extension)</string>
        <string>(allow mach-lookup)</string>
        <string>(allow file-write-create)</string>
        <string>(allow file-read-data)</string>
    </array>
</dict>
</plist>

My question is this: Is my new formatting the correct way of using the .sbpl entitlement?  After tasting my app, it works with this new entitlement file, now all I need to know is if it is acceptable for Apple.
I found two examples of entitlement files from here and here, and I believe my file is setup appropriately after looking at them.

A: I found another Sandbox entitlements file in GitHub and your formatting looks correct to my eyes.
I think another problem may be is that you need to supply arguments after commands like "mach-lookup".  I'm looking at the Apple Sandbox Guide unofficial documentation found here.


text:
Q: Is a resistor compulsory in a NOT gate made from an NPN transistor? I am making a NOT gate using a BC337/BC547A transistor (tried both) and I have made this circuit (image shown below) using a simulator:

This is working properly. However when I remove the resistor R1, as shown below, it is not working.

Can you please explain what the importance of the resistor is here?

A: Without the resistor, it is impossible for the output to be at any voltage other than that of the VCC supply rail, to which it is then directly wired.   All the transistor can do in such a case is short out the power supply.
What you drew in the first picture is called "resistor transistor logic" as it depends on a pulling resistor to counterbalance the transistor and provided the limited drive in the other direction.  But it wastes power (in the resistor) in one state, and it is slow in the direction where the resistor sources current.
More typically, "transistor transistor logic" was used - there other transistors would function to drive the output high when needed, or to act like the resistor does as something of a current source.`  But that's largely faded from use.
Today most logic is CMOS - Complementary Metal Oxide Semiconductor.  It is made of field-effect transistors with oxide-insulated gates.  And it is "complementary" because there's an approximate mirror image to the schematic, with an upper P-channel FET and a lower N-channel FET which work alternately to drive the signal high or low.


text:
Q: What prevent me from get this json data I'm trying to get this array of images in this json bellow and display it in GridView but i don't know why i can't reach that >>>
    {
id: 241,
title: "title",
image: "1469370455.jpg",
description: " descriotion   ",
images: [
"1469370455.jpg",
"1469370458.jpg",
"1469370481.jpg",
"1469370484.jpg"
]}

and this is my full AyncTask.
     private class AysncImages extends AsyncTask<String, Void, Integer> {
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            // Showing progress dialog
//            pDialog = new ProgressDialog(getActivity());
//            pDialog.setMessage("Please wait...");
//            pDialog.setCancelable(false);
//            pDialog.show();

        }

        @Override
        protected Integer doInBackground(String... arg0) {
            // Building Parameters
            HttpHandler sh = new HttpHandler();

            String jsonStr = sh.makeServiceCall(String.valueOf(Config.BASE_URL));

            //jsonStr = sh.makeServiceCall(url + 373); //or url + ID
            Log.i(TAG, "doInBackground Image: " + jsonStr);

            if (jsonStr != null) {

                try {
                    JSONObject jsonObj = new JSONObject(jsonStr);

                    JSONArray arrayObj = jsonObj.getJSONArray("images");

                    Log.i(TAG, "array: "+ jsonObj);

                    GridItem item = new GridItem();
                    for (int i = 0; i < arrayObj.length(); i++) {
                        String images = arrayObj.getString(i);

                        Log.i(TAG, "parseResult: " + jsonObj);
                        item.setImage(IMAGE_LINK + images);//IMAGE_LINK +

                        Log.i(TAG, "parseResult: " + IMAGE_LINK + " " + images);
                        mGridData.add(item);

                    }
                    // Getting JSON Array node

                } catch (JSONException e1) {
                    e1.printStackTrace();
                }
            }
            return null;
        }

        @Override
        protected void onPostExecute(Integer result) {
//            if (result == 1) {
                mGridAdapter.setGridData(mGridData);
            //} else {
              //  Toast.makeText(getActivity(), "Failed to fetch data!", Toast.LENGTH_SHORT).show();
           // }

            //Hide progressbar
            mProgressBar.setVisibility(View.GONE);
        }

    }

In my log i can't reach jsonObj or arrayObj I just can reach jsonStr what I'm missing ?
My Log for jsonStr

A: the json string you get is [{id:abc,...}]
but a JsonObject should start with {id:abc,...}
maybe you try to remove the '[' and ']' at the end of string in order to get the object
as start with '[' should be an array


text:
Q: How do I change the color of text from a radio button? I'm making a segmented switch and I'm trying to use transition to change the color of text, but for some reason the text color change isn't working.
https://jsfiddle.net/zp2z2bvw/1/
This is the CSS styling:
#Favorites_Switch:checked ~ #Selected_Container {
position: absolute;
left: 50%;
transition: all .15s ease;
border-radius: 0px 5px 5px 0px;
}

#Favorites_Switch:checked ~ #Favorites_Text {
color: #38D1A9;
transition: color .2s ease;
}

#Favorites_Switch:checked ~ #All_Text {
color: #FFFFFF;
transition: color .2s ease;
}

#All_Switch:checked ~ #Selected_Container {
position: absolute;
left: 0%;
transition: all .15s ease;
}

This is the html.

    <input type="radio" name="Switch" value="All" id="All_Switch" class="Radio_Switch"/>
    <input type="radio" name="Switch" value="Favorites" id="Favorites_Switch" class="Radio_Switch"/>

All

Favorites

I can't figure out why the font color won't change when I press on the label divs.

A: It's not working because the input checkbox elements are not siblings with the text elements (#Favorites_Text/#All_Text). You need to select the sibling label elements, and then select the descendant text elements from there.
In other words, you would change:
#Favorites_Switch:checked ~ #Favorites_Text { ... }
#Favorites_Switch:checked ~ #All_Text { ... }

to:
#Favorites_Switch:checked ~ label #Favorites_Text { ... }
#Favorites_Switch:checked ~ label #All_Text { ... }

Updated Example
#Favorites_Switch:checked ~ label #Favorites_Text {
  color: #38D1A9;
}

#Favorites_Switch:checked ~ label #All_Text {
  color: #FFFFFF;
}

As a side note, I also added the transition to the element .Switch_Text so that the transition occurs before and after the checkboxes are checked.
If the transition is added when the checkboxes are checked, then the transition will only occur when unchecking them.


text:
Q: Local administrator unique to machine when joining Azure AD with Intune I set up automatic Windows 10 machines enrollment to Azure AD. Machines join Azure AD without a problem and users can log in. Users do not have local admin permissions for the machine by default. But I need every machine to have a local admin (one user for one machine, not for all machines).
Now, I do this with Windows Device Configuration and I do specify local admin (not Azure AD user, just a local machine user). When the machine is joined Intune policy is applied. When logged in, I see that user (local admin) in local users and its a member of Administrators group. But local log on is not allowed (and I have no idea how to enable it).
So can I set up Intune (or whatever) to have all Azure AD users as a standard users but also for every machine to have a local admin? Can't figure this out and can't find this case in the Microsoft docs.

A: You can enrolled to Azure with users and then assign some Azure AD user to local admin. Here is the steps:
1. Login to the PC as the Azure AD user you want to be a local admin. This gets the GUID onto the PC.
2. Log out as that user and login as a local admin user.
3. Open a command prompt as Administrator and using the command line, add the user to the administrators group. As an example, if I had a user called alvipeo, the command would be "net localgroup administrators AzureAD\alvipeo /add" without the quotes.
4. Log back in as the user and they will be a local admin now.
Best regards,
Cici Wu


text:
Q: Hi, Im unable to install package as.Date as R says that as.Date is not available in version 3.6.2
package 'as.Date' is not available (for R version 3.6.2)

Hi, I'm unable to install package as.Date as R says that as.Date is not available in version 3.6.2.

A: That error message appears when you try to insert a package that is not available for said R version. In your case, as.Date is not the name of an available package. As per arg0naut's comment, it is actually the name of a R command, which is available in the base package. The base package is opened automatically when starting R, so you can use the as.Date command without manually loading a package.


text:
Q: Scripts after doing cURL don't work. Page is reloaded continuously These are the steps I want to do:

*

*Get the HTML code of http://www.skyscanner.es/ , a search of flights.

*Get only some part of that HTML: a specific "span" which has the price.

*Operate with it.

This is the PHP code what I do:
    <?php
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "http://www.skyscanner.es/");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($ch, CURLOPT_POST, 1);
        curl_setopt ($ch, CURLOPT_POSTFIELDS, "from=Bilbao (BIO)&to=Barcelona (BCN)&depdatetext=25/03/2013&sc_returnOrOneWay=2");
        $output = curl_exec($ch);
        curl_close($ch);
        echo $output;
    ?>

But I get a strange string like this:
     ‹¥TkoÚ0ý^‰ÿpTi"ê< t%<¤RuR»U+{}4ñ…X5qf›×Pÿûì$ZõÛ'Äu¬sî=çú:ýÓ믣Éï‡1¤f!àáû§»Ï#ðHül'àzr ¿n'÷wù!<Åã/x©1yëõÚ_·}©æÁä[°qY"G«–DŸæ 'ý¢Êf!2=x#CÔívKb FÊ\\ ¡àÐÿ,ùjàdf03d²Íу¤|x7&pì$)UÍ€kI®®:]yKe¸8¼;@àv2y€ª),520h' Ö`R®!§s3i€ !×Èü~Pòm"m¶ÁXUÝDëBô)!"©dÛÝ'ª9Ïâ°7³‰æ1ö?à¢|ÑÛø*F3z§ânQ¬ÐðÄîhši¢QñYoJ"§¹'ËŒÅÍqñôž'3Ž'Y"»œ2ƳyBÔÉ7…îÏ®zÏÐ8I£Ý¡~Ë¿°ja‰RÅÍ››—/m!£BêkähÚ§ÌÛ~nÐEýÐýö´0¬iMw¨¨vkÎLw/ÏêeoæÒ&iA^ôÌ3 §Ë$E÷Þ9Ô=<êØ'3{uûHµß)gºYMÏî…[1—š.³X¡ †¯Ð¡ý M\¤<³FŽÏÆ•{mŒ™ÇWö0öÆ\{ÞÎNˆ  bµ¿nœ\d|œÙ›SôÐöÓhøˆÊÎ0Œ•'Ê2¢a?°°ct¥ÙM'›‰ Z×û/6á~¦úië?®Š%—IÚÃIŠ%h+—@'òÉöfRAB3Gœ"0®sA·¶Àj+Í€g+*8ûH%ƒwµ"÷°¦ú Ç\ä¦ÒåÊ·¿Aí¨îK÷m-¾vñà-ú¡

So, I have not even passed the first step!
I tried to fix it in several ways but I don't know yet what I am doing wrong. I imagine that can be:

*

*The request because I don't add how much adult, children...

*The CURLOPT_URL has to be www.skyscanner.es/search.html as the form has in the action.

*Not do a POST request, do an cURL directly to an URL like http://www.skyscanner.es/flights/bio/bcn/130325/airfares-from-bilbao-to-barcelona-in-march-2013.html?flt=1
Please can anyone help me?
Thanks in advance!
Edited: I've changed the title, is closer to the problem I have now.

A: It doesn't matter what message is encoded in the body since you're receiving:
HTTP/1.1 405 Method Not Allowed
which means you can't use POST.
If you'll read all the headers of the response you'll see that one of them says:
Allow: GET, HEAD, OPTIONS, TRACE

If you'll remove the two lines:
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "from=Bilbao (BIO)&to=Barcelona (BCN)");

and change:
curl_setopt($ch, CURLOPT_URL, "http://www.skyscanner.es/");

into:
curl_setopt($ch, CURLOPT_URL, "http://www.skyscanner.es/vuelos/bio/bcn/130325/tarifas-de-bilbao-a-barcelona-en-marzo-2013.html");

It'll work.
Checkout the following code:
<?php

    $accept = array(
        'type' => array('application/rss+xml', 'application/xml', 'application/rdf+xml', 'text/xml'),
        'charset' => array_diff(mb_list_encodings(), array('pass', 'auto', 'wchar', 'byte2be', 'byte2le', 'byte4be', 'byte4le', 'BASE64', 'UUENCODE', 'HTML-ENTITIES', 'Quoted-Printable', '7bit', '8bit'))
    );
    $header = array(
        'Accept: '.implode(', ', $accept['type']),
        'Accept-Charset: '.implode(', ', $accept['charset']),
    );
    $encoding = null;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "http://www.skyscanner.es/vuelos/bio/bcn/130325/tarifas-de-bilbao-a-barcelona-en-marzo-2013.html?flt=1");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//    curl_setopt ($ch, CURLOPT_POST, 1);
//    curl_setopt ($ch, CURLOPT_POSTFIELDS, "from=Bilbao (BIO)&to=Barcelona (BCN)");
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    $response = curl_exec($ch);
    curl_close($ch);
    if (!$response) {
        // error fetching the response
    } else {
        echo $response;
    }
?>

A: I thought that it was using POST method because I get a page whithout prices.
Now I realize that the URL were relatives, so scrips were not loaded. I've add base tag.
[code before]
$result = str_replace("<head>", "<head><base href=\"$skyScannerURL\" />", $response);

Now it has styles and try to load something, but it enter in a bucle, the page is reloaded and the URL has a parameter increasing, it is: ?crty=107
The full code:
$accept = array(
    'type' => array('application/rss+xml', 'application/xml', 'application/rdf+xml', 'text/xml'),
    'charset' => array_diff(mb_list_encodings(), array('pass', 'auto', 'wchar', 'byte2be', 'byte2le', 'byte4be', 'byte4le', 'BASE64', 'UUENCODE', 'HTML-ENTITIES', 'Quoted-Printable', '7bit', '8bit'))
);
$header = array(
    'Accept: '.implode(', ', $accept['type']),
    'Accept-Charset: '.implode(', ', $accept['charset']),
);
$encoding = null;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.skyscanner.es/vuelos/bio/bcn/130325/tarifas-de-bilbao-a-barcelona-en-marzo-2013.html?flt=1");
//curl_setopt($ch, CURLOPT_URL, "http://www.skyscanner.es/flights/bio/bcn/130325/airfares-from-bilbao-to-barcelona-in-march-2013.html?flt=1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
$response = curl_exec($ch);
curl_close($ch);
if (!$response) {
    // error fetching the response
} else {
    $skyScannerURL = 'http://www.skyscanner.es/';
    $result = str_replace("<head>", "<head><base href=\"$skyScannerURL\" />", $response);
    echo $result;
}

You can see online here: codepad.viper-7.com
Obvious something is not working well.
Thanks again everyone.


text:
Q: nestjs mongoose .insertMany is not a function I'm stuck with using "insertMany". Can anyone explain how to use this method?
Nest official docs says nothing about this realization. https://docs.nestjs.com/techniques/mongodb
upload.model.ts
import { Schema, Document } from 'mongoose';

export const Upload = new Schema({
  name: { type: String, required: true },
  usernameCreate: { type: String, required: true },
  dateCreate: { type: Date },
});

export interface IUpload extends Document {

  readonly _id: Schema.Types.ObjectId;
  readonly name: string;
  readonly dateCreate: Date;
  readonly usernameCreate: string;
}

upload.service.ts
import { Model } from 'mongoose';
import { InjectModel } from '@nestjs/mongoose';
import { Injectable } from '@nestjs/common';
import { IUpload } from './upload.model';

@Injectable()
export class UploadService {

  constructor(
    @InjectModel('Upload') private readonly uploadModel: Model<IUpload>
  ) {}

  async create({ files, body }): Promise<IUpload> {
    const arr = files.map((file) => {
      return {
        name: file.filename,
        dateCreate: body.dateCreate,
        usernameCreate: body.usernameCreate,
      };
    });
    const createUploads = new this.uploadModel();
    return createUploads.insertMany(arr);
  }
}

terminal
TypeError: createUploads.insertMany is not a function

packages
"@nestjs/mongoose": "^7.2.0",
"mongoose": "^5.11.9",

A: I realized what Document doesn't have this method. Instead this I need to call it from Model
async create({ files, body }): Promise<any> {
    const arr = files.map((file) => {
      return {
        name: file.filename,
        dateCreate: body.dateCreate,
        usernameCreate: body.usernameCreate,
      };
    });
    return this.uploadModel.insertMany(arr);
  }

A: I also got the same error and i found that i am using the new keyword which should not be present at the time of insertMany.
return await this.bookingSlotsRespository.create(availableSlots);

and it works for me.

*

*availableSlots is an array of object which i have to save.

A: you are creating new instance for the model try this
import { Model } from 'mongoose';
import { InjectModel } from '@nestjs/mongoose';
import { Injectable } from '@nestjs/common';
import { IUpload } from './upload.model';

@Injectable()
export class UploadService {

  constructor(
    @InjectModel('Upload') private readonly uploadModel: Model<IUpload>
  ) {}

  async create({ files, body }): Promise<IUpload> {
    const arr = files.map((file) => {
      return {
        name: file.filename,
        dateCreate: body.dateCreate,
        usernameCreate: body.usernameCreate,
      };
    });
    await this.uploadModel().insertMany(arr);
    return {message:"success"}
  }
}


text:
Q: How do I control an empty input? How do I control an empty input?
I am creating my first component in React and I have problems with the logic of how to control or detect when an input is empty.
The idea is to change the class of the input according to its content, that is
If the input is not empty, change the border color to green,
If the input is empty, change the color of the border to gray.
the logic works when the input has a text, the problem is when I delete the content the input does nothing, until I write a letter again the message "input is empty" and "input with data" is activated
Why?
Login Component

const { useEffect, useState } = React;

const Login = function () {
  const [formState, setformState] = useState({
    isActive: true,
    inputEmail: "",
  });

  const { isActive, inputEmail } = formState;
  useEffect(
    function () {
      // console.log("hello");
    },
    [inputEmail]
  );

  const handleInputChange = function (e) {
    if (inputEmail == "") {
      console.log("input is empty");
      setformState({ ...formState, [e.target.name]: e.target.value, isActive: false });
    } else {
      setformState({ ...formState, [e.target.name]: e.target.value, isActive: true });
      console.log("input with data");
    }
  };

  return (
    <input type="text" name="inputEmail" className={`inputClass ${isActive ? "inputSelected" : ""}`} autoComplete="off" onChange={handleInputChange} />
  );
};
ReactDOM.render(<Login />, document.getElementById('root'));

A: You should be checking the incoming value which is e.target.value
  const handleInputChange = function (e) {
    if (e.target.value == "") {//<--
      console.log("input is empty");
      setformState({ ...formState, [e.target.name]: e.target.value, isActive: false });
    } else {
      setformState({ ...formState, [e.target.name]: e.target.value, isActive: true });
      console.log("input with data");
    }
  };

A: You are using the last value of state for your logic, so it appears that it is always one step behind.
You should also default your state for isActive to be false since the input value is initially false.
Instead, use the new value located in e.target.value like below:
I've changed the style to be inline, and the color to affect the background for a clearer demonstration.

const { useEffect, useState } = React;

const Login = function () {
  const [formState, setformState] = useState({
    isActive: false,
    inputEmail: "",
  });

  const { isActive, inputEmail } = formState;

  const handleInputChange = function (e) {
    if (e.target.value == "") {
      console.log("input is empty");
      setformState({ ...formState, [e.target.name]: e.target.value, isActive: false });
    } else {
      setformState({ ...formState, [e.target.name]: e.target.value, isActive: true });
      console.log("input with data");
    }
  };

  return (
    <input type="text" name="inputEmail" style={{ backgroundColor: isActive ? "green" : ""}} autoComplete="off" onChange={handleInputChange} />
  );
};
ReactDOM.render(<Login />, document.getElementById('root'));

Simplified Example
Depending on your requirments, you may be able to simplify this significantly.
If isActive is always to reflect whether or not inputEmail is empty or not, then you can omit it from state and determine it each render.
This means you don't need a condition in handleInputChange and can update it the same way no matter what.
I would also recommend setting the input value prop explicitly instead of just relying on them staying in sync.

const { useEffect, useState } = React;

const Login = function () {
  const [formState, setformState] = useState({
    inputEmail: "",
  });

  const { inputEmail } = formState;

  const handleInputChange = function (e) {
    setformState({ ...formState, [e.target.name]: e.target.value });
  };

  return (
    <input type="text" name="inputEmail" value={inputEmail} style={{ backgroundColor: !!inputEmail ? "green" : ""}} autoComplete="off" onChange={handleInputChange} />
  );
};
ReactDOM.render(<Login />, document.getElementById('root'));


text:
Q: Will a git reset --mixed on the master branch effect my local branches? New to git, so bear with me... and apologies for the messy visual depictions.
Here is what I thought I was doing:
                              -<commit>-<commit>(A)
                             /
                             -<commit>(B)
                           /
  ...-<commit 123>-(Master)
                          \
                            -<commit>-<commit>-<commit>(C)

But when I git pull'ed on (master) and merged, git status then said your branch is ahead of 'origin/master' by 6 commits (plus it doesn't work!). So I think I have:
                              -<mix of commits, intended for A, B or C>(A)
                             /
                             -<commits intended for B>(B)
                           /
           ...-<commit 456>-<commit>-<commit>-<commit>-<commit>-(Master)
                          \
                           -<mix of commits, intended for B or C>(C)

Will git reset --mixed 456 give me this:
                              -<mix of commits, intended for A, B or C>(A)
                             /
                             -<commits intended for B>(B)
                           /
   ...-<commit 456>(Master)
                          \
                           -<mix of commits, intended for B or C>(C)

leaving A, B and C untouched?
Either way, this is what I want. How do I achieve this?
Thank you in advance!


text:
Q: How to set default edittext color in android 4.x For setting default theme, I set that in application tag in the manifest file.
<application
    android:name=".App"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">

And this is the 'AppTheme' in styles.xml.
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="android:textColor">#0400ff</item>
    <item name="android:editTextColor">#ff0000</item>
</style>

This works in Android 5.0 and 6.0 devices.
But in Android 4.x, oddly it works only for 'textColor' not 'editTextColor'. Although I set this theme, default editText color is white in android 4.x.
I don't know why this problem happened.
Please give me some hints!

A: I answer this by myself. I found a similar question.
Android set edit text style globally in theme doesn't work
It told that I should use like this
<item name="editTextColor">#ff0000</item>

instead of
<item name="android:editTextColor">#ff0000</item>.

I used it because Android Studio auto complete function recommended it.
And now I know that I have to use these BOTH!
Android 5.0 and 6.0 follow the color name="android:editTextColor", but Android 4.X follow the color name="editTextColor".
The problem has solved!

A: try the following :
Java
Et.setTextColor()

XML
textColor="@color/yourColor"


text:
Q: Fill input value using javascript I need a JavaScript solutions. I recived data from aweber after user subscribe, in success page. so url like:
http://example.com/success/?email=example@email.com&name=Jhon&custom_phone=0005551114&custom_location=USA

They give some javascript solutions to show data in webpage or success page...
Referance: https://help.aweber.com/entries/21696333-How-Do-I-Display-Subscribers-Names-or-Email-Addresses-On-My-Thank-You-Page-
So When I put
<script type="text/javascript">formData.display("name")</script>
<script type="text/javascript">formData.display("email")</script>
<script type="text/javascript">formData.display("custom_phone")</script>
<script type="text/javascript">formData.display("custom_location")</script>

value will show in my page. But How can I put the value in a input field in success page??
<form action="" method="post">
<input type="text" name="username" value="Jhon">
<input type="text" name="useremail" value="example@email.com">
<input type="text" name="phoneno" value="0005551114">
<input type="text" name="country" value="USA">
<input tyoe="submit" value="Submit">
</form>

Please help..

A: You can change the Javascript code a bit, like this:
<script type="text/javascript">
 var formData = function() {  var query_string = (location.search) ? ((location.search.indexOf('#') != -1) ? location.search.substring(1, location.search.indexOf('#')) : location.search.substring(1)) : '';
var elements = [];
if(query_string) {
    var pairs = query_string.split("&");
    for(i in pairs) {
        if (typeof pairs[i] == 'string') {
            var tmp = pairs[i].split("=");
            var queryKey = unescape(tmp[0]);
            queryKey = (queryKey.charAt(0) == 'c') ? queryKey.replace(/\s/g, "_") : queryKey;
            elements[queryKey] = unescape(tmp[1]);
             }
       }
 }
return {
    display: function(key) {
        if(elements[key]) {
             document.write('<input type="text" name="' + key + '" value ="' + elements[key] + '"');
         }
         else {
               document.write("<!--If desired, replace everything between these quotes with a default in case there is no data in the query string.-->");
          }
  }
}
}
(); </script>

And your HTML will look like this:
<form action="" method="post">
<script type="text/javascript">formData.display("name")</script>
<script type="text/javascript">formData.display("email")</script>
<script type="text/javascript">formData.display("custom_phone")</script>
<script type="text/javascript">formData.display("custom_location")</script>
<input tyoe="submit" value="Submit">
</form>


text:
Q: Which forces keep two soap bubbles together? I am trying to calculate how many soap bubbles can hang together against the force of gravity, but I am not sure what forces hold them together. My guess is the surface tension, so an equation like $F=\sigma\cdot L$, but honestly I don't know if that is it. Would help a great deal!
It looks like this

A: Partial answer/comment.
Cyril Isenberg Soap Bubbles Dover Publications NY, is a beautiful popular book reference that includes sourcings from CV Boys. Several interesting problems (Minimum motor way junctions, Non symmetric soap bubbles etc.) are discussed.
Using Goldschmitt conditions in that book for stable bubbles formation we can estimate number of serially bubbles supported.
A static balance/ vertical equilibrium can be found by using the necessary angle $120^{\circ}$ at constant surface tension bubble junction shown in sketch. ( by meridional force resultants). Lumped mass of soapy solution (like sodium stearate) is unknown and should be assumed in any particular situation.
Calculation is relatively easy as weight of bubble segment is $\pi q h D $ where $q$ is mass per unit area of bubble, $(D,h)$ are maximum diameter and height of bubble segment. After including weight of the horizontal diaphragms also the vertical static force balance at top edge can be considered.


text:
Q: How to pass a Flask POST to React I have a simple application where I want to control a counter with React. I am trying to understand how data is sent from the frontend to the backend, and from the backend to the frontend.
I am able to POST the count to the backend, but I cannot return the count back to React. useEffect works for the POST request, but not the GET request and I'm not sure why.
I read this How to send data from React to Flask then back to react and show output on DOM, but I'm not familiar with enough React to understand class components yet.
app.py
from flask import Flask, request

app = Flask(__name__)

@app.route('/led', methods=['GET', 'POST'])
def led():
    count = 1
    if request.method == 'POST':
        count = request.json['count']
        return {'backendCount': count}
    return {'backendCount': count}

LED.js
import React, { useEffect, useState } from "react";

function LED() {

  const [count, setCount] = useState(1)
  const [backendData, setBackendData] = useState([{}]);

  function increment() {
    const newCount = count + 1;
    setCount(newCount);
  }

  function decrement() {
    const newCount = count - 1;
    setCount(newCount);
  }

  useEffect(() => {
    fetch('/led').then(
      response => response.json()
    ).then(data => setBackendData(data))
  }, []);

  useEffect(() => {
    fetch('/led', {
        method: 'POST',
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({"count": count})
    }).then(() => {
        console.log("POST: " + count)
    })
  })

  return (

LED Controller

Change the number of seconds between the LED turning on and off.

{count}

        <button onClick={increment}>+</button>
        <button onClick={decrement}>-</button>

Increment from backend:

{backendData.backendCount}

  );
}

export default LED;

A: I think your useState declaration might be wrong and should define a different variable type.
You should try this, as it appears that backend is an object, and not an array of object.
import React, { useEffect, useState } from "react";

function LED() {

  const [count, setCount] = useState(1)
  const [backendData, setBackendData] = useState({});

  function increment() {
    const newCount = count + 1;
    setCount(newCount);
  }

  function decrement() {
    const newCount = count - 1;
    setCount(newCount);
  }

  useEffect(() => {
    fetch('/led').then(
      response => response.json()
    ).then(data => setBackendData(data))
  }, {});

  useEffect(() => {
    fetch('/led', {
        method: 'POST',
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({"count": count})
    }).then(() => {
        console.log("POST: " + count)
    })
  })

  return (

LED Controller

Change the number of seconds between the LED turning on and off.

{count}

        <button onClick={increment}>+</button>
        <button onClick={decrement}>-</button>

Increment from backend:

{backendData.backendCount}

  );
}

export default LED;

A: I solved my question by using a button to POST the data to the backend and then GET to the frontend.
app.py
from flask import Flask, request

app = Flask(__name__)

class StoredData:
    count = 1
    def update_count(cls, num):
        cls.count = num

data = StoredData()

@app.route('/led', methods=['GET', 'POST'])
def led():
    if request.method == 'POST':
        count = request.json['count']
        data.update_count(count)
        return {'backendCount': data.count}
    return {'backendCount': data.count}

LED.js
import React, { useEffect, useState } from "react";

function LED() {

  const [count, setCount] = useState(1)
  const [backendData, setBackendData] = useState([{}]);

  function increment() {
    const newCount = count + 1;
    setCount(newCount);
  }

  function decrement() {
    const newCount = count - 1;
    setCount(newCount);
  }

  function handleTransfer() {
      fetch('/led', {
          method: 'POST',
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify({"count": count})
      }).then(() => {
          console.log("POST: " + count)
      })

      fetch('/led').then(
        response => response.json()
      ).then(data => setBackendData(data))
  }

  return (

LED Controller

Change the number of seconds between the LED turning on and off.

{count}

        <button onClick={increment}>+</button>
        <button onClick={decrement}>-</button>

Increment from backend:

        <button onClick={handleTransfer}>Transfer Data</button>

{backendData.backendCount}

  );
}

export default LED;


text:
Q: Maven require inclusion of file when building JAR file I need to include a file in the built JAR file from Maven.
So I followed this reference doc and added an  element in my pom.xml: https://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html
This however includes the file if it exists - I need to make this file a requirement for the end result JAR file. Is there a way to specify that the inclusion of the file is mandatory?

A: You can try an enforcer rule:
https://maven.apache.org/enforcer/enforcer-rules/requireFilesExist.html
This checks whether a file exists and breaks the build otherwise.


text:
Q: SQLite - WHERE Clause & UDFs Intro
I have the following SQLite table with 198,305 geocoded portuguese postal codes:
CREATE TABLE "pt_postal" (
  "code" text NOT NULL,
  "geo_latitude" real(9,6) NULL,
  "geo_longitude" real(9,6) NULL
);

CREATE UNIQUE INDEX "pt_postal_code" ON "pt_postal" ("code");
CREATE INDEX "coordinates" ON "pt_postal" ("geo_latitude", "geo_longitude");

I also have the following user defined function in PHP that returns the distance between two coordinates:
$db->sqliteCreateFunction('geo', function ()
{
    if (count($data = func_get_args()) < 4)
    {
        $data = explode(',', implode(',', $data));
    }

    if (count($data = array_map('deg2rad', array_filter($data, 'is_numeric'))) == 4)
    {
        return round(6378.14 * acos(sin($data[0]) * sin($data[2]) + cos($data[0]) * cos($data[2]) * cos($data[1] - $data[3])), 3);
    }

    return null;
});

Only 874 records have a distance from 38.73311, -9.138707 smaller or equal to 1 km.

The Problem
The UDF is working flawlessly in SQL queries, but for some reason I cannot use it's return value in WHERE clauses - for instance, if I execute the query:
SELECT
    "code",
    geo(38.73311, -9.138707, "geo_latitude", "geo_longitude") AS "distance"
    FROM "pt_postal" WHERE 1 = 1
        AND "geo_latitude" BETWEEN 38.7241268076 AND 38.7420931924
        AND "geo_longitude" BETWEEN -9.15022289523 AND -9.12719110477
        AND "distance" <= 1
    ORDER BY "distance" ASC
LIMIT 2048;

It returns 1035 records ordered by distance in ~0.05 seconds, however the last record has a "distance" of 1.353 km (which is bigger than the 1 km I defined as the maximum in the last WHERE).
If I drop the following clauses:
AND "geo_latitude" BETWEEN 38.7241268076 AND 38.7420931924
AND "geo_longitude" BETWEEN -9.15022289523 AND -9.12719110477

Now the query takes nearly 6 seconds and returns 2048 records (my LIMIT) ordered by distance. It's supposed take this long, but it should only return the 874 records that have "distance" <= 1.
The EXPLAIN QUERY PLAN for the original query returns:
SEARCH TABLE pt_postal USING INDEX coordinates (geo_latitude>? AND geo_latitude<?)
#(~7500 rows)
USE TEMP B-TREE FOR ORDER BY

And without the coordinate boundaries:
SCAN TABLE pt_postal
#(~500000 rows)
USE TEMP B-TREE FOR ORDER BY

What I Would Like to Do
I think I know why this is happening, SQLite is doing:

*

*use index coordinates to filter out the records outside of the boundaries in the WHERE clauses

*filter those records by the "distance" <= 1 WHERE clause, but distance is still NULL => 0!

*populate "code" and "distance" (by calling the UDF for the first time)

*order by the "distance" (which is populated by now)

*limit the records

What I would like SQLite to do:

*

*use index coordinates to filter out the records outside of the boundaries in the WHERE clauses

*for those records, populate code and distance by calling the UDF

*filter the records by the "distance" <= 1 WHERE clause

*order by the "distance" (without calling the UDF again)

*limit the records

Can anyone explain how I can make SQLite behave (if it's even possible) the way I want it to?

Postscript
Just out of curiosity, I tried to benchmark how much slower calling the UDF twice would be:
SELECT
    "code",
    geo(38.73311, -9.138707, "geo_latitude", "geo_longitude") AS "distance"
    FROM "pt_postal" WHERE 1 = 1
        AND "geo_latitude" BETWEEN 38.7241268076 AND 38.7420931924
        AND "geo_longitude" BETWEEN -9.15022289523 AND -9.12719110477
        AND geo(38.73311, -9.138707, "geo_latitude", "geo_longitude") <= 1
    ORDER BY "distance" ASC
LIMIT 2048;

To my surprise, it still runs in the same ~0.06 seconds - and it still (wrongly!) returns the 1035 records.
Seems like the second geo() call is not even being evaluated... But it should, right?

A: Basically, I was using sprintf() to see what kind of bounding coordinates where being computed, and since I couldn't run the query on any place other than PHP (because of the UDF) I was generating another query with prepared statements. The problem was, I wasn't generating the last bound parameter (the kilometers in the distance <= ? clause) and I was fooled by my sprintf() version.
Guess I shouldn't try to code when I'm sleepy. I'm truly sorry for your wasted time, and thank you all!

Just for the sake of completeness, the following returns (correctly!) 873 records, in ~ 0.04 seconds:
SELECT "code",
    geo(38.73311, -9.138707, "geo_latitude", "geo_longitude") AS "distance"
    FROM "pt_postal" WHERE 1 = 1
        AND "geo_latitude" BETWEEN 38.7241268076 AND 38.7420931924
        AND "geo_longitude" BETWEEN -9.15022289523 AND -9.12719110477
        AND "distance" <= 1
    ORDER BY "distance" ASC
LIMIT 2048;

A: This query (provided by @OMGPonies):
SELECT *
    FROM (
        SELECT
            "code",
            geo(38.73311, -9.138707, "geo_latitude", "geo_longitude") AS "distance"
            FROM "pt_postal" WHERE 1 = 1
                AND "geo_latitude" BETWEEN 38.7241268076 AND 38.7420931924
                AND "geo_longitude" BETWEEN -9.15022289523 AND -9.12719110477
    )
        WHERE "distance" <= 1
    ORDER BY "distance" ASC
LIMIT 2048;

Correctly returns the 873 records, ordered by distance in ~0.07 seconds.
However, I'm still wondering why SQLite doesn't evaluate geo() in the WHERE clause, like MySQL...

A: This also return 873 records, ordered by distance in ~0.04 seconds:
SELECT
    "code",
    geo(38.73311, -9.138707, "geo_latitude", "geo_longitude") AS "distance"
    FROM "pt_postal" WHERE 1 = 1
        AND "geo_latitude" BETWEEN 38.7241268076 AND 38.7420931924
        AND "geo_longitude" BETWEEN -9.15022289523 AND -9.12719110477
    GROUP BY "code"
        HAVING "distance" <= 1
    ORDER BY "distance" ASC
LIMIT 2048;

The reason this page doesn't have a GROUP BY clause is MySQL specific:

A HAVING clause can refer to any column or alias named in a
  select_expr in the SELECT list or in outer subqueries, and to
  aggregate functions. However, the SQL standard requires that HAVING
  must reference only columns in the GROUP BY clause or columns used in
  aggregate functions. To accommodate both standard SQL and the
  MySQL-specific behavior of being able to refer columns in the SELECT
  list, MySQL 5.0.2 and up permit HAVING to refer to columns in the
  SELECT list, columns in the GROUP BY clause, columns in outer
  subqueries, and to aggregate functions.

If no primary / unique key is available, the following hack also works (albeit a bit slower - ~0.16 seconds):
SELECT
    "code",
    geo(38.73311, -9.138707, "geo_latitude", "geo_longitude") AS "distance"
    FROM "pt_postal" WHERE 1 = 1
        AND "geo_latitude" BETWEEN 38.7241268076 AND 38.7420931924
        AND "geo_longitude" BETWEEN -9.15022289523 AND -9.12719110477
    GROUP BY _ROWID_
        HAVING "distance" <= 1
    ORDER BY "distance" ASC
LIMIT 2048;

A: I cannot tell from the documentation whether or not sqliteCreateFunction defines an aggregate, like SUM, or a scalar, like sqrt.  Aggregate functions cannot be referenced in a WHERE clause; HAVING is required.
Per the SQLite UDF documentation, you need to know if only xFunc is populated, or if xStep and xFinal are.  Those are the pointers SQLite uses to know the kind of function you're defining, and thus whether or not to honor it in a WHERE clause.


text:
Q: Java define class members by a final array I have an array which contains some definitions which are used in the program:
final String[] names = new String[]{"familyNames", "givenNames", "middleNames", "nickNames", "additionalNames", ..., ..., ..., ...}; // Lots of definitions

And now I need to create a new class with these definitions:
public class Person {
  final private String id;
  final private String familyNames;
  final private String givenNames;
  final private String middleNames;
  final private String nickNames;
  final private String additionalNames;
  ...
  ...
  ...
  ...
  ... // Very long list
}

Is it possible to define this class by that array? Something like:
public class Person {
  final private String id;
  final private .... names...
  public int compareTo(...) {...}
}

This Person class should support sort by multi fields, e.g. first by given name, then by family name, etc.

A: To avoid a long list of class member variables, you may use a map of attributes as mentioned here:
Map<String,String> attributesMap = new HashMap<String,String>();

"familyNames", "givenNames", "middleNames", "nickNames", "additionalNames", etc should be used as keys.

A: You could define it in a class Person by taking the attributesMap in a static factory method.
public class Person {
  final private String id;
  final private Name name;
  ...
  public static Person fromAttributesMap(Map<String, String> attributesMap) {
      Person person = new Person();
      person.id = attributesMap.get("id");
      ...
  }
}

But do keep related attributes together in their own classes. For eg; you could club familyName, givenName, nickName, etc. in a Name class:
class Name {
  final private String familyName;
  final private String givenName;
  final private String middleName;
}

I'm not in full agreement to the map approach. Infact, there is a code smell around the same - it is called "Primitive obsession"
You could also sort a List<Person>, for example by the family name:
public static Comparator<Person> FamilyNameComparator
                      = new Comparator<Person>() {

    public int compare(Person person1, Person person2) {

      //ascending order
      return person1.getFamilyName().compareTo(person2.getFamilyName());
    }

};

and then calling:
Arrays.sort(persons, Person.FamilyNameComparator);

You could also sort by multiple fields. Take a look at this question on SO.


text:
Q: Connecting to Database From EC2 to Another Database I am new to AWS. I have created a Spring Web app and a database(MySql) in a EC2 instance (which is working fine). In my web application, I am connecting to a database that is in another server to read and write to this other database.
So, This database is not a MYSQL database. The network admin has opened up the port 3306 for this EC2 instance to access the database from EC2. So, the problem is in my end.
I have opened up the 3306 port (My SQL) in the security group. But when I telnet the port, the connection fails. I can see that in EC2 127.0.0.1:3306 is listening just like 80.

*

*So my question is, what am I missing here?

*What are the options to trouble shoot this issue?

*Do I have to authorize the tomcat user or Bitnami user to access ports to connect to an outer database?
Anything relevant to this issue would be helpful
thanks in advance :)

A: If its listening on 127.0.0.1:3306 it is listening locally only and is not accessible form outside. If you change that to 0.0.0.0:3306 make sure your security groups are configured to only allow access to your database from your own instances. Dont just "open up 3306", open up 3306 only to the same security group or the security group your application spring server is in.
You say its not a mysql db, yet it uses mysql default port 3306. Thats a bit confusing. If its mysql you need to change the bind-address in my.cnf.

A: I think you need to give permissions to user like "dbuser@192.168.1.5" where IP is the IP from dbuser is trying to access the database.
Krish

A: It seems, This question is stupid, But then, This was a real problem. So, I will summarize what I learned and answer the question. IP Addresses are categorized into types, minimize the exhaustion of IP addresses (That is why we moved from IPV4 to IPV6). Anyways, there are Public IP addresses and Private IP addresses. Private IP addresses are for local networks and Public IP addresses are for accessing through the internet. So, What I did was, I opened up the port for the connecting Servers public IP address (It turned out to be PORT is not 3306, It was 2001 in my case, You only have to do it through Security Groups because my default all the outbound ports are open for EC2) and also, from the other end TCT PORT was opened for EC2. To do that I had to create a Elastic IP address for my EC2 (What Elastic IP address do is, it assigns a Public IP address that will not change when EC2 get restarted or changed). Then it should connect, For me it did not work till I created the Elastic IP


text:
Q: How can one's yearly reputation be larger than their total reputation? When looking at the reputation leagues for MSE we can see that Teresa Dietrich is ranked 25th when it comes to yearly reputation gain.

We also see that her reputation gain is bigger than her current reputation.
The first suspect in this case is of course caching. So to check that I went to see her current reputation on her profile. That matches what was listed in the league under total reputation. Another culprit could of course be caching of the total gain, so I went to check if she received any downvotes today. Her public reputation history shows no entries since December 2nd.

The last thing could of course be that she downvoted something. That scenario is also highly unlikely as she was last seen 18 hours ago according to her profile. That was yesterday in UTC time, so the script had since run at UTC midnight.
Are there any other possibilities or is this a genuine bug?
P.s. there are also other users with similar things (even larger differences), but I decided to use an SE employee as an example.


text:
Q: Error Attempt to de-reference a null object in component class I realize there are a lot of 'de-reference a null object' questions out there and I've damn near read them all, but I still can't figure out why the Account.Id is null in my code. I've tried instantiating the Account and using if statements to check to see if there are nulls, but nothing is working for me.
The following is my controller:
/*
    *This is a controller class for a contact search within all of Salesforce.
    *It brings results back to the page in real time.
    *There is visualforce page that goes with this controller - ContactSearchPage -
    *This page could be transformed into a visualforce component and used within another visualforce page.
    *This controller, page, or component can be changed to use any object in salesforce or multiple objects if needed.
    *It can be customized to fit any search application that might be required.

 */
public with sharing virtual class AccountSearchController {

    // the soql without the order and limit
    private String soql {get;set;}
    // the collection of contacts to display
    public List<Account> accounts {get;set;}
    public CLSearchDataClass aData {
        get{
            return aData;
        }
        set;
    }
    public Boolean isSelected {
        get {if (isSelected == null)
            isSelected = false;
            return isSelected;
        }
        set;
    }
    //Account account;
    /*public Account getAccount() {
        if(account == null)
            account = [select id, name, site from Account
                       where id = :ApexPages.currentPage().getParameters().get('id')];
        return account;
    }*/
    public Account account{
        get{
            return account;
        }
        set;
    }
    public String acctId {
        get {
            if (acctId == null) acctId = 'null';
            return acctId;
        }
        set{
        }
    }

    // the current sort direction. defaults to asc
    public String sortDir {
        get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
        set;
    }

    // the current field to sort by. defaults to last name
    public String sortField {
        get  { if (sortField == null) {sortField = 'name'; } return sortField;  }
        set;
    }

    // format the soql for display on the visualforce page
    public String debugSoql {
        get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 10'; }
        set;
    }

    // init the controller and display some sample data when the page loads
    public AccountSearchController() {
        soql = 'select Id, name, Industry, Zip_Postal_Code__c, Owner.id, parent.name, parent.id, Country_Code__c from account where name != null';
        runQuery();
    }

    // toggles the sorting of query from asc<-->desc
    public void toggleSort() {
        // simply toggle the direction
        sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
        // run the query again
        runQuery();
    }
    // runs the actual query
    public void runQuery() {
        try {
            accounts = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 10');
        } catch (Exception e) {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
            System.debug('Error ' + e);
        }
    }

    // runs the search with parameters passed via Javascript
    public PageReference runSearchA() {
        //Account
        String acctName = Apexpages.currentPage().getParameters().get('acctname');
        //String zipCode = Apexpages.currentPage().getParameters().get('zipCode');
        String PAcctName = Apexpages.currentPage().getParameters().get('PAcctName');
        String acctIndustry = Apexpages.currentPage().getParameters().get('acctIndustry');
        String acctCountry = Apexpages.currentPage().getParameters().get('acctCountry');
        //ID AcctId = Apexpages.currentPage().getParameters().get('AcctId');

        //Account
        soql = 'select Id, name, Industry, Zip_Postal_Code__c, Owner.id, parent.name, parent.id, Country_Code__c from account where name != null';
        if (!acctName.equals(''))
            soql += ' and name LIKE \''+String.escapeSingleQuotes(acctName)+'%\'';
        //if (!zipCode.equals(''))
        //soql += ' and Zip_Postal_Code__c LIKE \''+String.escapeSingleQuotes(zipCode)+'%\'';
        if (!PAcctName.equals(''))
            soql += ' and parent.name LIKE \''+String.escapeSingleQuotes(PAcctName)+'%\'';
        if (!acctIndustry.equals(''))
            soql += ' and Industry LIKE \''+acctIndustry+'\'';
        if (!acctCountry.equals(''))
            soql += ' and Country_Code__c LIKE \''+acctCountry+'\'';

        // run the query again
        runQuery();

        return null;
    }

    // use apex describe to build the picklist values
    public List<String> industries {
        get {
            if (industries == null) {
                industries = new List<String>();
                Schema.DescribeFieldResult field = Schema.Account.Industry.getDescribe();

                for (Schema.PicklistEntry f : field.getPicklistValues())
                    industries.add(f.getValue());
            }
            return industries;
        }
        set;
    }
    public List<String> accCountry {
        get {
            if (accCountry == null) {
                accCountry = new List<String>();
                schema.DescribeFieldResult field = Schema.Account.Country_Code__c.getDescribe();
                for (Schema.PicklistEntry f : field.getPicklistValues())
                    accCountry.add(f.getValue());
            }
            return accCountry;
        }
        set;
    }

    public void selectAcct(){
        if(isSelected = true){
            aData.acctId = acctId; **<-- This is where it's saying the null reference is**
            system.debug(aData.acctId);
        }
    }

    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();
        if(accounts.size() > 0){
            for (Account acc : accounts)
            {
                if(acc.Id != null){
                    options.add(new SelectOption(acc.Id, acc.Name));
                }
            }
        }
        return options;
    }
}

The following is my VisualForcePage:
<apex:component controller="AccountSearchController" >
    <apex:attribute type="CLSearchDataClass" name="accData" required="true" description="Account Data" assignTo="{!aData}"/>
  <apex:pageMessages id="errors" />

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <apex:actionFunction name="searchServer" action="{!runSearchA}" rerender="resultsA,debug,errors">

          <apex:param name="acctName" value="" />

          <apex:param name="PAcctName" value="" />
          <apex:param name="acctIndustry" value="" />
          <apex:param name="acctCountry" value="" />
      </apex:actionFunction>

        Account Name

        <input type="text" id="acctName" onkeyup="doAccountSearch();"/>

        Parent Account

        <input type="text" id="PAcctName" onkeyup="doAccountSearch();"/>

        Industries

          <select id="acctIndustry" onchange="doAccountSearch();">
            <option value=""></option>
            <apex:repeat value="{!industries}" var="tech">
              <option value="{!tech}">{!tech}</option>
            </apex:repeat>
          </select>

        Country

          <select id="acctCountry" onchange="doAccountSearch();">
            <option value=""></option>
            <apex:repeat value="{!accCountry}" var="country">
              <option value="{!country}">{!country}</option>
            </apex:repeat>
          </select>

      </apex:pageBlock>

    <apex:pageBlock mode="edit" id="resultsA">

        <apex:pageBlockTable value="{!accounts}" var="account" align="top">
            <apex:column >
                <apex:inputCheckbox id="selectAccountRow" value="{!isSelected}" onclick="return checkone(this,'{!account.id}')">
                    <apex:param value="{!account.id}"/>
                    <apex:inputHidden id="acctId" value="{!acctId}"/>
                    <apex:actionSupport event="onclick" action="{!selectAcct}" />
                </apex:inputCheckbox>

            </apex:column>
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Account" action="{!toggleSort}" rerender="resultsA,debug" >
                        <apex:param name="sortField" value="Name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                    <a href="/{!account.Id}"
                       id="{!account.Id}"
                       onblur="LookupHoverDetail.getHover('{!account.Id}').hide();"
                       onfocus="LookupHoverDetail.getHover('{!account.Id}', '/{!account.Id}/m?retURL=%2F{!account.Id}&isAjaxRequest=1').show();"
                       onmouseout="LookupHoverDetail.getHover('{!account.Id}').hide();"
                       onmouseover="LookupHoverDetail.getHover('{!account.Id}', '/{!account.Id}/m?retURL=%2F{!account.Id}&isAjaxRequest=1').show();">
                       {!account.Name}

            </apex:column>
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Country" action="{!toggleSort}" rerender="resultsA,debug">
                        <apex:param name="sortField" value="Country_Code__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!account.Country_Code__c}"/>
            </apex:column>
            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Industry" action="{!toggleSort}" rerender="resultsA,debug">
                        <apex:param name="sortField" value="industry" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!account.industry}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Parent Account" action="{!toggleSort}" rerender="resultsA,debug">
                        <apex:param name="sortField" value="parent.name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!account.parent.name}"/>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>

</apex:component>

It's saying the null reference is in the public void selectAcct()
Please let me know if there are any questions or if I need to clarify anything.

A: You have a lot of problems in your code, but to answer the first question: you never initialized aData, so it is null.
// init the controller and display some sample data when the page loads
  public AccountSearchController() {
    aData = new CLSearchDataClass(); // Initialize here
    soql = 'select Id, name, Industry, Zip_Postal_Code__c, Owner.id, parent.name, parent.id, Country_Code__c from account where name != null';
    runQuery();
  }

Secondly, you're "lazy-loading" way too much. Only use the technique if you don't know if you need the data (it appears you always do, so you may as well initialize everything in the constructor).
This line here will always execute:
  if(isSelected = true){

Using a single equals sign is an assignment, which results in isSelected always being set to true, and the branch is always executed (because the return value is true). Use == instead.
For some minor optimizations:
    if(accounts.size() > 0){
        for (Account acc : accounts)
        {
            if(acc.Id != null){
            options.add(new SelectOption(acc.Id, acc.Name));
            }
        }
    }

It's legal to iterate over an empty list, and checking for empty beforehand just wastes CPU time and makes code more verbose. Also, since acc is coming from a query, Id will never be null.
    for (Account acc : accounts) {
        options.add(new SelectOption(acc.Id, acc.Name));
    }

public PageReference runSearchA() {
    ...
    return null;
}

If you're never going to redirect, just use void. Returning a PageReference suggests that you could redirect, which is misleading. Doubly so if someone is using the Summary view of your class.


text:
Q: Firestore | Why do all where filters have to be on the same field? Apparently Firestore does not not support queries with range filters on different fields, as described here:
My question is, WHY?
HOW can I query by time and location for example:
Firestore.instance.collection('events')
      .where("eventTime", isGreaterThanOrEqualTo: DateTime.now().millisecondsSinceEpoch)
      .where("eventLocation", isGreaterThan: lesserGeopoint)
      .where("eventLocation", isLessThan: greaterGeopoint)
      .where("eventStatus", isEqualTo: "created")
      .orderBy('eventLocation', descending: false)
      .orderBy('eventTime')
      .snapshots(),

(Example from Flutter App written in Dart)
I receive the following Error:

All where filters other than whereEqualTo() must be on the same field. But you have filters on 'eventTime' and 'eventLocation', null)

I don't understand how this is not supported and how to solve queries like this?
Any help is appreciated :-)
Thanks,
Michael

A: Cloud Firestore gives a strong performance guarantee for any read operations it allows: the time a read operation takes depends on the number of items you're reading, not on the number of items in the collection. This is a quite unique performance guarantee, since it means that your queries will take the same amount of time when you have 1 million users as when you have 1 billion users.
Firestore only offers query operations for which it can maintain this performance guarantee. This is the main reason for the limitations you may find in the Firestore query API.
To work around the limit, you'll typically perform the filtering, and ordering on the primary field in the query, and then sort on the secondary field client-side
If you'd like to learn more about Firestore's query capabilities and limitations, I highly recommend watching How do queries work in Cloud Firestore? and the rest of the Get to Know Cloud Firestore video series.
Also see:

*

*Firestore order by two fields

*Firestore order by two fields in one query

A: Have you had a read through the page on indexes, which describes how some compound queries can be supported, and how composite indexes can be created and used?


text:
Q: Jekyll generates empty files I recently pulled a copy of my github pages site to a new Windows machine and when I run jekyll all the files get created in _site but any that use a layout are empty.
I have tried jekyll build --layouts C:\Path\to\site\_layouts which still resulted in empty files.
Its compiling SASS no problem and copying the files with no front matter. Its generating empty files for all the posts and drafts so its seeing _posts and _drafts which makes me think it should be able to see _layouts but its not...
anyone come across this issue?


text:
Q: How can I solve Windows PPTP VPN issues? I'm having persistent problems with Windows PPTP VPN connections. The VPN appears up whilst the tunnel won't transfer traffic (ping to a remote IP within the VPN works for a while, and then fails). The client receives routing information via DHCP. When the connection fails, the routing table is still correct so I don't think it's a routing problem.
My internet connection is via an ADSL2 line.
There's software to deal with PPTP problems, like TunnelRat, but I don't want to install v1.1 of the .NET framework and I'd rather get to the bottom of the problem (I have multiple VPN connections and some are more unreliable than others).
What can I do to get to the bottom of this?
Alternatively, what can I do to keep the connection alive?

A: Windows 7 has a built in Keepalive function.  You can adjust the frequency to be faster or slower depending on your server.  Windows describes the keep alive here: http://support.microsoft.com/kb/193841
I would say that persistence of the connection largely depends on the stability of your server.  Temporary disruptions can close the connection and typically, windows will try to reconnect.

A:
ping to a remote IP works for a while and then fails

I assume this is an IP address on the VPN network?
If not, then I wonder if your problem could have something to do with the option "Use default gateway on remote network" of the Windows VPN client. If enabled, then all your network/internet traffic is routed through the VPN server. For security, it's perfectly fine to keep that option enabled, because as far as I understand, connecting the VPN should then also clear any known routes to any remote IP, and try to establish a new route through the VPN server. It's up to your system administrator's security policy if that VPN server allows for routing traffic to external addresses.
So, if that remote IP is not on the VPN network itself, then I wonder if somehow your client temporarily remembers the old route (which does not use the VPN)? That would make the ping work until a new route through the VPN is used.
(On Windows XP see the properties of your VPN network, select tabsheet "Networking", select "Internet Protocol (TCP/IP)", click "Properties", and finally click "Advanced" to find that option, which defaults to on. On a Mac, the Advanced button shows an option "Send all traffic over VPN connection", which defaults to off.)


text:
Q: unsigned long vm_pgoff in vm_area_struct I was reading the memory management chapter of Linux Device drivers and i came accross the vm_area_struct .The structure has an offfset field namely  unsigned long vm_pgoff  .
I checked the comment for the member as  /* Offset (within vm_file) in PAGE_SIZE units, *not* PAGE_CACHE_SIZE */ . I'm not quite sure whether it is  the offset within the vma region or the offset in side the memory mapped file .
And i have seen driver's mmap implementation code to have the following line  to  recalculate the offset again by shifting the member by the PAGE_SHIFT bits .
unsigned long off = vma->vm_pgoff << PAGE_SHIFT;

I'm not able to understand the same and any help on this would be great .

A: According to the book Linux Device Drivers, 3rd edition,

unsigned long vm_pgoff;
The offset of the area in the file, in pages. When a file or device is mapped, this is the file position of the first page mapped in this area.

Thus, it is the offset, measured in number of pages, in the file/device. Thus, the first page in the vm_area is the page "vm_pgoff" of the file/device.
The file mm_types.h says the same.

A: In the source code (file mm.h) of function
 static inline unsigned long do_mmap(struct file *file, unsigned long addr,
unsigned long len, unsigned long prot,
unsigned long flag, unsigned long offset)

I have found expression offset >> PAGE_SHIFT (right shift) that is used as pgoff parameter of do_mmap_pgoff, so it is obvious, to "restore" original offset value we need to do Left Shift with the same PAGE_SHIFT (as function lowmem_page_address do that).


text:
Q: Best way to set the size of UIViews size in iPhone application (so everything looks good on both Retina and older display) I have the following problem. My application has a tab bar at the bottom and a simple TextView above. In order to fit well TextView above tab bar I had to resize it (I did it through Interface Builder) - I just set height to 401px (usually I hate to do such things).
Then I have tested application on the simulator, to my surprise everything looked o.k. on both standard iPhone display and Retina display. Since I do not have an iPhone I am wondering if everything would look good on the real device as well.
So, my question is: how to set the UIView size so it follows best practices and, what is more important, GUI looks good on both Retina and older display.
BTW: I know how to deal with icons and graphics to make them look good on Retina and older display, I've read all the relevant stackoverflow posts on the subject :)

A: Size is same on both standard and retina display. It's measured in points. Number of pixels depends on display density.
Pixel != point.
Look at UIScreen scale property. For standard screen it contains 1.0 and 2.0 for retina (iPhone 4). It can contain different values, even not integers.
If you set size UIImageView size to 100x100, it will have same physical size on standard and retina display. But on retina, it will show you much nicer image, because 100 points contains more pixels.

A: The units in Interface Builder are now interpreted as points not pixels. Therefore it will look the same on both types of displays. On old displays 1 point equates to 1 pixel. On Retina displays 1 point equates to 2 pixels.


text:
Q: JQuery & CSS on-screen keyboard not functioning on a remake of HTML EDIT - Here's what I have: https://codepen.io/anon/pen/wZQjQy
 Here's the original: https://codepen.io/anon/pen/YMRLBN
(had to put it on codepen, somehow adding a snippet here doesn't link the css)
I basically copy-pasted a customized on-screen keyboard which worked flawlessly (mostly) but after putting it in a different HTML, it's not working anymore.
keyboard I copied
This is the keyboard, all I really did is replace the characters with Cyrillic and remove the caps, tab, shift and all the "on" spans, since all I really need are the buttons and letters, all capitalized. Now, this worked nicely on my previous build for a page, but the page was inherently flawed by my endless barrage of copy-pasted material and became unfixable at some point, so I started over.
Using some more copy-paste but with Bootstrap now, I built something at least a quarter percent better than my previous mess. But when I imported the on-screen keyboard from the last HTML file, it's now not showing any characters, basically just not working. I really don't know what's going on.
the CSS (I included this because maybe the text is actually being written but just not being shown due to a messy CSS?)
$(function() {
  var $write = $('#write'),
    shift = false,
    capslock = false;

  $('#keyboard li').click(function() {
    var $this = $(this),
      character = $this.html(); // If it's a lowercase letter, nothing happens to this variable

    // Shift keys
    if ($this.hasClass('left-shift') || $this.hasClass('right-shift')) {
      $('.letter').toggleClass('uppercase');
      $('.symbol span').toggle();

      shift = (shift === true) ? false : true;
      capslock = false;
      return false;
    }

    // Caps lock
    if ($this.hasClass('capslock')) {
      $('.letter').toggleClass('uppercase');
      capslock = true;
      return false;
    }

    // Delete
    if ($this.hasClass('delete')) {
      var html = $write.html();

      $write.html(html.substr(0, html.length - 1));
      return false;
    }

    // Special characters
    if ($this.hasClass('symbol')) character = $('span:visible', $this).html();
    if ($this.hasClass('space')) character = ' ';
    if ($this.hasClass('tab')) character = "\t";
    if ($this.hasClass('return')) character = "\n";

    // Uppercase letter
    if ($this.hasClass('uppercase')) character = character.toUpperCase();

    // Remove shift once a key is clicked.
    if (shift === true) {
      $('.symbol span').toggle();
      if (capslock === false) $('.letter').toggleClass('uppercase');

      shift = false;
    }

    // Add the character
    $write.html($write.html() + character);
  });
});

html {
  width: 100%;
  height: auto;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: auto;
}

.maincontainer {
  background-image: url(b.png);
  background-repeat: repeat-y;
  background-position: right;
}

/*head*/

.nav-text {
  vertical-align: middle;
  color: white;
}

.row {
  padding: 15px;
  display: flex;
  justify-content: center;
}

.back-button {
  height: 100%;
}

#backer {
  float: left;
  width: auto;
}

.red {
  background-color: darkred;
}

.header {
  text-align: center;
  color: white;
  font-size: 25px;
  float: left;
  width: 90%;
}

.uk-icon {
  color: white;
}

/*main*/

/* Style the tab */

.tab {
  width: 100%;
  overflow: hidden;
}

/* Style the buttons inside the tab */

.tab button {
  width: 50%;
  background-color: inherit;
  float: left;
  border: none;
  background-color: darkred;
  color: white;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  transition: 0.3s;
  font-size: 17px;
}

#tabone {
  border-top-left-radius: 5px;
  border-right: 1px solid white;
}

#tabtwo {
  border-top-right-radius: 5px;
  border-left: 1px solid white;
}

/* Change background color of buttons on hover */

.tab button:hover {
  background-color: rgb(80, 3, 3);
}

/* Create an active/current tablink class */

.tab button.active {
  background-color: rgb(180, 15, 15);
}

/* Style the tab content */

.tabcontent {
  display: none;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-top: none;
  background-color: white;
}

#London {
  text-align: center;
}

#searchbutton {
  background-color: darkred;
  color: white;
  border: 0;
  border-radius: 5px;
  margin-bottom: 15px;
  padding-right: 20px;
}

#write {
  width: 90%;
  height: 300px;
  background: url(https://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Soyombo_red.svg/300px-Soyombo_red.svg.png) no-repeat scroll 50px 40px;
  background-size: 80PX;
  padding-left: 50px;
  border-radius: 5%;
  border: 1px solid black;
  margin-bottom: 20px;
  margin-top: 20px;
  text-align: center;
  font-size: 10vh;
}

#London>.container-fluid>h3 {
  margin-top: 5%;
  font-size: 4vh;
}

#keyboard {
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

#keyboard li {
  font-size: 30px;
  display: inline-block;
  margin: 0 5px 5px 0;
  width: 5%;
  padding: 0;
  height: 70px;
  line-height: 70px;
  text-align: center;
  background: #fff;
  border: 1px solid black;
  -moz-border-radius: 5px;
  -webkit-border-radius: 7PX;
  ;
}

#keyboard .delete {
  width: 120px;
}

.lastitem {
  margin-right: 0;
}

.uppercase {
  text-transform: uppercase;
}

.on {
  display: none;
}

#keyboard li:hover {
  position: relative;
  top: 1px;
  left: 1px;
  border-color: #e5e5e5;
  cursor: pointer;
}

#container.ul {
  margin: auto;
  float: center;
}

#container-x {
  width: 50%;
  margin: auto;
}

input[type=submit] {
  background: url(http://www.clker.com/cliparts/Y/3/d/w/R/r/search-icon-white-hi.png) no-repeat;
  background-size: 25%;
  background-position-y: 50%;
  background-position-x: 10%;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <title>
    Payment
  </title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/simple-keyboard@latest/build/css/index.css">

  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.1.3/css/uikit.min.css" />

  <link rel="stylesheet" href="style.css" />

            Эхлэх

            Тээврийн хэрэгслийн торгууль төлөх

          <button uk-icon="bus" class="tablinks" id="tabone" onclick="openTab(event, 'London')">ТЭЭВРИЙН ХЭРЭГСЭЛ</button>
          <button class="tablinks" id="tabtwo" onclick="openTab(event, 'Paris')">ЖОЛООНЫ ҮНЭМЛЭХ</button>

АВТОМАШИНЫ УЛСЫН ДУГААР

              <input type="text" id="write" maxlength="7" placeholder="UBA 0000">

            <input type="submit" value="Хайх" id="searchbutton" class="uk-button uk-button-default" href="#"></input>

1

2

3

4

5

6

7

8

9

0

Ф

Ц

У

Ж

Э

Н

Г

Ш

Ү

З

К

Ъ

Й

Ы

Б

Ө

А

Х

Р

О

Л

Д

П

Я

Ч

Е

Ё

С

М

И

Т

Ь

В

Ю

Paris

When I click on a li element from the keyboard, it's supposed to call that JS, making magic happen. It ain't doing nothing.
My best guess is the "tabs" not being active on form load, since the only real difference is I used bootstrap tabs on the last one but on this one I copied the W3 schools one.

A: Change your input area with ID "write" into a textarea.
Replace this line:
<input type="text" required="" id="write" maxlength="7" placeholder="UBA 0000">

with this:
<textarea id="write" rows="6" cols="60" placeholder="UBA 0000"></textarea>

Code Pen shows the changed code.


text:
Q: Nativescript app size is growing each time when a new screen is added I have 10 xml files, and 23 js files, and 1 css file
4 font styles, 25 10kb images. Thats all
my app folder size is 2.77 mb
these are the dependencies
{
  "nativescript": {
    "id": "org.nativescript.higherstudy",
    "tns-android": {
      "version": "6.3.0"
    },
    "tns-ios": {
      "version": "6.3.0"
    }
  },
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "repository": "<fill-your-repository-here>",
  "dependencies": {
    "@nativescript/theme": "~2.2.1",
    "@nstudio/nativescript-floatingactionbutton": "^1.1.0",
    "@nstudio/nativescript-loading-indicator": "^2.0.0",
    "nativescript-carousel": "^6.1.1",
    "nativescript-pdf-view": "^2.1.0",
    "nativescript-permissions": "^1.3.8",
    "nativescript-phone": "^1.4.1",
    "nativescript-toast": "^2.0.0",
    "nativescript-ui-listview": "^8.0.1",
    "tns-core-modules": "~6.3.0"
  },
  "devDependencies": {
    "nativescript-dev-webpack": "~1.4.0"
  },
  "gitHead": "94f487c5279f7abc2cc61cb48e357d1756865a40",
  "readme": "NativeScript Application"
}

when i build the app on Sidekick the size of apk file is 43,873kb which is 43mb
each time when i add xml js file the size was growing with a range of 5 to 8 mb in size.
is it time to stop using nativescript who will download my simple app with big size.
the problem video link https://youtu.be/FtcbagvDqR8


text:
Q: Can we change the view for AG grid in mobile devices I have been working on ag grid since quite long time. Currently we got a requirement to change the grid display for mobile devices (for example width <480 px).
Does Ag grid support/convert its view for small devices? If yes, could you provide the relevant link for the same?

A: AgGrid adjust by itself. The default themes is capable of dynamic resizing itself.
You can use params.api.sizeColumnsToFit() in either on onGridReady or onFirstDataRendered. This will do dynamic resizing with scrolls.
However i would suggest to create a seperate view for mobile, display only relevant colums which makes sense in mobile view.
var column = [{ field: "Col1" }, { field: "Col2", }, { field: "Col3", }, { field: "Col4", }, { field: "Col5", }];

    var mobileColumn = [{ field: "Col1" }, { field: "Col2", }, { field: "Col3", }];

    window.addEventListener('resize', function () {
        setTimeout(function () {
            if (window.innerWidth <= 480) {
                gridOptions.setColumnDefs(mobileColumn);
                params.api.sizeColumnsToFit();
            }
        })
    })

dynamically set columns for mobile view


text:
Q: Books from Esri Press Which books from Esri Press can you recommend?

A:
This question has been converted to Community Wiki and wiki locked
  because it is an example of a question that seeks a list of answers
  and appears to be popular enough to protect it from closure.  It
  should be treated as a special case and should not be viewed as the
  type of question that is encouraged on this, or any Stack Exchange
  site, but if you wish to contribute more content to it then feel free
  to do so by editing this answer.

*

*Getting to Know ArcGIS Desktop: for learning the BASICS of GIS

*Designing Geodatabases: Case Studies in GIS Data Modeling :This book provides a good introduction of steps and principles in designing geodatabases

*A to Z GIS: An Illustrated Dictionary of Geographic Information Systems: AN ILLUSTRATED DICTIONARY OF GEOGEPHIC INFORMATION SYSTEMS.

*The ESRI Guide to GIS Analysis Volume 1: Geographic Patterns & Relationships

*The ESRI Guide to GIS Analysis: Volume 2: Spatial Measurements and Statistics
:An extremely basic, starting point for any would-be GIS Analyst

*Designing Better Maps is great resource, even if you don't use ESRI products.

*Modeling Our World was helpful for me as well, especially at the begining of my adventure with GIS. It seems this book has been updated, however I haven't had a chance to see 2nd edition.

*Getting to Know ArcObjects An awesome book that I still reference regularly.  Need something of a similar standard, but updated around .NET instead of VBA. (VBA is being deprecated)

*Lining Up Data in ArcGIS: A Guide to Map  and your going to need to know about projections.

*Semiology of Graphics: Diagrams, Networks, Maps is excellent, and is the most popular non-GIS book published by ESRI.

*GIS for Decision Support and Public Policy Making is a must-read for anyone interested in GIS for local governments.  The authors go over specific case studies for 27 jurisdictions and shows the specific ROI they experienced from their GIS projects.

*Fun with GPS: on the lighter side, it has lots of ideas for doing GPS with kids (and kid-minded adults)

*Python Scripting for ArcGIS: Python Scripting for ArcGIS is a guide for experienced users of ArcGIS Desktop to get started with Python scripting without needing previous programming experience.


text:
Q: UIAlertView Button Event I have a question on Xamarin.Forms, I'm trying to navigate back page from detail page when UIAlertView pressed OK. But I couldn't do it. Here is my code;
{
    UIAlertView alert = new UIAlertView();
    alert.Title = "Warning";
    alert.AddButton("OK");
    alert.Message = "Payment not found!";
    alert.Clicked += ButtonClicked;
    alert.Show();
    return paymentList;
 }

 private void ButtonClicked(object sender, UIButtonEventArgs e)
 {
     //???
 }

Thanks.

A: UIAleartView does not have specific events for Buttons.
But, you can access the index of the button pressed from the UIButtonEventArgs (ex: e.ButtonIndex) verify what button is pressed

A: First of all, Xamarin.Forms doesn't have UIAlertView class (Inside the PCL project).
You can display alert there by calling asynchronous DisplayAlert method inside the Page instance. For example:
public class PaymentPage
{
    ...

    async void OnNoPaymentMethodDetected(object sender, EventArgs e)
    {
        await DisplayAlert("Error", "You have no payment method registered", "Okay");
        await Navigation.PopAsync(true);
    }
    ...
}

Note: your Pop Navigation method depends on your Push Navigation method. For instance, if you've used PushModalAsync(page2), then you have to use PopModalAsync() in page2 to move back, otherwise PopAsync() will cause an error.

If you want to have similar alert in iOS-specific project, you have to use the next code:
var controller = UIAlertController.Create("Error", "No payment method detected", UIAlertControllerStyle.Alert);

controller.AddAction(UIAlertAction.Create("Okay", UIAlertActionStyle.Cancel, (sender) =>
{
    NavigationController.PopViewController(true);
}));

ShowDetailViewController(controller, null);


text:
Q: Including php file in directory above WordPress installation I'm having trouble including an external .php file into my WordPress theme.
WordPress installation URL: mydomainname.com/blog
PHP File URL: mydomainname.com/testing/assets/inc/analytics.php
I'm trying to include this PHP file from within header.php of my WordPress theme.
My line of code looks like this:
<?php include ( site_url() . '/testing/assets/inc/analytics.php' );  ?>

I've also tried variations of PATH and ABSPATH but I can't get it to work. Interestingly, when I change the include to require_once it breaks the site.
Please help me figure out what exactly I'm doing wrong. Thank you!

A: You need to use file paths, not urls, so if mydomainname.com/blog is at /home/account/public_html/blog then your file is /home/account/public_html/testing/assets/inc/analytics.php.
I would recommend putting it into a one-off plugin though.

A: how about this one:
$path = dirname( ABSPATH );
include( $path . "/testing/assets/inc/analytics.php" );


text:
Q: Emacs Org-mode insert multiple images When I use org-mode in emacs, I usually do [[./figure1.png]] to insert a figure. But now I have about 200 figures and I need to visually check them all. I might be able to do this by using multiple cursors but I am wondering if there's any better way to do this. I am hoping like [[./figure*.png]] to insert all figures. Thanks,

A: You can use babel with raw output:
#+name: including-them-all
#+begin_src sh :results raw
  for i in figure*.png; do
      echo "[[file:$i]]"
  done
#+end_src

a C-cC-c on this will run the small shell script, and use its result as it was wrotten in org, and as such it will include you images.