text:
Q: Finding control on pages that inherits from base page In my project all of the .aspx pages inherit from a custom base class page which in turn inherits from System.Web.UI.Page.
I want to find the controls in current page. for that one I am using
foreach loop
foreach(control c in page.controls)

for this I am unable to cast my current page to system.web.ui.page.
how to cast the current page to system system.web.ui.page?

A: Please note that you are dealing with a control-tree, so you might want to have a recursion here. Following method should help (Linq with a recursive call):
private static IEnumerable<Control> FlattenControlTree<TFilterType>(Control control)
{
    if (control is TFilterType)
    {
        yield return control;
    }
    foreach (Control contr in control.Controls.Cast<Control>().SelectMany((c) => FlattenControlTree<TFilterType>(c)))
    {
        if (contr is TFilterType)
        {
            yield return contr;
        }
    }
}

By the end of the day, you only need to call:
var controls = FlattenControlTree<YourBaseType>(this.Page);

Please note that this kind of recursion is not very effective when it comes to big trees.

A: You may try this;
foreach(Control c in ((System.Web.UI.Page)this.Page).Controls)


text:
Q: Python: Get Argparse.parseargs as Raw String When I try to use argparse.parseargs() by printing it (for example), it always returns Namespace(argName='String Content')
So, if I get returned that I can't use it for other functions, for working with path (in my case).
So, there is a way to only get returned just the string being raw (for working with Windows paths, in my case)?

A: parse_args() returns a collection of values, (roughly) one for each argument you define. That doesn't change just because you only define one argument. Just extract the value you want.
p = ArgumentParser()
p.add_argument('--argName', default="foo")
args = p.parse_args()

print(args.argName)

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to access Response object in NestJS GraphQL resolver How can I access pass @Res() into my graphql resolvers?
this doesn't work:
@Mutation(() => String)
  login(@Args('loginInput') loginInput: LoginInput, @Res() res: Response) {
    return this.authService.login(loginInput, res);
  }

A: @Res() is for HTTP Requests. To access to res object you'd need to first make sure it is added to the context for graphql by using context: ({ req, res }) => ({ req, res }) in the GraphqlModule's options, and then you can use @Context() ctx to get the context and ctx.res to get the response object


text:
Q: Android Studio Change Occurrence Color How can I change the occurrence/write occurrence color in Android Studio? Is this even possible? In Eclipse it was found (on a Mac) under Preferences->General->Editors->Text Editors->Annotations
Does Android Studio even provide this option? It's a number of small annoyances like this (as well as the massive performance issues it seems to be having thus far) that prevent me from moving to Android Studio.
Currently running Android Studio 1.2 Beta if that helps.

A: Go to menu

Preferences > Editor > Color&Fonts > General

Find "Identifier under caret" and change Foregound or/and Background colors with a color you wish. When you click a variable, it will be highlighted with the color you chose.

A: To mark selected occurrences in Android Studio you have to additionally use a shortcut
Ctrl+Alt+Shift+J
to mark them. Then all occurrences will be highlighted with darker better to see color. That option is also available in menu
Edit -> Find -> Select All Occurrences
Still if you want to change that color then you can find it in
File -> Settings -> Editor -> Colors & Fonts -> General -> Selection background
If you are using default scheme then you will have to save a new scheme to change selection background color.
Sadly I didn't find any option to change the color of selected occurrence after selecting class/variable (one click, like in Eclipse). I guess that there is no option for that yet.


text:
Q: CSS Animations : -Webkits in webkits I keep seeing css animation code like this:
@-webkit-keyframes anim{
  0{
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg); /* Is this line needed if it is already declared below? */
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in; /* Is this line needed if it is already declared below? */
  }
  100%{
    -webkit-transform: perspective(400px);
    transform: perspective(400px); /* Is this line needed if it is already declared below? */
  }
}
@keyframes anim{
  0{
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); /* Is this line needed if it is already declared above? */
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    -webkit-animation-timing-function: ease-in; /* Is this line needed if it is already declared above? */
    animation-timing-function: ease-in;
  }
  100%{
    -webkit-transform: perspective(400px); /* Is this line needed if it is already declared above? */
    transform: perspective(400px);
  }
}

QUESTION
Is there any reason to declare non -webkit selectors within a @-webkit-keyframes code block and -webkit selectors within an @keyframes block?
Is the following equivelant to the code above?
@-webkit-keyframes anim{
  0{
    -webkit-transform:perspective(400px) rotate3d(1, 0, 0, 90deg);
    -webkit-animation-timing-function:ease-in;
  }
  100%{
    -webkit-transform:perspective(400px);
  }
}
@keyframes anim{
  0{
    transform:perspective(400px) rotate3d(1, 0, 0, 90deg);
    animation-timing-function:ease-in;
  }
  100%{
    transform:perspective(400px);
  }
}

Do we need to duplicate code within @-webkit-keyframes that is already stated in @keyframes where the @-webkit Is required.
If @-webkit-keyframes is not supported then why bother to declare -webkit functionality within the @keyframes block? Won't this be ignored also? And vice versa, If @-webkit-keyframes IS supported then the browser will use that block so why declare -webkit functionality in the @keyframes block?

A:
Do we need to duplicate code within @-webkit-keyframes that is already stated in @keyframes where the @-webkit Is required.

The answer is "Yes".
The browser will use whatever syntax it recognizes and ignore what it does not...but it will always support the last version that it does support.
So if the broswer doesn't support @keyframes when unprefixed it will ignore the whole statement and fallback to the prefixed version.


text:
Q: Sound Input device (microphone) not working I have recently updated my laptop OS from Ubuntu 12.04 to 14.04
After updating the OS, my laptop's input device ie., microphone is not working.
Earlier it was working with Ubuntu 12.04.
Also there is no sound input device driver detected

I am using Dell Vostro 1014.
after running command $ gstreamer-properties, output is:

I think my microphone is working but is not being betected by ubuntu as in above screenshot.
But after running Pulse Audio Sound Control, it shows input sound progress, it means input device is working but not being detected. Even by Sound Recorder.

After running alsamixer the output is:

A: Had the same problem.  Solved it like this:

*

*Run pavucontrol from the terminal window.

*Check microphone level and mute switch in tab Input Devices.

*Open tab Recording.

*In parallel, start the recording function in the wanted application. E.g. press record in Audacity or start a test call in Skype.

*In the Recording tab of pavucontrol, now a source selection becomes available.  Select the right one.  Worked for me.

To me it is (was) confusing that the source selector is not always present in pavucontrol.

A: I had a similar problem - no sound input device driver detected. I used pavucontrol, as explained in this Ask Ubuntu answer and it solved the problem:

*

*Install pavucontrol: sudo apt-get install pavucontrol

*Run:pavucontrol

*Go to the Input Devices tab

*Click the lock icon to unlock the channels

*Under Port, select the correct microphone (front or rear)

A: Goto PulseAudio volume control --> Configuration, choose "Analog Stereo Duplex" under the Profile section.
Restart your machine.
*Tried in Ubuntu 16.04 LTS

A: If you don't see your Microphone in the Port selection under the input devices in pavucontrol:
use pavucontrol -> configuration -> built_in Audio. Check if you have * Output + * Input choosen in your profile, otherwise your microphone isn't shown in the input devices section and cannot be used.

A: The following might work for you:

*

