qid int64 20k 62.9M | question stringlengths 123 5.84k | date stringlengths 10 10 | metadata sequence | response_j stringlengths 115 9.17k | response_k stringlengths 44 2.88k |
|---|---|---|---|---|---|
53,179,085 | I'm writing a code using Java Swing to press the right button when I type a number key.
But I can't find what I want through search.
This is my code and I can't understand why this isn't working.
Please help me..
```
import javax.swing.*;
import java.awt.Dimension;
import java.awt.event.*;
class class01 {
public... | 2018/11/06 | [
"https://Stackoverflow.com/questions/53179085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8933767/"
] | The code you are showing does exactly one thing: attach action listeners to your buttons..
Meaning: when you click the button, then the listener will be called.
You need a generic keyboard listener that translates key events into calls to the appropriate button, respectively action listener instead. | When you do this:
```
button1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
button1.keyPressed(KeyEvent.VK_1);
JOptionPane.showMessageDialog(f.getComponent(0), "Coffee selected");
}
});
```
You are telling `button1` what to do whe... |
53,179,085 | I'm writing a code using Java Swing to press the right button when I type a number key.
But I can't find what I want through search.
This is my code and I can't understand why this isn't working.
Please help me..
```
import javax.swing.*;
import java.awt.Dimension;
import java.awt.event.*;
class class01 {
public... | 2018/11/06 | [
"https://Stackoverflow.com/questions/53179085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8933767/"
] | From what I understand, essentially you want to have the same operation of a button assigned to a specific key stroke.
Things you want to avoid are `KeyListener`, especially because you have other focusable components in the view, namely buttons, which will steal keyboard focus and render the `KeyListener` useless. Th... | When you do this:
```
button1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
button1.keyPressed(KeyEvent.VK_1);
JOptionPane.showMessageDialog(f.getComponent(0), "Coffee selected");
}
});
```
You are telling `button1` what to do whe... |
213,173 | I am a senior Siebel CRM developer having more than 8 years of working experience. Now, I am very keen and excited to learn Salesforce and get certified as soon as possible.
Please guide me where to start from scratch ? | 2018/03/29 | [
"https://salesforce.stackexchange.com/questions/213173",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/55249/"
] | After some research and not reaching to any solution, I refreshed the selected Business Units by removing them, saving and the adding and saving again. This solved my issue. | You may need to raise the case with SFMC support. I have seen these issues, and support needs to toggle some backend settings to reset the SC and SFMC connection. |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | I see a
```
while (Height > 0)
```
so your infinite loop is coming from Height never getting less or equal to 0. | It's better to rewrite. When you do, decouple the code into several functions so that one function draws a single line, and another one calls the former to draw all the lines. |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | I see a
```
while (Height > 0)
```
so your infinite loop is coming from Height never getting less or equal to 0. | ```
void WriteStars(int Width,int Height)
{
int _sp=1; //Star Pos
bool _left = false;
for(int i =0;i<Height;i++)
{
Console.Write("|");
int j;
for(j=1;j<Width-1;j++)
{
if(j==_sp)
{
Console.Write("*");
if(_left)
... |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | ```
private static void WriteStars(int width, int height)
{
int j = 0;
for (int i = 0; i < height; i++)
{
Console.Write("|");
for (int f = 0; f < width; f++)
{
if (f == Math.Abs(j))
{
Console.Write("*... | I see a
```
while (Height > 0)
```
so your infinite loop is coming from Height never getting less or equal to 0. |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | I see a
```
while (Height > 0)
```
so your infinite loop is coming from Height never getting less or equal to 0. | even shorter:
```
static void Variante_2(int height, int width)
{
byte[][] arr = new byte[height][];
int pos = 0;
int mov = 1;
for (int line = 0; line < height; line++)
{
arr[line] = new byte[width];
for (int col = 0; col < width; col++) { arr[line][col] = 45; }
arr[line][pos] = 42;
pos += mo... |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | I see a
```
while (Height > 0)
```
so your infinite loop is coming from Height never getting less or equal to 0. | and it is possible to do it with less code:
```
static void Variante_3(int height, int width)
{
int pos = 1;
int mov = 1;
for (int line = 0; line < height; line++)
{
Console.WriteLine("|" + "*".PadLeft(pos, '_') + "|".PadLeft(width - pos, '_'));
pos += mov;
if (pos == 1 || pos =... |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | ```
private static void WriteStars(int width, int height)
{
int j = 0;
for (int i = 0; i < height; i++)
{
Console.Write("|");
for (int f = 0; f < width; f++)
{
if (f == Math.Abs(j))
{
Console.Write("*... | It's better to rewrite. When you do, decouple the code into several functions so that one function draws a single line, and another one calls the former to draw all the lines. |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | ```
private static void WriteStars(int width, int height)
{
int j = 0;
for (int i = 0; i < height; i++)
{
Console.Write("|");
for (int f = 0; f < width; f++)
{
if (f == Math.Abs(j))
{
Console.Write("*... | ```
void WriteStars(int Width,int Height)
{
int _sp=1; //Star Pos
bool _left = false;
for(int i =0;i<Height;i++)
{
Console.Write("|");
int j;
for(j=1;j<Width-1;j++)
{
if(j==_sp)
{
Console.Write("*");
if(_left)
... |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | ```
private static void WriteStars(int width, int height)
{
int j = 0;
for (int i = 0; i < height; i++)
{
Console.Write("|");
for (int f = 0; f < width; f++)
{
if (f == Math.Abs(j))
{
Console.Write("*... | even shorter:
```
static void Variante_2(int height, int width)
{
byte[][] arr = new byte[height][];
int pos = 0;
int mov = 1;
for (int line = 0; line < height; line++)
{
arr[line] = new byte[width];
for (int col = 0; col < width; col++) { arr[line][col] = 45; }
arr[line][pos] = 42;
pos += mo... |
6,763,429 | i want to write a shape with " \* " and " | " the shape is below.
The program must take height and width from user.Width is column number without ' | '.I tried to write but confused.My code sometimes works great and sometimes being stupid.For example when i enter height : 13, width : 4 it writes one more,if witdh is 1 ... | 2011/07/20 | [
"https://Stackoverflow.com/questions/6763429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852118/"
] | ```
private static void WriteStars(int width, int height)
{
int j = 0;
for (int i = 0; i < height; i++)
{
Console.Write("|");
for (int f = 0; f < width; f++)
{
if (f == Math.Abs(j))
{
Console.Write("*... | and it is possible to do it with less code:
```
static void Variante_3(int height, int width)
{
int pos = 1;
int mov = 1;
for (int line = 0; line < height; line++)
{
Console.WriteLine("|" + "*".PadLeft(pos, '_') + "|".PadLeft(width - pos, '_'));
pos += mov;
if (pos == 1 || pos =... |
62,851,314 | Let me explain what is happening:
* Database: Oracle 19c
* Apex: 19.1.0.00.15
* ORDS standalone is 19.1.0.r0921545
I did the tasks to configure an Apex Social Sign In to Microsoft AAD without almost any issue:
* I created the authentication method in Apex.
* I register my application and get the web credentials in A... | 2020/07/11 | [
"https://Stackoverflow.com/questions/62851314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13755538/"
] | I had issue like this, it seems Oracle SSL library has some bugs. Finally I implemented some Java Source for OJVM, please read my answer here: <https://stackoverflow.com/a/60152830/11272044> | In my understanding,you will need to do following(in addition to what you did) :
1. login to Apex as administrator
2. From settings, go to 'Wallet'
3. Add Wallet path(absolute path with prefix 'file://' and password you used for creating wallet
Now, your problem should be solved. |
62,851,314 | Let me explain what is happening:
* Database: Oracle 19c
* Apex: 19.1.0.00.15
* ORDS standalone is 19.1.0.r0921545
I did the tasks to configure an Apex Social Sign In to Microsoft AAD without almost any issue:
* I created the authentication method in Apex.
* I register my application and get the web credentials in A... | 2020/07/11 | [
"https://Stackoverflow.com/questions/62851314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13755538/"
] | Thank you to all who post answers, but finally, after struggling for a while, I found the root cause. Actually Oracle was right after all, as Microsoft has changed the way the authentication is handled, either you are using Oauth2 or OpenID, when you use Office365 and Azure Active Directory.
In this case, my organisat... | In my understanding,you will need to do following(in addition to what you did) :
1. login to Apex as administrator
2. From settings, go to 'Wallet'
3. Add Wallet path(absolute path with prefix 'file://' and password you used for creating wallet
Now, your problem should be solved. |
62,851,314 | Let me explain what is happening:
* Database: Oracle 19c
* Apex: 19.1.0.00.15
* ORDS standalone is 19.1.0.r0921545
I did the tasks to configure an Apex Social Sign In to Microsoft AAD without almost any issue:
* I created the authentication method in Apex.
* I register my application and get the web credentials in A... | 2020/07/11 | [
"https://Stackoverflow.com/questions/62851314",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13755538/"
] | Thank you to all who post answers, but finally, after struggling for a while, I found the root cause. Actually Oracle was right after all, as Microsoft has changed the way the authentication is handled, either you are using Oauth2 or OpenID, when you use Office365 and Azure Active Directory.
In this case, my organisat... | I had issue like this, it seems Oracle SSL library has some bugs. Finally I implemented some Java Source for OJVM, please read my answer here: <https://stackoverflow.com/a/60152830/11272044> |
20,576,864 | I am using Omniauth in a Rails application for login, my omniauth.rb, is as show below:
```
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, 'xxxxxxx', 'xxxxxxx'
provider :google_oauth2, 'xxxxxxxxx','xxxxxxxx'
end
```
When a user attempts t... | 2013/12/13 | [
"https://Stackoverflow.com/questions/20576864",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3100897/"
] | Our old friend `strace` solves this mystery.
In the `fflush("cat")` case, awk quickly writes all three values while cat is still loading. When cat finishes loading, it reads all three values in sequence and writes them out at the same time.
In the case of `close("cat")`, awk waits for the process to exit, at which po... | Not really something I have much experience of but the gawk manual tells us:
>
> fflush([filename])
> Flush any buffered output associated with filename,
> which is either a file opened for writing or a shell command for
> redirecting output **to a pipe** or coprocess.
>
>
>
Note that "cat" as used above is in... |
946,937 | I bought a Dell Studio XPS 8100 desktop back in 2010, which had Windows 7 installed and came with a partition for Dell Factory Restore.
After having installed Windows 10, what happened to that partition? Did the installation get rid of it? If not and I were to use it to do a Dell Factory Restore, would it "reinstall" ... | 2015/07/29 | [
"https://superuser.com/questions/946937",
"https://superuser.com",
"https://superuser.com/users/474857/"
] | The recovery partition will not be touched nor upgraded during this process. If you did a factory restore, you would end up with Windows 7. | If you run into a problem where you cannot access your recovery partition, or the partition is deleted, you can run a tool called DSRFIX and it should restore the recovery partition. |
946,937 | I bought a Dell Studio XPS 8100 desktop back in 2010, which had Windows 7 installed and came with a partition for Dell Factory Restore.
After having installed Windows 10, what happened to that partition? Did the installation get rid of it? If not and I were to use it to do a Dell Factory Restore, would it "reinstall" ... | 2015/07/29 | [
"https://superuser.com/questions/946937",
"https://superuser.com",
"https://superuser.com/users/474857/"
] | From what I am seeing, if there is not a system partition on the drive, only the Dell recovery partition & OS partition, then Windows 10 will alter the boot folder of that partition. This effects the PE recovery environment & will break the factory recovery. Even after reapplying the Factory.wim of windows 7 and it blu... | If you run into a problem where you cannot access your recovery partition, or the partition is deleted, you can run a tool called DSRFIX and it should restore the recovery partition. |
418,342 | I know I can pass parameters to java to limit the amount of memory used, but that doesn't change the application behavior. (assuming I will get an out of memory exception or similar)
I would like to limit the amount of memory that solr uses. I am assuming it is as simple as setting a single configuration option, but g... | 2012/08/16 | [
"https://serverfault.com/questions/418342",
"https://serverfault.com",
"https://serverfault.com/users/107102/"
] | Check out this article, it should address your needs
<http://blogs.technet.com/b/grouppolicy/archive/2009/07/30/security-filtering-wmi-filtering-and-item-level-targeting-in-group-policy-preferences.aspx>
and like Joe said, yes you can use groups for computers as well | Yes, you can use a security group populated with computer accounts to filter Group Policy. |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | You can listen to `timeupdate` und take the next to last value you got there before `seeking` is called as your source:
```
var previousTime = 0;
var currentTime = 0;
trackedPlayer.on('timeupdate', function() {
previousTime = currentTime;
currentTime = trackedPlayer.currentTime();
});
trackedPlayer.on('seeking... | Try with this code to know the length of video.
```
var duration = document.getElementById("duration");
var vid_duration = Math.round(document.getElementById("video").duration);
//alert(vid_duration);
duration.innerHTML = vid_duration;
//duration.firstChild.nodeValue = vid_duration;
``` |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | I needed to find the same value for a project I was working on so I could determine whether or not a user was skipping forward or backward in a videojs player.
Initially, I thought to save the currentTime() a user was seeking **from** on **timeupdate** then immediately removing my timeupdate listener once **seeking** ... | Try with this code to know the length of video.
```
var duration = document.getElementById("duration");
var vid_duration = Math.round(document.getElementById("video").duration);
//alert(vid_duration);
duration.innerHTML = vid_duration;
//duration.firstChild.nodeValue = vid_duration;
``` |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | I know this is an old post but this is the only solution that worked for me.
```
var counter = 0;
var beforeTimeChange = 0;
function handleSeeking() {
var timeoutTime = 300;
var beforeCounter = counter + 1;
if (trackedPlayer.cache_.currentTime === trackedPlayer.duration()) {
return;
// when video starts... | Try with this code to know the length of video.
```
var duration = document.getElementById("duration");
var vid_duration = Math.round(document.getElementById("video").duration);
//alert(vid_duration);
duration.innerHTML = vid_duration;
//duration.firstChild.nodeValue = vid_duration;
``` |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | For a more accurate solution, you can listen to the events that trigger the seek such as mousedown on progress bar, left key, right key etc., and get the current time from these events.
For example in version 7.10.2 you can do the following,
```
let seekStartTime;
player.controlBar.progressControl.on('mousedown', () ... | Try with this code to know the length of video.
```
var duration = document.getElementById("duration");
var vid_duration = Math.round(document.getElementById("video").duration);
//alert(vid_duration);
duration.innerHTML = vid_duration;
//duration.firstChild.nodeValue = vid_duration;
``` |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | I needed to find the start and end of a seeking action in my project and I used @Motorcykey answer and it worked, but there was a small bug. when I tried to seek to a time before the current time while the player was paused, the `position` didn't get updated. so I added just one line and it fixed it. I've tried other s... | Try with this code to know the length of video.
```
var duration = document.getElementById("duration");
var vid_duration = Math.round(document.getElementById("video").duration);
//alert(vid_duration);
duration.innerHTML = vid_duration;
//duration.firstChild.nodeValue = vid_duration;
``` |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | You can listen to `timeupdate` und take the next to last value you got there before `seeking` is called as your source:
```
var previousTime = 0;
var currentTime = 0;
trackedPlayer.on('timeupdate', function() {
previousTime = currentTime;
currentTime = trackedPlayer.currentTime();
});
trackedPlayer.on('seeking... | I needed to find the same value for a project I was working on so I could determine whether or not a user was skipping forward or backward in a videojs player.
Initially, I thought to save the currentTime() a user was seeking **from** on **timeupdate** then immediately removing my timeupdate listener once **seeking** ... |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | You can listen to `timeupdate` und take the next to last value you got there before `seeking` is called as your source:
```
var previousTime = 0;
var currentTime = 0;
trackedPlayer.on('timeupdate', function() {
previousTime = currentTime;
currentTime = trackedPlayer.currentTime();
});
trackedPlayer.on('seeking... | I know this is an old post but this is the only solution that worked for me.
```
var counter = 0;
var beforeTimeChange = 0;
function handleSeeking() {
var timeoutTime = 300;
var beforeCounter = counter + 1;
if (trackedPlayer.cache_.currentTime === trackedPlayer.duration()) {
return;
// when video starts... |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | You can listen to `timeupdate` und take the next to last value you got there before `seeking` is called as your source:
```
var previousTime = 0;
var currentTime = 0;
trackedPlayer.on('timeupdate', function() {
previousTime = currentTime;
currentTime = trackedPlayer.currentTime();
});
trackedPlayer.on('seeking... | For a more accurate solution, you can listen to the events that trigger the seek such as mousedown on progress bar, left key, right key etc., and get the current time from these events.
For example in version 7.10.2 you can do the following,
```
let seekStartTime;
player.controlBar.progressControl.on('mousedown', () ... |
29,743,729 | I am using video.js (<http://www.videojs.com/>) to build a video approval system and need to log user actions in the player. I can do this easily enough with play, pause, end etc. but have hit a problem when trying to log seeks.
I want to be able to log the start and end times of any seeks within the plaback, so we kn... | 2015/04/20 | [
"https://Stackoverflow.com/questions/29743729",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2664914/"
] | You can listen to `timeupdate` und take the next to last value you got there before `seeking` is called as your source:
```
var previousTime = 0;
var currentTime = 0;
trackedPlayer.on('timeupdate', function() {
previousTime = currentTime;
currentTime = trackedPlayer.currentTime();
});
trackedPlayer.on('seeking... | I needed to find the start and end of a seeking action in my project and I used @Motorcykey answer and it worked, but there was a small bug. when I tried to seek to a time before the current time while the player was paused, the `position` didn't get updated. so I added just one line and it fixed it. I've tried other s... |
2,767,139 | Can I do this in C++ (if yes, what is the syntax?):
```
void func(string* strs) {
// do something
}
func({"abc", "cde"});
```
I want to pass an array to a function, without instantiating it as a variable. | 2010/05/04 | [
"https://Stackoverflow.com/questions/2767139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/187141/"
] | It can't be done in the current C++, as defined by C++03.
The feature you are looking for is called "compound literals". It is present in C language, as defined by C99 (with C-specific capabilities, of course), but not in C++.
A similar feature is planned for C++ as well, but it is not there yet. | I don't think you can do that in C++98, but you can with [initializer\_lists](https://stackoverflow.com/questions/2357452/stdinitializer-list-as-function-argument) in C++1x. |
2,767,139 | Can I do this in C++ (if yes, what is the syntax?):
```
void func(string* strs) {
// do something
}
func({"abc", "cde"});
```
I want to pass an array to a function, without instantiating it as a variable. | 2010/05/04 | [
"https://Stackoverflow.com/questions/2767139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/187141/"
] | It can't be done in the current C++, as defined by C++03.
The feature you are looking for is called "compound literals". It is present in C language, as defined by C99 (with C-specific capabilities, of course), but not in C++.
A similar feature is planned for C++ as well, but it is not there yet. | As written, you can't do this. The function expects a pointer-to-string. Even if you were able to pass an array as a literal, the function call would generate errors because literals are considered constant (thus, the array of literals would be of type `const string*`, not `string*` as the function expects). |
2,767,139 | Can I do this in C++ (if yes, what is the syntax?):
```
void func(string* strs) {
// do something
}
func({"abc", "cde"});
```
I want to pass an array to a function, without instantiating it as a variable. | 2010/05/04 | [
"https://Stackoverflow.com/questions/2767139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/187141/"
] | It can't be done in the current C++, as defined by C++03.
The feature you are looking for is called "compound literals". It is present in C language, as defined by C99 (with C-specific capabilities, of course), but not in C++.
A similar feature is planned for C++ as well, but it is not there yet. | Use a variadic function to pass in unlimited untyped information into a function. Then do whatever you want with the passed in data, such as stuffing it into an internal array.
[variadic function](http://en.wikipedia.org/wiki/Variadic_function#Variadic_functions_in_C.2C_Objective-C.2C_C.2B.2B.2C_and_D) |
14,559,761 | I want to use `std::initializer_list`s in Visual Studio 2012 like a guy in [this example](http://musingstudio.com/2012/11/27/stdinitializer_list-an-even-better-way-to-populate-a-vector/) does. My operating system is Windows 8 x64.
Therefore I lately installed the [Visual C++ Compiler November 2012 CTP](http://www.micr... | 2013/01/28 | [
"https://Stackoverflow.com/questions/14559761",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1079110/"
] | (I work for Microsoft and with Dinkumware to maintain VC's Standard Library implementation.)
[danijar]
>
> I am not sure if it could be caused by the fact that I am (sadly) using the German edition of Visual Studio and the compiler update is in English.
>
>
>
Unfortunately, the English-only CTP does not support ... | As you have noticed, the November CTP is very limited in usability for at least two reasons:
1. The compiler has numerous crash-causing bugs, such as the one you discovered.
2. The C++ Standard Library was not updated with the compiler, leaving you without decent `<tuple>` and `<intializer_list>` (this includes the om... |
19,995 | I don't recall ever having the problem with the iron before, but it's been a few years since I used it, as I'm just getting back into some projects since my Electronics degree.
I bought some solder for a new project (I need a lot) and it's lead-free:
```
95% Tin
4% Silver
1% Copper
```
Now, I'm not sure how toleran... | 2011/09/25 | [
"https://electronics.stackexchange.com/questions/19995",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/5702/"
] | Your tip is dead since you have now sanded off the special coating. It will of course still get hot, but will oxidize rapidly so that solder won't wick onto it. This will make it very difficult to solder with.
You say the tip is supposed to be 370C (700F), but is that temperature controlled or just some open loop gues... | A 12w iron is way under-powered for leadfree. You need a temerature-controlled iron, 40-60W minimum |
38,380,164 | My project demo as link: <http://jsfiddle.net/Lvc0u55v/6741/>
I use AngularJS.
If a movie is not found, old values should not appear in the following code
```
<form style="margin-bottom: 40px;">
<ul>
<li><h2>Title: {{result().name}}</h2></li>
<li><h3>Release Date: {{result().release}}</h3></li>
... | 2016/07/14 | [
"https://Stackoverflow.com/questions/38380164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5257578/"
] | It would appear that the resultFactory is not being set with new values unless a film is actually found. You'll have to make sure that your resultFactory is being set even when a film does not match the user's search entry.
You can simply move your resultFactory.set outside of the `if` statement and set each key to an... | You need to add this
```
var details = {
name:"",
release: "",
length: "",
description: "",
rating: ""
}
resultFactory.set(details)
```
... |
4,583,801 | This is a classical Sangaku problem, also known as old Japanese geometry problems, that I found out just recently. The figure shows a semicircle with a smaller circle and an equilateral triangle inscribed inside it. Note that the semicircle can be *any* general semicircle, but in this case it has a radius of $1$ unit. ... | 2022/11/23 | [
"https://math.stackexchange.com/questions/4583801",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1092912/"
] | A slightly quicker step (2) skips the quadratic formula: Observe that the hypotenuse shared by your two 30-60-90 triangles has length $\frac 2{\sqrt 3} r$ (since the side lengths are proportional to $1:\sqrt 3:2$), hence
$$r + \frac 2{\sqrt 3}r = 1$$
which yields $r=2\sqrt 3-3$. | Here's my approach for the problem:
Please note that my answer uses a lemma that can be proven easily, that is, [the radii of two externally or internally tangent circles are collinear](https://youtu.be/0whTkdGBNn0).
[](https://i.stack.imgur.com/R518... |
6,856,491 | There is a file named \*.iso, where `*` is any string (dot, numbers, alphabets, spl characters).
\*.iso is located at /dm2/www/html/isos/preFCS5.3/
I want to get this filename into $filename. I know it's very simple. How can I do this in Perl? | 2011/07/28 | [
"https://Stackoverflow.com/questions/6856491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713200/"
] | Destructor of the Base class will be automatically called by the compiler, when your objet life time ends. you do not need to call it explicitly.
```
TMyObject::TMyObject() : TObject()
```
Does not inherit the constructor.
It is called as **[Member initializer list](https://stackoverflow.com/questions/6724626/c-c... | If you destroy a `TMyObject` through a reference of type `TMyObject` you don't have to do anything. In case you have a pointer/reference of type `TObject` to a `TMyObject` things will go wrong. *Only* the `TObject` destructor will be called, not the `TMyObject` one:
```
TObject* p = new TMyObject;
delete p; // Only th... |
6,856,491 | There is a file named \*.iso, where `*` is any string (dot, numbers, alphabets, spl characters).
\*.iso is located at /dm2/www/html/isos/preFCS5.3/
I want to get this filename into $filename. I know it's very simple. How can I do this in Perl? | 2011/07/28 | [
"https://Stackoverflow.com/questions/6856491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713200/"
] | Destructor of the Base class will be automatically called by the compiler, when your objet life time ends. you do not need to call it explicitly.
```
TMyObject::TMyObject() : TObject()
```
Does not inherit the constructor.
It is called as **[Member initializer list](https://stackoverflow.com/questions/6724626/c-c... | What's causing the confusion to you is that you can specifically mention "which" constructor of the base class you want to use as in the following example. But you can't/ don't need to specify the destructor.
```
TMyObject::TMyObject() : TObject()
```
You could use a different constructor, say `TObject (int i)` by w... |
6,856,491 | There is a file named \*.iso, where `*` is any string (dot, numbers, alphabets, spl characters).
\*.iso is located at /dm2/www/html/isos/preFCS5.3/
I want to get this filename into $filename. I know it's very simple. How can I do this in Perl? | 2011/07/28 | [
"https://Stackoverflow.com/questions/6856491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713200/"
] | This can be solved at `TObject`'s level. Its destructor has to be virtual:
```
#include <Classes.hpp>
class TObject
{
__fastcall TObject();
virtual __fastcall ~TObject();
};
```
This way you can either do:
```
TObject * pobj = new TMyObject();
delete pobj;
```
or
```
TMyObject * pobj = new TMyObject();
d... | Destructor of the Base class will be automatically called by the compiler, when your objet life time ends. you do not need to call it explicitly.
```
TMyObject::TMyObject() : TObject()
```
Does not inherit the constructor.
It is called as **[Member initializer list](https://stackoverflow.com/questions/6724626/c-c... |
6,856,491 | There is a file named \*.iso, where `*` is any string (dot, numbers, alphabets, spl characters).
\*.iso is located at /dm2/www/html/isos/preFCS5.3/
I want to get this filename into $filename. I know it's very simple. How can I do this in Perl? | 2011/07/28 | [
"https://Stackoverflow.com/questions/6856491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713200/"
] | This can be solved at `TObject`'s level. Its destructor has to be virtual:
```
#include <Classes.hpp>
class TObject
{
__fastcall TObject();
virtual __fastcall ~TObject();
};
```
This way you can either do:
```
TObject * pobj = new TMyObject();
delete pobj;
```
or
```
TMyObject * pobj = new TMyObject();
d... | If you destroy a `TMyObject` through a reference of type `TMyObject` you don't have to do anything. In case you have a pointer/reference of type `TObject` to a `TMyObject` things will go wrong. *Only* the `TObject` destructor will be called, not the `TMyObject` one:
```
TObject* p = new TMyObject;
delete p; // Only th... |
6,856,491 | There is a file named \*.iso, where `*` is any string (dot, numbers, alphabets, spl characters).
\*.iso is located at /dm2/www/html/isos/preFCS5.3/
I want to get this filename into $filename. I know it's very simple. How can I do this in Perl? | 2011/07/28 | [
"https://Stackoverflow.com/questions/6856491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/713200/"
] | This can be solved at `TObject`'s level. Its destructor has to be virtual:
```
#include <Classes.hpp>
class TObject
{
__fastcall TObject();
virtual __fastcall ~TObject();
};
```
This way you can either do:
```
TObject * pobj = new TMyObject();
delete pobj;
```
or
```
TMyObject * pobj = new TMyObject();
d... | What's causing the confusion to you is that you can specifically mention "which" constructor of the base class you want to use as in the following example. But you can't/ don't need to specify the destructor.
```
TMyObject::TMyObject() : TObject()
```
You could use a different constructor, say `TObject (int i)` by w... |
5,321,883 | I am very new to spring security . I picked up [this](https://rads.stackoverflow.com/amzn/click/com/1847199747) book and trying to execute the code .
While I do this I am getting
```
org.springframework.beans.NotReadablePropertyException: Invalid property
'principal.username' of bean class
[org.springframework.secu... | 2011/03/16 | [
"https://Stackoverflow.com/questions/5321883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571718/"
] | What the error message seems to be indicating is that something is trying to access a non-existent property on an `AnonymousAuthenticationToken` ; i.e. the authentication token that spring security uses when the session is not logged in.
I suspect that the problem is actually occurring either in your servlet code, or ... | I am reading/following the "Spring Security 3" book. Just add the following lines to the header.jsp The problem is that principal.username does not exists if you are not logged in.
```
<div class="username">
Welcome,
<sec:authorize access="isAuthenticated()">
<strong><sec:authentication property="pr... |
5,321,883 | I am very new to spring security . I picked up [this](https://rads.stackoverflow.com/amzn/click/com/1847199747) book and trying to execute the code .
While I do this I am getting
```
org.springframework.beans.NotReadablePropertyException: Invalid property
'principal.username' of bean class
[org.springframework.secu... | 2011/03/16 | [
"https://Stackoverflow.com/questions/5321883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571718/"
] | What the error message seems to be indicating is that something is trying to access a non-existent property on an `AnonymousAuthenticationToken` ; i.e. the authentication token that spring security uses when the session is not logged in.
I suspect that the problem is actually occurring either in your servlet code, or ... | Prerequisites as follows:
1. Add spring security taglib in jsp page you want to show username,
```
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
```
2. Add spring security jars, use
```
<sec:authentication property="principal" />
```
in jsp where you want to show the username
Fol... |
5,321,883 | I am very new to spring security . I picked up [this](https://rads.stackoverflow.com/amzn/click/com/1847199747) book and trying to execute the code .
While I do this I am getting
```
org.springframework.beans.NotReadablePropertyException: Invalid property
'principal.username' of bean class
[org.springframework.secu... | 2011/03/16 | [
"https://Stackoverflow.com/questions/5321883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571718/"
] | I am reading/following the "Spring Security 3" book. Just add the following lines to the header.jsp The problem is that principal.username does not exists if you are not logged in.
```
<div class="username">
Welcome,
<sec:authorize access="isAuthenticated()">
<strong><sec:authentication property="pr... | Prerequisites as follows:
1. Add spring security taglib in jsp page you want to show username,
```
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
```
2. Add spring security jars, use
```
<sec:authentication property="principal" />
```
in jsp where you want to show the username
Fol... |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | If it was physically capable of speaking, it would be able to speak the languages it knew in life. It still retains its knowledge of them, so *knowing* how to speak a language is not the problem. The problem is that a skeleton lacks lips, a tongue, vocal cords, a voicebox, and lungs. Speaking is simply impossible.
The... | Isn't this why we have Speak with Dead spells? The skeleton has no way of making vocalizations so cannot speak audibly but can understand language due to the magic that animates it. |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | If it was physically capable of speaking, it would be able to speak the languages it knew in life. It still retains its knowledge of them, so *knowing* how to speak a language is not the problem. The problem is that a skeleton lacks lips, a tongue, vocal cords, a voicebox, and lungs. Speaking is simply impossible.
The... | By RAW default, no.
===================
As explained by others it has no basic, default, means of expressing language. It's not about learning the language, it's the capability of the spell/energy powering the skeleton(s). Undeath is not in itself an impediment to speech (see: Liches).
Therefore you need to extrapola... |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | If it was physically capable of speaking, it would be able to speak the languages it knew in life. It still retains its knowledge of them, so *knowing* how to speak a language is not the problem. The problem is that a skeleton lacks lips, a tongue, vocal cords, a voicebox, and lungs. Speaking is simply impossible.
The... | <https://www.dandwiki.com/wiki/Skeleton_(5e_Race)> said
>
> You've managed to control the energies that sustain you to allow you speak. You can speak, read and write Common, as well as the language of your creator. A Giant Skeleton may speak Giant, a God Touched may know Celestial, a Magic Fluke may randomly grant yo... |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | If it was physically capable of speaking, it would be able to speak the languages it knew in life. It still retains its knowledge of them, so *knowing* how to speak a language is not the problem. The problem is that a skeleton lacks lips, a tongue, vocal cords, a voicebox, and lungs. Speaking is simply impossible.
The... | It is true, on pg 272 of the 5e Monster Manual, it states:
>
> They can't read, speak, emote, or communicate in any way except to nod, shake their heads, or point.
>
>
>
... and D&D Beyond - [Skeleton entry](https://www.dndbeyond.com/monsters/skeleton) states ...
>
> Understands all languages it knew in life bu... |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | By RAW default, no.
===================
As explained by others it has no basic, default, means of expressing language. It's not about learning the language, it's the capability of the spell/energy powering the skeleton(s). Undeath is not in itself an impediment to speech (see: Liches).
Therefore you need to extrapola... | Isn't this why we have Speak with Dead spells? The skeleton has no way of making vocalizations so cannot speak audibly but can understand language due to the magic that animates it. |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | It is true, on pg 272 of the 5e Monster Manual, it states:
>
> They can't read, speak, emote, or communicate in any way except to nod, shake their heads, or point.
>
>
>
... and D&D Beyond - [Skeleton entry](https://www.dndbeyond.com/monsters/skeleton) states ...
>
> Understands all languages it knew in life bu... | Isn't this why we have Speak with Dead spells? The skeleton has no way of making vocalizations so cannot speak audibly but can understand language due to the magic that animates it. |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | By RAW default, no.
===================
As explained by others it has no basic, default, means of expressing language. It's not about learning the language, it's the capability of the spell/energy powering the skeleton(s). Undeath is not in itself an impediment to speech (see: Liches).
Therefore you need to extrapola... | <https://www.dandwiki.com/wiki/Skeleton_(5e_Race)> said
>
> You've managed to control the energies that sustain you to allow you speak. You can speak, read and write Common, as well as the language of your creator. A Giant Skeleton may speak Giant, a God Touched may know Celestial, a Magic Fluke may randomly grant yo... |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | By RAW default, no.
===================
As explained by others it has no basic, default, means of expressing language. It's not about learning the language, it's the capability of the spell/energy powering the skeleton(s). Undeath is not in itself an impediment to speech (see: Liches).
Therefore you need to extrapola... | It is true, on pg 272 of the 5e Monster Manual, it states:
>
> They can't read, speak, emote, or communicate in any way except to nod, shake their heads, or point.
>
>
>
... and D&D Beyond - [Skeleton entry](https://www.dndbeyond.com/monsters/skeleton) states ...
>
> Understands all languages it knew in life bu... |
67,863 | The skeleton description says that while it cannot speak it, it can understand the languages it knew in life. Can it not speak because of its undeath or could it learn to speak a language? | 2015/08/31 | [
"https://rpg.stackexchange.com/questions/67863",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/21781/"
] | It is true, on pg 272 of the 5e Monster Manual, it states:
>
> They can't read, speak, emote, or communicate in any way except to nod, shake their heads, or point.
>
>
>
... and D&D Beyond - [Skeleton entry](https://www.dndbeyond.com/monsters/skeleton) states ...
>
> Understands all languages it knew in life bu... | <https://www.dandwiki.com/wiki/Skeleton_(5e_Race)> said
>
> You've managed to control the energies that sustain you to allow you speak. You can speak, read and write Common, as well as the language of your creator. A Giant Skeleton may speak Giant, a God Touched may know Celestial, a Magic Fluke may randomly grant yo... |
30,072,278 | I am having trouble with reading in a text file full of names (some are repeated) and inputting the first and last names together on 1 line. The program works and deletes repeated names but outputs them in alphabetical order with first and last names being treated as 2 different names. Am I outputting the names wrong w... | 2015/05/06 | [
"https://Stackoverflow.com/questions/30072278",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4110090/"
] | The `>>` operator in `partyList >> name` only reads from `partyList` until whitespace, which includes spaces, so `name` gets the values `"Daniel"`, `"Walrus"`, `"Amy"`, etc. on iteration. If you want to read one line at a time, use
```
while (std::getline(partyList, name))
```
which gets you `"Daniel Walrus"` etc. | ```
while (partyList >> name)
```
The `>>` operator is looking here for a first blank character. That's why your names are split this way. |
47,278,674 | I recently started study opencv. I only have a bachelor's degree on engineering. I am having a hard time of understanding these 2 morphological transformation: Black Hat, Top Hat. the official documents is [here](https://docs.opencv.org/master/d9/d61/tutorial_py_morphological_ops.html)
Can some one give some advice o... | 2017/11/14 | [
"https://Stackoverflow.com/questions/47278674",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6898439/"
] | Hopefully you understand *”morphological opening”*. If so, the (white) Top Hat tells you the pixels that would be removed by *”opening”*.
Likewise, the Black Hat tells you the pixels that would be added by *”morphological closing”*. | See the image for explanation. Simple algebra will help here.
>
> Top hat
>
>
>
top hat = image - opening = image - (image - false +ves) = false +ves
>
> Black hat
>
>
>
black hat = image - closing = image - (image - false -ves) = false -ves
[Explanation](https://i.stack.imgur.com/3Y15r.jpg) |
End of preview. Expand in Data Studio
StackExchange Paired Mini (100 samples)
This is a subset of the StackExchange Paired lvwerra/stack-exchange-paired dataset.
Disclaimer
For licensing or any other related detail, please refer to the original dataset linked above.
- Downloads last month
- 9