text:
Q: Vuetify Container Won't Fill Height Problem: My <v-container> component doesn't always go to the height of the application. I have tried using the fill-height property, setting height: 100%;, setting height: 100vh;, even tried using max-height. I can't seem to get the results that I want!
Goal: I want my container to always span the entire height of the window. My theme on the application changes between light/dark. This changes the background color, which should always cover the entire height and width of the application view port.

Code for App.vue:
<template>
  <v-app>
    <main>
      <v-container
        fluid
        fill-height
        id="app"
        tag="div"
        style="height: 100vh; max-height: 100%;"
        :class="theme"
      >
        <Toolbar color="primary" />
        <transition
          name="routerAnimation"
          enter-active-class="animated faster fadeIn"
        >
          <router-view></router-view>
        </transition>
        <v-snackbar
          :color="alertColor"
          class="animated faster heartBeat"
          :dark="isDark"
          v-model="alert"
          :multi-line="mode === 'multi-line'"
          :timeout="alertTimeout"
          top
          :vertical="mode === 'vertical'"
        >
          <v-icon class="pr-4">{{ getAlertIcon() }}</v-icon>
          {{ alertMessage }}
          <v-btn :dark="isDark" icon @click="toggleAlert(false)">
            <v-icon>close</v-icon>
          </v-btn>
        </v-snackbar>
      </v-container>
    </main>
  </v-app>
</template>

<script>
import Toolbar from "./components/Toolbar";
import { themeMixin } from "./mixins/themeMixin.js";
import { alertMixin } from "./mixins/alertMixin";
import { authMixin } from "./mixins/authMixin";
import { socketMixin } from "./mixins/socketMixin";
import { TokenService } from "./services/tokenService";
import { ThemeService } from "./services/themeService";
import { UserService } from "./services/userService";
import { cordMixin } from "./mixins/cordMixin";

export default {
  name: "app",
  mixins: [alertMixin, authMixin, cordMixin, themeMixin, socketMixin],
  components: { Toolbar },
  created() {
    this.init();
    const theme = ThemeService.getTheme();

    if (theme !== null) {
      this.$store.commit("theme", theme);
    } else {
      this.$store.commit("theme", this.isDark ? "dark" : "light");
    }
  },
  data() {
    return {
      color: "#0c0c0c",
      y: "top",
      x: null,
      mode: ""
    };
  },
  mounted() {
    this.init();
  }
};
</script>

<style>
@import "https://cdn.materialdesignicons.com/2.5.94/css/materialdesignicons.min.css";
@import "https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons";

html {
  height: 100%;
}
body {
  height: 100%;
  margin: 0 auto 0;
}
#app {
  height: 100%;
  font-family: "Hilda-Regular", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  width: inherit;
}
</style>

A: So the solution for me was to not only remove the container in App.vue, but to also remove the styles from the <style scoped> tag for both html and body. I was setting the height: 100%; which caused some issues when content was dynamically loaded in.
The correct App.vue looks like this:
<template>
  <v-app id="app" :dark="isDark">
    <Toolbar color="primary" />
    <transition
      name="routerAnimation"
      enter-active-class="animated faster fadeIn"
    >
      <router-view></router-view>
    </transition>
    <v-snackbar
      :color="alertColor"
      class="animated faster heartBeat"
      :dark="isDark"
      v-model="alert"
      :multi-line="mode === 'multi-line'"
      :timeout="alertTimeout"
      top
      :vertical="mode === 'vertical'"
    >
      <v-icon class="pr-4">{{ getAlertIcon() }}</v-icon>
      {{ alertMessage }}
      <v-btn :dark="isDark" icon @click="toggleAlert(false)">
        <v-icon>close</v-icon>
      </v-btn>
    </v-snackbar>
  </v-app>
</template>

<script>
import { themeMixin } from "./mixins/themeMixin.js";
import Toolbar from "./components/Toolbar";
import { alertMixin } from "./mixins/alertMixin";
import { authMixin } from "./mixins/authMixin";
import { socketMixin } from "./mixins/socketMixin";
import { TokenService } from "./services/tokenService";
import { ThemeService } from "./services/themeService";
import { UserService } from "./services/userService";
import { cordMixin } from "./mixins/cordMixin";

export default {
  name: "app",
  mixins: [alertMixin, authMixin, cordMixin, themeMixin, socketMixin],
  components: { Toolbar },
  created() {
    this.init();
    const theme = ThemeService.getTheme();

    if (theme !== null) {
      this.$store.commit("theme", theme);
    } else {
      this.$store.commit("theme", this.isDark ? "dark" : "light");
    }
  },
  data() {
    return {
      color: "#0c0c0c",
      y: "top",
      x: null,
      mode: ""
    };
  },
  methods: {
    init() {
      const token = TokenService.getToken();
      const user = UserService.getUser();

      if (token) {
        this.$store.commit("token", token);
        this.setExpiry();
      }

      if (user) {
        this.$store.commit("user", JSON.parse(user));
      }
    }
  },
  mounted() {
    this.init();
  },
  watch: {}
};
</script>

<style>
@import "https://cdn.materialdesignicons.com/2.5.94/css/materialdesignicons.min.css";
@import "https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons";

#app {
  font-family: "Hilda-Regular", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
</style>


text:
Q: List of object property not mapped while querying Azure Cosmos DB using EF Core 3.1 I'm struggling with a problem while querying Cosmos DB using as ORM Entity Framework Core 3.1
My situation is this:
I have a class which has an ID and a List of objects (i can't show even the name of the models for internal security, so we'll call the first class Items):
public class Model
{
   public Guid DeviceId { get; set; }
   public List<Items> Items { get; set; }
}

The class Items has different fields and as last field has a List of object:
public class Items
{
    //fields..
    public List<SubItem> SubItems {get; set;}
}

public class SubItem
{
    public int field1 { get; set; }

    public int field2 { get; set; }

    public string field3 { get; set; }

    public string field4 { get; set; }

    public double field5 { get; set; }
}

In my CosmosDB i've the following json that map the specific document:
{
    "DeviceId": "123456789",
    "Items": [
        {
            //fields...,
            "SubItems": [
                {
                    "field1": 1,
                    "field2": 6,
                    "field3": "blabla",
                    "field4": "blabla",
                    "field5": 100936000
                },
                ...
            ]
        }
    ],
    "id": "blablabla"
}

Now, i have configured in my ApplicationDbContext all the owned entities and i have a line where i map this "relationship" as follow:
public class ApplicationDbContext
{
  public DbSet<Model> Models{ get; set; }

  modelBuilder.HasDefaultContainer("Models");
  modelBuilder.Entity<Model>().ToContainer("Models");
  modelBuilder.Entity<Model>().HasKey(lr => lr.DeviceId);

  modelBuilder.Entity<Model>(lr =>
  {
     lr.HasNoDiscriminator();

     lr.OwnsMany(o => o.Items, na =>
     {
        na.OwnsMany(o => o.SubItems, na =>
        {
            na.ToJsonProperty("SubItems");
        });
     });
   });
}

And then in my repository, when i want to query the DB searching for a specific Device with a Device ID i call this simple method:
Model model = await _context.Models.FirstOrDefaultAsync(m => m.DeviceId == deviceID);

Now the problem is that, inside the model ALL fields are mapped except for the List<SubItems> SubItems
and i've tried everything, i mean everything, but i always get null in return.
What am i doing wrong?
Thanks in advice

redpajama_set_name: RedPajamaStackExchange


text:
Q: Bootstrap dropdown menu does not work with FastApi I create a simple bootstrap dropdown example. I am using it with FastAPi. The content of the menu appears empty. What is wrong here? I am running the code on VS code. I tried the solutions here but it does not work.
Here is the code:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

FastAPI

                Home

                Content

                        A

                        B

                C