*Run gksudo gedit /etc/modprobe.d/alsa-base.conf on terminal (if you have no access to a graphical interface in the moment, use sudo nano instead of gksudo gedit.

*Add options snd-hda-intel position_fix=1 or position_fix=2 to the end of the file.

*Reboot

Sources: http://ubuntuforums.org/showthread.php?t=1893142 and https://wiki.ubuntu.com/Audio/PositionReporting

A: sudo nano /etc/modprobe.d/alsa-base.conf

add this line:
options snd-hda-intel index=0 model=laptop-dmic

A: try this in terminal for no sound:
sudo alsa force-reload

restart device and check if sound is workin?
if it doesnt do this:
sudo apt-get remove --purge alsa-base pulseaudio

sudo apt-get install alsa-base pulseaudio

The following commands will also remove some important dependencies that may break Ubuntu. Type in the command sudo apt-get install ubuntu-desktop to reinstall the removed files.
Restart device and check ..This should probably do the job!

A: Open a terminal and issue the command alsamixer you will get a screen like this:

use the right arrow to highlight the Front Microphone
if it's muted as shown above, hit the 'M' key to toggle Mute off.
then use the up arrow to increase the gain (sensitivity) your end result should look similar to this. Hit the Esc key to exit. Your Microphone should now work as advertised.

A: I had the same problem. I found the solution after I upgraded to 16.04, but I think it works on 14.04 too! In Skype click "Open PulseAudio Volume Control". From there on move to "Input Devices" and change the Port. By some miracle my microphone started working after I changed my port to "Microphone (unplugged)". Good luck!

A: I had a similar problem on 14.04, sound input source was blank in the 'Sound Settings'.
I did the following, what did the trick is installing 'Audacity', for more info check the following link
sudo apt-get remove --purge alsa-base pulseaudio
sudo apt-get install alsa-base pulseaudio
sudo apt-get install audacity

A: For me everything looked correct, input device was selected correctly however I was unable to use the inner or the external mic. I solved it by enabling the webcam using the Fn keys. Apparently they are enabled and disabled by the same Fn key.


text:
Q: How to calculate average time differences by group? My data looks like this:
data <- read.table(header=T, text= '
 PID     Date           Date.diff
  1      2020-01-01     0
  1      2020-01-02     1
  1      2020-01-10     8
  2      2020-01-15     0
  3      2020-01-02     0
  4      2020-02-02     0
  4      2020-03-01     28
  4      2020-04-15     45
  ..     ..
 ')

Each date refers to a date that (in this case) a patient had a test done.
Using this code:
data$Date.diff <- unlist(tapply(data$Date, INDEX=data$PID, FUN=function(x)
  c(0, diff(as.numeric(x)))))

I was able to calculate the difference in dates (in days) as in the Date diff column.
If I calculate a mean based on Date diff, the result would be the mean number of days between all tests.
Now I would like to know the mean number of days between the 1st and 2nd, 2nd and 3rd ect.. tests, because I want to know if the intervals are getting shorter/longer.
Is that at all possible?

A: You could create a test number column for each patient and then for each test number calculate the average of Date.diff.
library(dplyr)

data %>%
  group_by(PID) %>%
  mutate(test_number = row_number()) %>%
  group_by(test_number) %>%
  summarise(Date.diff = mean(Date.diff)) -> result
result

A: You could use lag to make an offset column in your data frame and find the interval duaration, here is a solution with dplyr and lubridate:
library(dplyr)
library(lubridate)

data %>%
  mutate(across("Date", ymd)) %>%
  group_by(PID) %>%
  mutate(lag = lag(Date),
         diff2 = as.numeric(as.duration(interval(lag, Date)), "days")) %>%
  group_by(row_number()) %>%
  summarise(mean_days = mean(diff2, na.rm = TRUE), .groups = "drop")

# A tibble: 3 x 2
  `row_number()` mean_days
          <int>     <dbl>
1             1     NaN
2             2      14.5
3             3      26.5

A: Using ave is nicer to apply functions group-wise in order to create new columns, i.e. date differencing in your case. It already gives vectors back and avoids unlisting.
dat$Date.diff <- with(dat, ave(as.numeric(Date), PID, FUN=function(x) c(0, diff(x))))

head(dat)
# PID       Date Date.diff
# 1   1 2020-01-03         0
# 2   1 2020-01-03         0
# 3   1 2020-01-18        15
# 4   1 2020-01-24         6
# 5   1 2020-01-24         0
# 6   2 2020-01-05         0

tapply is now rather useful to tabulate by group. We may use it here to calculate the differences of the mean.Dates very easily. (The `1`=0 is just cosmetcis).
c(`1`=0, diff(with(dat, tapply(Date, PID, FUN=mean.Date))))
#   1    2    3    4    5
# 0.0  9.0 16.2  4.4 21.6

Data
dat <- structure(list(PID = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,
3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L),
    Date = structure(c(18264, 18264, 18279, 18285, 18285, 18266,
    18281, 18286, 18291, 18298, 18287, 18295, 18303, 18308, 18310,
    18288, 18297, 18304, 18310, 18326, 18302, 18319, 18332, 18335,
    18345), class = "Date")), row.names = c(NA, -25L), class = "data.frame")


text:
Q: EntityManager.persist problem on load related entity i have a problem with EntityManager.persist (i use tooplink of glassfish).
My code is:
MyEntity e = new MyEntity();
MyEntityPK ePK = new MyEntityPK();
ePK.setField1("aaa");
ePK.setField2("bbb");

e.setMyEntityPK(ePK);
e.setFiled3(ccc);

entityManager.persist(e);

//HERE NOT PROBLEM
//If a i want a related entity, i get null

AnotherEntity anotherEntity = e.getAnotherEntity();
//a is null

Why "anotherEntity" is null? After a persist, the object begin attached to PersistenceContext.
Why the related entity are not loaded if i call getAnotherEntity()
Tanks!
Luigi

A: persist() persists (inserts) the object. It persists what you pass it, the object will remain the same before and after the persist, except for a possible assign generated id.
You seem to want to find an existing entity not persist a new one.  For this you should use find() not persist.


text:
Q: Showing success icon in bootstrap 4 As I migrated from bootstrap 3.3.7 to Bootstrap 4, I learned of glyphicon being discontinued. So how to show success using font-awesome? What is the font-awesome equivalent for glyphicon-ok?
Does Anyone out here have a font-awesome equivalent sheet for all glyphicon icons.

A: Font Awesome assigns other name: "check". HTML icon is: <i class="fa fa-check"></i>.


text:
Q: Canonical basis of cluster algebras Let $x_{k+1} = \frac{x_k^{d_k}+1}{x_{k-1}}$, $k \in \mathbb{Z}$, where $d_{k+2} = d_k \in \mathbb{Z_{>0}}$. Let $b=d_1$ and $c=d_2$. Define the cluster algebra $A = A(\left( \begin{matrix} 0 & b \\ -c & 0 \end{matrix} \right))$ to be the algebra generated by all $x_k$. Is the following set $B$ a totally positive basis of $A$?
$$
B = \{ x_0^{m_0} x_1^{m_1} x_2^{m_2} x_3^{m_3}: min(m_0, m_2)=0, min(m_1, m_3)=0 \}.
$$
Are there some references for the canonical basis of the algebra $A$? Thank you very much.

A: You should look at Positivity and canonical bases in rank 2 cluster algebras of finite and affine types by Sherman and Zelevinsky where they are able to construct a canonical basis explicitly for finte type and affine type (i.e. $bc < 4$ and $bc = 4$ respectively). Your $B$ is a basis for $A$ called the standard monomial basis. However it is not canonical as you can choose any four consecutive $x_i, x_{i+1}, x_{i+2}, x_{i + 3}$. Also it does not have the following notion of positivity.
Given $y \in A$ we call $y$ positive if the expansion of $y$ as a Laurent polynomial in every cluster $x_i, x_{i+1}$ has only positive coefficients. We want a basis so that the positive elements of $A$ are positive combinations of the basis elements.
For $(b,c) = (2,2)$ consider $z = x_0x_3 - x_1x_2$, then
$$z = \frac{x_1^2 + x_2^2 + 1}{x_1 x_2},$$
and by symmetry is also a Laurent polynomial with positive coefficients for any other cluster.
For finite type the canonical basis is all cluster monomials and for affine type the basis is all cluster monomials along with some additional elements.


text:
Q: Problem with connecting to localhost on Ubuntu WSL2 I set up locally Apache2 server for django project, and it worked perfectly well. The problem is that after one day off i got back to it and tried getting on server, and somehow i couldn't connect to it, even after checking if apache service is running, and reloading configuration just to be sure. I couldn't access it from localhost, and any other local tag.
So after that i tried with django runserver command. Server was running, but i couldn't get on it as well. 2 days before, it worked without any issues. I'm using Ubuntu on WSL 3, and on windows i can run server without any problems. Tried pinging localhost and got 100% package loss.
What i did then was restarting whole Ubuntu service with wiping all data. After setting up system everything worked again. The thing is that this is second time that this problem is occuring, and last time i get rid of it the same way, just restarting whole Ubuntu with removing all data. Second time after setting everything up and running server i tried restarting my computer to check if this problemm occurs, after windows restart, but it worked.
EDIT:
I just discovered something really strange. I tried turning off my computer, and then turning it on. I could not connect to server, but after rebooting it i can connect like nothing happens. Tried it few times and literally every time after reboot i can connect, but after turning it off, and turning on i can't connect.

A: See this answer for more details. Some more details, however:
A shortcut to recovery should be running:
wsl --shutdown
After that, WSL's localhost port auto-mapping should be back to normal.
But for a more permanent fix, try disabling Windows Fast Startup.  This setting is causing Windows to pseudo-hibernate, which seems to be the biggest culprit in the localhost breakdown.


text:
Q: How to set default registers in vim? I want to set the default register of d, x, and c to the black hole and use some mapping for use other register, like <leader>d "*d
Of course I can remap like
noremap d "_d

but then I'd have to remap dd to "_dd and when I select something and press d vim waits a second because it could be dd, or just d. Other thing I could do is: noremap _ "_ but I dont want to tell vim that I want to use the black hole register each time I want to really delete something.

A: That behaviour is hardcoded and you can't do anything to change it except creating lots of brittle mappings.
You will be better off embracing the versatility of register rather than fighting it.


text:
Q: Android Sqlite Data lost when Application Hangs/Freeze and restarted Recently my users are complaining that application hangs while using it and the data stored getting lost when the reboot the mobile.
Its not happening everytime too.
Can some one please tell me for what are all the reasons sqlite data will get lost.?
Also for what are the reasons android application freeze?
Background : My application perform sqlite operation from all the screens. The device

Model Number: Samsung GT-18160 , Android Version:2.3.6 , Kernel
  Version:2.6.35.7-1219296 dpi@DELL210#2

A: You can assume no data should be lost. But you may want to nail down crash culprit first - luckily your user is on 2.x so tell him to use tools like aLogCat and grab the logs after your app crash. Then check what's there and fix. That should solve your "data lost" issue as whatever it is, it occurs after your app crashed. If it stop crashing then it should not trigger the snowball....


text:
Q: Setting up Autoreply outside office hours on Gmail I need to set up an auto responder for my Gmail account outside office hours, and I added this code to my Gmail account using Google scripts:

function autoReply() {
var interval = 5;    //  if the script runs every 5 minutes; change otherwise
  var date = new Date();
  var day = date.getDay();
  var hour = date.getHours();
  if ([6].indexOf(day) > -1 || (day == 0 && hour < 10) || (day == 5 && hour >= 19)) {
    var timeFrom = Math.floor(date.valueOf()/1000) - 60 * interval;
    var threads = GmailApp.search('is:inbox after:' + timeFrom);
    for (var i = 0; i < threads.length; i++) {
      if (threads[i].isUnread()){
      threads[i].reply("I am out of office. Your email will not seen until Monday morning.");
      threads[i].markRead();
      threads[i].markImportant();
      }
    }
  }
}

For some reason, it's not sending an autoreply when emails are sent to my account:
I need it to send auto-replies on Saturday all day and Sunday through Friday only outside office hours.
Can anyone tell me what's wrong with my code?

A: If you want this script to send an autoreply all day Saturday, and Sunday through Friday outside of office hours, change this line:
if ([6].indexOf(day) > -1 || (day == 0 && hour < 10) || (day == 5 && hour >= 19)) {

to:
if ([6].indexOf(day) > -1 || (hour < 10) || (hour >= 19)) {

the way it is coded now, it only replies on saturday, on sunday before 10, and on friday after 7pm.  it won't reply any other day.


text:
Q: I am trying to run a cjsx file. and while running "bundle install" i got this error. Gorans-MacBook-Pro:Dweller Goran$ bundle install
.
.
.
.
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v '1.8.3' succeeds before bundling


text:
Q: Im getting an await outside yield error for a minigame command Im setting up a minigame in one of my cogs and i get this error, discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.Games' raised an error: SyntaxError: 'await' outside async function (Games.py, line 78) This command works fine in my main.py though. My code is below, Thanks!
@commands.command()
    async def numbergame(self, ctx):

      channel = ctx.channel
      await channel.send("Guess the number from 0-100 by writing the number in this channel!")

      number = random.randint(1,100)

      def check(m):
        return m.content.isdigit() and m.channel == channel and m.author == ctx.author

        while True:
           try:
               msg = await self.bot.wait_for('message', timeout=30.0, check=check)
           except asyncio.TimeoutError:
               return await channel.send(f"{ctx.author.mention}, You are late to guess!")
           guess = int(msg.content)
           if guess == number:
               return await channel.send(f"Correct answer! {ctx.author.mention}")
           elif guess > number:
               await channel.send(f"{ctx.author.mention}, Your guess was too high!")
           elif guess < number:
               await channel.send(f"{ctx.author.mention}, Your guess was too low!")

A: Your while loop is inside the check function, when it's suppose to be inside the numbergame function. Try unindenting the while loop as follows:
@commands.command()
async def numbergame(self, ctx):
    channel = ctx.channel
    await channel.send("Guess the number from 0-100 by writing the number in this channel!")

    number = random.randint(1,100)

    def check(m):
        return m.content.isdigit() and m.channel == channel and m.author == ctx.author

    while True:
        try:
            msg = await self.bot.wait_for('message', timeout=30.0, check=check)
        except asyncio.TimeoutError:
            return await channel.send(f"{ctx.author.mention}, You are late to guess!")

        guess = int(msg.content)
        if guess == number:
            return await channel.send(f"Correct answer! {ctx.author.mention}")
        elif guess > number:
            await channel.send(f"{ctx.author.mention}, Your guess was too high!")
        elif guess < number:
            await channel.send(f"{ctx.author.mention}, Your guess was too low!")


text:
Q: How to find the list of only application running in windows? I want  to find the list of all  application running in windows.The list should consist of application only and not all process
Process p = Runtime.getRuntime().exec
        (System.getenv("windir") +"\\system32\\"+"tasklist.exe");
        try (BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()))) {
            while ((line = input.readLine()) != null) {
                System.out.println(line); //<-- Parse data here.
            }
        }

A: An application is a program which you interact with on the desktop. This is what you spend almost all of your time using on the computer. Internet explorer, microsoft word, iTunes, skype - they are all applications.
A process is an instance of a particular executable (.exe program file) running. A given application may have several processes running simultaneously. For example, some modern browsers such as google chrome run several processes at once, with each tab actually being a separate instance/process of the same executable.
So, what you could do is:
try {
        String line;
        Process p = Runtime.getRuntime().exec(System.getenv("windir") +"\\system32\\"+"tasklist.exe");
        BufferedReader input =
                new BufferedReader(new InputStreamReader(p.getInputStream()));
        while ((line = input.readLine()) != null) {
            //<-- Parse the line and insert into a set using image field as a key
        }
        input.close();
    } catch (Exception err) {
        err.printStackTrace();
    } // do not forget to handle exceptions!

you will need some filtering though, for example inserting the result of the tasklist command into a Set by the name in the 'image' column because they are all associated with the same app:


text:
Q: Passing arguments to callback functions How can I pass parameters to an arrow function when an eventListener is triggered?
// Name of certificate
let certificateName = document.querySelector('.js--c-name').value;

// Call upload function
currentFileInput.addEventListener('change', fileUpload , false);

const fileUpload = (certificateName) = (evt) => {
  // Here I need the parameter certificateName for testing
  console.log(`Name of Certificate: #{certificateName}`);

  // Function stuff...
  let myFile = evt.target.files[0],
      maxFileSize = evt.target.getAttribute('data-fileSizeMax');

  // Check filesize
  if(myFile.size <= maxFileSize){
   // etc.
  }

}

A: Make your fileUpload to return the inner function
const fileUpload = (certificateName) => (evt) => {

  console.log(`Name of Certificate: #{certificateName}`);

  let myFile = evt.target.files[0],
      maxFileSize = evt.target.getAttribute('data-fileSizeMax');

  if(myFile.size <= maxFileSize){
   // etc.
  }

}

You need to call the fileUpload function and pass certificateName.
currentFileInput.addEventListener('change', fileUpload(certificateName), false);

A: You need to wrap the function call in another function
let certificateName = document.querySelector('.js--c-name').value;

currentFileInput.addEventListener('change', function(e){
  fileUpload(e, certificateName ); //observe changes in this line
}, false);

const fileUpload = (evt, certificateName) => { //pass the arguments
  //rest of your code as is
}


text:
Q: How to take into account empty groups in Report Builder I have asset conditions that I am graphing for my Council using Microsoft Report Builder and I can't figure out a way to show categories that have no data against them. So below for instance, I have two examples of graphs of different asset types. The top graph has all of the categories I require (Excellent, Good, Fair, Poor and Failed), but the bottom graph is missing any examples of Failed assets. Is there any way that I can specify what categories must be included, so that blank ones are covered?
Example images:


text:
Q: ElasticSearch: Result window is too large My friend stored 65000 documents on the Elastic Search cloud and I would like to retrieve all of them (using python). However, when I am running my current script, there is an error noticing that :
RequestError(400, 'search_phase_execution_exception', 'Result window is too large, from + size must be less than or equal to: [10000] but was [30000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting.')

My script
 es = Elasticsearch(cloud_id=cloud_id, http_auth=(username, password))
 docs =  es.search(body={"query": {"match_all": {}}, '_source': ["_id"], 'size': 65000})

What would be the easiest way to retrieve all those document and not limit it to 10000 docs? thanks

A: The limit has been set so that the result set does not overwhelm your nodes. Results will occupy memory in the elastic node. So bigger the result set, bigger the memory footprint and impact on the nodes.
Depending on what you want to do with the retrieved documents,

*

*try to use the scroll api (as suggested in your error message) if its a batch job. Be mindful of the lifetime of scroll context in that case.
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-scroll

*or, use the Search After
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-search-after

A: The error message itself is mentioning that how can you solve the issue, look carefully this part of the error message.

This limit can be set by changing the [index.max_result_window] index
level setting.

Please refer update indices level setting on how to change that.
So for your setting it would look like:
PUT /<your-index-name>/_settings
{
    "index" : {
        "index.max_result_window" : 65000 -> note its equal to your all the docs in your index
    }
}

A: You should use the scroll API and get the results in different calls. The scroll API will return to you the results 10000 by 10000 as maximum (that will be available to consult during the amount of time you indicate in the call) and you will be able then to paginate the results and obtain them thanks to a scroll_id.


text:
Q: $\sqrt[3]{3} + \sqrt[3]{9}$ is algebraic over $\mathbb{Q}$ Show that $\alpha = \sqrt[3]{3} + \sqrt[3]{9}$ is algebraic over $\mathbb{Q}$ by presenting a polynomial $p$ from $\mathbb{Q}[X]$ with $p(\alpha)$.
It seems like $$\mathbb{Q}(\sqrt[3]{3} + \sqrt[3]{9}) = \{a + b\sqrt[3]{3} + c\sqrt[3]{9},~a,b,c\in\mathbb{Q} \},$$ but I'm stuck proving that it's closed under inverse. If that is true, then the minimal polynomial should be of 3rd degree. True or not, I can't find any such polynomial.
Solution: As @José Carlos Santos mentioned below:
$$\alpha^3=12+9\sqrt[3]3+9\sqrt[3]9=12+9\alpha,$$
from which it follows
$$(x - \sqrt[3]3-\sqrt[3]9)(x^2 + x(\sqrt[3]3+\sqrt[3]9) + (\sqrt[3]3+\sqrt[3]9)^2) - 9(x - \sqrt[3]3 - \sqrt[3]9)= x^3 - 12 - 9(\sqrt[3]3+\sqrt[3]9) -9x + 9(\sqrt[3]3+\sqrt[3]9) = x^3 - 9x - 12 = p(x);~~ p(\alpha) = 0.$$

A: Note that$$\alpha^3=12+9\sqrt[3]3+9\sqrt[3]9=12+9\alpha.$$

A: Let's have $q=\sqrt[3]{3}\quad$ and $\quad\alpha=q+q^2$.
$$q+q^2+q^3=q(1+q+q^2)\iff3+\alpha=q(1+\alpha)$$
Now since $q^3=3$ then $\alpha$ is solution of $$(3+\alpha)^3=3(1+\alpha)^3\iff 12+9\alpha-\alpha^3=0$$

A: If $\root 3 \of 3$ and $\root 3 \of 9$ are algebraic, then so is $\root 3 \of 3 + \root 3 \of 9$. The polynomial for $\root 3 \of 3$ is obviously $x^3 - 3$, and $x^3 - 9$ for $\root 3 \of 9$.
I wonder if maybe we can just add up the polynomials? We thus get $2x^3 - 12$. By the fundamental theorem of algebra, this has three solutions.
Those solutions are $\root 3 \of 6$, $\omega \root 3 \of 6$ and $\omega^2 \root 3 \of 6$, where $\omega$ is the complex cubic root of 1 with positive imaginary part. None of those numbers are equal to $\root 3 \of 3 + \root 3 \of 9$, so this seems to be a dead end.
However, it does suggest the idea of cubing $\root 3 \of 3 + \root 3 \of 9$ and seeing if that suggests a polynomial, which was probably the thought process behind Jose's answer.


text:
Q: Why is a company like Bauer allowed to sell Wet/Dry vacuums without the three prong plug for safety? Why is a company like Bauer allowed to sell Wet/Dry vacuums without the three prong plug for safety? I thought that all electrical appliances designed for outdoor and wet area use should have a third prong ground on the plug and be connected to a ground fault circuit interrupter (GFCI) receptacle!

A: The ground receptacle is only required when the outside of the appliance is metal.
When it is plastic and sufficient measures have been taken to make the device safe it is no longer required. See class II.
Ground is not required for the GFCI to work, if you throw your class II corded drill into a pool the GFCI will trip.


text:
Q: Use of $ in regular method I go over some code and I saw the following code
  var failedExtPlugins = PluginR.$getFailPlug();

It seems that this time the $ is not refer to jquery object (yes I know that when you use Jquery you start with $) I guess,so what does it mean?
it look like regular method...but way the use $

A: It looks just like a part of a name. I like to use $ in a name of jQuery objects I have. Maybe author has some thoughts about that.

A: Its a jQuery wrapped object. $ObjectName reflects that its holding a reference of jQuery wrapped object of particular dom object.
For Example:

var $obj = $("#SomeId");


text:
Q: Blazor not updating same value in input twice after manually manipulated same value though its firing change event Following is simple code
 @page "/demo"

POCBlazor

Input 1 :<input type="text" value="@somedata" @onchange="changeValue" placeholder="text 1" />
Input 2 :<input type="text" placeholder="text 2" />
@code {
    public string somedata { get; set; }
    void changeValue(ChangeEventArgs eventArgs)
    {

        somedata = eventArgs.Value.ToString();
        somedata = somedata + "asdf";
        StateHasChanged();
    }
}

Scenario

1) I add new value in input 1 then it represent with "asdf"

   e.g:
    enter value "123" --  changeValue function called
    --> Input 1 = "123asdf"

