qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
45,496,579 | Below date cast is not displaying milli seconds.
```
select from_unixtime(unix_timestamp("2017-07-31 23:48:25.957" , "yyyy-MM-dd HH:mm:ss.SSS"));
2017-07-31 23:48:25
```
What is the way to get milli seconds?
Thanks. | 2017/08/04 | [
"https://Stackoverflow.com/questions/45496579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2772176/"
] | Since this string is in ISO format, the casting can be done straightforward
```
hive> select cast("2017-07-31 23:48:25.957" as timestamp);
OK
2017-07-31 23:48:25.957
```
or
```
hive> select timestamp("2017-07-31 23:48:25.957");
OK
2017-07-31 23:48:25.957
``` | because unix\_timestamp is based on seconds, it truncate milliseconds.
Instead, you can transform string to timestamp using date\_format, which preserve milliseconds. And then from\_utc\_timestamp.
```
select from_utc_timestamp(date_format("2017-07-31 23:48:25.957",'yyyy-MM-dd HH:mm:ss.SSS'),'UTC') as datetime
``` |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | Perfect solution does exist, here it is.
I also thought this wasn't possible, even though it's very simple, people wrote solutions where you need a custom tool to scan the built file afterwards and scan for strings and encrypt the strings like that, which wasn't bad but I wanted a package that's compiled from Visual S... | If people are interrested by simple string encryption. I wrote a code sample describing string self decryption and tagging using a MACRO. An external cryptor code is provided to patch the binary (so the strings are crypted after program compilation). The strings are decrypted one at a time in memory.
<http://www.sevag... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | My preferred solution:
```
// some header
extern char const* const MyString;
// some generated source
char const* const MyString = "aioghaiogeubeisbnuvs";
```
And then use your favorite scripting language to generate this one source file where you store the "encrypted" resources. | If people are interrested by simple string encryption. I wrote a code sample describing string self decryption and tagging using a MACRO. An external cryptor code is provided to patch the binary (so the strings are crypted after program compilation). The strings are decrypted one at a time in memory.
<http://www.sevag... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | My preferred solution:
```
// some header
extern char const* const MyString;
// some generated source
char const* const MyString = "aioghaiogeubeisbnuvs";
```
And then use your favorite scripting language to generate this one source file where you store the "encrypted" resources. | I cannot compile that, the compiler throws countless errors, I was looking for other solutions for fast string encryption and found out about this little toy <https://www.stringencrypt.com> (wasn't hard, 1st result in Google for string encryption keyword).
This is how it works:
1. You enter the label name say sString... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | [This blog](http://molecularmusings.wordpress.com/2011/06/24/hashed-strings/) provides a solution for compile time string hashing in C++. I guess the principle is the same. Unfortunately You have to create a unique macro for each string length. | if you are willing to use C++11 features, variadic templates can be used to do compile-time encryption of variable length strings, an example would be [this](http://www.gamedeception.net/threads/20496-Compile-time-String-Encryption-with-C-0x).
Also see [this](https://stackoverflow.com/questions/3492742/compile-time-s... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | Perfect solution does exist, here it is.
I also thought this wasn't possible, even though it's very simple, people wrote solutions where you need a custom tool to scan the built file afterwards and scan for strings and encrypt the strings like that, which wasn't bad but I wanted a package that's compiled from Visual S... | My preferred solution:
```
// some header
extern char const* const MyString;
// some generated source
char const* const MyString = "aioghaiogeubeisbnuvs";
```
And then use your favorite scripting language to generate this one source file where you store the "encrypted" resources. |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | Perfect solution does exist, here it is.
I also thought this wasn't possible, even though it's very simple, people wrote solutions where you need a custom tool to scan the built file afterwards and scan for strings and encrypt the strings like that, which wasn't bad but I wanted a package that's compiled from Visual S... | I think you have to do something like what is done when using gettext (i18n) :
* use a macro like your CRYPT.
* use a parser that will crypt string when it finds CRYPT.
* write a function that decrypt, called by your macro.
For gettext, you use the \_() macro that is used to generate the i18ned string dictionnary and... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | Perfect solution does exist, here it is.
I also thought this wasn't possible, even though it's very simple, people wrote solutions where you need a custom tool to scan the built file afterwards and scan for strings and encrypt the strings like that, which wasn't bad but I wanted a package that's compiled from Visual S... | I cannot compile that, the compiler throws countless errors, I was looking for other solutions for fast string encryption and found out about this little toy <https://www.stringencrypt.com> (wasn't hard, 1st result in Google for string encryption keyword).
This is how it works:
1. You enter the label name say sString... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | This is a late answer, but I'm sure there's a better solution.
Plese refer to the accepted answer [here](https://stackoverflow.com/questions/6934217/encrypting-obfuscating-a-string-literal-at-compile-time).
Basically, it shows how to use the [ADVobfuscator](https://github.com/andrivet/ADVobfuscator) lib to obfuscate ... | I think you have to do something like what is done when using gettext (i18n) :
* use a macro like your CRYPT.
* use a parser that will crypt string when it finds CRYPT.
* write a function that decrypt, called by your macro.
For gettext, you use the \_() macro that is used to generate the i18ned string dictionnary and... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | This is a late answer, but I'm sure there's a better solution.
Plese refer to the accepted answer [here](https://stackoverflow.com/questions/6934217/encrypting-obfuscating-a-string-literal-at-compile-time).
Basically, it shows how to use the [ADVobfuscator](https://github.com/andrivet/ADVobfuscator) lib to obfuscate ... | if you are willing to use C++11 features, variadic templates can be used to do compile-time encryption of variable length strings, an example would be [this](http://www.gamedeception.net/threads/20496-Compile-time-String-Encryption-with-C-0x).
Also see [this](https://stackoverflow.com/questions/3492742/compile-time-s... |
7,270,473 | I don't want reverse-engineers to read the plain-text of hardcoded strings in my application. The trivial solution for this is using a simple [XOR-Encryption](http://chod-is.blogspot.com/2011/05/run-time-string-decryption.html). The problem is I need a converter and in my application it will look like this:
```
//Befo... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7270473",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/893890/"
] | [This blog](http://molecularmusings.wordpress.com/2011/06/24/hashed-strings/) provides a solution for compile time string hashing in C++. I guess the principle is the same. Unfortunately You have to create a unique macro for each string length. | I cannot compile that, the compiler throws countless errors, I was looking for other solutions for fast string encryption and found out about this little toy <https://www.stringencrypt.com> (wasn't hard, 1st result in Google for string encryption keyword).
This is how it works:
1. You enter the label name say sString... |
77,592 | I want to plot 4 separate lines on my graph but for some reason Mathematica is linking all my points into a single lines.
My data:
```
v = {3.26797, 4.07436, 5.12821, 5.42005};
m = {0.004, 0.00592, 0.00836, 0.01060};
```
I want a straight line from the origin
`{0,0}` to the point `{0.004,3.26797}`,
`{0,0}` to the... | 2015/03/18 | [
"https://mathematica.stackexchange.com/questions/77592",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/24904/"
] | ### `NIntegrate` does each integral separately
This has been observed before:
[NIntegrate piecewise vector function](https://mathematica.stackexchange.com/questions/45763/nintegrate-piecewise-vector-function), [Nested NIntegrate of vector function](https://mathematica.stackexchange.com/questions/51704/nested-nintegrat... | Adding `"SymbolicProcessing" -> 0` (it's probably the "default setting" of *Matlab*, right?) and making use of parallelism gives me a **3X** speedup on my dual-core old laptop:
```
laxis = ParallelTable[1.0 i, {i, 1, 2046}];
Total[ParallelMap[
NIntegrate[#/(x^3 + 10), {x, 0, Infinity},
Method -> {"GlobalAdapt... |
40,596,965 | I'm trying to initialize `Set<String>` variable during the debug session in eclipse. So I right-click on the variable to change and in "Change Object Value" window type the following expression:
```
new HashSet<String>(Arrays.asList(new String[]{"a", "b"}));
```
Eclipse returns the following error:
```
HashSet cann... | 2016/11/14 | [
"https://Stackoverflow.com/questions/40596965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5202500/"
] | If you want to use a class that is not imported (no corresponding `import` statement in the current file), then you can use these classes by their fully qualified names:
```
new java.util.HashSet<String>(java.util.Arrays.asList(new String[]{"a", "b"}));
``` | this will work:
```
Set<String> yourSet = new HashSet<String>(Arrays.asList("a", "b"));
```
And your eclipse errors, you need to import Java.Util and Collection classes. Right click anywhere on your class and click on "source" >> "organize imports". |
40,596,965 | I'm trying to initialize `Set<String>` variable during the debug session in eclipse. So I right-click on the variable to change and in "Change Object Value" window type the following expression:
```
new HashSet<String>(Arrays.asList(new String[]{"a", "b"}));
```
Eclipse returns the following error:
```
HashSet cann... | 2016/11/14 | [
"https://Stackoverflow.com/questions/40596965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5202500/"
] | A more flexible solution would be to use the `Display` view in `Debug Perspective` of Eclipse :
Enter that :
```
yourSet = new java.util.HashSet<String>();
yourSet.addAll(java.util.Arrays.asList("a", "b"));
```
Then, select these lines, right-click and choose `execute` option.
Here an example with a screenshot :
... | this will work:
```
Set<String> yourSet = new HashSet<String>(Arrays.asList("a", "b"));
```
And your eclipse errors, you need to import Java.Util and Collection classes. Right click anywhere on your class and click on "source" >> "organize imports". |
40,596,965 | I'm trying to initialize `Set<String>` variable during the debug session in eclipse. So I right-click on the variable to change and in "Change Object Value" window type the following expression:
```
new HashSet<String>(Arrays.asList(new String[]{"a", "b"}));
```
Eclipse returns the following error:
```
HashSet cann... | 2016/11/14 | [
"https://Stackoverflow.com/questions/40596965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5202500/"
] | If you want to use a class that is not imported (no corresponding `import` statement in the current file), then you can use these classes by their fully qualified names:
```
new java.util.HashSet<String>(java.util.Arrays.asList(new String[]{"a", "b"}));
``` | A more flexible solution would be to use the `Display` view in `Debug Perspective` of Eclipse :
Enter that :
```
yourSet = new java.util.HashSet<String>();
yourSet.addAll(java.util.Arrays.asList("a", "b"));
```
Then, select these lines, right-click and choose `execute` option.
Here an example with a screenshot :
... |
18,763,776 | I don't understand the condition `((wins[i] & score) === wins[i])`. `score` is a value and `wins[i]` is an element inside an array that contains integers. They are compared like if they were booleans. Enlighten me please.
```
wins = [7, 56, 448, 73, 146, 292, 273, 84];
win = function (score) { //score is an int value... | 2013/09/12 | [
"https://Stackoverflow.com/questions/18763776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1924247/"
] | These aren't logical operators, they are fundamentally different. You need to understand the binary representation of numbers. So for example, if `a = 7` and `b = 12`, then `a & b` is evaluated by looking at the bits which are 1 in both `a` **and** `b`:
```
a 00000111
b 00001100
a&b 00000100
```
So `7 & 12 = 4`.... | People talking about bitwise operators are right: <http://en.wikipedia.org/wiki/Bitwise_operation>
In this case, the entire condition is true, if `win[i]` contains no binary 1 at a position, where `score` doesn't also have a binary 1. (in other words, bitwise implication `win[i]` => `score`) |
18,763,776 | I don't understand the condition `((wins[i] & score) === wins[i])`. `score` is a value and `wins[i]` is an element inside an array that contains integers. They are compared like if they were booleans. Enlighten me please.
```
wins = [7, 56, 448, 73, 146, 292, 273, 84];
win = function (score) { //score is an int value... | 2013/09/12 | [
"https://Stackoverflow.com/questions/18763776",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1924247/"
] | These aren't logical operators, they are fundamentally different. You need to understand the binary representation of numbers. So for example, if `a = 7` and `b = 12`, then `a & b` is evaluated by looking at the bits which are 1 in both `a` **and** `b`:
```
a 00000111
b 00001100
a&b 00000100
```
So `7 & 12 = 4`.... | We can't completely answer here, as we don't have the context.
You must understand that it's about the binary representation of the integers, which are used as bit storage.
You can see the bits using
```
[7, 56, 448, 73, 146, 292, 273, 84].map(function(v) { var s=v.toString(2);return '00000000'.slice(s.length)+s })... |
45,570,038 | I know that a table cell in a JTable automatically gets a Checkbox if you set its class to Boolean.
However, I have a column in my JTable, which contains integer values. Is it possible to add Checkboxes to those (non-boolean) cells like in my poor drawing here:
[` method in your table model.
[See JavaDoc](https://docs.oracle.com/javase/7/docs/api/javax/swing/table/AbstractTableModel.html#getColumnClass(int)).
The other one is an own [TableCellEditor](https://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellEditor.html) a... | Why not just create a new class which contains both a label and a checkbox and add that to your table?
```
import java.awt.*;
import javax.swing.*;
public class LabelWithCheckBox extends JPanel{
public LabelWithCheckBox(String text){
setLayout(new GridBagLayout());
JLabel jLabel = new JLabel(text);
JChe... |
45,570,038 | I know that a table cell in a JTable automatically gets a Checkbox if you set its class to Boolean.
However, I have a column in my JTable, which contains integer values. Is it possible to add Checkboxes to those (non-boolean) cells like in my poor drawing here:
[. Your implementation of `getColumnClass()` would then return `Value.class` for the relevant column. A complete example us... | Why not just create a new class which contains both a label and a checkbox and add that to your table?
```
import java.awt.*;
import javax.swing.*;
public class LabelWithCheckBox extends JPanel{
public LabelWithCheckBox(String text){
setLayout(new GridBagLayout());
JLabel jLabel = new JLabel(text);
JChe... |
45,570,038 | I know that a table cell in a JTable automatically gets a Checkbox if you set its class to Boolean.
However, I have a column in my JTable, which contains integer values. Is it possible to add Checkboxes to those (non-boolean) cells like in my poor drawing here:
[. Your implementation of `getColumnClass()` would then return `Value.class` for the relevant column. A complete example us... | One way is to override the `getColumnClass()` method in your table model.
[See JavaDoc](https://docs.oracle.com/javase/7/docs/api/javax/swing/table/AbstractTableModel.html#getColumnClass(int)).
The other one is an own [TableCellEditor](https://docs.oracle.com/javase/7/docs/api/javax/swing/table/TableCellEditor.html) a... |
16,753,529 | I'm making a console program where I've got multiple values mapped to `dictionary` `keyLookup`. I'm using if commands that use the key to output some `console.writeline = ("stuff");` but it only works if I have the value and the key the same (in the dictionary). I don't know why this is. I've been mucking about with `l... | 2013/05/25 | [
"https://Stackoverflow.com/questions/16753529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2419629/"
] | You should iterate through the dictionary differently (Dont use ToList-Function).
Try this instead:
```
foreach (KeyValuePair kvp (Of String, String) In testDictionary)
{
Debug.WriteLine("Key:" + kvp.Key + " Value:" + kvp.Value);
}
```
And your application is crashing if the word doesn't match, because of this co... | >
> `foundKey = keyLookup[word];`
>
>
>
If `word` doesn't exist in keyLookup then it will crash.
>
> `string foundKey = mathFunction[mFunction];`
>
>
>
if `mFunction` doesn't exist in mathFunction then it will crash.
---
If you're trying to make this a "conversational" program, then the word look-up **is**... |
17,838 | So let's say you boot up your Linux install all the way to the desktop. You start up a gnome-terminal/konsole/whatever so you have a tty to enter commands to.
Now let's say I SSH into that same machine. It will bind me to another tty to enter commands to.
Now let's say I want to "switch" my tty from my original SSH... | 2011/08/01 | [
"https://unix.stackexchange.com/questions/17838",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/9524/"
] | Maybe these schema can clarify the situation.
This is the usual setting:
>
>
> ```
> Terminal (/dev/ttyX or /dev/pts/x)
> device
> |
> (screen)<--[<output]----x-------(stdout) Process1
> Ter... | Reconnecting the processes on the other terminal to your current terminal is not possible without dirty tricks. It is possible by forcing the process to perform certain system calls (with [`ptrace`](http://en.wikipedia.org/wiki/Ptrace)); this causes some programs to crash. There are several tools that do this, such as ... |
5,242,202 | To appreciate something, you need contrast with something else. How can our generation appreciate the concept of stored-program when we haven't seen any other way of computing? | 2011/03/09 | [
"https://Stackoverflow.com/questions/5242202",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/597858/"
] | I assume you are asking regarding InnoDB, since MyISAM does not support transactions.
There is no such thing as *out of transaction*, even with the default `autocommit=1`, every statement for itself is a transaction.
The answer to your question depends on what you mean by `only committed data`.
Say we have a table w... | If you have a Specific database in mind, we could probably tell you what the default is from a vanilla installation. Otherwise ... it's whatever the person who configured and installed the database system set it to, or what someone set it to after that. |
35,390,122 | I'm working on a new OS-X Daemon process (run from launchd) and would like to get popup window every time it crashes with all relevant information (pid, path to crash file, etc...). This will sure help my debugging effort in this early stage of the development.
Basically, i want to have the same behavior as a UI appli... | 2016/02/14 | [
"https://Stackoverflow.com/questions/35390122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4333809/"
] | If there is no opening tag for a closing tag the document is not a valid Xml. It's OK to have a tag without a value `<Tag />` - which is an equivalent to `<Tag></Tag>` but it is not valid to have a closing tag without a corresponding opening tag. Elements also have to be correctly nested. | A common thing is
```
<tag/>
```
, which is an equivalent of
```
<tag></tag>
```
, useful when there is no inner content.
For example, you can see in html :
```
<img src="foo.png"/>
```
But
```
</tag>
```
alone is not valid in standard contexts. |
35,390,122 | I'm working on a new OS-X Daemon process (run from launchd) and would like to get popup window every time it crashes with all relevant information (pid, path to crash file, etc...). This will sure help my debugging effort in this early stage of the development.
Basically, i want to have the same behavior as a UI appli... | 2016/02/14 | [
"https://Stackoverflow.com/questions/35390122",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4333809/"
] | If there is no opening tag for a closing tag the document is not a valid Xml. It's OK to have a tag without a value `<Tag />` - which is an equivalent to `<Tag></Tag>` but it is not valid to have a closing tag without a corresponding opening tag. Elements also have to be correctly nested. | A tag like `<tag/>` is an **empty-element tag** (also called a self-closing tag), which is shorthand for `<tag></tag>`: both represent an empty element.
Quoted from the [W3C Recommendation on XML](https://www.w3.org/TR/REC-xml/#dt-eetag):
>
> [Definition: An element with no content is said to be **empty**.]
>
> T... |
114,349 | That is the problem. When I create an account without password (Or disable the password on an account that has), when I try to install softwares or when I log out the account, it asks for password.. If I type the old password, it says: "invalid password" and isnt possible to do anything on Ubuntu.. Im using Ubuntu 11.1... | 2012/03/19 | [
"https://askubuntu.com/questions/114349",
"https://askubuntu.com",
"https://askubuntu.com/users/51290/"
] | Not TOO bad ideas, but still not recommended:
=============================================
In order to get a no password at login for the gui, you use the autologin options for your login manager lightdm or gdm.
lightdm `system settings - user accounts - your username - automatic login`
lightdm is the default, ... | **Try using an empty password.** Instead of trying to use the previous password, just leave the password field empty - this should work, because as it is impossible to get rid of all these dialogs that ask you for a pass-phrase, disabling the password is usually achieved by setting it to a blank value. |
114,349 | That is the problem. When I create an account without password (Or disable the password on an account that has), when I try to install softwares or when I log out the account, it asks for password.. If I type the old password, it says: "invalid password" and isnt possible to do anything on Ubuntu.. Im using Ubuntu 11.1... | 2012/03/19 | [
"https://askubuntu.com/questions/114349",
"https://askubuntu.com",
"https://askubuntu.com/users/51290/"
] | The problem you are having is because passwords are encrypted, and stored in /etc/shadow
When making a password , a empty password is not the same as as a space.
To make a user with a blank password, you generate a password with
```
perl -e 'print crypt("password","\$6\$v/salt\$") . "\n"'
```
Be sure to change you... | **Try using an empty password.** Instead of trying to use the previous password, just leave the password field empty - this should work, because as it is impossible to get rid of all these dialogs that ask you for a pass-phrase, disabling the password is usually achieved by setting it to a blank value. |
114,349 | That is the problem. When I create an account without password (Or disable the password on an account that has), when I try to install softwares or when I log out the account, it asks for password.. If I type the old password, it says: "invalid password" and isnt possible to do anything on Ubuntu.. Im using Ubuntu 11.1... | 2012/03/19 | [
"https://askubuntu.com/questions/114349",
"https://askubuntu.com",
"https://askubuntu.com/users/51290/"
] | Not TOO bad ideas, but still not recommended:
=============================================
In order to get a no password at login for the gui, you use the autologin options for your login manager lightdm or gdm.
lightdm `system settings - user accounts - your username - automatic login`
lightdm is the default, ... | OK, I have to do a little guesswork as the situation of your system is not absolutely clear to me.
1.) An account in Ubuntu has always a password. It is used to validate your authorization to change important configurations of your system. You can only deactivate that the password is asked when booting into your accou... |
114,349 | That is the problem. When I create an account without password (Or disable the password on an account that has), when I try to install softwares or when I log out the account, it asks for password.. If I type the old password, it says: "invalid password" and isnt possible to do anything on Ubuntu.. Im using Ubuntu 11.1... | 2012/03/19 | [
"https://askubuntu.com/questions/114349",
"https://askubuntu.com",
"https://askubuntu.com/users/51290/"
] | The problem you are having is because passwords are encrypted, and stored in /etc/shadow
When making a password , a empty password is not the same as as a space.
To make a user with a blank password, you generate a password with
```
perl -e 'print crypt("password","\$6\$v/salt\$") . "\n"'
```
Be sure to change you... | OK, I have to do a little guesswork as the situation of your system is not absolutely clear to me.
1.) An account in Ubuntu has always a password. It is used to validate your authorization to change important configurations of your system. You can only deactivate that the password is asked when booting into your accou... |
114,349 | That is the problem. When I create an account without password (Or disable the password on an account that has), when I try to install softwares or when I log out the account, it asks for password.. If I type the old password, it says: "invalid password" and isnt possible to do anything on Ubuntu.. Im using Ubuntu 11.1... | 2012/03/19 | [
"https://askubuntu.com/questions/114349",
"https://askubuntu.com",
"https://askubuntu.com/users/51290/"
] | Not TOO bad ideas, but still not recommended:
=============================================
In order to get a no password at login for the gui, you use the autologin options for your login manager lightdm or gdm.
lightdm `system settings - user accounts - your username - automatic login`
lightdm is the default, ... | I had a similar problem, this worked quite easily for me:
* open the terminal (ctrl+alt+t)
* type: `passwd` (you don't have to type `sudo passwd`, and shouldn't)
* You will be prompted to enter the new UNIX password
* re-enter your password
* you'll be notified that your password has been updated successfully.
* you m... |
114,349 | That is the problem. When I create an account without password (Or disable the password on an account that has), when I try to install softwares or when I log out the account, it asks for password.. If I type the old password, it says: "invalid password" and isnt possible to do anything on Ubuntu.. Im using Ubuntu 11.1... | 2012/03/19 | [
"https://askubuntu.com/questions/114349",
"https://askubuntu.com",
"https://askubuntu.com/users/51290/"
] | The problem you are having is because passwords are encrypted, and stored in /etc/shadow
When making a password , a empty password is not the same as as a space.
To make a user with a blank password, you generate a password with
```
perl -e 'print crypt("password","\$6\$v/salt\$") . "\n"'
```
Be sure to change you... | I had a similar problem, this worked quite easily for me:
* open the terminal (ctrl+alt+t)
* type: `passwd` (you don't have to type `sudo passwd`, and shouldn't)
* You will be prompted to enter the new UNIX password
* re-enter your password
* you'll be notified that your password has been updated successfully.
* you m... |
206,811 | I keep getting told I'm in the wrong place :)
I'm having odd troubles with my home network since I added a media server which uses a VPN to the outside world. SOME (not all) internal network traffic is affected unless I disable the VPN. I'm lost. I thought Server Fault made sense, but I see people getting lambasted f... | 2013/11/09 | [
"https://meta.stackexchange.com/questions/206811",
"https://meta.stackexchange.com",
"https://meta.stackexchange.com/users/238573/"
] | [The help center for Super User](https://superuser.com/help/on-topic) states it is suitable to ask "personal and home computer networking" related questions on it, so you should be good to go on there.
To cross it *off* the list of contenders (and for completeness), there's also <http://networkengineering.stackexchang... | Super User is so bloated with categories of questions, that it's nearly hopeless to illicit a good answer about anything that is remotely related to (so-called) "home networking", and Network Engineering is so "professional" that layman questions get booted almost immediately. The problem is that many "home" users are ... |
31,234,873 | I get this error when I try scaffolding a project using yeoman with this command.
```
npm install generator-gulp-webapp --global
```
The error:
```
Yeoman Doctor
Running sanity checks on your system
✖ NODE_PATH matches the npm root
npm global root value is not in your NODE_PATH
```
I am using Ubuntu 15.04 and h... | 2015/07/05 | [
"https://Stackoverflow.com/questions/31234873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1368430/"
] | It seems installing with
```
sudo npm install generator-gulp-webapp --global
```
solved the problem. | try with "Run as Administrator" option. It will work. |
82,019 | Contacts have Specialities (skills) to sell so I have a Master-Detail from Contact to Speciality. We sell Product (1/2 day, full day) for those Contacts so the Product has a lookup to the Contact. Speciality <= Contact => Product.
Now I want to search for Products based on Specialities. I can get from Product to Conta... | 2015/07/02 | [
"https://salesforce.stackexchange.com/questions/82019",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/21845/"
] | Daniel Ballinger has it.
I'm assuming this helper is called from an Account Trigger, so you don't want to addError to the contact, instead you want to add it to the associated Account.
```
if(accountIdSet.size()>0) {
//Add Account Id to your query see ** below
contactsList = [select id,name,Par... | In the same way as Caleb Sidel and Daniel Ballinger. You need add in Contact query the field AccountId, and after you do the update, you need catch the contact error.
I prefer use a Map of Contacts vs List of Contacts, because SaveResult Class has the id of the success and wrong records.
```
public class AccountTrigg... |
186,795 | What are the SQL Server benefits of using proper data types?
Example:
1. SmallInt/TinyInt vs Regular Integer
2. Decimal(2) vs float
3. Varchar(100) vs char(100)
Will it really matter these days, with modern computing?
Thanks, | 2017/09/25 | [
"https://dba.stackexchange.com/questions/186795",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/-1/"
] | >
> What are the SQL Server benefits of using proper data types?
>
>
>
If you use the right datatype your database will better match your model and is more likely to be efficient both in terms of space & speed. You are at risk of this question being closed as "too broad" because it can be quite a wide subject.
To... | It definitely matters even these days even with modern computing. My guess it is going to matter for a very long time.
Using proper datatypes can save you `MB`s. Even `GB`s sometimes.
Have a look at Aaron Bertrand article [here](https://sqlblog.org/2009/10/12/bad-habits-to-kick-choosing-the-wrong-data-type).
It will ... |
186,795 | What are the SQL Server benefits of using proper data types?
Example:
1. SmallInt/TinyInt vs Regular Integer
2. Decimal(2) vs float
3. Varchar(100) vs char(100)
Will it really matter these days, with modern computing?
Thanks, | 2017/09/25 | [
"https://dba.stackexchange.com/questions/186795",
"https://dba.stackexchange.com",
"https://dba.stackexchange.com/users/-1/"
] | >
> What are the SQL Server benefits of using proper data types?
>
>
>
If you use the right datatype your database will better match your model and is more likely to be efficient both in terms of space & speed. You are at risk of this question being closed as "too broad" because it can be quite a wide subject.
To... | The benefit of using the proper type is the **MEMORY** that SQL Server uses to store data of this or that type.
1. `TinyInt` - 1 byte (can store integer values 0-255)
2. `SmallInt` - 2 byte (can store integer values -32,768 - 32,767)
3. `Int` - 4 byte (can store integer value -2^31 - 2^31 -1)
4. `BigInt` - 8 byte (can... |
46,653,870 | The working solution I have is below. But it does not scale well and looks verbose.
I want to be able to add more and more `<li>` tags with out creating so much code.
This code simply toggles a bottom border so you know what you have selected.
```
render () {
var style_fave;
var style_splash;
if (this... | 2017/10/09 | [
"https://Stackoverflow.com/questions/46653870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8497391/"
] | I've solved the issue by annotating my MyControllerTestConfiguration inner static class with @EnableWebMvc.
```
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebAppConfiguration
public class MyControllerTest {
@Configuration
@EnableWebMvc // <------------ added this
public static class My... | In my particular case, I had a `@SpringBootTest` annotated class, and adding `@EnableWebMvc` to either the main controller (a `@RestController` to be specific) or the config was out of the question. I tried different approaches and none worked, probably because we had some dependencies that overrode some Spring version... |
7,910,204 | When calling `FB.login()` in IE (any version), the popup auth dialog simply says:
>
> An error occurred with <appname>. Please try again later.
>
>
>
The call works as expected in Chrome, Firefox, and Opera. Reduced test:
```
FB.init({
appId : '...',
channelURL : '...',
status : true,
co... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7910204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201952/"
] | An other stuff to be considered...
An enum could only be updated thru a modification of the database structure elsewhere a linked table permits dynamic creation of record. | It depends on architecture and many other factors.
For example, you do not allow reading/writing data except using stored procedures. In this case you can feel free use "tinyint" datatype. If you allow reading/writing with direct queries it should be better to use constraint i.e. ENUM to avoid improper statuses (if UI... |
7,910,204 | When calling `FB.login()` in IE (any version), the popup auth dialog simply says:
>
> An error occurred with <appname>. Please try again later.
>
>
>
The call works as expected in Chrome, Firefox, and Opera. Reduced test:
```
FB.init({
appId : '...',
channelURL : '...',
status : true,
co... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7910204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201952/"
] | IMHO, the enum extension makes it much easier to embed semantics into a table and also improves efficiency by:
1. decreasing the number of joins required for a query
2. reducing the number of open tables in the DBMS
The only downsides I am aware of is
1. the ENUM type is not implemented by other DBMS
2. if you choo... | It depends on architecture and many other factors.
For example, you do not allow reading/writing data except using stored procedures. In this case you can feel free use "tinyint" datatype. If you allow reading/writing with direct queries it should be better to use constraint i.e. ENUM to avoid improper statuses (if UI... |
7,910,204 | When calling `FB.login()` in IE (any version), the popup auth dialog simply says:
>
> An error occurred with <appname>. Please try again later.
>
>
>
The call works as expected in Chrome, Firefox, and Opera. Reduced test:
```
FB.init({
appId : '...',
channelURL : '...',
status : true,
co... | 2011/10/26 | [
"https://Stackoverflow.com/questions/7910204",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201952/"
] | IMHO, the enum extension makes it much easier to embed semantics into a table and also improves efficiency by:
1. decreasing the number of joins required for a query
2. reducing the number of open tables in the DBMS
The only downsides I am aware of is
1. the ENUM type is not implemented by other DBMS
2. if you choo... | An other stuff to be considered...
An enum could only be updated thru a modification of the database structure elsewhere a linked table permits dynamic creation of record. |
63,353,380 | I am really new in flex-box. I have been playing around with flex-box by using [Saas](https://sass-lang.com/guide). My goal is keep distance between flex-box items like this: [](https://i.stack.imgur.com/1arUO.png)
I could not able to do that. I have ... | 2020/08/11 | [
"https://Stackoverflow.com/questions/63353380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12494839/"
] | ```css
.social-media {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
background-color: #f9f871;
align-items: center;
}
``` | You can an give:
```
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
flex:1;
}
```
this will solve your issue |
63,353,380 | I am really new in flex-box. I have been playing around with flex-box by using [Saas](https://sass-lang.com/guide). My goal is keep distance between flex-box items like this: [](https://i.stack.imgur.com/1arUO.png)
I could not able to do that. I have ... | 2020/08/11 | [
"https://Stackoverflow.com/questions/63353380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12494839/"
] | ```css
.social-media {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
background-color: #f9f871;
align-items: center;
}
``` | I've added `margin-left: auto;` to the social icons so they will use the remaining space as margin to the left
I've added `margin: auto;` to `.policy` so it wil be centered in between (but not absolutely centered) and added a little `margin-right` to the `p` elements so there is a little space between them
```css
.so... |
63,353,380 | I am really new in flex-box. I have been playing around with flex-box by using [Saas](https://sass-lang.com/guide). My goal is keep distance between flex-box items like this: [](https://i.stack.imgur.com/1arUO.png)
I could not able to do that. I have ... | 2020/08/11 | [
"https://Stackoverflow.com/questions/63353380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12494839/"
] | i've tried to reproduce that png image. i've change a little bit your html.
```css
body {
background-color: pink;
}
.social-media {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
background-color: #f9f871;
}
.logo {
font-size: 25px;
}
.copyright-wrapper {
display... | ```css
.social-media {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
background-color: #f9f871;
align-items: center;
}
``` |
63,353,380 | I am really new in flex-box. I have been playing around with flex-box by using [Saas](https://sass-lang.com/guide). My goal is keep distance between flex-box items like this: [](https://i.stack.imgur.com/1arUO.png)
I could not able to do that. I have ... | 2020/08/11 | [
"https://Stackoverflow.com/questions/63353380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12494839/"
] | i've tried to reproduce that png image. i've change a little bit your html.
```css
body {
background-color: pink;
}
.social-media {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
background-color: #f9f871;
}
.logo {
font-size: 25px;
}
.copyright-wrapper {
display... | You can an give:
```
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
flex:1;
}
```
this will solve your issue |
63,353,380 | I am really new in flex-box. I have been playing around with flex-box by using [Saas](https://sass-lang.com/guide). My goal is keep distance between flex-box items like this: [](https://i.stack.imgur.com/1arUO.png)
I could not able to do that. I have ... | 2020/08/11 | [
"https://Stackoverflow.com/questions/63353380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12494839/"
] | i've tried to reproduce that png image. i've change a little bit your html.
```css
body {
background-color: pink;
}
.social-media {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
background-color: #f9f871;
}
.logo {
font-size: 25px;
}
.copyright-wrapper {
display... | I've added `margin-left: auto;` to the social icons so they will use the remaining space as margin to the left
I've added `margin: auto;` to `.policy` so it wil be centered in between (but not absolutely centered) and added a little `margin-right` to the `p` elements so there is a little space between them
```css
.so... |
47,513,726 | My regex doesn't really work for splitting a TitleCase word in PHP.
Articles without an author should not be affected by the regex.
**My current regex:** `From (\S+\s){2}(?<=[a-z])(?=[A-Z])`
Here is my [Regex](https://regex101.com/r/00Wyol/1)
**Input:**
`From Günther RossmannThis is the article
From Harry Gregson-W... | 2017/11/27 | [
"https://Stackoverflow.com/questions/47513726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405150/"
] | With the `{2}` quantifier your pattern gets expanded as `\S+\s\S+\s` but there is no whitespace between the lower- and the uppercase letter.
You may use
```
'~From\s+(\S+\s\S+)(?![^\p{Lu}])~u'
```
See the [regex demo](https://regex101.com/r/ccnELf/2)
**Details**
* `From` - a literal substring
* `\s+` - 1+ whitesp... | You may use this regex to match title case author names preceded by `From`:
```
\bFrom(?:[\h-]+\p{Lu}\p{Ll}*)+
```
[RegEx Demo](https://regex101.com/r/WNOUL3/2)
**RegEx Breakup:**
* `\bFrom`: Match `From` with word boundary
* `(?:`: Start non-capturing group
+ `[\h-]+`: Match `1+` horizontal space or hyphen
+ `\... |
47,513,726 | My regex doesn't really work for splitting a TitleCase word in PHP.
Articles without an author should not be affected by the regex.
**My current regex:** `From (\S+\s){2}(?<=[a-z])(?=[A-Z])`
Here is my [Regex](https://regex101.com/r/00Wyol/1)
**Input:**
`From Günther RossmannThis is the article
From Harry Gregson-W... | 2017/11/27 | [
"https://Stackoverflow.com/questions/47513726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3405150/"
] | With the `{2}` quantifier your pattern gets expanded as `\S+\s\S+\s` but there is no whitespace between the lower- and the uppercase letter.
You may use
```
'~From\s+(\S+\s\S+)(?![^\p{Lu}])~u'
```
See the [regex demo](https://regex101.com/r/ccnELf/2)
**Details**
* `From` - a literal substring
* `\s+` - 1+ whitesp... | Code
----
[See regex in use here](https://regex101.com/r/HylfCl/1)
```
(From \S+\h+\S+(?<=\p{Ll})(?=\p{Lu}))
```
---
Results
-------
### Input
```
From Günther RossmannThis is the article
From Harry Gregson-WilliamsAnother article text
From Nora WaldstättenSome lorem ipsum stuff
From the fantastic architect of t... |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | The main point of using `volatile` keyword is to prevent compiler from generating a code that uses CPU registers as faster ways to represent variables. This forces compiled code to **access the exact memory location in RAM on every access** to the variable to get the latest value of it which may have been changed by an... | The compiler is indeed to allow that nothing *else* changes your variables unless some every specific conditions are met. One of them is volatile access; others are certain compiler barriers.
The naive way to program multithreaded code which you may have in mind is indeed prone to errors and would be considered undefi... |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | The compiler is indeed to allow that nothing *else* changes your variables unless some every specific conditions are met. One of them is volatile access; others are certain compiler barriers.
The naive way to program multithreaded code which you may have in mind is indeed prone to errors and would be considered undefi... | You can freely avoid volatile variables in multi-threaded software by using barriers. You can find many examples in linux kernel sources. Also using barriers instead of volatile allow compiler to generate much more efficient code. |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | The compiler is indeed to allow that nothing *else* changes your variables unless some every specific conditions are met. One of them is volatile access; others are certain compiler barriers.
The naive way to program multithreaded code which you may have in mind is indeed prone to errors and would be considered undefi... | As for case 2),
I have written the same code as case 2) in your question many times, and did NOT meet any problems. I think this is because the modern compiler can handle this situation. Say, the compiler can "see" I change "flag" inside "rx\_isr", and do not add any optimization. However, this is insecure due to the... |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | The main point of using `volatile` keyword is to prevent compiler from generating a code that uses CPU registers as faster ways to represent variables. This forces compiled code to **access the exact memory location in RAM on every access** to the variable to get the latest value of it which may have been changed by an... | You can freely avoid volatile variables in multi-threaded software by using barriers. You can find many examples in linux kernel sources. Also using barriers instead of volatile allow compiler to generate much more efficient code. |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | The main point of using `volatile` keyword is to prevent compiler from generating a code that uses CPU registers as faster ways to represent variables. This forces compiled code to **access the exact memory location in RAM on every access** to the variable to get the latest value of it which may have been changed by an... | >
> Is it because a compiler by-design has no idea of "asynchronous call" (in case of ISR), or multithreading? But this can't be, right?
>
Yes, it is that way.
In C the compiler has no notion of concurrency, so it is allowed to reorder and cache memory accesses, as long as the view from a single thread can't notice... |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | The main point of using `volatile` keyword is to prevent compiler from generating a code that uses CPU registers as faster ways to represent variables. This forces compiled code to **access the exact memory location in RAM on every access** to the variable to get the latest value of it which may have been changed by an... | As for case 2),
I have written the same code as case 2) in your question many times, and did NOT meet any problems. I think this is because the modern compiler can handle this situation. Say, the compiler can "see" I change "flag" inside "rx\_isr", and do not add any optimization. However, this is insecure due to the... |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | >
> Is it because a compiler by-design has no idea of "asynchronous call" (in case of ISR), or multithreading? But this can't be, right?
>
Yes, it is that way.
In C the compiler has no notion of concurrency, so it is allowed to reorder and cache memory accesses, as long as the view from a single thread can't notice... | You can freely avoid volatile variables in multi-threaded software by using barriers. You can find many examples in linux kernel sources. Also using barriers instead of volatile allow compiler to generate much more efficient code. |
12,738,672 | I read about usage of C `volatile` keyword in memory-mapped hardware register, ISR, and multithreaded program.
1) register
```
uint8_t volatile * pReg;
while (*pReg == 0) { // do sth } // pReg point to status register
```
2) ISR
```
int volatile flag = 0;
int main()
{
while(!flag) { // do sth }
}
interrupt... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12738672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1559625/"
] | >
> Is it because a compiler by-design has no idea of "asynchronous call" (in case of ISR), or multithreading? But this can't be, right?
>
Yes, it is that way.
In C the compiler has no notion of concurrency, so it is allowed to reorder and cache memory accesses, as long as the view from a single thread can't notice... | As for case 2),
I have written the same code as case 2) in your question many times, and did NOT meet any problems. I think this is because the modern compiler can handle this situation. Say, the compiler can "see" I change "flag" inside "rx\_isr", and do not add any optimization. However, this is insecure due to the... |
14,793 | 1. I'm trying to create a Sentiment Analysis algorithm for a custom data (government dept specifc data) and not like any other social media data etc. The data exists but I need to categorise the data as positive or negative.
2. My requirement is to classify the test data as positive or negative using a sentiment analys... | 2016/10/28 | [
"https://datascience.stackexchange.com/questions/14793",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/25631/"
] | The only way to obtain a high-quality dataset in your specific domain is to do it manually. There exists no other method that can give you the sentiment labels for texts in arbitrary domains. If there would exists such a method, why would you even bother to create your own model.
You should probably find/hire people ... | You can use SentiWordNet for classifying your data. SentiWordNet assigns to each synset of WordNet three sentiment scores: positivity, negativity, objectivity. |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | You could take an outer loop for visiting the characters and if a non space character is found, create a new string with an uppercase letter at this position.
```js
function wave(string) {
var result = [],
i;
for (i = 0; i < string.length; i++) {
if (string[i] === ' ') continue;
r... | I use modify of String prototype :
for implementation of replaceAt .
```js
// Modify prototype
String.prototype.replaceAt=function(index, replacement) {
return this.substr(0, index) + replacement+ this.substr(index + replacement.length);
}
function WaveFunction(str) {
var base = str;
var R = [];
v... |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | This does it. However, if you have spaces in your string, it will output string without any "waved letter" (since also space is handled):
```js
const wave = (str = '') => {
return str
.split('')
.map((letter, i, arr) => `${arr.slice(0, i)}${letter.toUpperCase()}${arr.slice(i + 1, arr.length)}`.replace(/,/... | I use modify of String prototype :
for implementation of replaceAt .
```js
// Modify prototype
String.prototype.replaceAt=function(index, replacement) {
return this.substr(0, index) + replacement+ this.substr(index + replacement.length);
}
function WaveFunction(str) {
var base = str;
var R = [];
v... |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | You can take each char in string in for loop and make it uppercase and the append with prefix and post fix string
```js
var array=[];
const wave = (str) => {
if(typeof str === 'string' && str === str.toLowerCase()){
for (let index = 0; index < str.length; index++) {
if (str[index] === ' ') conti... | I use modify of String prototype :
for implementation of replaceAt .
```js
// Modify prototype
String.prototype.replaceAt=function(index, replacement) {
return this.substr(0, index) + replacement+ this.substr(index + replacement.length);
}
function WaveFunction(str) {
var base = str;
var R = [];
v... |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | You could take an outer loop for visiting the characters and if a non space character is found, create a new string with an uppercase letter at this position.
```js
function wave(string) {
var result = [],
i;
for (i = 0; i < string.length; i++) {
if (string[i] === ' ') continue;
r... | This does it. However, if you have spaces in your string, it will output string without any "waved letter" (since also space is handled):
```js
const wave = (str = '') => {
return str
.split('')
.map((letter, i, arr) => `${arr.slice(0, i)}${letter.toUpperCase()}${arr.slice(i + 1, arr.length)}`.replace(/,/... |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | You could take an outer loop for visiting the characters and if a non space character is found, create a new string with an uppercase letter at this position.
```js
function wave(string) {
var result = [],
i;
for (i = 0; i < string.length; i++) {
if (string[i] === ' ') continue;
r... | You can take each char in string in for loop and make it uppercase and the append with prefix and post fix string
```js
var array=[];
const wave = (str) => {
if(typeof str === 'string' && str === str.toLowerCase()){
for (let index = 0; index < str.length; index++) {
if (str[index] === ' ') conti... |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | You could take an outer loop for visiting the characters and if a non space character is found, create a new string with an uppercase letter at this position.
```js
function wave(string) {
var result = [],
i;
for (i = 0; i < string.length; i++) {
if (string[i] === ' ') continue;
r... | I use tradicional js. This works on 99% off today browsers.
Where answer very pragmatic. I use array access for string ;
Magic is "String.fromCharCode(str.charCodeAt(x) ^ 32);"
Make it inverse always when we call this line.
```js
// Also tested UTF-8 non english chars
var index = 0;
var mydata= "helloçφšteti";
... |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | This does it. However, if you have spaces in your string, it will output string without any "waved letter" (since also space is handled):
```js
const wave = (str = '') => {
return str
.split('')
.map((letter, i, arr) => `${arr.slice(0, i)}${letter.toUpperCase()}${arr.slice(i + 1, arr.length)}`.replace(/,/... | I use tradicional js. This works on 99% off today browsers.
Where answer very pragmatic. I use array access for string ;
Magic is "String.fromCharCode(str.charCodeAt(x) ^ 32);"
Make it inverse always when we call this line.
```js
// Also tested UTF-8 non english chars
var index = 0;
var mydata= "helloçφšteti";
... |
54,983,179 | I can't seem to figure it out how to make a wave from a string in Javascript.
Rules:
1. The input will always be lower case string.
2. Ignore whitespace.
Expected result:
```
wave("hello") => ["Hello", "hEllo", "heLlo", "helLo", "hellO"]
wave (" h e y ") => [" H e y ", " h E y ", " h e Y "]
wave ("") => []
```
... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54983179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10228823/"
] | You can take each char in string in for loop and make it uppercase and the append with prefix and post fix string
```js
var array=[];
const wave = (str) => {
if(typeof str === 'string' && str === str.toLowerCase()){
for (let index = 0; index < str.length; index++) {
if (str[index] === ' ') conti... | I use tradicional js. This works on 99% off today browsers.
Where answer very pragmatic. I use array access for string ;
Magic is "String.fromCharCode(str.charCodeAt(x) ^ 32);"
Make it inverse always when we call this line.
```js
// Also tested UTF-8 non english chars
var index = 0;
var mydata= "helloçφšteti";
... |
141,619 | Hi I want to clarify in the following sentence:
>
> "One of the processes is brought by aversive emotional responses, and is likely to be controlled by the xxxxx pathway."
>
>
>
We usually use "One of the **\_\_**" followed by singular verb "is". However "emotional responses" is plural? Is this correct? Second fo... | 2013/12/13 | [
"https://english.stackexchange.com/questions/141619",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/59524/"
] | Since "*one* of the processes" is the subject of the sentence, the singular "is" should be used.
"... brought by aversive emotional responses..." serves as an [adjective clause](http://www.grammar-monster.com/glossary/adjective_clauses.htm), describing "one of the processes," so the plurality of "emotional responses" ... | Stick with *is* because *responses* is the object of the preposition *by*. |
70,615,402 | Please anyone can help me. May I ask how to check if the entire specific column in the datagridview has a value or not using vb.net
I tried different ways but I didn't get what i want.
i use this code but it only check the current cell not the entire column
```
If (String.IsNullOrWhiteSpace(mainform.DataGridView... | 2022/01/07 | [
"https://Stackoverflow.com/questions/70615402",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17820213/"
] | After multiple discussions with Agora Support, it appears the answer is no, **if only using the web SDK**, however they are introducing a new server side feature to make this possible.
It's currently in beta, so you'll have to ask Agora Support to enable it for your account, but once you've done so you can create and ... | I'm assuming you're using `startLiveStreaming` method using the Agora Web SDK. You can attach event listeners on all hosts to listen for primary host's online status, in case the primary host (the host that calls the start method) goes offline - a secondary host can call the start (and transcode) method.
You can also ... |
171,721 | When I redefine the command \cleardoublepage to include the words "This page has been intentionally left blank", the titles of the chapters are misaligned.
```
\documentclass{book}
\usepackage[a4paper, top=14mm, bottom=10mm, inner=15mm, outer=13mm, bindingoffset=10mm, includefoot, includehead, headsep=14mm, footskip=1... | 2014/04/15 | [
"https://tex.stackexchange.com/questions/171721",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/49973/"
] | This combines Werner's comment with a modified version of Ian Thompson's answer.
Werner's suggestion
===================
Werner's suggestion resolves the problem mentioned in the question but reveals a further problem:
```
\documentclass{book}
\usepackage[a4paper, top=14mm, bottom=10mm, inner=15mm, outer=13mm, bind... | I'm not sure why, but putting `\centering` in a group fixes the problem.
```
\documentclass{book}
\usepackage[a4paper, top=14mm, bottom=10mm, inner=15mm, outer=13mm, bindingoffset=10mm, includefoot, includehead, headsep=14mm, footskip=14mm]{geometry}
\usepackage{titlesec}
\titleformat{\chapter}[hang]{\normalfont\huge\... |
57,524 | I wanted to work on `HttpSessions` and JSP.
This is the view I have:
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<div>
<c:out value="All available products:"/>
<br/>
<br/>
<c:forEach items="${applicationScope.allProducts}" var="product">
<c:out value="... | 2014/07/20 | [
"https://codereview.stackexchange.com/questions/57524",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/37811/"
] | ### Interfaces vs implementations
Always use interfaces in declarations, not implementations. Instead of:
>
>
> ```
> private static HashMap<Integer,String> products = new HashMap<Integer, String>();
>
> ```
>
>
Do like this:
```
private static Map<Integer,String> products = new HashMap<Integer, String>();
`... | In the JSP, there are a couple areas where you are inconsistant in your style. For example, you are outputting strings via
```
<c:out value="All available products:"/>
```
vs
```
Currently your cart contains these items dude:
```
Also, you are mixing/matching c:out and EL string interpolation in your url constr... |
349,016 | Those of us with iPhone apps (released or unreleased) are able to send out limited beta builds using ad-hoc distribution. While the Apple docs for this have a few holes in them, there are a number of blogs, postings and other articles out there on "the net" that fill the gaps.
However, one thing I haven't seen anyone ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/349016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32136/"
] | We use the same app ID, just for simplicity. There are enough headaches in ad-hoc distribution that we don't want to confuse anybody with "why are there two apps on my phone?" problems. | I think it depends on how important the data in your app is. If the data is valuable I don't think beta testers would want it putting at risk, hence having a separate AppID would make sense. Of course, that also means that they won't test the application as fully either and any "upgrade" code won't get tested.
In my c... |
349,016 | Those of us with iPhone apps (released or unreleased) are able to send out limited beta builds using ad-hoc distribution. While the Apple docs for this have a few holes in them, there are a number of blogs, postings and other articles out there on "the net" that fill the gaps.
However, one thing I haven't seen anyone ... | 2008/12/08 | [
"https://Stackoverflow.com/questions/349016",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32136/"
] | We use the same app ID, just for simplicity. There are enough headaches in ad-hoc distribution that we don't want to confuse anybody with "why are there two apps on my phone?" problems. | I use both different Bundle Identifiers to allow my testing team to have multiple versions of the app installed as well as different Bundle Display NAmes, so they can easily see that they are using a development or beta build and report that number back to me when issues are found. |
1,361 | Although these two words are obviously closely related (I believe *tunc* = *tum* + *ce*), I would like to know whether they are usually **interchangeable** and the **meaning differences that exist between them**.
If I want to refer to a past time (*tum/tunc homines alas habebant*), which is appropriate? Can both be us... | 2016/08/11 | [
"https://latin.stackexchange.com/questions/1361",
"https://latin.stackexchange.com",
"https://latin.stackexchange.com/users/45/"
] | Smith's suggests that *tunc* (formed from *tum* + -*ce*, the enclitic adding emphasis) differs from *tum* only in being slightly stronger; although, since either is often strengthened by *demum*, etc., to me it seems a pretty fine distinction.
When making a contrast (*tum* . . . *cum* . .), I think using *tunc* for *t... | >
> Does tunc suggest that X is no longer the case?
>
>
>
It seems unlikely. At least, if it does, the English and American lawyers didn't know it. The first time I recall coming across the word tunc was in the legal phrase "nunc pro tunc," which is used about an order that is meant to take effect as of a past tim... |
27,310,385 | In the outer function, this.foo is bar, that's what I expected. However, in the inner function, this.foo is undefined, which is very surprising. Could anyone help me on this? Thanks.
```
var myObject = {
foo: "bar",
func: function () {
console.log("outer func: this.foo = " + this.foo);
(functi... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27310385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4327343/"
] | In the outer function, this refer to myObject and therefore can properly reference and access foo.
In the inner function,which is a closure, though, this no longer refers to myObject. As a result, this.foo is undefined in the inner function (Prior to ECMA 5, this in the inner function would refer to the global window ... | The first implementation is:
```
var myObject = {
foo: "bar",
func: function () {
console.log("outer func: this.foo = " + this.foo);
(function (self) {
console.log("inner func: self.foo = " + self.foo);
}(this));
}
};
myObject.func();
```
The second implementation is... |
5,297,068 | I am trying to get the attribute of a single node in VBA, but can't manage it using DOM
The XML looks like following:
```
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2... | 2011/03/14 | [
"https://Stackoverflow.com/questions/5297068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/655107/"
] | Try:
(Include a reference to Microsoft XML v3, I saved your xml to a file on my desktop)
```
Dim xmlDoc As DOMDocument30
Set xmlDoc = New DOMDocument30
xmlDoc.Load ("C:\users\jon\desktop\test.xml")
Dim id As String
id = xmlDoc.SelectSingleNode("//GetUserInfo/User").Attributes.getNamedItem("ID").Text
``` | I tried using similar code to load and extract attributes from a web service provided XML file. It turns out that unless you set the xDoc.async property to false, xDoc.Load() returns immediately and then the rest of your code goes to waste. |
62,275,621 | Here is my code I want to use GPU for my code. Currently it is running on CPU.
```
elf.graph = tf.Graph()
with self.graph.as_default():
self.face_graph = tf.GraphDef()
fid=tf.gfile.GFile(self.facenet_model, 'rb')
serialized_graph = fid.read()
self.face_graph.ParseFromString(seri... | 2020/06/09 | [
"https://Stackoverflow.com/questions/62275621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12635565/"
] | There is quite a complete guide on tensorflow's website for this: <https://www.tensorflow.org/guide/gpu>
Confirm tf can see your gpu:
```
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
```
See your GPU names:
```
from tensorflow.python.client import ... | Wrap it in
```
with tf.device('/GPU:0'):
....
``` |
21,954,097 | I am working on a project and i got a live mysql database with more than 200 tables with millions of records.For my local setup i want to export record from each table e.g 10 records from table 'A' and 10 from table 'B'.Its not possible for me to download selective numbers of record one by one as it w'll took my whole ... | 2014/02/22 | [
"https://Stackoverflow.com/questions/21954097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2637738/"
] | I don't know about phpMyAdmin, but `mysqldump` with `--where` parameter can do this
```
$ mysqldump --user=XXX --password=XXX --where='1 limit 10' DatabaseName > filename.sql
``` | In general, yes, what you want is easy to accomplish, but in your specific case, I think the answer is that it's not possible to do exactly what you want.
In general, it's easy to export only a subset of results; there are in fact a couple of ways to accomplish this. First, from each table export page, you can select ... |
30,373,513 | I am creating a tilemap platform game in SpriteKit. I assigned collision paths to the physics body of all ground tiles and made them non-dynamic. To the player I assigned two collision polygons: a circle on the bottom and a rectangle on the top.
The player sprite has a fixed position on screen, while the level is scro... | 2015/05/21 | [
"https://Stackoverflow.com/questions/30373513",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3986394/"
] | This has more to do with your game logic instead of your map properties. You need to have several "states" for your player. For example, if your player is idle you can set the CGVector to 0,0. This will stop the player from moving in any direction.
To give you some examples on movement. Let's say you want to make your... | It's a tilemap platform game...
Then gravity isn't important, put gravity to a very low value and then change all your impulses for the jumps and such in relation to the change in gravity...
OR,
Possibly, if the game isn't randomly generated you can set up a uibezierpath, and turn the path off if he stops moving up ... |
36,224,624 | I am having a Delphi XE Project with the following resource:
[](https://i.stack.imgur.com/oediA.png)
I have used [**`function LoadResourceFont`**](https://stackoverflow.com/questions/2984474/embedding-a-font-in-delphi) and tried the following code:
```
unit Unit1;
int... | 2016/03/25 | [
"https://Stackoverflow.com/questions/36224624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4109159/"
] | Your code has several errors in it.
1. `LoadResourceFont()` returns a `Boolean`. You are trying to assign that value to the `TLabel.Font.Name` property, which you cannot do since a `Boolean` is not a `String`. You are also trying to assign the `Boolean` to a `TLabel.Font[2]` property, which is not even a valid identif... | `Label.Font` doesn't have subscripts, so `Label2.Font[2]` is invalid.
Also, assigning the boolean result of your `LoadFontResource` function to a `Label.Font` of any kind will clearly not work, as that boolean result will never be a **font**.
I'd suggest you learn the basics of programming using Delphi and also study... |
57,307,628 | I created a key. I did aws-configure at the command line using the values from the key *and I used the defaults provided for region and format*:
```
$ aws configure
AWS Access Key ID [****************9104]: AKI...
AWS Se... | 2019/08/01 | [
"https://Stackoverflow.com/questions/57307628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/631619/"
] | Default region name should be the one of region name, not the value you specified,
```
T4qF8cA0VhFpL+tGcpyXmsWN/Ln3WMkLwpeJBwVhDkd5lBolFNeEG1JBPFsnVXKPCp2
CUZHni/qw
```
Please input your region code such as `us-west-1`. The output format is also wrong. Might be `json`. See [This](https://docs.aws.amazon.com/cli/late... | These are currently set values. So you already configured the CLI earlier by providing incorrect data.
>
> When you are prompted for information, the current value will be displayed in [brackets]. If the config item has no value, it be displayed as [None].
>
>
> |
21,614,457 | Referring to the top answer on this post:
[Header and footer in CodeIgniter](https://stackoverflow.com/questions/9540576/header-and-footer-in-codeigniter)
How could you update this class to support multiple views if required?
e.g. sometimes loading two or more views between the header and footer templates...
Thanks... | 2014/02/06 | [
"https://Stackoverflow.com/questions/21614457",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2512444/"
] | >
> which one will happen first?
>
>
>
Notice that there is no such thing as a "CSS event". However, the behaviour is undefined; you could consider the CSS change and the JS event to happen at the same time. The relevant specs [CSS Selectors 4](http://dev.w3.org/csswg/selectors4/#hover-pseudo), [DOM 3 Events](http... | Depends a lot on how the browser works, and shouldn't be relied on. Most browsers should run the two at almost exactly the same time. If you want one to execute before/after the other, just control the CSS styling via JavaScript, for example on hover add a class and on not hover remove the class.
Although, if this is ... |
32,397,645 | I'm using laravel to migrate some data, but i'm having this message below:
```
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1005 Can'... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3943220/"
] | All of your foreign keys must be unsigned
```
$table->integer('supervisor_id')->unsigned()->nullable();
$table->integer('coordenador_id')->unsigned()->nullable();
$table->integer('gerente_id')->unsigned()->nullable();
$table->integer('diretor_id')->unsigned()->nullable();
$table->integer('sexo_id'... | Without seeing your table structure, from your below query it could be that
both column `id` and `supervisor_id` doesn't match datatype and size. Make sure both datatype and size are same for both this column
Also, check if any other constraint with name `funcionarios_supervisor_id_foreign` already exists. If so, try... |
32,397,645 | I'm using laravel to migrate some data, but i'm having this message below:
```
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1005 Can'... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3943220/"
] | Without seeing your table structure, from your below query it could be that
both column `id` and `supervisor_id` doesn't match datatype and size. Make sure both datatype and size are same for both this column
Also, check if any other constraint with name `funcionarios_supervisor_id_foreign` already exists. If so, try... | The execution order of the migration files needs to be checked first. the referenced table migration should be done before refer it in integrity constains. |
32,397,645 | I'm using laravel to migrate some data, but i'm having this message below:
```
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1005 Can'... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3943220/"
] | All of your foreign keys must be unsigned
```
$table->integer('supervisor_id')->unsigned()->nullable();
$table->integer('coordenador_id')->unsigned()->nullable();
$table->integer('gerente_id')->unsigned()->nullable();
$table->integer('diretor_id')->unsigned()->nullable();
$table->integer('sexo_id'... | You get `error code 1005` when there is a wrong primary key reference in your code. Here is what you can do to debug your code:
1. Make sure that your FK you are referring actually exists.
2. Make sure that you don't have typo. The case must be same too.
3. FK-linked fields must match definitions exactly. |
32,397,645 | I'm using laravel to migrate some data, but i'm having this message below:
```
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1005 Can'... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3943220/"
] | You get `error code 1005` when there is a wrong primary key reference in your code. Here is what you can do to debug your code:
1. Make sure that your FK you are referring actually exists.
2. Make sure that you don't have typo. The case must be same too.
3. FK-linked fields must match definitions exactly. | The execution order of the migration files needs to be checked first. the referenced table migration should be done before refer it in integrity constains. |
32,397,645 | I'm using laravel to migrate some data, but i'm having this message below:
```
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1005 Can'... | 2015/09/04 | [
"https://Stackoverflow.com/questions/32397645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3943220/"
] | All of your foreign keys must be unsigned
```
$table->integer('supervisor_id')->unsigned()->nullable();
$table->integer('coordenador_id')->unsigned()->nullable();
$table->integer('gerente_id')->unsigned()->nullable();
$table->integer('diretor_id')->unsigned()->nullable();
$table->integer('sexo_id'... | The execution order of the migration files needs to be checked first. the referenced table migration should be done before refer it in integrity constains. |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | As others have said, this is a deliberate limitation of popup UI.
Instead, you could inject some HTML into the page which loads the content you want in your popup into an element which hovers over the existing page. You will have to implement the close functionality yourself, but it will persist.
Have a look at e.g.... | [This answer](https://stackoverflow.com/a/28677706/2667536) to [How do I prevent Chrome developer tools from closing when the current browser window closes?](https://stackoverflow.com/questions/11136010/how-do-i-prevent-chrome-developer-tools-from-closing-when-the-current-browser-wi) what very helpful in my case:
---
... |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | In an answer to a FAQ here: <https://developer.chrome.com/docs/extensions/mv3/faq/#faq-persist-popups>
Popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away. | [This answer](https://stackoverflow.com/a/28677706/2667536) to [How do I prevent Chrome developer tools from closing when the current browser window closes?](https://stackoverflow.com/questions/11136010/how-do-i-prevent-chrome-developer-tools-from-closing-when-the-current-browser-wi) what very helpful in my case:
---
... |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | You [cannot stop the Chrome pop-up from closing](http://developer.chrome.com/extensions/faq.html#faq-persist-popups), unless you're in developer mode. You could consider this alternative, though:
### Launching a normal pop-up instead:
In your `popup.html` file, load a Javascript file that runs this:
```
var popupWin... | In an answer to a FAQ here: <https://developer.chrome.com/docs/extensions/mv3/faq/#faq-persist-popups>
Popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away. |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | As a **user**, you currently cannot force the the popup to stay open. That is a UI decision the UI team made. If you want to want to force a setup, you can have other way to show this by changing the popup icon, open a new tab when it requests, or new popup view for registration.
As a **developer**, inspect the popup,... | Best way to workaround this is to :
* Right-Click inside the popup
* Click: **Inspect**
Or just press `CTRL+Shift+I`
A new window will open with the Developer Tools... just keep that window open and the popup will never close. |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | You [cannot stop the Chrome pop-up from closing](http://developer.chrome.com/extensions/faq.html#faq-persist-popups), unless you're in developer mode. You could consider this alternative, though:
### Launching a normal pop-up instead:
In your `popup.html` file, load a Javascript file that runs this:
```
var popupWin... | If you enable panels at "chrome://flags/#enable-panels" you can use something like:
```
chrome.windows.create({
url:"popup.html",
type:"panel",
width:300,
height:200
});
```
to open a panel window instead which will stay on top all the time as long as you don't move it from the bottom of the screen. |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | Best way to workaround this is to :
* Right-Click inside the popup
* Click: **Inspect**
Or just press `CTRL+Shift+I`
A new window will open with the Developer Tools... just keep that window open and the popup will never close. | [This answer](https://stackoverflow.com/a/28677706/2667536) to [How do I prevent Chrome developer tools from closing when the current browser window closes?](https://stackoverflow.com/questions/11136010/how-do-i-prevent-chrome-developer-tools-from-closing-when-the-current-browser-wi) what very helpful in my case:
---
... |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | Best way to workaround this is to :
* Right-Click inside the popup
* Click: **Inspect**
Or just press `CTRL+Shift+I`
A new window will open with the Developer Tools... just keep that window open and the popup will never close. | I've just discovered a tricky way: sending an `alert()` box before the process/function that causes off keeps it open. |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | As a **user**, you currently cannot force the the popup to stay open. That is a UI decision the UI team made. If you want to want to force a setup, you can have other way to show this by changing the popup icon, open a new tab when it requests, or new popup view for registration.
As a **developer**, inspect the popup,... | If you enable panels at "chrome://flags/#enable-panels" you can use something like:
```
chrome.windows.create({
url:"popup.html",
type:"panel",
width:300,
height:200
});
```
to open a panel window instead which will stay on top all the time as long as you don't move it from the bottom of the screen. |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | If you enable panels at "chrome://flags/#enable-panels" you can use something like:
```
chrome.windows.create({
url:"popup.html",
type:"panel",
width:300,
height:200
});
```
to open a panel window instead which will stay on top all the time as long as you don't move it from the bottom of the screen. | [This answer](https://stackoverflow.com/a/28677706/2667536) to [How do I prevent Chrome developer tools from closing when the current browser window closes?](https://stackoverflow.com/questions/11136010/how-do-i-prevent-chrome-developer-tools-from-closing-when-the-current-browser-wi) what very helpful in my case:
---
... |
4,146,930 | If I open my extension popup then I open another window or tab following the popup does not stay open if I return to it.
Is there a way to force it so the popup stays open? | 2010/11/10 | [
"https://Stackoverflow.com/questions/4146930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436630/"
] | In an answer to a FAQ here: <https://developer.chrome.com/docs/extensions/mv3/faq/#faq-persist-popups>
Popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away. | Best way to workaround this is to :
* Right-Click inside the popup
* Click: **Inspect**
Or just press `CTRL+Shift+I`
A new window will open with the Developer Tools... just keep that window open and the popup will never close. |
1,756,584 | I'm pulling some info from a database then putting it into a DIV and injecting all that in to my page. The problem I have is positioning the newly injected DIV after it has finished loading.
Here's my jQuery:
```
$j(document).ready(function() {
$('a#load-content').click(function(event) {
event.preventDefault... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Position it in your success handler you've already got:
```
$j.getJSON('../json/quicky/product/id/' + productId, function(json) {
var html = '<div class="quick-info"><img src="' + json.image + '"/></div>';
$j('body').append( html );
positionBoxCenter();
});
```
The problem with load is that you h... | try using [$().live](http://docs.jquery.com/Events/live)
```
$j('div.quick-info').live('load', function() {
positionBoxCenter();
});
```
with jQuery 1.3.2
because `div.quick-info` doesn't exist at the time you try and bind `load`
also FYI .. in general, `$('#load-content')` selects faster than `$('a#loa... |
1,756,584 | I'm pulling some info from a database then putting it into a DIV and injecting all that in to my page. The problem I have is positioning the newly injected DIV after it has finished loading.
Here's my jQuery:
```
$j(document).ready(function() {
$('a#load-content').click(function(event) {
event.preventDefault... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Position it in your success handler you've already got:
```
$j.getJSON('../json/quicky/product/id/' + productId, function(json) {
var html = '<div class="quick-info"><img src="' + json.image + '"/></div>';
$j('body').append( html );
positionBoxCenter();
});
```
The problem with load is that you h... | The problem is you are trying to bind an event handler to 'div.quick-info' before such an element exists. (when $(document).ready() executes, the div hasn't been added yet)
Use thenduks suggestion of accomplishing the action in the success handler. |
1,756,584 | I'm pulling some info from a database then putting it into a DIV and injecting all that in to my page. The problem I have is positioning the newly injected DIV after it has finished loading.
Here's my jQuery:
```
$j(document).ready(function() {
$('a#load-content').click(function(event) {
event.preventDefault... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Position it in your success handler you've already got:
```
$j.getJSON('../json/quicky/product/id/' + productId, function(json) {
var html = '<div class="quick-info"><img src="' + json.image + '"/></div>';
$j('body').append( html );
positionBoxCenter();
});
```
The problem with load is that you h... | You are creating your div in the ready function which will be called once a#load-content is clicked.
However you are setting up load event straight away. That javascript will get executed as the page loads which will be way before the div has actually been created.
I would put it at the end of the getJSON function li... |
1,756,584 | I'm pulling some info from a database then putting it into a DIV and injecting all that in to my page. The problem I have is positioning the newly injected DIV after it has finished loading.
Here's my jQuery:
```
$j(document).ready(function() {
$('a#load-content').click(function(event) {
event.preventDefault... | 2009/11/18 | [
"https://Stackoverflow.com/questions/1756584",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Position it in your success handler you've already got:
```
$j.getJSON('../json/quicky/product/id/' + productId, function(json) {
var html = '<div class="quick-info"><img src="' + json.image + '"/></div>';
$j('body').append( html );
positionBoxCenter();
});
```
The problem with load is that you h... | The load event doesn't apply to the div, as it's simply not loaded.
Skip the load event entirely and just place the code that positions the element after the code that adds the element to the body. |
6,480 | I'm interested in doing pano stitching digitally. There are several apps that look promising. I'm looking at learning Hugin (**<http://hugin.sourceforge.net/>**), but before I start investing the time in it, I thought I'd solicit opinions on what a good beginner pano stitching app might be...
I'm intending to stitch ... | 2011/01/06 | [
"https://photo.stackexchange.com/questions/6480",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/2998/"
] | THE beginner pano app has to be Autostitch. There is almost no interface, you open a bunch of files and select the output size. That's it! It does not get any easier than that.
Then there is also Microsoft ICE. It's the same principle in that it stitches without user input but it does let you tweak the horizon, center... | Well... I suspect that your probably more looking for FOSS applications, I will put in a vote for [PTgui](http://www.ptgui.com/). The thing I really appreciate about using it is although there's a lot of feature depth to the program if you want to dig in and get your hands dirty, it's super-simple to get started... you... |
6,480 | I'm interested in doing pano stitching digitally. There are several apps that look promising. I'm looking at learning Hugin (**<http://hugin.sourceforge.net/>**), but before I start investing the time in it, I thought I'd solicit opinions on what a good beginner pano stitching app might be...
I'm intending to stitch ... | 2011/01/06 | [
"https://photo.stackexchange.com/questions/6480",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/2998/"
] | The only program I've used is Hugin, but I'm really happy with it. I think it's pretty easy to use, and for the most part it's an automatic process. You'll spend most of your time waiting for the software to process the photos, so your best bet is to just install some software and start using it so you can get your res... | Well... I suspect that your probably more looking for FOSS applications, I will put in a vote for [PTgui](http://www.ptgui.com/). The thing I really appreciate about using it is although there's a lot of feature depth to the program if you want to dig in and get your hands dirty, it's super-simple to get started... you... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.