text:
Q: hadoop sqoop load csv file into mysql I am learning hadoop sqoop. I am working on a hortonworks sandbox (a hadoop virtual machine of single node: http://hortonworks.com/products/hortonworks-sandbox/#install).
I am trying to load a csv file via sqoop into a mysql table. I have created a database flightinfo and a table weather in it. I created a table in hive called sqoop_tmp with the file location of that csv file.
I used following command to load the csv into mysql:
    sqoop export --connect jdbc:mysql://localhost/flightinfo –-table weather –-export-dir /apps/hive/warehouse/sqoop_tmp

Here is the error message:

update: @z-1
I tried your code and it returns something different

A: try with username and password of mysql
sqoop export --connect jdbc:mysql://localhost/flightinfo --table weather --export-dir /apps/hive/warehouse/sqoop_tmp --username SomeUser -P

Note - user should have permission.

A: You have to provide username and password of MySQL and must have permissions to access the database.
It looks like you did a fresh install of mysql and didn't not configure the root account to secure with root password.
You can do that using the following steps:

*

*$ mysqladmin -u root password "newpassword"
for example $ mysqladmin -u root password mysql-root-password

*Restart MySQL daemon. $ sudo service mysqld restart or $ sudo /etcinit.d/mysqld restart

*Login to MySQL using $ mysql -u root -P and enter the password when prompted.

If you have your database created as root user. Now you can issue the following sqoop command to export data from hdfs to sqoop database.
$ sqoop export --connect jdbc:mysql://localhost/flightinfo --username root -P --table weather --export-dir /apps/hive/warehouse/sqoop_tmp
Still facing permission issue?? Permission to the user to access database is the problem.
Then, You should be able to solve by granting permissions using the steps below.

*

*Login to MySQL using $ mysql -u root -P

*mysql> GRANT all PRIVILEGES on filghtinfo.* to 'root'@'localhost' IDENTIFIED BY 'password'
Note: The password you set here should be used from sqoop.

A: Try this:
sqoop export --connect jdbc:mysql://localhost/flightinfo --table weather --export-dir /apps/hive/warehouse/sqoop_tmp

You had –- not --. These two are not the same.


text:
Q: PHP form auto response I am using the following php code which has been given to me, it works fine, apart from the auto response bit.  I know its not a lot of code I just don't know how to do it or why it's not working.
Any help would be appreciated.  Thanks in advance.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> - Contact Us</title>

<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<link rel="stylesheet" type="text/css" href="css/colorbox.css" />

<?php require_once('includes/js.php'); ?>

<?php
//FIll out the settings below before using this script
$your_email = "(email address)";
$website = "(website name)";
//BOTS TO BLOCK
$bots = "/(Indy|Blaiz|Java|libwww-perl|Python|OutfoxBot|User-Agent|PycURL|AlphaServer|T8Abot|Syntryx|WinHttp|WebBandit|nicebot)/i";
//Check if known bot is visiting
if (preg_match($bots, $_SERVER["HTTP_USER_AGENT"])) {
 exit ("Sorry bots are not allowed here!");
}

//Known Exploits

$exploits = "/(content-type|bcc:|cc:|from:|reply-to:|javascript|onclick|onload)/i";

//Spam words
$spam_words = "/(viagra|poker|blackjack|porn|sex)/i";

// BAD WORDS
$words = "/(
bitch|dick|pussy|pussies|ass|fuck|cum|cumshot|cum shot|
gangbang|gang bang|god dammit|goddammit|viagra|anus|analsex
)/i";
//BAD WORD/SPAM WORD/EXPLOIT BLOCKER
function wordBlock($word) {
  //Make variables global
 global $words;
 global $exploits;
 global $spam_words;

 if (preg_match($words, $word)) {
  $word = preg_replace($words, "#####", $word);
 }
 if(preg_match($exploits,$word)){
$word = preg_replace($exploits,"",$word);

}
if(preg_match($spam_words,$word)){
  $word = preg_replace($spam_words,"$$$$",$word);
}
 return $word;
}
//CLean data function
function dataClean($data) {
 $data = stripslashes(trim(rawurldecode(strip_tags($data))));
 return $data;
}
//CREATE MAIN VARIABLES
$name = (isset ($_POST['name'])) ? dataClean($_POST['name']) : FALSE;
$company = (isset ($_POST['company'])) ? dataClean($_POST['company']) : FALSE;
$address = (isset ($_POST['address'])) ? dataClean($_POST['address']) : FALSE;
$postcode = (isset ($_POST['postcode'])) ? dataClean($_POST['postcode']) : FALSE;
$phone = (isset ($_POST['phone'])) ? dataClean($_POST['phone']) : FALSE;
$email = (isset ($_POST['email'])) ? dataClean($_POST['email']) : FALSE;
$comment = (isset ($_POST['message'])) ? wordBlock(dataClean($_POST['message'])) : FALSE;
$submit = (isset ($_POST['send'])) ? TRUE : FALSE;
$email_check = "/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i";
//$ip = $_SERVER["REMOTE_ADDR"];
$errors = array();
//Check if send button was clicked
if ($submit) {
 if (!$name) {
  $errors[] = "Please enter a name!";
 }
 if ($name) {
  if (!ereg("^[A-Za-z' -]*$", $name)) {
   $errors[] = "You may not use special characters in the name field!";
  }
 }
 if (!$email) {
  $errors[] = "Please enter an email address!";
 }
 if ($email) {
  if (!preg_match($email_check, $email)) {
   $errors[] = "The E-mail you entered is invalid!";
  }
 }
 /*
 if (!$subject) {
  $errors[] = "Please enter an email subject!";
 }
*/
 if (!$comment) {
  $errors[] = "Please don't leave the message field blank!";
 }
//Check if any errors are present
 if (count($errors) > 0) {
  foreach ($errors AS $error) {
   print "• $error
";
  }
 }
 else {
//MESSAGE TO SEND TO ADMIN
//Create main headers
  $headers = "From: " . $website . " <$your_email> \n";
  $headers .= "Reply-to:" . $email . " \n";
  $headers .= "MIME-Version: 1.0\n";
  $headers .= "Content-Transfer-Encoding: 8bit\n";
  $headers .= "Content-Type: text/html; charset=UTF-8\n";
  $message = "";
  $message .= "
New E-Mail From " . $website . "

";
  $message .= "Name: " . $name . "
";
  $message .= "Company: " . $company . "
";
  $message .= "Address: " . $address . "
";
  $message .= "Postcode: " . $postcode . "
";
  $message .= "Phone No: " . $phone . "
";
  $message .= "E-mail: " . $email . "
";
  $message .= "Message: " . $comment . "
";
//E-mails subject
  $mail_subject = "Message from " . $website . "";
/*
CHECK TO BE SURE FIRST E-MAIL TO ADMIN IS A SUCCESS AND SEND EMAIL TO ADMIN
OTHERWISE DON'T SEND AUTO RESPONCE
*/
  if (mail($your_email, $mail_subject, $message, $headers)) {
//UNSET ALL VARIABLES
   unset ($name, $email, $company, $address, $postcode, $phone, $comment, $_REQUEST);
//JAVASCRIPT SUCCESS MESSAGE
   echo "

   ";
//SUCCESS MESSAGE TO SHOW IF JAVASCRIPT IS DISABLED
   echo "
THANK YOU YOUR MESSAGE HAS BEEN SENT
";
/*
-----------------END MAIL BLOCK FOR SENDING TO ADMIN AND START AUTO RESPONCE SEND-----------------
*/
//AUTO RESPONCE MESSAGE
//Create main headers
   $headers = "From: " . $website . " <$your_email> \n";
   $headers .= "Reply-to:" . $your_email . " \n";
   $headers .= "MIME-Version: 1.0\n";
   $headers .= "Content-Transfer-Encoding: 8bit\n";
   $headers .= "Content-Type: text/html; charset=UTF-8\n";
   $message = "";
   $message .= "
Thank You For Contacting Us

";
   $message .= "On behalf of " . $website . " we wanna thank you for contacting us and to let you know we will respond to your message as soon as possible thank you again.";
//E-mails subject
   $mail_subject = "Thank you for contacting " . $website . "";
//Send the email
   mail($email, $mail_subject, $message, $headers);
/*
-----------------END MAIL BLOCK FOR SENDING AUTO RESPONCE -----------------
*/
  }
  else {
   echo "

   ";
   echo "
SORRY COULD NOT SEND YOUR MESSAGE
";
  }
 }
}
?>

   <?php require_once('includes/nav.php'); ?>

Get In Touch

T. (0117) 935 3888

F. (0117) 967 7333

E. sales@regalbalustrades.co.uk

Where To Find Us

Regal Balustrades

Regal House,

Honey Hill Road,

Kingswood,

Bristol  BS15 4HG

Contact us

Please use this form to request further information about Regal Balustrades and our services. To speak to a member of our staff in person, please call us on 0117 9353888

<form method='POST' action='<?php echo "".$_SERVER['PHP_SELF'].""; ?>'>

    Name:
    <input type='text' name='name' value='<?php echo "" . $_REQUEST['name'] . "";?>' />

    Company:
    <input type='text' name='company' value='<?php echo "" . $_REQUEST['company'] . "";?>' />

    Address:
    <textarea name='address' rows='5' id='address' class='address' ><?php echo "" . $_REQUEST['address'] . "";?></textarea>

    Postcode:
    <input type='text' name='postcode' value='<?php echo "" . $_REQUEST['postcode'] . "";?>' />

    Telephone:
    <input type='text' name='phone' value='<?php echo "" . $_REQUEST['phone'] . "";?>' />

    Email:
    <input type='text' name='email' value='<?php echo "" . $_REQUEST['email'] . "";?>' />

    Enquiry:
    <textarea name='message' class='enquiry' id='enquiry' rows='5' cols='40' ><?php echo "" . $_REQUEST['message'] . "";?></textarea>

<input type='submit' class='submit' name='send' value='Send message' />

We will respond as soon as possible.

</form>

 <?php require_once('includes/footer.php'); ?>

A: Most likely this is a problem with your mail server. Are you sure you can send mail via the mail() function? To find out, just run a small script on your server containing the following code:
<?php
mail('your@email.com', 'Test mail', 'If you receive this message, everything works fine');
?>

If you don't get the test message (you must change the address in the script to your own address), there may be a problem with the mail server. You can either install a mail server or  take a look at the following question to change your code so that you can send mail via external servers: PHP - mail() function not working on my hosting

A: Try getting rid of the line breaks in $words like the following:
// BAD WORDS
$words = "/(word|word|word|";
$words .= "word|word|word)/i";

Or
// BAD WORDS
$words = "/(word|word|word|word|word|word)/i";


text:
Q: Adding more responsibilities to Activities in a flexible way I am considering how I can add tasks to Android Activities in a flexible way. I can only use implementation inheritance for one thing in Java and I would like to use it, if I use it at all, for something else.
I think I need to draw the domain first a bit:
Activities are UI windows basically, with intrinsic lifecycle responsibilities enforced by the API. The tasks I speak of are UI-visible popovers that do some offline stuff and then disappear. They stem from AsyncTasks. The code of all of this is not a problem, I have this already, even pretty generalized with interfaces. I'm looking at further design improvements I can make.
There are many type of activities and they could all work with some types of tasks. For instance a search window would have a task that adds one of the search results, let's say it's a book, to the collection of books in the main application. It allows you to add multiple, hence the popover. A window that displays the collection has a task that lets you export a book to an external file format. It won't stop you from browsing through your collection, yet it needs to display a progress bar as it may take a while to export.
A specific Task exists as a nested class in a specific Activity. It needs to be saved away and restored along with lifecycle events: there's a onSaveInstanceState(Bundle) and onRestoreInstanceState(Bundle) for that, among others. The Activity has a list of active tasks (or just a member for one task). Some UI event will create a new task and add it to the list, a la onClick(): ATask task = new ATask(); task.execute(something);.
Here's what I have considered so far:

*

*Implementation inheritance
Just move this task business to an abstract super class of all specific activities.

*Decorator pattern
Create a TaskedActivityDecorator that would add this responsibility on any activity. The decorator would have to mimic the entire Activity interface as provided by the API, mostly passthroughs though. So this may already be a bit too heavyweight. It would also need to add the UI events/buttons that launch the task, which may not always be possible if the action is more consequential.
But the biggest problem I could come up with here is that Android uses a manifest to loosely couple all activities together. Therein you need to declare every specific activity or it can not be used. This is a problem because the decorator would work at runtime, with composition. I can't declare the decorator and add in the information that it needs to wrap a specific activity.
With Android I seem to end up with implementation inheritance a lot more than I'd like to. Hence I have too much coupling or code duplication. The activities always easily grow out to big fat classes. Am I correct to say that that is partly because of existing design choices in the Android framework, such as the manifest taking away composition solutions, or the Context object? Am I correct to say that from the get-go it cuts away a significant amount of established design patterns in key areas, including the MVC pattern.