2) Second time I update input 1 with same value then the change event fired and code works but value is not updating in input 1

second time: again enter value "123" --- changeValue function called --> Input 1 = "123"

A: I am not sure what is the issue, and this should be investigated. I'll do it when I can spare the time. You are right about what you experience. However, if you use the @bind directive the desired behavior is attained. Do this and verify....
 Input 1 :<input type="text" @bind="@Somedata" placeholder="text 1" />
 Input 2 :<input type="text" placeholder="text 2" />

@somedata

 @code {

 private string somedata;

 public string Somedata
 {
  get {return somedata; }
  set{
    if( somedata != value)
   {
      somedata = value + "asdf";
   }
  }

}

}

I guess I know what is the issue...

POCBlazor

Input 1 :<input type="text" value="@Somedata" @onchange="changeValue">
placeholder="text 1" />
Input 2 :<input type="text" placeholder="text 2" />

@Somedata

@code {

   public string Somedata { get; set; }

   void changeValue(ChangeEventArgs eventArgs)
   {

       Somedata = eventArgs.Value.ToString();
       Somedata += "asdf";
   }
}
}

When you enter the value 123 into the text box, the onchnage event is invoked, and as a result the eventhandler is executed
. and thus the Somedata property contains the value 123asdf. Since the change event is a UI event, the StateHasChanged
is automatically called, and it notifies the component that its value has changed and it should re-render. The component re-renders,
and now the text box, as said above, contains the value 123asdf.
When you enter the value 123, once again, the processing cycle repeats itself, but, look at your code:
somedata = eventArgs.Value.ToString();

The value 123 is assigned to somedata
Now somedata === 123, right ?
somedata = somedata + "asdf";

Add the string "asdf" to the value of somedata and assigned the combined value to somedata. Now somedata contains the value '123asdf". This is the same value as before, right ? This means that your component is not going to be re-render as the state of the component does not changed.
Note: The StateHasChanged method is only a sort of notifier for the component that its state has changed, but the component is to decide whether to re-render or not, so even if you use it in your code, the component refuse to budge. Incidentally, the presence of the StateHasChanged method is not necessary because it is automatically called with UI events.
The next time you enter 123 and tab out, the change event is not triggered at all. But if you NEXT enter the value 1234, both property and text box
will have the combined value: 1234asdf
This behavior is by design...


text:
Q: AIVA- Expected number of IO clients failed to join in time I have an AIVA chatbot integrated with my application, which is not responding to the queries. Below are the logs generated out of it.
Once the application servers are restarted the chatbot is up for sometime and eventually fails again to work. Any help?

    * nohup npm start to start up the chatbot server *
    [Mon Apr 15 2019 07:31:44 GMT+0000 (utc)] Authenticated database successfully
    [Mon Apr 15 2019 07:31:44 GMT+0000 (utc)] INFO Starting aiva process
    [Mon Apr 15 2019 07:31:44 GMT+0000 (utc)] INFO Starting poly-socketio server on port: 6467, expecting 4 IO clients
    [Mon Apr 15 2019 07:31:44 GMT+0000 (utc)] ERROR
    [Mon Apr 15 2019 07:31:44 GMT+0000 (utc)] ERROR
    [Mon Apr 15 2019 07:31:44 GMT+0000 (utc)] ERROR
    [Mon Apr 15 2019 07:31:44 GMT+0000 (utc)] INFO Deploying bot aivadev with adapter HTTPADAPTER
    Starting up aivadev
    [Mon Apr 15 2019 07:31:46 GMT+0000 (utc)] WARNING Expected /data/installations/aiva/aiva-IAE/aiva/scripts/server.config to assign a function to module.exports, got object
    [Mon Apr 15 2019 07:31:46 GMT+0000 (utc)] INFO global-client-js 1oK8mIFqpNepxpcQAABo joined, -101 remains
    [Mon Apr 15 2019 07:31:46 GMT+0000 (utc)] INFO All`enter code here` 4 IO clients have joined
    [Mon Apr 15 2019 07:33:24 GMT+0000 (utc)] ERROR {}
    [Mon Apr 15 2019 07:33:24 GMT+0000 (utc)] ERROR Expected number of IO clients failed to join in time
    [Mon Apr 15 2019 07:33:24 GMT+0000 (utc)] INFO Shutting down
    [Mon Apr 15 2019 07:33:24 GMT+0000 (utc)] INFO 1oK8mIFqpNepxpcQAABo left
    error: Forever detected script exited with code: 1
    error: Script restart attempt #1