*Decorator with wrappers:
That I can't specify the decorator and the specific activity it applies to together in the manifest, doesn't mean I can't create classes that represent and arrange this composition. I could of course create many SpecificDecoratorActivity classes, that also implement the Activity interface and act like the decorator, and then wrap in the real specific activity. I'm not sure if it solves my problem though. It seems like a lot of work, a lot of rubbish classes, and takes me far from my original goal.

*Strategy pattern:
If I can't skin the activity, then I'd better outsource part of its guts. This will give me yet more connections though as the activities will need to know about the Strategy. The Strategy itself however will be more lightweight as a Decorator. Yet it feels not so much like Strategy where there is a choice of which one, but rather just moving part of the class to another class. I would call it TaskManager. And would I still pull up the strategies knowledge into an activity super class?

*Any other pattern?:
Which pattern is the best choice? Don't shun your opinion on the specific Android case. No need to talk about tasks specifically.

A: I think I don't fully understand what you're trying to accomplish, it was a lot to read, but I think I can say a couple things. You mentioned that Android doesn't have design patterns like MVC, I can say that this isn't correct. Android native classes play pretty nicely with POJOs, I think you can structure a lot of things however it makes the most since to.

A: First, I don't know anything about Android development, so I was waiting for someone else to answer you, but since you haven't gotten a lot of responses:
What about the Bridge pattern?  This isn't the canonical case described in Design Patterns, but it sounds like it might fit, since what you want is to have separate hierarchies with implementation inheritance (one for tasks and one for activities).
This is similar to what you discussed as a strategy pattern, and yes, it is moving part of the class to another class, but to a new class that doesn't have the limitations (i.e., the manifest) of the old.  I'm not sure this gives you more connections - a reference seems a weaker connection than a nested class.
As far as putting the strategies knowledge into an activity super class, you could, but you did state that you would rather use implementation inheritance for something else.  If so you could put into an interface instead.


text:
Q: Do microwaves break hydrogen bonds? We're told that the photon energy of microwave frequency radiation ($\sim 10^{-5}~\text{eV}$) is not high enough to break hydrogen bonds.  But if that's true, how does dielectric heating of water work? Liquid water is a network of polar molecules held together by H bonds so that they CAN'T rotate, in concert with the microwave beam or anything else ....
Seems like this is a problem of the two ways of looking at radiation -- classical wave vs photon stream -- being incompatible.

A: In a solid or liquid we have collective vibrations of the whole system. It can be useful to think of these as quasiparticles called phonons, that is when we add vibrational energy to the system as a whole it generates a phonon, or conversely a phonon can decay and emit energy.
Black body radiation is (mostly) the emission of photons from the collective vibrations i.e. the decay of phonons to emit photons, and dielectric heating is the reverse process i.e. the absorption of photons to create phonons. This is what happens in your microwave oven. The heating is due to the excitation of the collective vibrations, not to the interaction of photons with hydrogen bonds. The quanta of these collective excitations (i.e. their phonons) are generally very small so they can absorb photons of even very low energies.
In real materials the collective vibrational modes are anharmonic oscillators so they all interact with each other and the vibrational energy is distributed between them in accordance with the Boltzmann distribution. That means the vibration energy from the absorbed microwave photons is quickly equilibrated with higher energy modes such as the vibrational excitations of hydrogen bonds, and it can break those bonds. This means energy can be absorbed in small units from microwave photons and still build up sufficiently to break the much higher energy hydrogen bonds.

A: I would think that microwaves are only sufficient to factor into the rotational modes of the water molecule and that they couldn't "break" per se, the hydrogen bond. Even if they did, I think the Van Der Walls forces would make a quick repair!

A: You don't need an individual quantum of energy to break any waves; you just need the energy to be absorbed.
It's like pushing someone on a swing (with rigid arms on the swing). You don't need to be strong enough to push them so they make a complete loop after a single push: it would be enough to keep pushing at the right time, and if there is sufficiently low friction in the system you will eventually push them "over the top".
The vibration / rotation modes of water molecules are coupled - excite one, and over time some of the energy transfers to other modes. So the entire system absorbs energy, until bonds start to break. In fact, even without adding energy bonds are breaking (and forming) all the time - again, because the energy of an individual water molecule will change as they "jiggle".
We can say something about the average energy of a molecule - but usually not about the energy of the individual molecule.
Does that make sense?


text:
Q: JQUERY BIND to a LABEL, and pass the name & value <p id="noteTypebox">
<label for="noteType_2" class="notetypelabel" id="noteType_2" >
<input type="radio" name="noteTypeID" value="2" class="notetype">IDI</input>
</label>
</p>