text:
Q: sass command not found - running service on debian boot I want to compile sass files remotely on my VPS, so I made this init.d script:
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides:          sass
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Script used to compile sass
# Description:       Script used to copile sass and scss files
#            directly, running from boot
### END INIT INFO

# Author: Karol K

DESC="Running sass compiler"
DAEMON=/media/start_sass.sh

And here is start_sass.sh:
#!/bin/bash
sass --watch /var/www:/var/www --style compressed &

Unfortunately, it doesn't work.
When I check service sass status I get following:
root@Serwer:~# service sass status -l
● sass.service - LSB: Script used to compile sass
   Loaded: loaded (/etc/init.d/sass)
   Active: active (exited) since Thu 2016-08-11 12:14:50 CEST; 2s ago
  Process: 9777 ExecStop=/etc/init.d/sass stop (code=exited, status=0/SUCCESS)
  Process: 9785 ExecStart=/etc/init.d/sass start (code=exited, status=0/SUCCESS)

Aug 11 12:14:50 Serwer sass[9785]: /media/start_sass.sh: line 2: sass: command not found

System is Debian 8 x64

A: It might be an issue with the PATH.
Try using the full path in the script, like /usr/bin/sass.
Find out where the sass binary is located with which sass.
Setting the $PATH variable in the script would also solve it, add this before line before the sass --watch line:
export PATH=$PATH:/directory/where/sass/is_located/
where of course the latter part is replaced with the actual directory.


text:
Q: can I generate a keystore to use with someone else's workspace? I've inherited someone's java project and haven't touched java for almost 10 years now.
We started with a clean workspace, opened up the code, and are having trouble with the Keystore file.
We used the cmd prompt to create a new keystore file, and put in a new password, but the errors are complaining that the password verification failed. I don't know the previous password though, can anyone guide on what we should do?
We're running jdk 1.6.0.18 (I know it's old, but it's we have to at least go into maintenance mode before we update .. .. if we go to 1.6.0.45 that may require code changes right?), struts 1.38, tomcat 6.0
My errors/server logs are as follows:
Aug 9, 2013 1:56:03 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_18\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\oracle\product\11.2.0\client_2;C:\oracle\product\11.2.0\client_2\bin;C:\oracle\product\11.2.0\client_1\bin;C:\app\gwongwon\product\11.2.0\client_1\bin;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\
Aug 9, 2013 1:56:03 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:coiWeb' did not find a matching property.
Aug 9, 2013 1:56:03 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:casTest' did not find a matching property.
Aug 9, 2013 1:56:03 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Aug 9, 2013 1:56:03 PM org.apache.tomcat.util.net.jsse.JSSESocketFactory getKeystore
SEVERE: Failed to load keystore type JKS with path C:\Users\gwongwon/.keystore due to Keystore was tampered with, or password was incorrect
java.io.IOException: Keystore was tampered with, or password was incorrect
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
    at java.security.KeyStore.load(KeyStore.java:1185)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:412)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:296)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:544)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:481)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:156)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:180)
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1123)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769)
    ... 20 more
Aug 9, 2013 1:56:03 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.io.IOException: Keystore was tampered with, or password was incorrect
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
    at java.security.KeyStore.load(KeyStore.java:1185)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:412)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:296)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:544)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:481)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:156)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:180)
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1123)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769)
    ... 20 more
Aug 9, 2013 1:56:03 PM org.apache.catalina.core.StandardService initialize
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]
LifecycleException:  Protocol handler initialization failed: java.io.IOException: Keystore was tampered with, or password was incorrect
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1125)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Aug 9, 2013 1:56:03 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 580 ms
Aug 9, 2013 1:56:03 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 9, 2013 1:56:03 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
[WARN] No value found in context for: 'java:comp/env/cas/SingleSignOutFilter/artifactParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/artifactParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/service'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/service'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/artifactParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/artifactParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/serviceParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/serviceParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/encodeServiceUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/encodeServiceUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/exceptionOnValidationFailure'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/exceptionOnValidationFailure'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/redirectAfterValidation'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/redirectAfterValidation'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/useSession'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/useSession'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/acceptAnyProxy'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/acceptAnyProxy'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/allowedProxyChains'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/allowedProxyChains'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/proxyCallbackUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/proxyCallbackUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/renew'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/renew'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/proxyReceptorUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/proxyReceptorUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/Cas20ProxyReceivingTicketValidationFilter/millisBetweenCleanUps'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/millisBetweenCleanUps'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/AuthenticationFilter/service'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/service'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/AuthenticationFilter/artifactParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/artifactParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/AuthenticationFilter/serviceParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/serviceParameterName'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/AuthenticationFilter/encodeServiceUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/encodeServiceUrl'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/AuthenticationFilter/gatewayStorageClass'; Returning null.
[WARN] No value found in context for: 'java:comp/env/cas/gatewayStorageClass'; Returning null.
Aug 9, 2013 1:56:04 PM org.apache.catalina.core.ApplicationContext log
INFO: StartUpServlet: C:\Users\gwongwon\dpsWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\coiWeb\WEB-INF\classes\log4j.properties
Aug 9, 2013 1:56:04 PM org.apache.catalina.core.ApplicationContext log
INFO: StartUpServlet: edu.miami.it.coi
Aug 9, 2013 1:56:04 PM org.apache.catalina.core.ApplicationContext log
INFO: StartUpServlet: initDataSource() -> successful; lookup name = jdbc/tmDB2EVDevlV5
Aug 9, 2013 1:56:18 PM org.apache.catalina.core.ApplicationContext log
INFO: StartUpServlet: testPoolConnection() -> db2 rs = 001
[INFO] Loading chain catalog from jar:file:/C:/Users/gwongwon/dpsWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/coiWeb/WEB-INF/lib/struts-core-1.3.8.jar!/org/apache/struts/chain/chain-config.xml
Aug 9, 2013 1:56:18 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Aug 9, 2013 1:56:18 PM org.apache.tomcat.util.net.jsse.JSSESocketFactory getKeystore
SEVERE: Failed to load keystore type JKS with path C:\Users\gwongwon/.keystore due to Keystore was tampered with, or password was incorrect
java.io.IOException: Keystore was tampered with, or password was incorrect
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
    at java.security.KeyStore.load(KeyStore.java:1185)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:412)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:296)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:544)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:481)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:156)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:565)
    at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:207)
    at org.apache.catalina.connector.Connector.start(Connector.java:1196)
    at org.apache.catalina.core.StandardService.start(StandardService.java:540)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769)
    ... 20 more
Aug 9, 2013 1:56:18 PM org.apache.coyote.http11.Http11Protocol start
SEVERE: Error starting endpoint
java.io.IOException: Keystore was tampered with, or password was incorrect
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:771)
    at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
    at java.security.KeyStore.load(KeyStore.java:1185)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:412)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:296)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:544)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:481)
    at org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:156)
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
    at org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:565)
    at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:207)
    at org.apache.catalina.connector.Connector.start(Connector.java:1196)
    at org.apache.catalina.core.StandardService.start(StandardService.java:540)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.security.UnrecoverableKeyException: Password verification failed
    at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:769)
    ... 20 more
Aug 9, 2013 1:56:18 PM org.apache.catalina.core.StandardService start
SEVERE: Failed to start connector [Connector[HTTP/1.1-8443]]
LifecycleException:  service.getName(): "Catalina";  Protocol handler start failed: java.io.IOException: Keystore was tampered with, or password was incorrect
    at org.apache.catalina.connector.Connector.start(Connector.java:1203)
    at org.apache.catalina.core.StandardService.start(StandardService.java:540)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Aug 9, 2013 1:56:18 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Aug 9, 2013 1:56:18 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/10  config=null
Aug 9, 2013 1:56:18 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 14565 ms

A: You should be able to change the password that Tomcat uses to open the keystore. See the Tomcat documentation here.
Specifically, in the <tomcat install location>/conf/server.xml file, find the Connector xml tag where the keystore file is specified and change the keystorePass attribute.
Alternatively, look in the configuration file for what the password is currently set to and change your keystore's password to that.


text:
Q: How to change Global Mule Configuration Elements at run time I need to change the global mule configuration elements at run time. How can I do it. I have a Web Service connector with values wsdl location, Service, port, address loaded by data sense. I need to change configuration of the global element at run time by disabling data sense. Thanks in advance

A: I read that global elements can be configured only once. But I need to configure  it many a times in runtime!


text:
Q: How to convert Linear Layout to Relative Layout Please help. how i can convert this code from LinearLayout to Relative Layout, if its possible. Or what i can do to work this code with FAB in overlay?
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:orientation="vertical"
    android:background="@color/white">

    <android.support.v7.widget.Toolbar
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/toolbar"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    <!-- Framelayout to display Fragments -->

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/emptyScreen">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/label_empty_list"
            android:id="@+id/emptyScreenMsg"
            android:layout_centerVertical="true"
            android:layout_centerHorizontal="true"
            android:textColor="@color/gray_text" />
    </RelativeLayout>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/contentScreen" >

        <android.support.v4.widget.SwipeRefreshLayout
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/itemsContainer"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:layout_width="match_parent"
            android:background="@color/white">

            <ListView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scrollbars="none"
                android:id="@+id/streamListView" />

        </android.support.v4.widget.SwipeRefreshLayout>

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:visibility="gone"
            android:background="@color/white"
            android:gravity="center"
            android:id="@+id/streamAdMobCont">

            <com.google.android.gms.ads.AdView
                android:id="@+id/adView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_alignParentBottom="true"
                ads:adSize="BANNER"
                ads:adUnitId="@string/banner_ad_unit_id">
            </com.google.android.gms.ads.AdView>

        </LinearLayout>

    </LinearLayout>

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/loadingScreen"
        android:background="@color/white">

        <ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/progressBar"
            android:layout_centerVertical="true"
            android:layout_centerHorizontal="true" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/errorScreen"
        android:background="@color/white">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="20dp"
            android:layout_centerVertical="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/error_data_loading"
                android:id="@+id/StreamErrorScreenMsg"
                android:layout_centerVertical="true"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:gravity="center"
                android:textSize="16dp"
                android:textColor="@color/gray_text" />
        </LinearLayout>

    </RelativeLayout>

</LinearLayout>

<!-- Listview to display slider menu -->

<ListView
    android:id="@+id/list_slidermenu"
    android:layout_width="300dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:choiceMode="singleChoice"
    android:divider="@color/drawer_divider"
    android:dividerHeight="1dp"
    android:listSelector="@drawable/item_list_row_selector"
    android:background="@color/drawer_bg"
    android:scrollbars="none"
    android:padding="0dp" />

Plaeeaaseeeeeeee help me pleaseeeeeeeeee... Thank's and sorry for my bad english :)

A: <?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:ads="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:orientation="vertical"
        tools:context=".MainActivity">

        <android.support.v7.widget.Toolbar xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/colorPrimary"
            android:minHeight="?attr/actionBarSize"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />

        <!-- Framelayout to display Fragments -->

        <RelativeLayout
            android:id="@+id/emptyScreen"
            android:layout_below="@id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <TextView
                android:id="@+id/emptyScreenMsg"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="@string/label_empty_list"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:textColor="@color/gray_text" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/contentScreen"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/emptyScreen"
            android:orientation="vertical">

            <android.support.v4.widget.SwipeRefreshLayout xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/itemsContainer"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:background="@color/white">

                <ListView
                    android:id="@+id/streamListView"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:scrollbars="none" />

            </android.support.v4.widget.SwipeRefreshLayout>

            <LinearLayout
                android:id="@+id/streamAdMobCont"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:background="@color/white"
                android:gravity="center"
                android:layout_below="@id/itemsContainer"
                android:orientation="vertical"
                android:visibility="gone">

                <com.google.android.gms.ads.AdView
                    android:id="@+id/adView"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    ads:adSize="BANNER"
                    ads:adUnitId="@string/banner_ad_unit_id"></com.google.android.gms.ads.AdView>

            </LinearLayout>

        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/loadingScreen"
            android:layout_below="@id/contentScreen"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@color/white">

            <ProgressBar
                android:id="@+id/progressBar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/errorScreen"
            android:layout_below="@id/loadingScreen"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="@color/white">

            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                android:padding="20dp">

                <TextView
                    android:id="@+id/StreamErrorScreenMsg"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_alignParentStart="true"
                    android:layout_centerVertical="true"
                    android:gravity="center"
                    android:text="@string/error_data_loading"
                    android:textColor="@color/gray_text"
                    android:textSize="16dp" />
            </LinearLayout>

        </RelativeLayout>

    </RelativeLayout>

    <!-- Listview to display slider menu -->

    <ListView
        android:id="@+id/list_slidermenu"
        android:layout_width="300dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/drawer_bg"
        android:choiceMode="singleChoice"
        android:divider="@color/drawer_divider"
        android:dividerHeight="1dp"
        android:listSelector="@drawable/item_list_row_selector"
        android:padding="0dp"
        android:scrollbars="none" />
</android.support.v4.widget.DrawerLayout>

A: Just use android:layoutBelow for each item.
Android's documentation has a good example.


text:
Q: How does a migration discover the database type in Fluent Migrator? Using Fluent Migrator, how does a Migration class method discover the nature of the database being migrated?   I need to know whether it is SQLite or something else.
I know there is a legacy class called MigratorDotNetMigration but I do not want to give up the power of Fluent Migrator--and this is not a legacy migration I am working on.

A: I found the solution here.  It is based on IsDatabase().


text:
Q: Reason for placing function type and method name on different lines in C I just started at a company and one of the style comments at my first code review was that the return type and method name should be on different lines. For example, this
void foo() {
}

should be this
void
foo() {
}

I've always used the first style, and I was wondering if there is any reason other than personal preference why people use the second style? I don't think the first one hurts readability at all. Is one more common than the other with C programmers and large open source projects?

A: This is pretty much the only code formatting rule that I have found actually makes a noticeable impact on readability and it takes almost no effort (assuming your code editor doesn't start a fight with you over it).
It is good programming language design to have names appear in a consistent position in declarations/definitions. The rationale is straightforward: you have a nice visual anchor (a curly brace or just a hanging indentation) that you can use to immediately find the start of the name. You don't have to actually parse the language when scanning through a file the find the name.
It's the same as when you are formatting a document: when you start a new section you put the name up front in boldface--often on its own line--not buried somewhere, undifferentiated, in a long sentence.
Early C had very terse signatures: return types were optional and argument types were declared after the signature. Names also tended to be very short. This mitigated the impact of having an occasional return type offsetting the name.
double dot(x, y);

Is still pretty digestible.
C++ made this a bit worse. It moved argument type specifications into signatures making signatures longer. This syntax was later adopted during the standardization of C.
static struct origin *find_origin(struct scoreboard *sb,
                  struct commit *parent,
                  struct origin *origin)

is less digestible, but not too bad. (Excerpt from Git)
Now consider modern programming practices with long, descriptive names and parametrized types and see how this choice has become disastrous. An example from a Boost header:
template <class A1, class A2, class A3, class A4, class A5, class A6>
inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&)
{
   typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6>::type result_type;
   return result_type();
}

If you are writing generic code, signatures like that aren't even out of the ordinary. You can find examples of much worse cases than this without trying too hard.
C, C++, and their derivatives, Java and C#, seem to be the exceptions to having readable declarations/definitions. Their popular predecessors and peers (Fortran, ALGOL, Pascal) placed names before result types and, thankfully, many of their successors (Go, Scala, TypeScript, and Swift to name a few) have chosen more readable syntaxes as well.

A: I first met this style on like 19th year working with C&C++. Was pretty much baffled on how could someone invent this evil thing.
The only (potentially) positive point I could find is that you can find the funciton definition using grep ^FuncName. Might be relevant factor decade+ ago in some real tool hating communities...  At the place I saw it was applied to C++ and class member funcitons, that kill even this attribute.
Guess my opinion. :)

A:
was wondering if there is any reason other than personal preference
  why people use the second style?

That's a style that was popular back in the early days of C, so the reason may just be that that's how they've done it for a very long time, they've got a lot of code that looks like that, and that's what everyone is used to. Not so much personal preference as corporate momentum.
Another reason is that function names always start in the first column. Return types vary in length and can be somewhat complex -- putting the type on its own line makes the function name easier to find.
If the company has a set style, they may also have a coding standards document. Ask for it. It may explain the reason(s) for this choice, and having a copy will help you avoid similar issues in future reviews.


text:
Q: VSCode Shortcut to add strings to React react-intl Is there a VSCode keyboard shortcut/function to add selected text string as needed for react-intl components.
Description of workflow of the shortcut in VSCode:

*

*Select a string 'foo bar' and press a shortcut key

*The string is copied to messages constant.

  fooBar: {
    id: 'foo-bar',
    defaultMessage: 'Foo Bar',
  },
});

*The 'foo-bar' id is inserted in the selected text.

 <FormattedMessage id={foo-bar} />