Given the code above, I would like JQUERY code that Binds to the LABEL, since the INPUT box is hidden (I don't want the radio buttons on the apge).
When a user clicks on a label, it should trigger the JQUERY function and provide the value of the INPUT associated with the label. For example, if a user clicked on label for="noteType_1", it would be able to alert noteType_1 & 1
Here is my current code, I could use your help! thanks
$( document ).ready( function() {
    $('#noteTypebox:label').click(radioClicks)
});

function radioClicks() {
    alert(input name + input value);
    return false;
};

Thanks

A: I would do something like this:
$(document).ready(function() {
    $('#noteTypebox label').click(radioClicks);
});

function radioClicks() {
    var input = $(this).children("input");
    alert(input.attr("name") + " " + input.val());
    return false;
};

This however relies that you always structure your HTML the same.
A far more robust way would be to do the following:
function radioClicks() {
    var label = $(this);
    var input = $("input#" + label.attr("for"));
    alert(input.attr("name") + " " + input.val());
    return false;
};

in this case the label can be anywhere in relation to the input and it will still work.
UPDATE: Have updated second code snippet to only get the radio button that is checked.
A response to the comment:
The code above looks for an input with the same id as the for attribute of the label. Seeing as you changed the id of the input, this breaks the code and makes the second example not so adequate. The first example however should work fine for you as long as the input remains a child of the label. Also, I need to mention that the for attribute on your label has become redundant with your changes since all its saying now is that the label applies to itself.

A: You need to find the input element associated with the label, like this:
var input = $('#' + $(this).attr('for'));

You can then get the name by writing input.attr('name') and the value by writing input.val().

A: Just change to:
$(".notetypelabel").click( ....


text:
Q: How to detect exceptions in concurrent.futures in Python3? I have just moved on to python3 as a result of its concurrent futures module. I was wondering if I could get it to detect errors. I want to use concurrent futures to parallel program, if there are more efficient modules please let me know.
I do not like multiprocessing as it is too complicated and not much documentation is out. It would be great however if someone could write a Hello World without classes only functions using multiprocessing to parallel compute so that it is easy to understand.
Here is a simple script:
from concurrent.futures import ThreadPoolExecutor

def pri():
    print("Hello World!!!")

def start():
    try:
        while True:
            pri()
    except KeyBoardInterrupt:
        print("YOU PRESSED CTRL+C")

with ThreadPoolExecutor(max_workers=3) as exe:
    exe.submit(start)

The above code was just a demo, of how CTRL+C will not work to print the statement.
What I want is to be able to call a function is an error is present. This error detection must be from the function itself.
Another example
import socket
from concurrent.futures import ThreadPoolExecutor
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
def con():
    try:
        s.connect((x,y))
        main()
    except: socket.gaierror
         err()
def err():
    time.sleep(1)
    con()
def main():
    s.send("[+] Hello")
with ThreadPoolExecutor as exe:
    exe.submit(con)

A: Here's a solution. I'm not sure you like it, but I can't think of any other. I've modified your code to make it work.
from concurrent.futures import ThreadPoolExecutor
import time

quit = False

def pri():
    print("Hello World!!!")

def start():
    while quit is not True:
        time.sleep(1)
        pri()

try:
    pool = ThreadPoolExecutor(max_workers=3)
    pool.submit(start)

    while quit is not True:
        print("hei")
        time.sleep(1)
except KeyboardInterrupt:
    quit = True

Here are the points:

*

*When you use with ThreadPoolExecutor(max_workers=3) as exe, it waits until all tasks have been done. Have a look at Doc

If wait is True then this method will not return until all the pending futures are done executing and the resources associated with the executor have been freed. If wait is False then this method will return immediately and the resources associated with the executor will be freed when all pending futures are done executing. Regardless of the value of wait, the entire Python program will not exit until all pending futures are done executing.
You can avoid having to call this method explicitly if you use the with statement, which will shutdown the Executor (waiting as if Executor.shutdown() were called with wait set to True)

It's like calling join() on a thread.
That's why I replaced it with:
pool = ThreadPoolExecutor(max_workers=3)
pool.submit(start)

*Main thread must be doing "work" to be able to catch a Ctrl+C. So you can't just leave main thread there and exit, the simplest way is to run an infinite loop

*Now that you have a loop running in main thread, when you hit CTRL+C, program will enter the except KeyboardInterrupt block and set quit=True. Then your worker thread can exit.
Strictly speaking, this is only a workaround. It seems to me it's impossible to have another way for this.
Edit
I'm not sure what's bothering you, but you can catch exception in another thread without problem:
import socket
import time
from concurrent.futures import ThreadPoolExecutor
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)

def con():
    try:
        raise socket.gaierror
        main()
    except socket.gaierror:
        print("gaierror occurred")
        err()

def err():
    print("err invoked")
    time.sleep(1)
    con()

def main():
    s.send("[+] Hello")

with ThreadPoolExecutor(3) as exe:
    exe.submit(con)

Output
gaierror occurred
err invoked
gaierror occurred
err invoked
gaierror occurred
err invoked
gaierror occurred
...

A: Way too late to the party, but maybe it'll help someone else...
I'm pretty sure the original question was not really answered. Folks got hung up on the fact that user5327424 was using a keyboard interrupt to raise an exception when the point was that the exception (however it was caused) was not raised. For example:
import concurrent.futures

def main():
    numbers = range(10)

    with concurrent.futures.ThreadPoolExecutor() as executor:
        results = {executor.submit(raise_my_exception, number): number for number in numbers}

def raise_my_exception(number):
    print('Proof that this function is getting called. %s' % number)
    raise Exception('This never sees the light of day...')

main()

When the example code above is executed, you will see the text inside the print statement displayed on the screen, but you will never see the exception. This is because the results of each thread are held in the results object. You need to iterate that object to get to your exceptions. The following example shows how to access the results.
import concurrent.futures

def main():
    numbers = range(10)

    with concurrent.futures.ThreadPoolExecutor() as executor:
        results = {executor.submit(raise_my_exception, number): number for number in numbers}

    for result in results:
        # This will cause the exception to be raised (but only the first one)
        print(result.result())

def raise_my_exception(number):
    print('Proof that this function is getting called. %s' % number)
    raise Exception('This will be raised once the results are iterated.')

main()

I'm not sure I like this behavior or not, but it does allow the threads to fully execute, regardless of the exceptions encountered inside the individual threads.


text:
Q: document.getElementbyId: Object required I have some code on a classic ASP page that is attempting to get the innerHTML of a <div> element.
    Dim oElm
    Set oElm = document.getElementById("screenDiv")

    if oElm Is Nothing then
        '''
    else
        document.getElementById("screenDiv").innerHTML = ""
    end if

I've tried the above but I'm getting the Object Required error.
What do I need to do to get around this error?

A:
NOTE: client side VBScript is outdated, deprecated, and doesn't work in any modern browser including newer versions of IE.

This means the code is located before the element, so when it executes, such
element does not exist.
To solve this, have the code execute in the onload event:
<script type="text/vbscript">
Set window.onload = GetRef("WindowLoad")
Function WindowLoad
    Dim oElm
    Set oElm = document.getElementById("screenDiv")
    if oElm Is Nothing then
        MsgBox("element does not exist")
    else
        oElm.innerHTML = ""
    end if
End Function
</script>

Credit for the correct way goes to Korikulum, and the official documentation can be found here.
Live test case. (IE only)


text:
Q: Save and retrieve image from another project in the same solution or common directory I am working with a eCommerce project. in this solution I have 2 project admin part and ui part. the problem is if i store image in admin it work fine in admin project, how can i access it from UI project? or I have to create a common directory in the solution to store and retrieve image, i don't know what to do and how to do, please help me with that.
for save an image my code is ......
public static string SaveAnImage(HttpPostedFileBase file, string path)
    {
        string fileName = "";
        string vFileName = Guid.NewGuid().ToString();
        string fileExtension = Path.GetExtension(file.FileName)?.ToLower();
        if (fileExtension != null)
        {
            path += vFileName;
            path += fileExtension.ToLower();

            file.SaveAs(path);
            fileName = vFileName + fileExtension.ToLower();
        }
        return fileName;
    }

and retread an image ....
ProductImage = Path.Combine(_mainImagepath , objDataReader["ProductImage"].ToString());

now how can I retrieve it from UI project??? Thanks.....

A: That's really two separate questions:
How do I share the folder in production?
If the sites are on the same server, you can put the shared images pretty much anywhere on the same server. If they are on different servers, you would want to map a network location on both servers to wherever the images are located. In either case, you would then create a virtual directory in IIS on both sites pointing to that shared location.
How do I share the folder in development (i.e. Visual Studio)?
That's a bit more tricky. Basically, you would need to handle it in the same way as in production, but the problem is that IIS Express is not nearly as transparent as full IIS. I've employed the following method in Visual Studio 2012 and 2013, but the last time I tried it in 2015, it no longer worked. That may have been fixed by now, though, as it's been a while. Regardless, this is pretty much your only option.

*

*Right-click on your solution in the Solution Explorer pane and choose Add > New Website....

*Click the Browse... button on the resulting window.

*Click the Local IIS tab.

*Find the first site in the list that you want to utilize the shared image directory on, and click on it to highlight it.

*Then, in the top right of the window, click the icon that looks like a folder with a star on it. If you hover over it for a second, it will say "Create New Virtual Directory".

*In "Alias name:", enter what the path portion within your application should be. For example, if you wanted to find the images at http://localhost:12345/SharedImages, then you would enter SharedImages. Make sure that whatever you choose is not an actual existing directory within your project, though.

*For "Folder:", browse to the physical directory where the shared images are at on your computer.

*Uncheck the Create IIS application checkbox.

*Click OK.

*Repeat steps 4-9 for any additional sites.

*Click Cancel on the previous window.

*Click Cancel again on the original Add New Website Window. (You're not actually going to add a new website to your solution. This is just the only way to access the place where you can create this virtual directory.)

At that point, you should be back to the main Visual Studio window. You won't actually notice any difference in your project/solution, as this was all done in IIS Express. However, if you browse your website and try to load an image under the virtual directory, you should be able to see it in your browser, i.e.:
http://localhost:12345/SharedImages/foo.jpg
If you see the image, everything is working fine.

A: There are couples ways to get file stream from the server. so for static files you may create download link in your views using @Url.Content("yourfilepath") or you would create an action to download file stream:
public FileResult GetMyFile()
{
    byte[] fileBytes = System.IO.File.ReadAllBytes(@"c:\folder\myfile.ext");
    string fileName = "myfile.ext";
    return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
}

A: In Razor View you can show it using this code.
<img src="@Url.Content("/imagesfolder/image123.jpg")" alt="Image" >


text:
Q: Nested URLs, controllers and views in Ruby on Rails What I am trying to do is to nest my pages in Rails for example:
www.mysite.com/fifa17/ps4

This way, once I am on the show.html.erb, I can use use the route to sell my product for specifically that game on that console platform..
At the moment, I have a Console model with has_many :games and a Game model with has_many :consoles, but I can't get the routing and views to work. Do I have just one controller or two?
I have both the Games and Consoles seeded under ActiveRecords by name.
I seem to be able to call one of the actions (i.e. Console.name) but cannot call both the console name and Game name.

A: A great place to read on this would be in Ruby on Rails Associations Guide and Routing Guide.
What you want to do, is to update your Console and Game associations, to use has_and_belongs_to_many. You can read more on that here
And double check your routing, check this StackOverflow Question for a similar case.


text:
Q: UIView is not responding when changed in NSTimer method I have this NSTimer repeating loop that will check if there is any news in my app. The checking part is irrelevant and it works fine, but to show if there's news or not, I made a UIView called orangeDot. This should be orangeDot.alpha = 1.0 if there is news and orangeDot orangeDot.alpha = 0.0 if not. But it doesn't always work. Sometimes the orangeDot is hidden (alpha=0) when there's news and sometimes the other way around. This is the code:
-(void) checkForNews {
    NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
    bool news = (([defaults boolForKey:@"newsFromChat"]) || ([defaults boolForKey:@"newsFromAwaiting"])) ? YES : NO;

    if (news) {
        NSLog(@"yay news");
        [orangeDot setAlpha:1.0f];
    } else {
        NSLog(@"nothing new");
        [orangeDot setAlpha:0.0f];
    }

    NSLog(@"%@",orangeDot);
}

The NSLog works perfect and there's never problems with that part, but even though the log says "yay news" the orangeDot could be hidden and again the other way around. But sometimes it works... I haven't found a pattern in the bug yet.
I have to mention that neither .alpha nor .hidden works right.
The orangeDot is sat up like this:
@property (nonatomic, retain) IBOutlet UIView * orangeDot;

and connected in the storyboard.
Please help :)

A: Based on your code, I have two things in mind:

*

*UIView updates should be made on the main thread. Check if you are calling this method from the main thread, or just call this method from main thread.
- (void)checkForNews {

    dispatch_async(dispatch_get_main_queue(), ^{

        NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
        bool news = (([defaults boolForKey:@"newsFromChat"]) || ([defaults boolForKey:@"newsFromAwaiting"])) ? YES : NO;

        if (news) {
            NSLog(@"yay news");
            [orangeDot setAlpha:1.0f];
        } else {
            NSLog(@"nothing new");
            [orangeDot setAlpha:0.0f];
        }

        NSLog(@"%@",orangeDot);
    });
}

*Your orangeDot declaration seems a little suspicious. Have you declared some other variable with the same name? Try to call self.orangeDot instead of only orangeDot. Normally Xcode don't let us access the IBOutlet the way you done. If you declared it once and correctly, you will be able to access the object via self.orangeDot or just _orangeDot (with an initial underline character).
//using .self
[self.orangeDot setAlpha:1.0f];

//or using underline to access the var. without setter
[_orangeDot setAlpha:1.0f];

Update:
Do you really really need to loop to check for updates on your user defaults? How about forget about this timer stuff and implement NSNotification pattern (or Delegates, or whatever)? You just need to send a notification event and listen for it on your relative view controller: I expect you already know how to implement it, but I will leave a little example here:
//Somewhere ... just after you update your news data.
[[NSNotificationCenter defaultCenter] postNotificationName:@"NewChatDataAvailable" object:nil];

At this point, you are telling your entire app that you have new chat data available, without looping unnecessarily checking for it. Now all we need to do is register to receive this notifications:
//In this example I will register on viewDidLoad:

- (void)viewDidLoad:(BOOL)animated {

    [super viewDidLoad:animated];

    //Now, your method will be called on when necessary (when data arrives)
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(checkForNews)
                                                 name:@"NewChatDataAvailable"
                                               object:nil];
}

Now, let's improve a little bit your code:
- (void)checkForNews {

    dispatch_async(dispatch_get_main_queue(), ^{

        NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];

        //You don't need to put the ? YES : NO stuff, and BOOL in capital letters
        BOOL hasNews = (([defaults boolForKey:@"newsFromChat"]) ||
                         ([defaults boolForKey:@"newsFromAwaiting"]));

        if (hasNews) {
            NSLog(@"yay news");
            [self.orangeDot setAlpha:1.0f];
        } else {
            NSLog(@"nothing new");
            [self.orangeDot setAlpha:0.0f];
        }

        NSLog(@"%@",self.orangeDot);
    });
}

I hope it helps you. And ... when you update your question with code or something, edit your question and insert the code there, don't post it as an answer.

A: Thanks for the help so far!
A better overview over the code:
...
@synthesize orangeDot;
...

- (void) viewDidLoad {
   ...
   [self reloader];
   ...
}

- (void) reloader{
    if (refreshAuto == nil) {
    refreshAuto = [NSTimer scheduledTimerWithTimeInterval: 2.0
                      target: self selector:@selector(checkForNews) userInfo: nil repeats:YES];
    }
}

 - (void)checkForNews {
    dispatch_async(dispatch_get_main_queue(), ^{
    NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
    bool news = (([defaults boolForKey:@"newsFromChat"]) || ([defaults boolForKey:@"newsFromAwaiting"])) ? YES : NO;

    if (news) {
        NSLog(@"yay news");
        [orangeDot setAlpha:1.0f];
    } else {
        NSLog(@"nothing new");
        [orangeDot setAlpha:0.0f];
    }

    NSLog(@"%@",orangeDot);
    });
}

The log would some times look like this when the orangeDot is shown:
...
2015-05-25 12:02:23.788 Teazr[1314:442396] nothing new
2015-05-25 12:02:23.789 Teazr[1314:442396] <UIButton: 0x154520f40; frame = (322 47; 11 11); alpha = 0; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x17422a740>>
...

The @synthesizing is a personal preferring and not required. But it works the same way with self.orangeDot and no synthesizing..


text:
Q: ASP.NET web api SPA project layout I am building a proof-of-concept line-of-business Single Page App. I want to use ASP.NET web api for the REST service layer, and Backbone.js and Require.js on client. I would like to use modular structuring of js files and templates (Require.js) so the source code of the app would not end up in one html page.
I havent found an example how to lay out the project in Visual Studio, and what project type should I choose. Should Web Api be in one project, and web application in another, or should it be mixed. Any advice or best practice would be very appreciated.
Thanks!

A: What I did previously for the same goals was to put the WebApi and Web application in the same project. It makes thigs easier from the point of view that you will everything set up when you create the project in Visual Studio.
There is a slight problem in having the webapi in a different project: since you have to put that on a separate hosting or eventually on the same hosting but bound on a different port or virtual directory, it may need some time setting up IIS... eventually in the past we used the Url rewrite module to redirect calls from the Web App to the Web Api application. There may be simpler settings but again it will require a bit of time, depending on your confidence in setting up IIS...
For starter/proof of concept probably having everything on the same application will make things smoother. You may want to keep Domain Models and DB access in separate projects so if eventually you end up splitting the WebApi from the Web App you can still reference those two without problems.
In the end, the Web Application will only have one controller with one action (Home/Index maybe) and this will be the point of contact that will deliver all your html/css/js to the client. Being a SPA, everything from now on will be managed by Backbone on the client (navigation too), with the occasional call to your JSON Web Api endpoints to get and post data.


text:
Q: Start explorer.exe without creating a window C# I have a program that restarts explorer.exe
Here is my code for killing explorer.exe
Process[] process = Process.GetProcessesByName("explorer.exe");

foreach (Process theprocess in process) {
    theprocess.Kill();
}

The following code work successfully and stops explorer.exe
Here is my code for starting explorer.exe
Process.Start("explorer");

This also works, but it also creates a Windows Explorer window as well as starting the explorer.exe process.
My question is, how can I start explorer.exe without creating a Windows Explorer window?Immediately closing the explorer window could also be considered as an answer.

A: I don't know how to start explorer without opening a window, but you can use the ShellWindows interface from SHDocVW.dll to enumerate explorer windows as explained here and then close the window as it pops up:
// Kill explorer
Process[] procs = Process.GetProcessesByName("explorer");
foreach (Process p in procs)
{
    p.Kill();
}

// Revive explorer
Process.Start("explorer.exe");

// Wait for explorer window to appear
ShellWindows windows;
while ((windows = new SHDocVw.ShellWindows()).Count == 0)
{
    Thread.Sleep(50);
}

foreach (InternetExplorer p in windows)
{
    // Close explorer window
    if(Path.GetFileNameWithoutExtension(p.FullName.ToLower()) == "explorer")
        p.Quit();
}

A: If the explorer is not running, it is enough to call the full path to explorer.exe:
Process.Start(
    Path.Combine(
        Environment.GetEnvironmentVariable("windir"), "explorer.exe"
    )
);

This will only open a window when the explorer is already running, otherwise it just opens the taskbar.

A: I found a much nicer solution to this after encountering an issue where the taskbar would not always appear when starting explorer:
Process.Start(Path.Combine(Environment.GetEnvironmentVariable("windir"), "explorer.exe"));

If you specify the full path like this, it will not create a window and will only load the taskbar if explorer is not already running.
Taken from this answer.


text:
Q: 2D Array with malloc() error I am trying to dynamically allocate an array in c based on the command line arguments, but I am getting an exception error. What am I doing wrong?
int **array =(int**)malloc(Argument1);
for(a=0;a<Argument2;a++)
    array[a]=(int*)malloc(Argument2);

and the exeption is thrown after:
__forceinline void * __cdecl _heap_alloc (size_t size)
{
 //stuff here
 return HeapAlloc(_crtheap, 0, size ? size : 1); }

I got past the for loop once and then got an access error when trying to read the data, but every other time it triggers a breakpoint. What could I be doing wrong in Visual Studio?

A: The argument to the malloc function is the size in bytes, not in number of elements, because there is no way for malloc to know each element's size.
Also the loop should loop through Argument1, not Argument2.
Try this:
int **array = malloc(arg1 * sizeof(int*));
for (int I = 0; I < arg1; I++) {
    array[I] = malloc(arg2 * sizeof(int));
}


text:
Q: Identifying key in BibLaTeX map source In a comment to the question Notes after bibliography entry with Biber and BibLaTeX Marco Daniel suggested to use \DeclareSourcemap to add notes to specific entries.
The most immediate solution would be to have a definition of source map like, where we search entries based on they BibTeX key, thus using something like:
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=entrykey, match={key1},
            fieldset=note, fieldvalue={This is a note}]
    }
  }
}

However, it does not work: the note field is not inserted for the appropriate entry.  However, if a different field is used, e.g., author
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=author, match={Author},
            fieldset=note, fieldvalue={This is a note}]
    }
  }
}

then, the note is inserted.
I think that an MWE in this case would not be required, but since somebody is going to ask for it, here it is:
\documentclass{article}
\usepackage{filecontents}
\usepackage[style=numeric]{biblatex}
\addbibresource{\jobname.bib}
\begin{filecontents}{\jobname.bib}
@article{key1,
author = {Author, John},
title  = {Title},
journal =  {A Journal},
year = 2012,
}
@article{key2,
author = {Author2, John},
title  = {Title},
journal =  {A Journal},
year = 2012,
}
\end{filecontents}
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=entrykey, match={key1},
            fieldset=note, fieldvalue={This is a note}]
    }
    \map{
      \step[fieldsource=author, match={Author2},
            fieldset=note, fieldvalue={This is a note}]
      }
  }
}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

So, the  question is whether it is possible to use the BibTeX key (entrykey) in a biber mapsource specification, or what is the field that can be used and uniquely identifies a bibentry?

A: I don't think that you can match the entrykey field (but it would be perhaps worth a feature request). But actually you probably don't need it. You could do something like this instead:
\documentclass{article}
\usepackage{filecontents}

\usepackage[style=numeric]{biblatex}
\addbibresource{\jobname.bib}
\begin{filecontents}{\jobname.bib}
@article{key1,
author = {Author, John},
title  = {Title},
journal =  {A Journal},
year = 2012,
}
@article{key2,
author = {Author2, John},
title  = {Title},
journal =  {A Journal},
year = 2012,
}
@article{key3,
author = {Author3, John},
title  = {Title},
journal =  {A Journal},
year = 2012,
}
\end{filecontents}

\makeatletter
\@namedef{key1note}{This is note 1}
\@namedef{key2note}{This is note 2}
% key3 has no note
\makeatother

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldset=note,
            fieldvalue=\unexpanded{\csname\thefield{entrykey}note\endcsname}
            ]
      }
  }
}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


text:
Q: Triggering CSS animation on JS textContent change I am basically creating a simple quiz app. Right now when the question is wrong, it updates the textContent of the question space to let the user know that they were wrong. Then after a setTimeOut, it changes it back to the question again.
That works fine as things stand. Right now though those changes happen instantly and I want them to fade out then in. Ive been trying to figure out just by changing opacity though right now nothing is affect it. So I figure I am either setting the animation incorrectly (very possible), or I am doing something wrong in the JavaScript.
So what I am looking for:

*

*FadeIn the new textContent telling the user that the question was wrong

*Wait 1 second
3.FadeOut the newTextContent and replace with the old question content.

For 1 and 3: I am thinking it can be done creating a simple Keyframe animation then reversing it. (opacity 100 to 0% then opacity 0% to 100).

*I can wait the 1 second with my setTimeout as things stand now, I just am not sure how to make sure the animation triggers to do the fadeEffect.

I am using Vanilla Js (prefer no Jquery) could someone point me in the right direction here?
Jsfiddle : https://jsfiddle.net/ubw97kfe/
Ive added comments to point to the particular code elements I am referencing.

// Title of Question Set
const title = document.querySelector(".input_title-input");

// Array of Questions
const questions = [];
let chosen = [];

// Selected Question
let qChosen = [];

// Toggles if a new question is selected
let toggle = 0;

// Selecting Inputs and Button
let question = document.querySelector(".input_question-input");
let answer = document.querySelector(".input_answer-input");
let submit = document.querySelector(".input_submit-button");
let display = document.querySelector(".input_display");
let card = document.querySelector(".card_container");
let start = document.querySelector(".input_start-btn");
let guessInput = document.querySelector(".guess_input");
let submitGuess = document.querySelector(".submitGuess");
let nextQuestion = document.querySelector(".nextQuestion");

// Select all display items
let displayItems = document.getElementsByClassName("input_display-item");

// Select LI quiz card values
let cardQuestion = document.querySelector(".quiz_question");
let cardAnswer = document.querySelector(".quiz_answer");

// Event Listener on Submit Button for Display Items Idividually
submit.addEventListener("click", function() {
    if (question.value === "" || answer.value === "") {
        question.classList.toggle("error");
        answer.classList.toggle("error");
    } else {
        createObj();

        let trashCan = createDisplayItem();
        trashCan.dataset.index = questions.length - 1;
        trashCan.addEventListener("click", function(e) {
            start.disabled = true;
            questions.splice(this.dataset.index, 1);
            // this.parentNode.remove();
            let thisItem = this.parentNode;
            fadeOutIn(thisItem, 1000);

            console.log(questions.length);
        });
        inputReset();
        toggle = questions.length;
        start.removeAttribute("disabled");

        console.log(questions.length);
    }
});

start.addEventListener("click", function() {
    generateCard();
    hideInputs();
});

/* ============================================
==============================================*/

// Event Listener to test if guess is correct
submitGuess.addEventListener("click", function() {
    if (guessInput.value.toLowerCase() === qChosen.answer.toLowerCase()) {
        card.classList.toggle("flip");
        submitGuess.disabled = true;
    } else {
        // Insert wrong message here
        cardQuestion.textContent = "You have guessed incorrectly. Please Try Again";
        // SetTimeout to reset back to Chosen Question
        setTimeout(function(){
            cardQuestion.textContent = qChosen.question;
        }, 1000);
    }
});

/* ============================================
==============================================*/

// Selects the Next question
nextQuestion.addEventListener("click", function() {
    card.classList.toggle("flip");
    guessInput.value = "";
    submitGuess.disabled = false;
    setTimeout(generateCard, 1000);
});

// Create The object for inclusion to array
function createObj() {
    let obj = {};
    obj.question = question.value;
    obj.answer = answer.value;
    questions.push(obj);
}

// Resets inputs to blank after submit
function inputReset() {
    question.value = "";
    answer.value = "";
    if (question.classList.contains("error")) {
        question.classList.toggle("error");
        answer.classList.toggle("error");
    }
}

// Creates Each Display Item
function createDisplayItem() {
    // Create new Div
    let newUl = document.createElement("ul");

    // Create Li and Image Elements
    let liQuestion = document.createElement("li");
    let liAnswer = document.createElement("li");
    let trashCan = document.createElement("img");

    // Set img src
    trashCan.src = "../assets/trash.svg";

    // Set classes
    newUl.className = "input_display-item";
    liQuestion.className = "input_display-question";
    liAnswer.className = "input_display-answer";
    trashCan.className = "input_display-delete";

    // Set LI textContent
    liQuestion.textContent = question.value;
    liAnswer.textContent = answer.value;

    // Append Children
    display.appendChild(newUl);
    newUl.appendChild(liQuestion);
    newUl.appendChild(liAnswer);
    return newUl.appendChild(trashCan);
}

//Generating Card Information per question
function generateCard() {
    random();
    if (toggle < 0) {
        cardQuestion.textContent = "There are no more questions left";
        cardAnswer.textContent = "There are no more questions left";
    } else {
        cardQuestion.textContent = qChosen.question;
        cardAnswer.textContent = qChosen.answer;
    }
}

// Choses a random value for the selection set
function random() {
    if (questions.length === 0) {
        toggle = -1;
    } else {
        let num = Math.floor(Math.random() * questions.length);
        chosen = questions.splice(num, 1).concat(chosen);
        qChosen = chosen[0];
    }
}

// hides all the inputs when start quiz is selected
function hideInputs(){
    for(let i = 0; i < displayItems.length; i++){
        fadeOutIn(displayItems[i], 1000);
    }
}

// FadeOut the display items when trashCan is clicked.
function fadeOutIn(elem, speed){
    if(!elem.style.opacity){
        elem.style.opacity = 1;
    }

    var outInterval = setInterval(function(){
        elem.style.opacity -= 0.02;
        if(elem.style.opacity <=0){
            clearInterval(outInterval);
            elem.remove();
        }
    }, speed/50)
}
/** Variables
 ---------------------------------------------------------*/
/** Reset
 ---------------------------------------------------------*/
* {
  margin: 0;
  padding: 0; }

*,
*::before,
*::after {
  -webkit-box-sizing: inherit;
  box-sizing: inherit; }

html {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  font-size: 62.5%; }

body {
  font-weight: 400;
  line-height: 1.5;
  font-size: 2rem;
  background-color: #bdbdc7; }

/** Primary Container
 ---------------------------------------------------------*/
.container {
  max-width: 180rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex; }

.flex {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center; }

.fadeOut {
  visibility: hidden;
  transition: all 0.5s ease-out; }

/** Input Section
 ---------------------------------------------------------*/
input[type="text"] {
  padding: 0.5rem;
  width: auto;
  min-width: 100%;
  line-height: 2rem; }

.input {
  width: 40rem;
  height: 100vh;
  padding: 1rem;
  background-color: #ccc;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column; }
  .input_title {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column; }
    .input_title-label {
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      justify-content: center; }
    .input_title-input {
      padding: 0.5rem; }
  .input_question {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column; }
    .input_question-label {
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      justify-content: center; }
    .input_question-input {
      padding: 0.5rem; }
  .input_answer {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column; }
    .input_answer-label {
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      justify-content: center; }
    .input_answer-input {
      padding: 0.5rem; }
  .input_question-input.error, .input_answer-input.error {
    border: 2px red solid; }
  .input_submit {
    width: 100%; }
    .input_submit-button {
      margin-top: 1rem;
      padding: 0 1.5rem; }
  .input_start {
    width: 100%; }
  .input_display {
    width: 100%;
    font-size: 1.5rem;
    padding: 2rem 0 1rem 0; }
    .input_display-item {
      margin-bottom: 1rem;
      padding: .2rem 2rem;
      text-transform: capitalize;
      background-color: #fff;
      border-radius: 1rem;
      list-style: none;
      display: -webkit-box;
      display: -ms-flexbox;
      display: flex;
      -webkit-box-pack: justify;
      -ms-flex-pack: justify;
      justify-content: space-between;
      -webkit-box-align: center;
      -ms-flex-align: center;
      align-items: center; }
    .input_display-item:nth-child(odd) {
      background-color: #aaa;
      border-radius: 1rem; }
    .input_display-delete {
      height: 1.8rem;
      width: 1.8rem; }

.input :not(.input_display) div {
  padding-bottom: 2rem; }

/** Quiz Card
 ---------------------------------------------------------*/
.card {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  width: 100%; }
  .card_container {
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    -webkit-perspective: 1000px;
    perspective: 1000px;
    width: 60rem;
    margin: 1rem;
    cursor: pointer; }
    .card_container .front {
      -webkit-transform: rotateY(0deg);
      transform: rotateY(0deg);
      -webkit-transform-style: preserve-3d;
      transform-style: preserve-3d; }
      .card_container .front:after {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        width: 100%;
        height: 100%;
        content: "";
        display: block;
        opacity: 0.6;
        background-color: #000;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        border-radius: 10px; }
    .card_container .back {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      background-color: #cedce7;
      background: linear-gradient(45deg, #dedce7 0%, #596a72 100%);
      -webkit-transform: rotateY(180deg);
      transform: rotateY(180deg);
      -webkit-transform-style: preserve-3d;
      transform-style: preserve-3d; }
    .card_container .front,
    .card_container .back {
      background-color: red;
      background-size: cover;
      background-position: center;
      -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
      transition: -webkit-transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
      transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
      transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1), -webkit-transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
      transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
      -webkit-backface-visibility: hidden;
      backface-visibility: hidden;
      text-align: center;
      min-height: 500px;
      height: auto;
      border-radius: 10px;
      color: #fff;
      font-size: 1.5rem; }

.flip {
  -webkit-transition: -webkit-transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transition: -webkit-transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1), -webkit-transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1); }
  .flip .back {
    -webkit-transform: rotateY(0deg);
    transform: rotateY(0deg);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d; }
  .flip .front {
    -webkit-transform: rotateY(-180deg);
    transform: rotateY(-180deg);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d; }

.inner {
  -webkit-transform: translateY(-50%) translateZ(60px) scale(0.94);
  transform: translateY(-50%) translateZ(60px) scale(0.94);
  top: 50%;
  position: absolute;
  left: 0;
  width: 100%;
  padding: 2rem;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  outline: 1px solid transparent;
  -webkit-perspective: inherit;
  perspective: inherit;
  z-index: 2; }

/* The particular element applying the animation
==============================================*/

.quiz_question {
  animation: fade 10s linear; }

/* ============================================
==============================================*/

.front .inner p {
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative; }

.card_container-guess {
  padding-top: 2rem; }
  .card_container-guess .guess_input {
    width: 2rem;
    margin: 1rem auto;
    padding: 1rem;
    border-radius: 1rem;
    -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55), 0px 1px 1px rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55), 0px 1px 1px rgba(255, 255, 255, 0.5);
    border: 1px solid #666;
    opacity: 0.6;
    outline: none; }
    .card_container-guess .guess_input:hover, .card_container-guess .guess_input:focus {
      opacity: .8;
      color: #08c;
      -webkit-box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.25), inset 0px 3px 6px rgba(0, 0, 0, 0.25);
      box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.25), inset 0px 3px 6px rgba(0, 0, 0, 0.25); }
  .card_container-guess-buttons {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between; }
    .card_container-guess-buttons .btnNew {
      margin: 1rem 2rem; }

.btnNew {
  height: 5rem;
  width: 12rem;
  margin: 1.5rem 3rem 1rem 1rem;
  font-weight: 700;
  color: #333;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#f4f1ee), to(#fff));
  background-image: linear-gradient(to bottom, #f4f1ee, #fff);
  -webkit-box-shadow: 0px 8px 30px 1px rgba(0, 0, 0, 0.3), inset 0px 4px 1px 1px white, inset 0px -3px 1px 1px rgba(204, 198, 197, 0.5);
  box-shadow: 0px 8px 30px 1px rgba(0, 0, 0, 0.3), inset 0px 4px 1px 1px white, inset 0px -3px 1px 1px rgba(204, 198, 197, 0.5);
  border-radius: 5%;
  position: relative;
  -webkit-transition: all .1s linear;
  transition: all .1s linear;
  outline: none; }

.btnNew:after {
  color: #e9e6e4;
  content: "";
  display: block;
  font-size: 30px;
  height: 3rem;
  text-decoration: none;
  text-shadow: 0px -1px 1px #bdb5b4, 1px 1px 1px white;
  position: absolute;
  width: 3rem; }

.btnNew:hover {
  background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f4f1ee));
  background-image: linear-gradient(to bottom, #fff, #f4f1ee);
  color: #0088cc; }

.btnNew:active {
  background-image: -webkit-gradient(linear, left top, left bottom, from(#efedec), to(#f7f4f4));
  background-image: linear-gradient(to bottom, #efedec, #f7f4f4);
  -webkit-box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.4), inset opx -3px 1px 1px rgba(204, 198, 197, 0.5);
  box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.4), inset opx -3px 1px 1px rgba(204, 198, 197, 0.5);
  outline: none; }

.btnNew:active:after {
  color: #dbd2d2;
  text-shadow: 0px -1px 1px #bdb5b4, 0px 1px 1px white;
  outline: none; }

/* KeyFrame Animation in question */
@keyframes fade {
  0% {
    opacity: 100%; }
  100% {
    opacity: 0%; } }

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Flash</title>

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

                Enter a Title
                <input class="input_title-input" id="title" type="text" placeholder="List of Towels">

                Enter a Question
                <input class="input_question-input" id="question" type="text" placeholder="What is 42?">

                Enter an Answer
                <input class="input_answer-input" id="answer" type="text" placeholder="The Meaning Life, Universe, and Everything">

                <button class="input_submit-button btnNew">Submit</button>

                <button type="button" class="input_start-btn btnNew" disabled>Start Quiz</button>

Please Set Some Questions Up

                    <input type="text" class="guess_input">

                        <button class="submitGuess btnNew">Submit Guess</button>
                        <button class="nextQuestion btnNew">Next Question</button>

A: The main problem there is that you want replace a string with another string. So you can't really fade out the first and fade in the second a the same moment. You could make another card as overflow and put it over the question card, so you have more control over the animation and text style.
I replaced the submitGuess.addEventListener with this one:
    // Event Listener to test if guess is correct
submitGuess.addEventListener("click", function() {
  if (guessInput.value.toLowerCase() === qChosen.answer.toLowerCase()) {
    card.classList.toggle("flip");
    submitGuess.disabled = true;
  } else {
    // Insert wrong message here
    cardQuestion.style.animation="colorfadeerr 0.5s ease-in-out forwards";
    // SetTimeout to reset back to Chosen Question
    setTimeout(function(){
      cardQuestion.style.animation="colorfadequestion 0.3s ease-in-out";
    }, 1500);
  }
});

cardQuestion.addEventListener("animationstart", function() {
  if(cardQuestion.textContent === qChosen.question)
    cardQuestion.textContent = "You have guessed incorrectly. Please Try Again";
  else
    cardQuestion.textContent = qChosen.question;
});

And added this in the css:
@keyframes colorfadeerr {
  0% {
    color: rgba(255,255,255,0.0); }
  10% {
    color: rgba(255,255,255,0.0); }
  100% {
    color: rgba(255,200,200,1.0); }
    }

@keyframes colorfadequestion {
  0% {
    color: rgba(255,255,255,0.0); }
  30% {
    color: rgba(255,255,255,0.0); }
  100% {
    color: rgba(255,255,255,1.0); }
    }

The first animation will hide the text and show you the error message with another color. The second animation will show you the first text again (white).
I don't know if this can help you. I tried to leave it similar to your code. But as said, the effect would be nicer if you can put another card over your question. So you have a fade out of the question and a fade in of the error message at the same time.


text:
Q: Convert HTML invoice and Email i am developing an ERP.  i have html invoice and  need as  email. The question is  constructing  invoice in jquery & ajax, i need to convert PDF and mail that invoice, please help me regarding this!!

A: You probably need to concentrate on one item at a time. This is just a head start of your requirement.

*

*Build the Invoice :  Integrate an editor just like this or you can get from CkEditer(If want  your user to change the content/design)

*Generate  the PDF : Grab the html from the Editer and send that to create the PDF (you can use itextSharp or EO.PDf
//Code to convert an Url or HTML file to PDF. The following code writes  output to a file. You can
//also write output to a Stream, a PdfPage, or a PdfDocument object
HtmlToPdf.ConvertUrl(urlOrHtmlFile, outputFileName);

*Attach the generated PDF, and Email.
Email with Attachment
Check and change your spec as required.
Ask Questions  with specific scenario on SO to get help on that.


text:
Q: Python: Exception handling The code below asks the user to input a directory and a word. The program searches for the word through files in the directory and sub subdirectories. It prints out the name of the directories, how many directories and files that has bee searched in and the number of times the word is found. The code seem to work, but I would like it to print "Folder not found" if the user type in a path that does not exist. The attempt below prints nothing. Any ideas?
import os
import tkinter as tk

results = []
dirs = 0
files = 0
words = 0

def recSearch(path,word):
    global dirs
    global files
    global words
    foldername = os.listdir(path)

    try:
        for i in foldername:
            if os.path.isdir(f"{path}\\{i}"):
                results.append(f"{path}\\{i}")
                dirs += 1
                recSearch((f"{path}\\{i}"),word)
            else:
                with open(os.path.join(path, i), "r") as fileObject:
                    for j in fileObject:
                        if word in j:
                            files += 1
                            words += j.count(word)
    except NotFound:
        text.insert('end', 'Folder not found')

def click():
    recSearch(path.get(), word.get())
    text.insert('end', "Search start\n---------------------------------\n")
    for i in results:
        text.insert('end', i + "\n")
    text.insert('end', '---------------------------------\n')
    text.insert('end', f"Searched: {dirs} directories and {files} files, found {words} occurences of {word.get()}")

window = tk.Tk()
window.title("Find word")
path = tk.StringVar()
entry = tk.Entry(window, textvariable=path, width=50)
entry.insert(-1,"Directory or filename")
word = tk.StringVar()
word_entry = tk.Entry(window, textvariable=word, width=20)
word_entry.insert(-1, "Word")
search_button = tk.Button(window, text="Search", width=15, command=click)
text = tk.Text(window, height=50, width=180)
entry.grid(row=0, column=0)
word_entry.grid(row=0, column=1)
search_button.grid(row=0, column=2)
text.grid(row=1, columnspan=3)
window.mainloop()


text:
Q: I want the HostStartTime column in descending order from CTE I want the HostStartTime column in descending order from CTE
WITH FilterData
     AS (
     SELECT(CONVERT(VARCHAR(35), HostStartTime, 103)+' '+(CONVERT(VARCHAR(35), HostStartTime, 24))) HostStartTime,
        --stuff(stuff(reserve1,1,4,'****'),len(reserve1)-3,4,'****')
           stuff(reserve1, 5, 8, '********') AS CardNo,
           Reserve2 AS AccountNumber,
           (CASE
                WHEN HostResponse = 'Y'
                THEN 'SUCCESS'
                ELSE 'FAILURE'
            END) HostResponse,
           HostID
     FROM TBL_Host
     WHERE HostStartTime >= @i_StartDate
           AND HostStartTime <= @i_EndDate
           AND HostID = 'GENERATE_PIN'
     ORDER BY HostStartTime DESC)
     SELECT HostStartTime,
            isnull(CardNo, 'NA') CardNo,
            AccountNumber,
            HostResponse,
            HostID
     FROM FilterData
     ORDER BY HostStartTime DESC;

A: Since the original HostStartTime column is already datetime/timestamp, it should sort as a datetime properly.  A quick fix here might be to add that column to the select list of your CTE, and then use it to do the final ordering:
WITH FilterData AS (
    SELECT
        -- add the next line to your CTE
        HostStartTime AS HostStartTimeOrig,
        CONVERT(VARCHAR(35), HostStartTime, 103) + ' ' +
            CONVERT(VARCHAR(35), HostStartTime, 24) AS HostStartTime,
        STUFF(reserve1, 5, 8, '********') AS CardNo,
        Reserve2 AS AccountNumber,
        CASE WHEN HostResponse = 'Y' THEN 'SUCCESS'
            ELSE 'FAILURE' END AS HostResponse,
        HostID
    FROM TBL_Host
    WHERE HostStartTime BETWEEN @i_StartDate AND @i_EndDate AND
        HostID = 'GENERATE_PIN'
)

SELECT
    HostStartTime,
    ISNULL(CardNo, 'NA') CardNo,
    AccountNumber,
    HostResponse,
    HostID
FROM FilterData
ORDER BY
    HostStartTimeOrig DESC;


text:
Q: flutter firebase cloud function emulator, on call functions not working I use firebase emulator and my cloud functions are in error...
I call my function like that :
HttpsCallable displayNameAndEmail = FirebaseFunctions.instanceFor(region: 'europe-west1').httpsCallable("displayNameAndEmail");

displayNameAndEmail.call({
          'displayName': "$firstName $lastName",
          'lang': lang,
          'email': email
        });
        print("\nDisplayName6\n\n");

And here is the error I get :
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: [firebase_functions/unavailable] UNAVAILABLE
E/flutter (14049):
E/flutter (14049): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7)
E/flutter (14049): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
E/flutter (14049): <asynchronous suspension>
E/flutter (14049): #2      MethodChannelHttpsCallable.call (package:cloud_functions_platform_interface/src/method_channel/method_channel_https_callable.dart:22:24)
E/flutter (14049): <asynchronous suspension>
E/flutter (14049): #3      HttpsCallable.call (package:cloud_functions/src/https_callable.dart:34:37)
E/flutter (14049): <asynchronous suspension>
E/flutter (14049):
E/flutter (14049): #0      MethodChannelHttpsCallable.call (package:cloud_functions_platform_interface/src/method_channel/method_channel_https_callable.dart:38:7)
E/flutter (14049): <asynchronous suspension>
E/flutter (14049): #1      HttpsCallable.call (package:cloud_functions/src/https_callable.dart:34:37)
E/flutter (14049): <asynchronous suspension>
E/flutter (14049):

Any idea ?

A: The first line creates a separate FirebaseFunctions instance (for the specified region). You have to instruct this new instance to connect to the emulator as Frank pointed out in the first comment.
Here is the FlutterFire documentation providing more details. If you are on Android:

*

*remember to use 10.0.2.2 as the host (necessary when using the Android emulator)

*add

<application android:usesCleartextTraffic="true"/>

to android\app\src\debug\AndroidManifest.xml. This allows plain HTTP traffic to/from the Firebase emulators.
Another useful mention is to leverage the dart cascade notation, .., as follows:
String ip = Platform.isAndroid ? '10.0.2.2' : 'localhost';

var instance = FirebaseFunctions.instanceFor(region: 'europe-west1')
  ..useFunctionsEmulator(origin: 'http://$ip:5001');
HttpsCallable displayNameAndEmail =
  instance.httpsCallable("displayNameAndEmail");

Also, if you upgrade to the latest version, the FlutterFire team seems to aim for a more uniform approach/interface. All emulator enabling methods (such as useFunctionsEmulator) now accept host and port as positional arguments (previously it took only one named argument, origin).

A: In my case,
I have only used it like that. I haven't edited the XML, nor do I need to put localhost 10.0.2.2 for android. Just add your region.
  FirebaseFunctions.instanceFor(region: "us-central").useFunctionsEmulator('localhost', 5001);


text:
Q: How can I separate areas with floats from each other? I'm struggling with Bootstrap rows and columns in a SharePoint web site. The problem is that I can't and don't want to change the styling that originates from SharePoint, but still be able to use the Bootstrap grid in a part of the page.
I've tried to illustrate the problem without Bootstrap and SharePoint. Here's the JSFiddle:
https://jsfiddle.net/knLjyhe4/
Below is a complete illustration of my example. The problem is that once I use a row to separate element B from C, D and E, the height of side element A affects the first row's height, which I don't want. I want element C to appear immediately below element B. The second example is how it looks before I add the div.row elements.

Below is the HTML and CSS for the isolated example. I had hoped that I could style the div.main element somehow so that the float of A doesn't affect the float of B-E at all. But I can't figure it out.
Please note that I'm sure there are several solutions if I start to change the HTML and styles (like using position), but I really just want to know if there is a way in CSS where the div.main element gets "its own" floating area, without being affected by the A element's float.

This is element A in problematic example. I want element C immediately below element B, regardless of the height of this element

This is element B

This is element C

This is element D

This is element E

This is element A when it works but without rows

This is element B

This is element C

This is element D

This is element E

This is element F

This is element G

This is element H

This is element I

A: Seems to be working if you change your CSS for .main to this (display: table-row;):
.main {
  margin-left: 240px;
  display: table-row;
}

Updated JSFiddle here
UPDATE 1
Changed table to table-row since it did not work in IE10.
UPDATE 2
For future reference, the final solution used in SharePoint / O365 looked something like this:
HTML (.container is a bootstrap container)

CSS
.container .inner-container {
    display: inline-block;
    width: 100%;
}

A: The .main needs to be float:left and it needs to have less px to width.
Try defines
  .side {width:30%; float:left;}
  .main{width:70%; float:left; margin-left:0; }

Don't forget to clean the margin-left of .main

A: The clear: both property on the row:after pseudoclass is causing your second row to jump down below the left-floated side element.
In bootstrap you should use classname col-md-4 on your side element, classname col-md-8 on your main element, and remove the float: left property from your side element.  This will give you 2 columns, one for side which is 4 grids wide and one for main which is 8 grids wide.  Your rows should function as you expect once the float is gone.

This is element A

This is element B

This is element C

This is element D

This is element E

In general, with bootstrap you don't want to float things.  Also, instead of setting element widths explicitly, it is better to use the .col- classes to fit them into the bootstrap grid system.


text:
Q: iOS 5 - Dividing UITableView into sections by Core Data Attribute I'm quite the newbie at Core Data, so please bear with me. ;)
In my Data Model, I have a single entity called "Item", with 2 attributes, "Section" and "Name." I already have the UITableView (my main view) populated using by Name, but I want to divide the TableView into 3 different sections, determined by attribute "section." I'm thinking that the "section" attribute should be an integer, so 0 would be the first section, 1 would be the second and 2 would be the third.
I really am not sure how to divide the TableView into the sections. I'm using NSFetchedResultsController. Here's the current code.
- (void)setupFetchedResultsController
{
// 1 - Decide what Entity you want
NSString *dbEntityName = @"Item"; // Put your entity name here

// 2 - Request that Entity
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:dbEntityName];

// 3 - Filter it if you want
//request.predicate = [NSPredicate predicateWithFormat:@"Item.name = what"];

// 4 - Sort it if you want
request.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"name"
                                                                                ascending:YES
                                                                                selector:@selector(localizedCaseInsensitiveCompare:)]];
// 5 - Fetch it
self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request
                                                                    managedObjectContext:self.managedObjectContext
                                                                      sectionNameKeyPath:nil
                                                                               cacheName:nil];
[self performFetch];
}

Also, I was wondering if the Fetch Request template inside the data model in Xcode would help out at all. I see how to create the fetch request, but not how to make it do anything with what it fetches (ex: put the fetched data into a certain TableView section.)
If anyone could help out, it would be greatly appreciated.

A: You need to choose a sectionNameKeyPath when creating the NSfetchedResultsController. That should point to a property in your model objects that will be the same for every item in the same section.
To display section headers, make sure you implement all tableView dataSource methods as in the example in NSfetchedResultsController documentation.


text:
Q: GWT Requestfactory coarse grained wrapper object Currently in my application we are using GWT RequestFactory. We have multiple EntityProxy. Couple of finder method returns List from service layer. Since we are using pagination in our application we are returning pre-configured number of EntityProxy in List. We requires total number of EntityProxy also for showing in pagination UI for which we are making separate request. We want to create some wrapper object which encapsulates List and totalRecord count in single class. So in single request we can get both List and record count. What is best to do this using requestfactory ? Note : I am beginner in GWT RequestFactory.

A: The answer of Umit is quite correct. I would only add a layer that abstracts the pagination handling. This comes useful when you have your BasicTables and BasicLists to address all data through the same interface PageProxy (eg. for pagination)
public interface PaginationInfo extends ValueProxy {
    public int getTotalRecords();
    //either have the manual page info
    public int getPageNumber();
    //or use the count API on GAE (returned by your db request as a web safe String)
    public String getCount();
}

public interface PageProxy extends ValueProxy {
    public PaginationInfo getPageInfo();
}

public interface MyEntityProxy extends EntityProxy  {}

public interface MyEntityPageProxy extends PageProxy {
    public List<MyEntityProxy> getEntities();
}

A: Well you can use something along this lines:
public interface MyEntityProxy extends EntityProxy  {}

public interface MyEntityPageProxy extends ValueProxy {
    public List<MyEntityProxy> getEntities();
    public int getTotalRecords();
}

It would be better to use a generic PageProxy interface (i.e. MyEntityPageProxy<T extends EntityProxy>) however because of this bug it's not possible or at least only through a workaround.
So for each EntityProxy you want to have Paginationsupport you have to create a separate PageProxy interface.


text:
Q: ¿Como ordeno un archivo de texto en forma descendente? Hasta ahora he probado con estos ejemplos y no he podido resolverlo:
linea1=(open("ENDEUDADOS2.TXT"))
linea1.sort(reverse=False)

me sale error:

AttributeError: '_io.TextIOWrapper' object has no attribute 'sort'

con este:
linea1=("ENDEUDADOS2.TXT")
linea1.sorted(reverse=False)

error:

AttributeError: 'str' object has no attribute 'sorted'

con este no me escribe nada en el archivo de salida:
linea1=sorted("ENDEUDADOS-FINAL.TXT",reverse=True)
open("ENDEUDADOS2.TXT","w").writelines(linea1)

Gracias por su ayuda

A: Primero, voy a suponer que quieres ordenar las líneas del archivo según orden lexicográfico (como cadenas), en caso contrario necesitarás aplicar el casting adecuado a cada línea antes de ordenar.
La causa de que no funcione te la dice el error en los dos primeros casos:

*

*En el primer código intentas usar el supuesto método sort de linea1, dónde línea1 es
el archivo abierto, un objeto _io.TextIOWrapper  y que por tanto no tiene dicho método. Ten en cuenta que si se sigue las normas de estilo de Python sort es un método que actúa in-place por lo que solo estará definido, si lo está, para objetos mutables como las listas.

*En el segundo caso intentas usar el supuesto método sorted sobre una cadena (porque es solo eso, una cadena con el nombre o ruta de tu fichero). str tampoco tiene dicho método definido. sorted si que es una función preconstruida que acepta cualquier iterable y retorna una lista con los items ordenados.

*En el tercer caso, usas sorted correctamente sobre una cadena (no sobre tu fichero), por lo que al final escribirías en tu archivo la siguiente línea XUTTSONNLIFEEDDDAA.- que son los caracteres ordenados lexicográficamente de "ENDEUDADOS-FINAL.TXT" y esto cuando el GC cierre el archivo y se vacíe el buffer, ya que no cierras el fichero explícitamente y los cambios pueden no reflejarse por tanto de forma inmediata.
La solución simple es usar efectivamente el builtin sorted y pasarle el fichero (el cual es iterable gracias a readline). Es buena práctica cerrar siempre de forma explicita un fichero abierto con open mediante el método close o usar with que lo hará por ti:
with open("ENDEUDADOS.txt") as in_file, open("ENDEUDADOS2.TXT","w") as out_file:
    out_file.writelines(sorted(in_file, reverse=True))


text:
Q: How to prevent the spring boot application starting for each test classes I know this question is an old one but I could not solve the problem in my case. When I am running test classes spring boot application is starting for each test class. I am having bellow annotations in my test class files. I want to start the application only once for all test classes
@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles("test")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
@WithMockUser

A: I have achieved this using a parent BaseTest
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
public abstract class BaseTest {

}

I use SpringRunner but SpringJUnit4ClassRunner should be ok too

A: @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)

By using the WebEnvironment.RANDOM_PORT you are telling spring boot to start a server on each class instantiation.
To avoid this, use a parent class that all testclasses extend from.


text:
Q: Unable to parse pdf by Jpedal I'm facing a problem while parsing a PDF with Jpedal.
While reading the wordlist from the Jpedal, I get garbled characters in the wordslist.  This also happens when using OCR, and when I copy the text from PDF and paste in Word or a simple text editor.   What I understand is this PDF was generated by Quartz PDF context on MAC OS X 10.6.4, which is used to compress the file size, but iseasily viewable on PDF viewers.  I searched for any Java API supporting for decoding this kind of PDF but was unsuccessful.  I'm looking for any application or Java API which I can use to decode it; must be usable on a Linux machine.

A: Hye everybody
I'm posting a possible solution for problem. Here is link describing how quartz parse the pdf and of course which need to be implemented in code cause till now I didn't found any readymade API for it and I believe that stackoverflow is all about taking initiative and do and answer the questions which not been done or asked before.
regards
Rituraj