text:
Q: Glide not showing the Image Hello I am trying to add a profile image in my application but it not showing the image I get this error I am also trying to add in user adapter it not showing also I can not the solve the problem thanks for answering thanks
the error message
2022-01-28 08:32:18.553 28556-28556/com.example.travelinstam I/ViewTarget: Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use .override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
2022-01-28 08:32:18.568 28556-28556/com.example.travelinstam I/ViewTarget: Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use .override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
2022-01-28 08:32:18.742 28556-28556/com.example.travelinstam W/Glide: Load failed for gs://travelinstam2.appspot.com/placeholder.png with size [100x100]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
2022-01-28 08:32:18.785 28556-28556/com.example.travelinstam W/Glide: Load failed for gs://travelinstam2.appspot.com/placeholder.png with size [100x100]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource

here the my code
    private void userInfo(){
        DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Users").child(profileid);
        reference.addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
                if (getContext() == null){
                    return;
                }

                User user = dataSnapshot.getValue(User.class);

                Glide.with(getContext()).load(user.getImageurl()).into(image_profile);
                username.setText(user.getUsername());
                fullname.setText(user.getFullname());
                bio.setText(user.getBio());
            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {

            }
        });

    }

I use the hdodenhof:circleimageview version
implementation 'de.hdodenhof:circleimageview:3.1.0'

here the my layout code
                <de.hdodenhof.circleimageview.CircleImageView
                    android:layout_width="80dp"
                    android:layout_height="80dp"
                    android:id="@+id/image_profile"/>

A: I tried to open the resource from the link that I extracted from you log gs://travelinstam2.appspot.com/placeholder.png but it failed.
Have you checked that the resource URL is correct and reachable?
Answer: According to our discussion in the comment section, the issue was with the URL provided to Glide.


text:
Q: Animated PS1 prompt BASH I'm aware that this has been asked before but I couldn't find the answer I wanted anywhere. What I need (would like to have) is a BASH prompt that looks like this:
[ blah@blah ] >
[ blah@blah ]  >
[ blah@blah ]   >

(then the animation repeats)
Its just for the life of me I can't figure it out and I've been searching for days (apparently not too many people don't want an animated prompt). What I want it to do is go through one frame of the animation every 1/2 second so every full animation would be 1 1/2 seconds long.
Is there any way I can do this? Thanks in advance and sorry if the way I explained it was a bit confusing.

A: This is what I got:
animation() {
S="\033[s"
U="\033[u"

POS="\033[1000D\033[2C"
while [ : ]
do
    eval echo -ne '${S}${POS}\>\ \ ${U}'
    sleep 0.3
    eval echo -ne '${S}${POS}\ \>\ ${U}'
    sleep 0.3
    eval echo -ne '${S}${POS}\ \ \>${U}'
    sleep 0.3
done
}
PS1='[     ] : [ \u @ \h ] > '
animation &

I slightly modified a script from one of the links so you just put this into a file and source it or paste it into a terminal to get a simple animated prompt.


text:
Q: How to run code once all DependencyProperties have finished binding? I have two DependencyProperties on a custom UserControl. They're based on each other, so if only one property is provided then the other will be calculated. The problem is that I do not want this calculation to run if both values are provided, as it can be a hit on performance.
public static readonly DependencyProperty PropertyAProperty =
        DependencyProperty.Register(nameof(PropertyA), typeof(Guid?), typeof(UserControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPropertyAChanged));
    public static readonly DependencyProperty PropertyBProperty =
        DependencyProperty.Register(nameof(PropertyB), typeof(MyClass), typeof(UserControl), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPropertyBChanged));

private static void OnPropertyAChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var control = (MyUserControl)d;
    if (control.PropertyB == null)
        control.CalculatePropertyB();
}
private static void OnPropertyB Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var control = (MyUserControl)d;
    if (control.PropertyA == null)
        control.CalculatePropertyA();
}

In this sequence of events where I use my UserControl and bind both properties, the following sequence occurs :

*

*PropertyA is set

*PropertyB is calculated

*PropertyB is set

Is there something I can use that will only execute after BOTH properties have finished updating their bindings?
The only way I have found to actually do this is in OnChanged method, run something on the dispatcher at the DispatcherPriority of ApplicationIdle, which really isn't ideal in my case. I'd like to ensure it calculates before DispatcherPriority.Input
private static void OnPropertyAChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var control = (MyUserControl)d;
    Dispatcher.BeginInvoke(new Action(() =>
    {
        if (control.PropertyB == null)
            control.CalculatePropertyB();
    }), DispatcherPriority.ApplicationIdle);
}

A: Obviously that UI thread will update properties from view one by one
But there is possibility to use async handlers with small delay for allow to release UI thread and switch it to update other dependencyProperties.
In continuation of async method - all properties will be updated and you will be able to analize their values.
private bool _isUnderReCalculation = false;

public async Task Update()
{
   await Task.Delay(100); // this is advantage of async\await - we can release UI thread for complete update values.

   // continuation of method need to call only one time.
   // bindings completed
   if (_isUnderReCalculation ) return;

   try
   {
      _isUnderReCalculation = true;

      // TODO: run some method.
   }
   finally
   {
      _isUnderReCalculation = false;
   }
}

And in propertyChanged handler you need to call this method
private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var control = (MyUserControl)d;
    control.Update();
}


text:
Q: How to call SharePoint 2013 REST API from HTML page I can get the SharePoint 2013 list/libraries information using REST API, this is working fine from a SharePoint App. If I want to retrieve the same information from a HTML page, I am getting error "The request was aborted or timed out." I think the issue would be that it will not have authenticated to interact with SharePoint.
Can anybody help me how to make this working from a HTML page?

 // Load the required SharePoint libraries
$(document).ready(function () {
    //Get the URI decoded URLs.
    hostweburl =
        decodeURIComponent(
            getQueryStringParameter("SPHostUrl")
    );
    appweburl =
        decodeURIComponent(
            getQueryStringParameter("SPAppWebUrl")
    );

// resources are in URLs in the form:
// web_url/_layouts/15/resource
var scriptbase = hostweburl + "/_layouts/15/";

// Load the js files and continue to the successHandler
$.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);

});

// Function to prepare and issue the request to get
//  SharePoint data
function execCrossDomainRequest() {
    // executor: The RequestExecutor object
    // Initialize the RequestExecutor with the app web URL.
    var executor = new SP.RequestExecutor(appweburl);

// Issue the call against the app web.
// To get the title using REST we can hit the endpoint:
//      appweburl/_api/web/lists/getbytitle('listname')/items
// The response formats the data in the JSON format.
// The functions successHandler and errorHandler attend the
//      sucess and error events respectively.
executor.executeAsync(
    {
        url:
            appweburl +
            "/_api/web/lists/getbytitle('Announcements')/items",
        method: "GET",
        headers: { "Accept": "application/json; odata=verbose" },
        success: successHandler,
        error: errorHandler
    }
);

}

A: A Web page will run within the context of the browser it is loaded within. For security reasons, the browser will create a "sandboxed" environment which will prevent cross-site calls unless the remote server allows them. You will need to ensure that the server you are calling allows cross-origin (a.k.a. CORS) requests.
When you run a full-blown application, you are not typically bound by the same sandbox model since security is managed by the application container (e.g., the operating system or application server).


text:
Q: Razor WebSite - Defining Layout in _PageStart, RenderSection stops working I'm defining my Layout in _PageStart.cshtml for all templates.
In my template file, like home.cshtml, the RenderSection is ignored.
_PageStart.cshtml
Layout = "~/template/_Layout.cshtml";
RunPage();

_Layout.cshtml
...
<link rel="stylesheet" href="/css/style.css">
@RenderSection("css", required: false)
...
@RenderBody()
...

home.cshtml
@section css{
    <link rel="stylesheet" href="/css/home.css">
}
...

Only RenderSection is ignored, _Layout.cshtml is correctly loaded.
If specific the Layout in home.cshtml, RenderSection works.
Can anyone help me ?


text:
Q: Insert a new row based on previous or next time values I'm trying to insert a new row based on the timeline of my data so that there is no gap within a chunk of time. For example, my current table looks like this:
 ID          StartDate                  EndDate                 StartTime                  EndTime
1573  2019-07-17 00:00:00.000   2019-07-17 00:00:00.000  2019-07-17 09:00:00.000  2019-07-17 10:00:00.000
1573  2019-07-17 00:00:00.000   2019-07-17 00:00:00.000  2019-07-17 10:00:00.000  2019-07-17 11:00:00.000
1573  2019-07-17 00:00:00.000   2019-07-17 00:00:00.000  2019-07-17 11:00:00.000  2019-07-17 11:45:00.000
1573  2019-07-17 00:00:00.000   2019-07-17 00:00:00.000  2019-07-17 12:00:00.000  2019-07-17 13:00:00.000
8679  2019-09-03 00:00:00.000   2019-09-03 00:00:00.000  2019-09-03 09:00:00.000  2019-09-03 10:00:00.000

As you can see, there is a 15 min gap between the third and the last rows and I want to insert a new row like this to get rid of the gap and make it continuous.
1573  2019-07-17 00:00:00.000   2019-07-17 00:00:00.000  2019-07-17 11:45:00.000  2019-07-17 12:00:00.000

So basically, when there is a gap within the same StartDate and EndDate for the same ID, I'd like to insert a new row to eliminate the gap in the timeline.
I tried to do this with LAG/LEAD function but couldn't figure it out. I'd appreciate any help.
Thank you.

A: You can use LEAD() to get the next StartTime and compare with existing row EndTime to determine if there are any missing or gap.
SELECT t.ID, t.StartDate, t.EndDate,
       t.EndTime as StartTime,
       t.NextStartTime as EndTime
FROM
(
    select *, NextStartTime = LEAD(StartTime) OVER(PARTITION BY ID ORDER BY StartTime)
    from   yourtable t
) t
WHERE t.EndTime <> t.NextStartTime

dbfiddle demo


text:
Q: How to save text file in UTF-8 format using pdftotext I am using pdftotext opensource tool to convert the PDF to text files. How can I save the text files in UTF-8 format so that I can retain all the accent characters in text files. I am using the below command to convert which extracts the content to text file but not able to see any accented characters.
pdftotext -enc UTF-8 book1.pdf book1.txt
Please help me to resolve this issue.
Thanks in advance,

A: You can get a list of available encodings using the command:
pdftotext -listenc

and pick the right one using the -enc argument. Mine here seems to do UTF-8 by default. i.e. your "UTF-8" is superflous
pdftotext -enc UTF-8 your.pdf

You may want to check your locale (LC_ALL, LANG, ...).
EDIT:
I downloaded the following PDF:
http://www.i18nguy.com/unicode/unicodeexample.pdf
and converted it on a Windows 7 PC (german) and XPDF 3.02PL5 using the command:
pdftotext.exe -enc UTF-8 unicodeexample.pdf

The text file is definitely UTF-8 encoded, as all characters are displayed correctly. What are you using the text file for? If you're displaying it through a web application, your content encoding might simply be wrong, while the text file has been converted as you wanted it to.
Double-check using either a browser (force the encoding in Firefox to ISO-8859-1 and UTF-8) or using a hex editor.

A: Things are getting a little bit messy, so I'm adding another answer.
I took the PDF apart and my best guess would be a "problem" with the font used:

*

*open the PDF file in Acrobar Reader

*select all the text on the page

*copy it and paste it into a Unicode-aware text editor (there's no "hidden" OCR, so you're copying actual data)

You'll see that the codepoints you end up with aren't the ones you're seeing in the PDF reader. Whatever the font is, it may have a mapping different from the one defined in the Unicode standard. As such, your content is "wront" and there's not much you can do about it.


text:
Q: mouseMoveEvent not working in QGraphicsScene I am trying to implement a paint program in PyQt4. In the QGraphicsScene, I use the mouseMoveEvent to draw lines connecting the consecutive mouse co-ordinates.
The code is as follows:
def mouseMoveEvent(self, event):
    x1 = event.pos().x()
    y1 = event.pos().y()
    self.addLine(self.x0, self.y0, x1, y1, self.pen)
    self.x0, self.y0 = x1, y1

x0, y0 are initialized as 0,0.
The problem I encounter is that, when I click the mousebutton a single point is drawn at (0,0), and no more drawing takes place.
The same mouseMoveEvent works perfectly in QGraphicsView. Is there anything that I'm missing?

A: I figured out the problem. The above code is fine, except that event.pos() does not work in QGraphicsScene. Inorder to capture the mouseEvent's co-ordinates in QGraphicsScene, we must use event.scenePos()


text:
Q: Facebook not working with Exported/Signed APK File I have recently got Facebook to work when debugging my application by following the insructions on facebooks developer page on how to export and get the hash key we need to put in the developer portal.
So now this is done, i tried using facebook log in with a exported and signed version of my application. Unfortunately i was not able to get it to work. It would never return a log in session after logging in through the facebook app or web page.
I believe this is due to the keys being difference between the released and signed apk and the apk i use to debug.
Anyone know how to fix this problem?

A: You are correct on the key hash's being different from the debug.keystore and the release signing key. To remedy that, follow the steps on this website here: http://www.helloandroid.com/tutorials/using-facebook-sdk-android-development-part-1
It has a nice tutorial that will fix the issue in almost no time.
The gist of it is:

*

*Download OpenSSl for Windows and extract the .zip to a simple location like: c:\openssl with all the contents of the zip extracted in this folder's root.

*Copy your signing key file to your JRE installation's bin folder. For example, in my case: C:\Program Files\Java\jre7\bin

*While in the bin folder where you copied the signing key, Press SHIFT+ Right Click -> Open command window here.

*Run this command: keytool -exportcert -alias YOUR_ALIAS -keystore YOUR_SIGNING_KEY > c:\openssl\bin\debug.txt

*Enter your password for the signing key

*Now, navigate to the c:\openssl\bin folder and type in the following commands:

openssl sha1 -binary debug.txt > debug_sha.txt
And then,
openssl base64 -in debug_sha.txt > debug_base64.txt
Done! The debug_base64.txt contains your Key Hash. Copy this in your app console and you are all set.
This sounds lengthy, but you really will be done in literally 4 - 5 minutes. ;-)

A: In order to generate the key Please follow the steps provided above.
the main problem you can face will be alias as it'll throw exception: keytool error: unable to find alias (likely).
if you have signed key to release the app fetch alias of that key using:
keytool -list -keystore
Now use this alias in keytool -exportcert -alias  -keystore  c:\openssl\bin\debug.txt
Now you can follow the steps mentioned in the previous comment.

A: Copy Paste the SHA1 key to the link.
Internally its converting Hex to Base64.
We can convert from this Website directly.
worked for me.


text:
Q: UEFI CSM / legacy performance Are there any known performance problems of "legacy" Operating Systems (Windows 7, for example) running on UEFI with CSM?
Lately, I've seen quite a few brand-new computers by different OEMs that have pretty decent specs but are running Windows 7 on UEFI and their performance is dreadful even when freshly installed.
It may be a coincidence or seeing patterns in the sand but, if I recall correctly, it started around the time that Windows 8 and, therefore, UEFI became mainstream.

A: None that I know of, like BIOS which it replaces, UEFI is really only for booting the machine and starting up all the hardware correctly before handing control to the Operating System, so shouldn't be impacting on performance while it's running.
CSM compatibility support module provides support for older operating systems but again it's for booting the machine and hardware.


text:
Q: Finding a chain with no least or greatest elements for $(\mathcal{P}(\mathbb{N}),\subseteq)$ I have a poset $(\mathcal{P}(\mathbb{N}),\subseteq)$, where $\mathcal{P}$ is a power set, and I need to find a non-empty chain, such as that chain would not have the least or greatest element.
It is easy for me to imagine a chain in $(\mathcal{P}(\mathbb{N}),\subseteq)$, but I can't really grasp the idea of how do I make up a chain with no least element.
From what I have googled so far, I can suppose it should be somehow related to the poset $(\mathbb{Q},\subseteq)$, but I don't know how to develop that idea (in case it shall lead me to an answer at all).

A: I. Define $A_n\in\mathcal P(\mathbb N)$ for $n\in\mathbb Z$ by setting
$$A_n=\{1,3,5,7,\dots\}\setminus\{1,3,5,\dots,2|n|-1\}\text{ for }n\lt0,$$
$$A_n=\{1,3,5,7,\dots\}\cup\{2,4,6,\dots,2n\}\text{ for }n\ge0.$$
Then $m\lt n\implies A_m\subsetneq A_n$.
II. Establish a one-to-one correspondence netween $\mathbb N$ and the set $S=\{x+iy:x,y\in\mathbb N\}$. Define a chain in $\mathcal P(S)$ by setting $B_\theta=\{z\in S:0\lt\arg z\lt\theta\}$ for $0\lt\theta\lt\frac\pi2$.
Then $\phi\lt\theta\implies B_\phi\subsetneq B_\theta$.


text:
Q: Upload multiple images and insert them into custom html code Good evening. :)
Well, my mother is currently using a wordpress installation for her day to day blogging.
Often, a post consists of some text and a few images, which are displayed via the very nice flexslider script.
Usually, when the post is ready, I handle the flexslider part.
However, I'm not always around, so posts get delayed, I get calls...
You know. :)
I'd like her to be able to do it herself, so I was thinking about writing a quick and dirty little plugin.
Basically, just select some images from the library and paste the code into the editor.
Nothing fancy, this shouldn't take longer than a night or so.
The problem is, I've never developed anything wordpress, so some tips would be greatly appreciated.
Of course, I'm not afraid of reading the documentation, but I don't have the time to really dive into it right now.
Thanks for your time. :)

A: Just take a look at the RW_Meta_Box library to add a drag and drop interface to add images as post meta data. That's the most easiest approach, plus it uses the new »WP Pluploader«. For more details take a look at this answer on how to customize it and read a little in the TenderApp Knowledgebase for a how-to.