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 |
|---|---|---|---|---|---|
55,772,399 | I installed **Magento 2** - Luma theme using XAMPP.
When I try to change one heading for example, from **Admin Panel** - everything is working.It displays changed heading in the front end correctly.
When I try do the same from **core code** - it's not working.
I save everything in core core when change something. D... | 2019/04/20 | [
"https://Stackoverflow.com/questions/55772399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9626464/"
] | I solved the problem like this:
```
// First e-mail to recipient 1
$mail = new PHPMailer;
$mail->setFrom('example@example.com');
$mail->addAddress('recipient1@example.com');
$mail->Subject = 'Subject';
$mail->isHTML(true);
$mail->Body = '...';
// Attach multiple files one by one
for (... | You moved the uploaded files from the temporary store when sending your first mail, and so they are no longer there on the second attempt.
```
move_uploaded_file($_FILES['userfile']['tmp_name'][$ct], $uploadfile)
```
You need to move the uploaded file first, and then use the variable `$uploadfile` twice.
You should... |
7,643,528 | I asked this function based on this concept (maybe incorrect?!): Wherever a const can exist, a volatile can exist at the place.
```
class classA
{
public:
const int Foo() const;
}
```
Here the first "const" means the return value is const, we can not change it.
the second const means "Is Query", this function ca... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7643528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/966236/"
] | Volatile has one primary function, which is to say "STOP! This object is connected to external resources, and thus when I write to it, don't reorder the write with respect to other volatile reads or writes, and when I read to it, don't reorder it likewise and don't optimize these away!".
To support this, you can put ... | >
> The second const means "Is Query", this function can not change the member variable and can not call non-const function.
>
>
>
Yes, thats correct.
>
> volatile void Function1();
>
> The return type is volatile?
>
>
>
The return type of the function here is `void`(means nothing). If it returns nothi... |
7,643,528 | I asked this function based on this concept (maybe incorrect?!): Wherever a const can exist, a volatile can exist at the place.
```
class classA
{
public:
const int Foo() const;
}
```
Here the first "const" means the return value is const, we can not change it.
the second const means "Is Query", this function ca... | 2011/10/04 | [
"https://Stackoverflow.com/questions/7643528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/966236/"
] | Volatile has one primary function, which is to say "STOP! This object is connected to external resources, and thus when I write to it, don't reorder the write with respect to other volatile reads or writes, and when I read to it, don't reorder it likewise and don't optimize these away!".
To support this, you can put ... | >
> the second const means *"can be used when `this` is a pointer to `const`"*, this function can not change *non-`mutable`* member variables *of `this`* and can not call non-const functions *on `this`*.
>
>
>
There, fixed that for you.
Now it should be clear what a `volatile` member function means: it can be cal... |
9,653 | The context is a PMO running across two development groups, one doing [Agile development](http://en.wikipedia.org/wiki/Agile_software_development), the other using the [waterfall model](http://en.wikipedia.org/wiki/Waterfall_model). In order to come up with a common approach and engagement model, we would like to stand... | 2013/07/31 | [
"https://pm.stackexchange.com/questions/9653",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/6637/"
] | The definition of a project in agile terms is no different to that of a project in traditional terms. The difference is how the project is run and executed and the values behind the project.
**Common**
Both agile projects and traditional projects:
* have a start and end
* may be constrained by schedule, scope or bud... | Regardless of the mechanism to deliver (as per @Brett's answer) I suggest that the definition of a project be as simple as "a project is an activity which delivers measurable value to the organisation by either increasing revenue, reducing cost or improving efficiency".
Each project that you deliver should be easily ... |
9,653 | The context is a PMO running across two development groups, one doing [Agile development](http://en.wikipedia.org/wiki/Agile_software_development), the other using the [waterfall model](http://en.wikipedia.org/wiki/Waterfall_model). In order to come up with a common approach and engagement model, we would like to stand... | 2013/07/31 | [
"https://pm.stackexchange.com/questions/9653",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/6637/"
] | The definition of a project in agile terms is no different to that of a project in traditional terms. The difference is how the project is run and executed and the values behind the project.
**Common**
Both agile projects and traditional projects:
* have a start and end
* may be constrained by schedule, scope or bud... | How Agile projects are different from Waterfall projects
--------------------------------------------------------
To elaborate on what @Brett Maytom PST said on the differences side:
1. **Minimize project risk**: If you have features that are high risk (any unique value proposition that has not been built before), yo... |
9,653 | The context is a PMO running across two development groups, one doing [Agile development](http://en.wikipedia.org/wiki/Agile_software_development), the other using the [waterfall model](http://en.wikipedia.org/wiki/Waterfall_model). In order to come up with a common approach and engagement model, we would like to stand... | 2013/07/31 | [
"https://pm.stackexchange.com/questions/9653",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/6637/"
] | The definition of a project in agile terms is no different to that of a project in traditional terms. The difference is how the project is run and executed and the values behind the project.
**Common**
Both agile projects and traditional projects:
* have a start and end
* may be constrained by schedule, scope or bud... | In Project Management you deliver a Project while in Agile you deliver an Epic. Projects have a defined start and end date while Epics have Products with a defined acceptance or done criteria instead of a date.
IMO the term Project shouldn't be used in Agile. You should align the teams to use similar terms and rolls ... |
9,653 | The context is a PMO running across two development groups, one doing [Agile development](http://en.wikipedia.org/wiki/Agile_software_development), the other using the [waterfall model](http://en.wikipedia.org/wiki/Waterfall_model). In order to come up with a common approach and engagement model, we would like to stand... | 2013/07/31 | [
"https://pm.stackexchange.com/questions/9653",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/6637/"
] | Regardless of the mechanism to deliver (as per @Brett's answer) I suggest that the definition of a project be as simple as "a project is an activity which delivers measurable value to the organisation by either increasing revenue, reducing cost or improving efficiency".
Each project that you deliver should be easily ... | How Agile projects are different from Waterfall projects
--------------------------------------------------------
To elaborate on what @Brett Maytom PST said on the differences side:
1. **Minimize project risk**: If you have features that are high risk (any unique value proposition that has not been built before), yo... |
9,653 | The context is a PMO running across two development groups, one doing [Agile development](http://en.wikipedia.org/wiki/Agile_software_development), the other using the [waterfall model](http://en.wikipedia.org/wiki/Waterfall_model). In order to come up with a common approach and engagement model, we would like to stand... | 2013/07/31 | [
"https://pm.stackexchange.com/questions/9653",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/6637/"
] | Regardless of the mechanism to deliver (as per @Brett's answer) I suggest that the definition of a project be as simple as "a project is an activity which delivers measurable value to the organisation by either increasing revenue, reducing cost or improving efficiency".
Each project that you deliver should be easily ... | In Project Management you deliver a Project while in Agile you deliver an Epic. Projects have a defined start and end date while Epics have Products with a defined acceptance or done criteria instead of a date.
IMO the term Project shouldn't be used in Agile. You should align the teams to use similar terms and rolls ... |
18,825,878 | My setting for the project:
* Deployment target: iOS6.1
* Base SDK: 7.0
* IB Document: Opens in 5.0
When I run app in simulator(7.0) I see almost what I expect (I don't understand why barbuttons don't use color tint — on previous screen it shows blue):

So now to change the tint color for your bar buttons you need to use `tintColor` which is the color for the interactive elements within a navigation bar including... | I enabled Autolayout in IB, and now it uses iOS7 on a device too.
Upd.: After some time it start show strange design again. It gone only after I set iOS7 as base and deployment SDK. |
40,444,135 | How can I make my Timer do different things depends on what activated it? I've tried using this code
```
Dim a As Integer = 0
Dim b As Integer = 0
Private Sub Button1_MouseHover(sender As Object, e As EventArgs) Handles Button1.MouseHover
Timer1.Start
End Sub
Private Sub Button2_MouseHover(sender As Object, e As... | 2016/11/05 | [
"https://Stackoverflow.com/questions/40444135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7051414/"
] | Another possibly simpler approach, would be to use the Timer.Tag property and use one handler for both buttons:
```
Private Sub Button_Click(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click
Timer1.Tag = sender
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArg... | I am not sure what is value of this and this is not, generally speaking, something people do, but if you want to know which action activated timer you need to register it
```
Private _timer As Timer
Private _activatingControl As Object
Private Sub ActivateTimer(c as Object)
_activatingControl = c ' this is first... |
40,444,135 | How can I make my Timer do different things depends on what activated it? I've tried using this code
```
Dim a As Integer = 0
Dim b As Integer = 0
Private Sub Button1_MouseHover(sender As Object, e As EventArgs) Handles Button1.MouseHover
Timer1.Start
End Sub
Private Sub Button2_MouseHover(sender As Object, e As... | 2016/11/05 | [
"https://Stackoverflow.com/questions/40444135",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7051414/"
] | Another possibly simpler approach, would be to use the Timer.Tag property and use one handler for both buttons:
```
Private Sub Button_Click(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click
Timer1.Tag = sender
Timer1.Start()
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArg... | I like tinstaafl's Tag property method. A similar approach would be to create a custom timer which inherits from System.Windows.Forms.Timer and has a Button property which can be set in the button's MouseHover event handler.
The timer's Start method only needs to be called once so I moved this to the form's load event... |
8,831,241 | I have an array called `dbRecipes` which contains a list of recipes divided into groups. For example, the *Dinner* group might have a stuffed salmon, a salad, and mashed potatoes. The dessert group would have a chocolate molten lava-cake. Mmmm.
I need to display these recipes in a grouped list, such as:
```
Group 1:
... | 2012/01/12 | [
"https://Stackoverflow.com/questions/8831241",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/392044/"
] | ```
var groups =
from r in dbRecipes
orderby r.DisplayOrder
group r by r.Group into g
orderby g.Key.GroupOrder
select g;
foreach (var g in groups)
{
output.Write("{0}<br/>", g.Key.GroupName);
foreach(var r in g)
{
output.Write("---{0}<br/>", r.Recipe.Title);
}
}
``` | Untested, but here is an adaptation using `GroupBy`:
```
var groups = dbRecipes.GroupBy(r => r.Group).OrderBy(g => g.Key.GroupOrder);
foreach(var recipeGroup in groups)
{
output.Write("{0}<br/>", recipeGroup.Key.GroupName);
foreach(var recipe in recipeGroup.OrderBy(r => r.DisplayOrder))
{
output.Wr... |
17,198,498 | I am building an page the script is done it lists Name and Points in a table. But when i gonna do the design it will be to hard to do it with "echo". So i am woundering if i can get this into vars insted that i can just use in a html file.
Table look like this
Name | Points | Date
What i want is to make a var for th... | 2013/06/19 | [
"https://Stackoverflow.com/questions/17198498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2494970/"
] | Is this what you want?
```
$names = array();
$points = array();
while($row = mysql_fetch_array($resultbtm)) {
$names[] = $row['Name'];
$points[] = $row['tokens'];
}
echo '<pre>';
print_r($names);
print_r($points);
echo '</pre>';
```
Not 100% sure if this is what you were looking for, but the `$names` and `... | You could use `extract`
```
echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Tokens</th> </tr>";
// keeps getting the next row until there are no more to get
$c = 1;
while($row = mysql_fetch_array( $resultbtm )) {
${'top'.$c.'n'} = $name;
${'top'.$c.'p'} = $points;
... |
17,198,498 | I am building an page the script is done it lists Name and Points in a table. But when i gonna do the design it will be to hard to do it with "echo". So i am woundering if i can get this into vars insted that i can just use in a html file.
Table look like this
Name | Points | Date
What i want is to make a var for th... | 2013/06/19 | [
"https://Stackoverflow.com/questions/17198498",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2494970/"
] | You can do it like this: (no need to create so many variables)
```
$str = "<table border='1'>";
$str .= "<tr> <th>Name</th> <th>Tokens</th> </tr>";
// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $resultbtm )) {
// Print out the contents of each row into a table
$s... | You could use `extract`
```
echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Tokens</th> </tr>";
// keeps getting the next row until there are no more to get
$c = 1;
while($row = mysql_fetch_array( $resultbtm )) {
${'top'.$c.'n'} = $name;
${'top'.$c.'p'} = $points;
... |
47,951,408 | When the program is finding the prime numbers, it compiles.
But an error occurred during runtime. How can I fix it ?
What is the easiest way of finding prime numbers?
Error :
```
Exception in thread "main" java.lang.ArithmeticException: / by zero
at PrimeNumbers.main(PrimeNumbers.java:6)
```
Code :
```
impor... | 2017/12/23 | [
"https://Stackoverflow.com/questions/47951408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9059554/"
] | You must change your code like this:
```
class PrimeNumbers{
public static void main(String args[])
{
boolean flag;
for(int i=1;i<=100;i++)
{
flag = true;
for(int j=2;j<=(i/2);j++){
if(i%j==0)
flag = false;;
if(flag == true)
System.out.println(... | You need to change your second for loop to start from 1 not 0. Because modular of zero is an error.
```
for(int j=1;j<i;j++){
if(i%j==0){
``` |
47,951,408 | When the program is finding the prime numbers, it compiles.
But an error occurred during runtime. How can I fix it ?
What is the easiest way of finding prime numbers?
Error :
```
Exception in thread "main" java.lang.ArithmeticException: / by zero
at PrimeNumbers.main(PrimeNumbers.java:6)
```
Code :
```
impor... | 2017/12/23 | [
"https://Stackoverflow.com/questions/47951408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9059554/"
] | You need to change your second for loop to start from 1 not 0. Because modular of zero is an error.
```
for(int j=1;j<i;j++){
if(i%j==0){
``` | You have i = 0 and j = 0 in the first iteration of your loop. In order to obtain the modulus, i is divided by j. Therefore, you are performing in the first iteration:
0 / 0
Thus getting the divide by zero exception. |
47,951,408 | When the program is finding the prime numbers, it compiles.
But an error occurred during runtime. How can I fix it ?
What is the easiest way of finding prime numbers?
Error :
```
Exception in thread "main" java.lang.ArithmeticException: / by zero
at PrimeNumbers.main(PrimeNumbers.java:6)
```
Code :
```
impor... | 2017/12/23 | [
"https://Stackoverflow.com/questions/47951408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9059554/"
] | You need to change your second for loop to start from 1 not 0. Because modular of zero is an error.
```
for(int j=1;j<i;j++){
if(i%j==0){
``` | There are two possible ways of prime number calculation:
```
public static boolean isPrime(long num) {
return num > 1 && LongStream.rangeClosed(2, (long)Math.sqrt(num)).noneMatch(div -> num % div == 0);
}
public static boolean isPrime1(long num) {
for (long i = 2, sqrt = (long)Math.sqrt(num); i <= sqrt; i++)
... |
47,951,408 | When the program is finding the prime numbers, it compiles.
But an error occurred during runtime. How can I fix it ?
What is the easiest way of finding prime numbers?
Error :
```
Exception in thread "main" java.lang.ArithmeticException: / by zero
at PrimeNumbers.main(PrimeNumbers.java:6)
```
Code :
```
impor... | 2017/12/23 | [
"https://Stackoverflow.com/questions/47951408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9059554/"
] | You need to change your second for loop to start from 1 not 0. Because modular of zero is an error.
```
for(int j=1;j<i;j++){
if(i%j==0){
``` | ```
public static void main(String args[]){
boolean flag=false;
int i=1;
while(i<=100){
for(int j=2;j<=i/2;j++) {
if(i%j==0){
flag=true;
break;
}else {
flag... |
47,951,408 | When the program is finding the prime numbers, it compiles.
But an error occurred during runtime. How can I fix it ?
What is the easiest way of finding prime numbers?
Error :
```
Exception in thread "main" java.lang.ArithmeticException: / by zero
at PrimeNumbers.main(PrimeNumbers.java:6)
```
Code :
```
impor... | 2017/12/23 | [
"https://Stackoverflow.com/questions/47951408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9059554/"
] | You must change your code like this:
```
class PrimeNumbers{
public static void main(String args[])
{
boolean flag;
for(int i=1;i<=100;i++)
{
flag = true;
for(int j=2;j<=(i/2);j++){
if(i%j==0)
flag = false;;
if(flag == true)
System.out.println(... | You have i = 0 and j = 0 in the first iteration of your loop. In order to obtain the modulus, i is divided by j. Therefore, you are performing in the first iteration:
0 / 0
Thus getting the divide by zero exception. |
47,951,408 | When the program is finding the prime numbers, it compiles.
But an error occurred during runtime. How can I fix it ?
What is the easiest way of finding prime numbers?
Error :
```
Exception in thread "main" java.lang.ArithmeticException: / by zero
at PrimeNumbers.main(PrimeNumbers.java:6)
```
Code :
```
impor... | 2017/12/23 | [
"https://Stackoverflow.com/questions/47951408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9059554/"
] | You must change your code like this:
```
class PrimeNumbers{
public static void main(String args[])
{
boolean flag;
for(int i=1;i<=100;i++)
{
flag = true;
for(int j=2;j<=(i/2);j++){
if(i%j==0)
flag = false;;
if(flag == true)
System.out.println(... | There are two possible ways of prime number calculation:
```
public static boolean isPrime(long num) {
return num > 1 && LongStream.rangeClosed(2, (long)Math.sqrt(num)).noneMatch(div -> num % div == 0);
}
public static boolean isPrime1(long num) {
for (long i = 2, sqrt = (long)Math.sqrt(num); i <= sqrt; i++)
... |
47,951,408 | When the program is finding the prime numbers, it compiles.
But an error occurred during runtime. How can I fix it ?
What is the easiest way of finding prime numbers?
Error :
```
Exception in thread "main" java.lang.ArithmeticException: / by zero
at PrimeNumbers.main(PrimeNumbers.java:6)
```
Code :
```
impor... | 2017/12/23 | [
"https://Stackoverflow.com/questions/47951408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9059554/"
] | You must change your code like this:
```
class PrimeNumbers{
public static void main(String args[])
{
boolean flag;
for(int i=1;i<=100;i++)
{
flag = true;
for(int j=2;j<=(i/2);j++){
if(i%j==0)
flag = false;;
if(flag == true)
System.out.println(... | ```
public static void main(String args[]){
boolean flag=false;
int i=1;
while(i<=100){
for(int j=2;j<=i/2;j++) {
if(i%j==0){
flag=true;
break;
}else {
flag... |
8,882,108 | I trying to improve a textbox that filters a gridview, by implementing an enhanced textbox that can identify AND, OR, NOT operators by searching for this keywords in the string the user inputs in the textbox.
I am trying to do a regular expression to group the results but I'm not very good at this and I am failing to ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8882108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1128484/"
] | This works for me
\w+(\sand\snot|\sor\snot|\sand|\sor|$) | Try this regex out:
>
> (build[^b]+)
>
>
> |
8,882,108 | I trying to improve a textbox that filters a gridview, by implementing an enhanced textbox that can identify AND, OR, NOT operators by searching for this keywords in the string the user inputs in the textbox.
I am trying to do a regular expression to group the results but I'm not very good at this and I am failing to ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8882108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1128484/"
] | I might recommend that instead of using a regular expression to group the results you do something like this. I think it would be more robust than trying to guess at the right regex.
```
string filter = "build1 and buil2 and build3 or build4 or not build5"
list<string> filterTokens = filter.Split(new char[] {' '})
st... | Try this regex out:
>
> (build[^b]+)
>
>
> |
8,882,108 | I trying to improve a textbox that filters a gridview, by implementing an enhanced textbox that can identify AND, OR, NOT operators by searching for this keywords in the string the user inputs in the textbox.
I am trying to do a regular expression to group the results but I'm not very good at this and I am failing to ... | 2012/01/16 | [
"https://Stackoverflow.com/questions/8882108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1128484/"
] | This works for me
\w+(\sand\snot|\sor\snot|\sand|\sor|$) | I might recommend that instead of using a regular expression to group the results you do something like this. I think it would be more robust than trying to guess at the right regex.
```
string filter = "build1 and buil2 and build3 or build4 or not build5"
list<string> filterTokens = filter.Split(new char[] {' '})
st... |
54,739,913 | I'm trying to get <https://codepen.io/SpacecaseArtist/project/editor/DQWYxo> onto my local machine to play around with it.
I clicked export at the bottom right, and downloaded the zip. I extracted the zip into a folder, and then opened index.html on my browser. When I open it, I'm greeted with a scrollable, blank pag... | 2019/02/18 | [
"https://Stackoverflow.com/questions/54739913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5701790/"
] | Just add a local path:
```
<script src="path/to/file.js"></script>
```
The above are partial absolute links - to make them work, you need Internet and to add `https:` before the `//`:
```
<script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/138941/draggble.min.js"></script>
``` | **Just remove the forward slashes at src for all links.** like below
```
<script src="s3-us-west-2.amazonaws.com/s.cdpn.io/138941/teenmax.min.js"></script>
<script src="s3-us-west-2.amazonaws.com/s.cdpn.io/138941/waypoints.min.js"></script>
<script src="s3-us-west-2.amazonaws.com/s.cdpn.io/138941/classy.js"></script>... |
7,625 | I've forked a dApp Connector I found on Github and I'm trying to add some transaction metadata to the ADA transaction it builds. This is what I currently have:
```
buildSendADATransaction = async () => {
//metadata
const messageData = {
receiver_id: "SJKdj34k3jjKFDKfjFUDfdjkfd",
sender_id: "jkfdsuf... | 2022/03/13 | [
"https://cardano.stackexchange.com/questions/7625",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/6757/"
] | As an FYI, the mainnet node DB/chain itself is currently using 41GB of disk on Linux.
```
$du -h db
38G db/immutable
2.9G db/ledger
163M db/volatile
41G db
``` | The database for `db-sync` at chain tip is over 100GB.
>
> Syncing on epoch 254. So far in total they have taken 88 GB of disk space.
>
>
>
Yep and by the time you get to epoch 323 (current tip) the database will need more than 100GB.
>
> Is this normal?
>
>
>
Yes
>
> How much disk space is it expected to... |
7,625 | I've forked a dApp Connector I found on Github and I'm trying to add some transaction metadata to the ADA transaction it builds. This is what I currently have:
```
buildSendADATransaction = async () => {
//metadata
const messageData = {
receiver_id: "SJKdj34k3jjKFDKfjFUDfdjkfd",
sender_id: "jkfdsuf... | 2022/03/13 | [
"https://cardano.stackexchange.com/questions/7625",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/6757/"
] | The database for `db-sync` at chain tip is over 100GB.
>
> Syncing on epoch 254. So far in total they have taken 88 GB of disk space.
>
>
>
Yep and by the time you get to epoch 323 (current tip) the database will need more than 100GB.
>
> Is this normal?
>
>
>
Yes
>
> How much disk space is it expected to... | For Epoch 359, cnode at 82G and db sync is 216G (sudo du -hd 1 /var/lib/postgresql/12). Looking at the comments above it makes sense that the DB is way larger, 2.6x in this case. |
7,625 | I've forked a dApp Connector I found on Github and I'm trying to add some transaction metadata to the ADA transaction it builds. This is what I currently have:
```
buildSendADATransaction = async () => {
//metadata
const messageData = {
receiver_id: "SJKdj34k3jjKFDKfjFUDfdjkfd",
sender_id: "jkfdsuf... | 2022/03/13 | [
"https://cardano.stackexchange.com/questions/7625",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/6757/"
] | The database for `db-sync` at chain tip is over 100GB.
>
> Syncing on epoch 254. So far in total they have taken 88 GB of disk space.
>
>
>
Yep and by the time you get to epoch 323 (current tip) the database will need more than 100GB.
>
> Is this normal?
>
>
>
Yes
>
> How much disk space is it expected to... | What is the current storage consumption for DB-sync? There's no "extended" version anymore either, right? |
7,625 | I've forked a dApp Connector I found on Github and I'm trying to add some transaction metadata to the ADA transaction it builds. This is what I currently have:
```
buildSendADATransaction = async () => {
//metadata
const messageData = {
receiver_id: "SJKdj34k3jjKFDKfjFUDfdjkfd",
sender_id: "jkfdsuf... | 2022/03/13 | [
"https://cardano.stackexchange.com/questions/7625",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/6757/"
] | As an FYI, the mainnet node DB/chain itself is currently using 41GB of disk on Linux.
```
$du -h db
38G db/immutable
2.9G db/ledger
163M db/volatile
41G db
``` | For Epoch 359, cnode at 82G and db sync is 216G (sudo du -hd 1 /var/lib/postgresql/12). Looking at the comments above it makes sense that the DB is way larger, 2.6x in this case. |
7,625 | I've forked a dApp Connector I found on Github and I'm trying to add some transaction metadata to the ADA transaction it builds. This is what I currently have:
```
buildSendADATransaction = async () => {
//metadata
const messageData = {
receiver_id: "SJKdj34k3jjKFDKfjFUDfdjkfd",
sender_id: "jkfdsuf... | 2022/03/13 | [
"https://cardano.stackexchange.com/questions/7625",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/6757/"
] | As an FYI, the mainnet node DB/chain itself is currently using 41GB of disk on Linux.
```
$du -h db
38G db/immutable
2.9G db/ledger
163M db/volatile
41G db
``` | What is the current storage consumption for DB-sync? There's no "extended" version anymore either, right? |
7,625 | I've forked a dApp Connector I found on Github and I'm trying to add some transaction metadata to the ADA transaction it builds. This is what I currently have:
```
buildSendADATransaction = async () => {
//metadata
const messageData = {
receiver_id: "SJKdj34k3jjKFDKfjFUDfdjkfd",
sender_id: "jkfdsuf... | 2022/03/13 | [
"https://cardano.stackexchange.com/questions/7625",
"https://cardano.stackexchange.com",
"https://cardano.stackexchange.com/users/6757/"
] | What is the current storage consumption for DB-sync? There's no "extended" version anymore either, right? | For Epoch 359, cnode at 82G and db sync is 216G (sudo du -hd 1 /var/lib/postgresql/12). Looking at the comments above it makes sense that the DB is way larger, 2.6x in this case. |
18,285,888 | im fairly new to PHP but I am trying to make a guessing game.
the idea is you guess the number between 1-100 and the code is meant to have a randomly assigned code to guess until guessed, currently just working on the assigning the number. so it doesnt randomize everytime I attempt to guess.
```
<?php
session_start();... | 2013/08/17 | [
"https://Stackoverflow.com/questions/18285888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2606918/"
] | Look at this code:
```
$_SESSION[var_answer] = rand (1, 100);
$var_number = $_REQUEST['number'];
if($var_number == $_SESSION[var_answer]){
echo " That is correct ;)";
}
```
You are overwriting the session variable every time the page is reloaded. As far as I understand, you want to store the number in session, u... | `$_SESSION[var_answer]` must be changed to `$_SESSION['var_answer']` everywhere and it will solve your problem.
So your code must be
```
<?php
session_start();
$_SESSION['var_answer'] = rand (1, 100);
$var_number = $_REQUEST['number'];
if($var_number == $_SESSION['var_answer']){
echo " That is correct ;)";
}
else ... |
30,714 | I was reading [this](http://www.cl.cam.ac.uk/~srk31/blog/2014/10/07/) article about types, and started wondering how static type checkers could enforce other properties in programs. For example, say I wanted to create a language which would allow checking at compile time that a particular function was only called at mo... | 2014/10/07 | [
"https://cs.stackexchange.com/questions/30714",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/5348/"
] | The property you mention is probably not something that sounds like an ideal fit for enforcement by type systems, so it's not the first example I would suggest looking at, if you want to learn more about how type systems can be used to enforce a variety of properties. (I'm not saying it is impossible to enforce that pr... | Many problems of this kind can be adressed by **[abstract
interpretation](http://en.wikipedia.org/wiki/Abstract_interpretation)** of programs. It may well be that abstract
interpretations can always be expressed in type systems, but I am not quite
sure about it as I did not follow the field for a long time. The early w... |
30,714 | I was reading [this](http://www.cl.cam.ac.uk/~srk31/blog/2014/10/07/) article about types, and started wondering how static type checkers could enforce other properties in programs. For example, say I wanted to create a language which would allow checking at compile time that a particular function was only called at mo... | 2014/10/07 | [
"https://cs.stackexchange.com/questions/30714",
"https://cs.stackexchange.com",
"https://cs.stackexchange.com/users/5348/"
] | The property you mention is probably not something that sounds like an ideal fit for enforcement by type systems, so it's not the first example I would suggest looking at, if you want to learn more about how type systems can be used to enforce a variety of properties. (I'm not saying it is impossible to enforce that pr... | I'm aware of at least one attempt to use unification to infer time-like facts about programs. The following papers are from David Gifford's research group at MIT, back in the late 1980s/early 1990s. They infer the "times" of functions as polymorphic expressions of the "times" of their inputs. Dornic's paper tries to in... |
46,842,980 | I am trying to run this code and everything seems to be working except the if statement. Even though there is a match but it still does not display the correct answer as shown in the code but instead displays the code in else statement.
```js
var colors = [
"rgb(255,0,0)",
"rgb(255,255,0)",
"rgb(0,255,0)",
... | 2017/10/20 | [
"https://Stackoverflow.com/questions/46842980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7879743/"
] | ```js
var colors = [
"rgb(255, 0, 0)",
"rgb(255, 255, 0)",
"rgb(0, 255, 0)",
"rgb(0, 255, 255)",
"rgb(0, 0, 255)",
"rgb(255, 0, 255)"
]
var squares = document.querySelectorAll(".square");
var pickedColor = colors[3];
var colorDisplay = document.querySelector("#colorDisplay");
colorDisplay.textC... | In the if condition you are comparing the two different strings. When you apply this color in `rgb()` format, the browser formats it with spaces between the color arguments.
You gave: `rgb(0,255,0)`
In browser: `rgb(0, 255, 0)`
So, you need to add spaces in your `colors` array. Change your colors array to this,
... |
49,453,439 | Counting number of times a particular level (in transaction data) and then aggregating it the number of times in new variable (under one row per customer)

I have 2 levels to solicitation method, phone and email. I have created 2 new columns which co... | 2018/03/23 | [
"https://Stackoverflow.com/questions/49453439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8162689/"
] | You can use `refs`
<https://reactjs.org/docs/refs-and-the-dom.html>
Example:
```
class Parent extends Component {
render() {
return (
<View>
<Child ref={instance => { this.child = instance; }} />
<TouchableOpacity onPress={() => { this.child.clicked(); }}>
<Text>Click</Text>
... | It's better to do `myFunction` logic inside `ParentComponent` and `setState` the data which can be passed into `child` ie:`Foo`.
```
constructor(props) {
super(props);
this.state = {
fooData: initialValue,
}
}
myFunction = () => {
// Some stuff here
this.setSta... |
49,453,439 | Counting number of times a particular level (in transaction data) and then aggregating it the number of times in new variable (under one row per customer)

I have 2 levels to solicitation method, phone and email. I have created 2 new columns which co... | 2018/03/23 | [
"https://Stackoverflow.com/questions/49453439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8162689/"
] | Basically what I did is to call a local function when `onPress` and change the state of the Parent. I pass this state to the Child during its creation. And since the Child are updated (if needed) when the Parent's state change this do the trick.
```
export default class ParentComponent extends Component {
construct... | It's better to do `myFunction` logic inside `ParentComponent` and `setState` the data which can be passed into `child` ie:`Foo`.
```
constructor(props) {
super(props);
this.state = {
fooData: initialValue,
}
}
myFunction = () => {
// Some stuff here
this.setSta... |
2,280,515 | while running maven from eclipse you have option to execute these launch configurations by default .. here is the image of that :

Now I can add my own launch configurations and execute them. Like this :

Now instead of ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2280515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/169277/"
] | >
> Now instead of running run configurations every time, is it possible that I put my own launch configuration called "Clean install skip tests with assembly" instead of default run configuration #1(Maven assembly:assembly) or can I add #10 configuration to be my created configuration.
>
>
>
I don't think so. But... | When you select `Run As > 2 Maven Build` (the one with the shortcut. It may not always be `2`) you can choose which run configuration to use from a simpler dialog - including your custom. |
2,280,515 | while running maven from eclipse you have option to execute these launch configurations by default .. here is the image of that :

Now I can add my own launch configurations and execute them. Like this :

Now instead of ... | 2010/02/17 | [
"https://Stackoverflow.com/questions/2280515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/169277/"
] | >
> Now instead of running run configurations every time, is it possible that I put my own launch configuration called "Clean install skip tests with assembly" instead of default run configuration #1(Maven assembly:assembly) or can I add #10 configuration to be my created configuration.
>
>
>
I don't think so. But... | For skipping tests dont add -D in the goals field. Use the "Skip Tests" checkbox that is below the Profiles input box adn it should work :) |
28,115,739 | I'm trying to port my Firefox extension to work under Electrolysis / e10s / multi-process mode. I've got a feature that requires registration through nsIComponentRegistrar so it's in a JSM which gets loaded only once (per process). I'm running in the child scope, so I don't have access to things like files, but my feat... | 2015/01/23 | [
"https://Stackoverflow.com/questions/28115739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91238/"
] | `"@mozilla.org/childprocessmessagemanager;1"` is the way to go. Use that in child process JSMs.
However, as MDN puts it:
>
> In addition to Message Managers centered around window and tab objects
> there also is a separate hierachy focusing on process boundaries.
>
>
>
Therefore, you cannot use the regular fram... | This may work, no promises.
Try loading:
```
Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
```
If that doesn't work then try using:
```
Cc['@mozilla.org/childprocessmessagemanager;1'].getService(Ci.nsISyncMessageSender);
```
Or vice-versa |
688,686 | I use ths script in Default.aspx page.
```
<script id="clientEventHandlersJS" type="text/javascript">
function Button1_onclick() {
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery("S... | 2009/03/27 | [
"https://Stackoverflow.com/questions/688686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/415865/"
] | The WbemScripting objects are not marked as "Safe for scripting", and rightly so! If they were, any web page could figure out what processes you are running, terminate them, and even launch new applications! Talk about a security breach...
The WbemScripting objects are made for use in [Windows Scripting](http://www.pc... | Check to make certain that the COM object you are trying to create is installed, and marked as safe for scripting. Confirm your security settings in IE. Beyond this, ActiveXObject is only available via IE, not other browsers. Most likely is it either isn't "safe for scripting", or your security settings for the securit... |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | If your parachute fails to open entirely you are almost certainly extremely dead no matter where you land, however occasionally people do survive. A partial failure of a chute is much more survivable. You will be coming down much faster than you would with a good chute, and you are going to get injured, probably badly.... | From a jump instructor, whose chute failed:
>
> You landed in a blackberry bush, right? Yeah, it was less than a meter
> high and it wasn't super dense but it was better than hitting than the
> hard floor or hitting the lake. **If I'd landed in the water I would
> have been knocked out just the same and broken the ex... |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | From a jump instructor, whose chute failed:
>
> You landed in a blackberry bush, right? Yeah, it was less than a meter
> high and it wasn't super dense but it was better than hitting than the
> hard floor or hitting the lake. **If I'd landed in the water I would
> have been knocked out just the same and broken the ex... | At 200 km/ h, 120 mph, the top speed a human body can reach in free fall, water surface could be as hard as a brick wall.
I wonder if there's any difference in reaching the water in vertical or horizontal, or if sending something before you to break the surface will reduce the impact.
I've read about two men during WW ... |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | At 200 km/ h, 120 mph, the top speed a human body can reach in free fall, water surface could be as hard as a brick wall.
I wonder if there's any difference in reaching the water in vertical or horizontal, or if sending something before you to break the surface will reduce the impact.
I've read about two men during WW ... | If you see a large water body around you, direct yourself to that.
Carry something which can cause a **large concussive force** just as you're about to impact. Say you're about to hit the water, you lob in object X which causes a large boom. The concussive force of the blast *pushes you back* and **cushions you** usin... |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | **An impact on land has a small chance of survival, an impact on unbroken water has none.**
Falling from thousands of feet without a parachute is very likely a death sentence, but there are a handful of cases in which people have survived. In nearly all of them, it is because the person landed in particularly hospitab... | At a freefall speed of 120MPH, water would provide a drag of about 1000 Gs which would be the same as hitting the ground and stopping in 6 inches (15cm). Better than concrete but still not survivable. |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | From a jump instructor, whose chute failed:
>
> You landed in a blackberry bush, right? Yeah, it was less than a meter
> high and it wasn't super dense but it was better than hitting than the
> hard floor or hitting the lake. **If I'd landed in the water I would
> have been knocked out just the same and broken the ex... | If you see a large water body around you, direct yourself to that.
Carry something which can cause a **large concussive force** just as you're about to impact. Say you're about to hit the water, you lob in object X which causes a large boom. The concussive force of the blast *pushes you back* and **cushions you** usin... |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | From a jump instructor, whose chute failed:
>
> You landed in a blackberry bush, right? Yeah, it was less than a meter
> high and it wasn't super dense but it was better than hitting than the
> hard floor or hitting the lake. **If I'd landed in the water I would
> have been knocked out just the same and broken the ex... | At a freefall speed of 120MPH, water would provide a drag of about 1000 Gs which would be the same as hitting the ground and stopping in 6 inches (15cm). Better than concrete but still not survivable. |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | From a jump instructor, whose chute failed:
>
> You landed in a blackberry bush, right? Yeah, it was less than a meter
> high and it wasn't super dense but it was better than hitting than the
> hard floor or hitting the lake. **If I'd landed in the water I would
> have been knocked out just the same and broken the ex... | **An impact on land has a small chance of survival, an impact on unbroken water has none.**
Falling from thousands of feet without a parachute is very likely a death sentence, but there are a handful of cases in which people have survived. In nearly all of them, it is because the person landed in particularly hospitab... |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | If your parachute fails to open entirely you are almost certainly extremely dead no matter where you land, however occasionally people do survive. A partial failure of a chute is much more survivable. You will be coming down much faster than you would with a good chute, and you are going to get injured, probably badly.... | At a freefall speed of 120MPH, water would provide a drag of about 1000 Gs which would be the same as hitting the ground and stopping in 6 inches (15cm). Better than concrete but still not survivable. |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | At a freefall speed of 120MPH, water would provide a drag of about 1000 Gs which would be the same as hitting the ground and stopping in 6 inches (15cm). Better than concrete but still not survivable. | At 200 km/ h, 120 mph, the top speed a human body can reach in free fall, water surface could be as hard as a brick wall.
I wonder if there's any difference in reaching the water in vertical or horizontal, or if sending something before you to break the surface will reduce the impact.
I've read about two men during WW ... |
45,507 | I was watching these 'what if' parachute failure videos on YouTube and everywhere they say do not choose water over land. Why should we not choose water and what happens if we land in water?
One such video: | 2017/11/08 | [
"https://aviation.stackexchange.com/questions/45507",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/26707/"
] | If your parachute fails to open entirely you are almost certainly extremely dead no matter where you land, however occasionally people do survive. A partial failure of a chute is much more survivable. You will be coming down much faster than you would with a good chute, and you are going to get injured, probably badly.... | **An impact on land has a small chance of survival, an impact on unbroken water has none.**
Falling from thousands of feet without a parachute is very likely a death sentence, but there are a handful of cases in which people have survived. In nearly all of them, it is because the person landed in particularly hospitab... |
129,900 | In this question -
[Is there a method for constructing decision trees that takes account of structured/hierarchical/multilevel predictors?](https://stats.stackexchange.com/questions/28179/is-there-a-method-for-constructing-decision-trees-that-takes-account-of-structur/28181#28181) - they mention a panel data method for... | 2014/12/21 | [
"https://stats.stackexchange.com/questions/129900",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/39630/"
] | When you have panel data, there are a different tasks that you can try to solve, e.g. time series classification/regression or panel forecasting. And for each task, there are numerous approaches to solve it.
When you want to use machine learning methods to solve panel forecasting, there are a number of approaches:
... | LSTM (Long Short Term Memory) might be relevant for you. This type of model can handle multiple features in multiple points in time, which should fit panel data. [Here](http://colah.github.io/posts/2015-08-Understanding-LSTMs/) is a very nice explanation on the concept of LSTM, and [here](https://www.r-bloggers.com/rec... |
52,221,892 | Is it possible to preload / pre-populate a database in my React Native application and then the first time it is run, simply do a sync? I already have most, if not all of the database information before the app is distributed, it would be awesome if it just had to do a quick sync when the app is run. Any ideas how I wo... | 2018/09/07 | [
"https://Stackoverflow.com/questions/52221892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570269/"
] | The value of the cdf at x is the integral of the pdf between -inf and x, but you are computing it between 0 and x. Maybe you are assuming that the pdf is 0 for x < 0 but it is not:
```
rs = np.random.RandomState(seed=52221829)
b = 1
data = st.pareto.rvs(b, size=10000, random_state=rs)
ag = st.gaussian_kde(data)
x = n... | Not sure about why your function is not working exactly but one way of calculating CDF is as follows:
```
def get_cdf_1(data):
# start with sorted list of data
x = [i for i in sorted(data)]
cdf = []
for xs in x:
# get the sum of the values less than each data point and store that value
... |
52,221,892 | Is it possible to preload / pre-populate a database in my React Native application and then the first time it is run, simply do a sync? I already have most, if not all of the database information before the app is distributed, it would be awesome if it just had to do a quick sync when the app is run. Any ideas how I wo... | 2018/09/07 | [
"https://Stackoverflow.com/questions/52221892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/570269/"
] | The value of the cdf at x is the integral of the pdf between -inf and x, but you are computing it between 0 and x. Maybe you are assuming that the pdf is 0 for x < 0 but it is not:
```
rs = np.random.RandomState(seed=52221829)
b = 1
data = st.pareto.rvs(b, size=10000, random_state=rs)
ag = st.gaussian_kde(data)
x = n... | I think it's just:
```
def get_cdf(data):
return sorted(data), np.linspace(0, 1, len(data))
```
but I might be misinterpreting the question!
when I compare this to the analytic result I get the same:
```
x_cdf, y_cdf = get_cdf(st.pareto.rvs(1, size=10000))
import matplotlib.pyplot as plt
plt.semilogx(x_cdf, y_c... |
12,923,775 | In my current problem, I have several hundred animated gifs that will preform a certain animation a few times and then do a different animation the last time. So that means the gif loops 3 times or so then on the 4th time instead of looping it will do a different animation. These loops are all just hardcoded into layer... | 2012/10/16 | [
"https://Stackoverflow.com/questions/12923775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/745719/"
] | *Note: shorter solution below*
Here's a Python iterator class that can be used to generate these sequences:
```
class quantizer:
def __init__(self, total, limit):
self.total = total
self.limit = limit
self.index = float(0)
self.step = float(total) / float(limit)
def __iter__(se... | ```
# shrink N K -- outputs K (default 10) evenly-spaced integers in the range [0, N)
shrink() {
local i k=$((${2:-10} - 1)) n=$(($1 - 1))
for i in 0 $(seq $k); do echo $((n * i / k)); done
}
$ echo $(shrink 75)
0 8 16 24 32 41 49 57 65 74
$ echo $(shrink 20)
0 2 4 6 8 10 12 14 16 19
```
A couple of assumptions ... |
12,923,775 | In my current problem, I have several hundred animated gifs that will preform a certain animation a few times and then do a different animation the last time. So that means the gif loops 3 times or so then on the 4th time instead of looping it will do a different animation. These loops are all just hardcoded into layer... | 2012/10/16 | [
"https://Stackoverflow.com/questions/12923775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/745719/"
] | *Note: shorter solution below*
Here's a Python iterator class that can be used to generate these sequences:
```
class quantizer:
def __init__(self, total, limit):
self.total = total
self.limit = limit
self.index = float(0)
self.step = float(total) / float(limit)
def __iter__(se... | An awk solution. You can easily add an offset if you don't want to start at frame 0.
```
#!/bin/bash
awk -v ori_f=$1 -v final_f=$2 '
BEGIN {
steps=ori_f/final_f
for (i=0; i<final_f; i++){
printf "%.0f\n", val
val=val+steps
}
}
'
``` |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **MDMA**, commonly known as ecstasy. Prior to widespread recreational use, MDMA was used to assist psychotherapy, and current research is looking at its role in PTSD treatment.
According to [Wikipedia](https://en.wikipedia.org/wiki/MDMA#Effects), effects include
>
> Euphoria – a sense of general well-being and happi... | **Captagon**
Also known as Fenethylline, in my time fighting ISIS I witnessed that they would dose suicide bombers or assault squads with this drug to make them more likely to carry out their orders. Its not a very widely studied drug, but middle eastern militant groups favor it because it (at least appears) to lower ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **MDMA**, commonly known as ecstasy. Prior to widespread recreational use, MDMA was used to assist psychotherapy, and current research is looking at its role in PTSD treatment.
According to [Wikipedia](https://en.wikipedia.org/wiki/MDMA#Effects), effects include
>
> Euphoria – a sense of general well-being and happi... | **Keppra rage.**
Keppra, or levetiracetam, is an antiepileptic drug. It is popular, safe, effective and has minimal side effects. But one important (uncommon) side effect is rage.
<https://www.ncbi.nlm.nih.gov/pubmed/18583196>
>
> LEV was rated as very effective by 40% of the patients. In contrast to
> only 9% of ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **MDMA**, commonly known as ecstasy. Prior to widespread recreational use, MDMA was used to assist psychotherapy, and current research is looking at its role in PTSD treatment.
According to [Wikipedia](https://en.wikipedia.org/wiki/MDMA#Effects), effects include
>
> Euphoria – a sense of general well-being and happi... | The correct answer is: Crystal Methamphetamine dose: 1 gram Ingest: eat, drink, or smoke
Ones inhibition will be completely be disabled. It will remove ones inhibition, so if you was shy to ask a girl out on a date... you will become more brave and bold. If you never cuss before you will be able to cuss with ease. If ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **MDMA**, commonly known as ecstasy. Prior to widespread recreational use, MDMA was used to assist psychotherapy, and current research is looking at its role in PTSD treatment.
According to [Wikipedia](https://en.wikipedia.org/wiki/MDMA#Effects), effects include
>
> Euphoria – a sense of general well-being and happi... | Methoxetamine
Chemically related to Ketamine, it is (or was) a research chemical having dissociative properties as wel as acting as a serotonine re-uptake inhibitor.
SSRI effect is heightened serotinine, which leads to:
* confidence is increased
* inhibitions are lowered
* problems seem smaller
Dissociative effect ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **MDMA**, commonly known as ecstasy. Prior to widespread recreational use, MDMA was used to assist psychotherapy, and current research is looking at its role in PTSD treatment.
According to [Wikipedia](https://en.wikipedia.org/wiki/MDMA#Effects), effects include
>
> Euphoria – a sense of general well-being and happi... | Cellulose
=========
You don't apply it to someone's drink, though. You apply it to the palm of their hands. Or place it on the table and let them pick it.
Raw cellulose won't do, though. You need the kind that comes from special labs called 'mints'. They are marked with numbers which tell the concentration of the dru... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | Because it mimics the neurotransmitter GABA and boosts the brain’s supply of dopamine, phenibut is particularly good at shushing central nervous system responses that lead to nervousness, anxiety and inhibition. This makes it a handy anxiolytic, but it’s also used commonly used as a sedative, mood regulator and cogniti... | Methoxetamine
Chemically related to Ketamine, it is (or was) a research chemical having dissociative properties as wel as acting as a serotonine re-uptake inhibitor.
SSRI effect is heightened serotinine, which leads to:
* confidence is increased
* inhibitions are lowered
* problems seem smaller
Dissociative effect ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **Captagon**
Also known as Fenethylline, in my time fighting ISIS I witnessed that they would dose suicide bombers or assault squads with this drug to make them more likely to carry out their orders. Its not a very widely studied drug, but middle eastern militant groups favor it because it (at least appears) to lower ... | The correct answer is: Crystal Methamphetamine dose: 1 gram Ingest: eat, drink, or smoke
Ones inhibition will be completely be disabled. It will remove ones inhibition, so if you was shy to ask a girl out on a date... you will become more brave and bold. If you never cuss before you will be able to cuss with ease. If ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **Captagon**
Also known as Fenethylline, in my time fighting ISIS I witnessed that they would dose suicide bombers or assault squads with this drug to make them more likely to carry out their orders. Its not a very widely studied drug, but middle eastern militant groups favor it because it (at least appears) to lower ... | Methoxetamine
Chemically related to Ketamine, it is (or was) a research chemical having dissociative properties as wel as acting as a serotonine re-uptake inhibitor.
SSRI effect is heightened serotinine, which leads to:
* confidence is increased
* inhibitions are lowered
* problems seem smaller
Dissociative effect ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **Keppra rage.**
Keppra, or levetiracetam, is an antiepileptic drug. It is popular, safe, effective and has minimal side effects. But one important (uncommon) side effect is rage.
<https://www.ncbi.nlm.nih.gov/pubmed/18583196>
>
> LEV was rated as very effective by 40% of the patients. In contrast to
> only 9% of ... | Methoxetamine
Chemically related to Ketamine, it is (or was) a research chemical having dissociative properties as wel as acting as a serotonine re-uptake inhibitor.
SSRI effect is heightened serotinine, which leads to:
* confidence is increased
* inhibitions are lowered
* problems seem smaller
Dissociative effect ... |
120,380 | I'm looking for an existing drug or chemical that most closely matches the following criteria, which will be listed from most to least important:
1. lessening of social and moral inhibitions
2. doesn't reduce higher functions of the brain (You're still smart... ish.)
3. not very detectable in one's beverage (This is w... | 2018/08/04 | [
"https://worldbuilding.stackexchange.com/questions/120380",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/53850/"
] | **MDMA**, commonly known as ecstasy. Prior to widespread recreational use, MDMA was used to assist psychotherapy, and current research is looking at its role in PTSD treatment.
According to [Wikipedia](https://en.wikipedia.org/wiki/MDMA#Effects), effects include
>
> Euphoria – a sense of general well-being and happi... | Generally speaking, *any* mild sedative, at the correct dose, works as a disinhibitor, and most will have this effect before they show any other detectable effects such as loss of higher mental abilities (to do mental mathematics, for instance), significant loss of coordination and slowing of reflexes, drowsiness, and ... |
13,754,876 | Is anyone knows how to Release bitmaps from android.view.GLES20DisplayList.
And why it keeps them alive even if you clean, let's say, ImageView manually?
Or maybe there is a way to disable GLES20DisplayList, tried to use android:hardwareAccelerated="false" in AndroidManifest, still no luck.
Looks like affected only in... | 2012/12/07 | [
"https://Stackoverflow.com/questions/13754876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369348/"
] | This seems to be a memory leak in 4.2. Looks like this fix is intended against it: <https://android.googlesource.com/platform/frameworks/base/+/034de6b1ec561797a2422314e6ef03e3cd3e08e0>
I disabled hardware acceleration in the manifest for 4.2 for the activity where I encountered this problem, this helped with android.... | I recently did an in-depth memory analysis regarding this issue. As Yulia pointed out above, disabling hardware acceleration would do the trick in general. Alternatively, you can set the ImageView’s Drawable to null, recycle the bitmap, or detach the ImageView as you pointed out.
However, depending on the API version,... |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | Sometimes the Logcat is empty in Eclipse because the emulator doesn't have the focus. Go to the DDMS perspective and try clicking on the 'emulator' entry in the top-left screen.
Can be even more confusing if there's also a real G1 connected, then you have to choose from which one you want to see the output :)
Hope th... | Eclipse only has a limitted buffer to display the logcat. There's a little clear button somewhere on that page, I forget where. Press that, it will clear the logcat and start displaying again. |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | Eclipse only has a limitted buffer to display the logcat. There's a little clear button somewhere on that page, I forget where. Press that, it will clear the logcat and start displaying again. | This also happens to me when I'm running both an avd in the emulator and usb debugging on a physical device. The avd will not give up focus, even though I'm loading the apk onto the device for debugging. I can fix by closing the avd. |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | Sometimes the Logcat is empty in Eclipse because the emulator doesn't have the focus. Go to the DDMS perspective and try clicking on the 'emulator' entry in the top-left screen.
Can be even more confusing if there's also a real G1 connected, then you have to choose from which one you want to see the output :)
Hope th... | Even `adb logcat` shows weird stuff and stops working after a while for no apparent reason: [logcat.png](http://imageshack.us/photo/my-images/6/logcat.png/). Eclipse restart and Android device restart doesn't help.
however console: `adb logcat -c` does work. |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | Eclipse only has a limitted buffer to display the logcat. There's a little clear button somewhere on that page, I forget where. Press that, it will clear the logcat and start displaying again. | Even `adb logcat` shows weird stuff and stops working after a while for no apparent reason: [logcat.png](http://imageshack.us/photo/my-images/6/logcat.png/). Eclipse restart and Android device restart doesn't help.
however console: `adb logcat -c` does work. |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | I just always keep logcat open in my terminal instead of eclipse. Just navigate to your platform-tools folder and type `adb logcat` | Even `adb logcat` shows weird stuff and stops working after a while for no apparent reason: [logcat.png](http://imageshack.us/photo/my-images/6/logcat.png/). Eclipse restart and Android device restart doesn't help.
however console: `adb logcat -c` does work. |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | I just always keep logcat open in my terminal instead of eclipse. Just navigate to your platform-tools folder and type `adb logcat` | This also happens to me when I'm running both an avd in the emulator and usb debugging on a physical device. The avd will not give up focus, even though I'm loading the apk onto the device for debugging. I can fix by closing the avd. |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | I just always keep logcat open in my terminal instead of eclipse. Just navigate to your platform-tools folder and type `adb logcat` | Sometimes you selected certain session filter by mistake. By showing the two-pane view of your LogCat you'll be able to check the active filter in the left-pane. I once fixed the empty LogCat by selecting "All messages". |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | Sometimes the Logcat is empty in Eclipse because the emulator doesn't have the focus. Go to the DDMS perspective and try clicking on the 'emulator' entry in the top-left screen.
Can be even more confusing if there's also a real G1 connected, then you have to choose from which one you want to see the output :)
Hope th... | Sometimes you selected certain session filter by mistake. By showing the two-pane view of your LogCat you'll be able to check the active filter in the left-pane. I once fixed the empty LogCat by selecting "All messages". |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | Sometimes the Logcat is empty in Eclipse because the emulator doesn't have the focus. Go to the DDMS perspective and try clicking on the 'emulator' entry in the top-left screen.
Can be even more confusing if there's also a real G1 connected, then you have to choose from which one you want to see the output :)
Hope th... | I just always keep logcat open in my terminal instead of eclipse. Just navigate to your platform-tools folder and type `adb logcat` |
4,446,014 | Logcat is often not working, showing nothing. It's very unlivable. Restarting eclipse everytime it happens is too annoying.
Is there anything I can do to solve it?
Thanks | 2010/12/15 | [
"https://Stackoverflow.com/questions/4446014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/542792/"
] | Sometimes the Logcat is empty in Eclipse because the emulator doesn't have the focus. Go to the DDMS perspective and try clicking on the 'emulator' entry in the top-left screen.
Can be even more confusing if there's also a real G1 connected, then you have to choose from which one you want to see the output :)
Hope th... | This also happens to me when I'm running both an avd in the emulator and usb debugging on a physical device. The avd will not give up focus, even though I'm loading the apk onto the device for debugging. I can fix by closing the avd. |
3,624,748 | need help about the following
when I run the following command on linux its run fine
```
awk -v NAME=MACHINE '$1 == NAME' /etc/hosts
```
but on SUN Solaris I get the following:
```
awk -v NAME=MACHINE '$1 == NAME' /etc/hosts
awk: syntax error near line 1
awk: bailing out near line 1
```
how to fit the f... | 2010/09/02 | [
"https://Stackoverflow.com/questions/3624748",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/396841/"
] | Solaris is well known for the fact that the some commands under /bin /usr/bin are not POSIX compliant. Instead they have additional compliant versions under /usr/xpg4 and similar hierarchies.
Thus, under Solaris you can use just:
```
/usr/xpg4/bin/awk -v NAME=MACHINE '$1 == NAME' /etc/hosts
```
Under Solaris 10 t... | the simple way is to use nawk and the rest syntax |
31,926 | I have a dataset that has a large number of categorical features and a few numerical features, and I want to predict the probability that any given input is one of two types of a certain binary output feature. I don't want to solve a classifier problem for reasons that are well outlined [in this link](http://www.fharre... | 2018/05/21 | [
"https://datascience.stackexchange.com/questions/31926",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/34158/"
] | **Premise**:
The confusion matrix that you mention above is only correct if
1. there is as much Positive and Negative cases in the data
2. we use a random classifier that assigns Positive and Negative class both with probability 0.5
So you derive the confusion matrix for a very particular random classifier for a very... | A couple of definitions:
* True positive rate (TPR): Probability that a positive is labeled as positive.
* False positive rate (FPR): Probability that a negative is labeled as positive
ROC curves are plotted by varying the threshold of output score of the classifier (above which an instance is classified as positive,... |
31,926 | I have a dataset that has a large number of categorical features and a few numerical features, and I want to predict the probability that any given input is one of two types of a certain binary output feature. I don't want to solve a classifier problem for reasons that are well outlined [in this link](http://www.fharre... | 2018/05/21 | [
"https://datascience.stackexchange.com/questions/31926",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/34158/"
] | A couple of definitions:
* True positive rate (TPR): Probability that a positive is labeled as positive.
* False positive rate (FPR): Probability that a negative is labeled as positive
ROC curves are plotted by varying the threshold of output score of the classifier (above which an instance is classified as positive,... | A simpler proof for [Gino\_JrDataScientist](https://datascience.stackexchange.com/a/31877) answer :-)
Assuming that your calssifier is a *Bernoulli* random variable with parameter $\rho$, and based on these [definitions](https://en.wikipedia.org/wiki/Receiver_operating_characteristic) we will have:
$$TPR=\frac{TP}{P}... |
31,926 | I have a dataset that has a large number of categorical features and a few numerical features, and I want to predict the probability that any given input is one of two types of a certain binary output feature. I don't want to solve a classifier problem for reasons that are well outlined [in this link](http://www.fharre... | 2018/05/21 | [
"https://datascience.stackexchange.com/questions/31926",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/34158/"
] | **Premise**:
The confusion matrix that you mention above is only correct if
1. there is as much Positive and Negative cases in the data
2. we use a random classifier that assigns Positive and Negative class both with probability 0.5
So you derive the confusion matrix for a very particular random classifier for a very... | A simpler proof for [Gino\_JrDataScientist](https://datascience.stackexchange.com/a/31877) answer :-)
Assuming that your calssifier is a *Bernoulli* random variable with parameter $\rho$, and based on these [definitions](https://en.wikipedia.org/wiki/Receiver_operating_characteristic) we will have:
$$TPR=\frac{TP}{P}... |
2,273,393 | ```
<?php
switch($_GET["action"])
{
case "add_item":
{
AddItem($_GET["idc"], $_GET["qty"]);
ShowCart();
break;
}
case "update_item":
{
UpdateItem($_GET["idc"], $_GET["qty"]);
ShowCart();
break;
}
case "remove_item":
{
RemoveItem($_GET["idc"], $_GET["id"]);
ShowCart();
break;
}
default:
{
ShowCart();
}
}
function AddIt... | 2010/02/16 | [
"https://Stackoverflow.com/questions/2273393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269837/"
] | Your SELECT has a comma at the end of your last field. You should remove that comma.
```
SELECT
cart.id cart_id,
dkb.id dkb_id,
cdkb.id cdkb_id,
dbl.id dbl_id, <-- comma here isn't needed
``` | It seems to me you have a comma too much after:
```
dbl.id dbl_id
```
**Edit:** Another error in the query is that you are referencing a field from table **dbl**:
```
dbl.id dbl_id
```
but you are not joining that table to the query so `dbl.id` is an unknown entity. |
2,273,393 | ```
<?php
switch($_GET["action"])
{
case "add_item":
{
AddItem($_GET["idc"], $_GET["qty"]);
ShowCart();
break;
}
case "update_item":
{
UpdateItem($_GET["idc"], $_GET["qty"]);
ShowCart();
break;
}
case "remove_item":
{
RemoveItem($_GET["idc"], $_GET["id"]);
ShowCart();
break;
}
default:
{
ShowCart();
}
}
function AddIt... | 2010/02/16 | [
"https://Stackoverflow.com/questions/2273393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269837/"
] | It seems to me you have a comma too much after:
```
dbl.id dbl_id
```
**Edit:** Another error in the query is that you are referencing a field from table **dbl**:
```
dbl.id dbl_id
```
but you are not joining that table to the query so `dbl.id` is an unknown entity. | Your query will also blow up if $\_GET['is'] is not set. You're assigning the value null to $is and $ic, not the string "null". A null value in string context is a blank string (''), so you'll end up with `ON ( cart.id = dkb.id and dkb.id = )` which is a syntax error.
You'll have to change the initial assignment to so... |
2,273,393 | ```
<?php
switch($_GET["action"])
{
case "add_item":
{
AddItem($_GET["idc"], $_GET["qty"]);
ShowCart();
break;
}
case "update_item":
{
UpdateItem($_GET["idc"], $_GET["qty"]);
ShowCart();
break;
}
case "remove_item":
{
RemoveItem($_GET["idc"], $_GET["id"]);
ShowCart();
break;
}
default:
{
ShowCart();
}
}
function AddIt... | 2010/02/16 | [
"https://Stackoverflow.com/questions/2273393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269837/"
] | Your SELECT has a comma at the end of your last field. You should remove that comma.
```
SELECT
cart.id cart_id,
dkb.id dkb_id,
cdkb.id cdkb_id,
dbl.id dbl_id, <-- comma here isn't needed
``` | Your query will also blow up if $\_GET['is'] is not set. You're assigning the value null to $is and $ic, not the string "null". A null value in string context is a blank string (''), so you'll end up with `ON ( cart.id = dkb.id and dkb.id = )` which is a syntax error.
You'll have to change the initial assignment to so... |
1,565,996 | I have some pinned entries in the Jumplists for various of my Taskbar-pinned programs:
[](https://i.stack.imgur.com/r0Do9.png)
I want to re-order those pinned entries. **Is there any way to do so?**
Drag-and-droping does nothing, alas. | 2020/07/04 | [
"https://superuser.com/questions/1565996",
"https://superuser.com",
"https://superuser.com/users/466237/"
] | Jump lists are created automatically when a user interacts with the system, doing such acts as opening applications or accessing files,
are stored in the folder:
```
%appdata%\Microsoft\Windows\Recent\AutomaticDestinations\
```
They all have cryptic names based on the application id (APPID).
For example, the one for... | You can't change the order of the items in the jump lists of taskbar. But there is a workaround to do so. First unpin all items from the jump list. Then pin all items again in your order. I know, this process is a bit lengthy and time consuming, but i can't find any other way. |
465,958 | I'm having a bit of trouble with this section of a biology paper:
"LSU was amplified in these species using F63.2 and Mollusc28R2, which amplified **all but** ~400 bases at the 3' end of the gene."
Does it mean it amplified *almost* all 400 bases, or every base *except* for those 400.
Thank you in advance. I don't s... | 2018/09/27 | [
"https://english.stackexchange.com/questions/465958",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/317935/"
] | "But" here is a preposition (not a conjunction) with the definition:
>
> Except; apart from; other than.
>
> *‘supply currently exceeds demand in all but the most rural areas’*
>
> [Oxford Dictionaries](https://en.oxforddictionaries.com/definition/but)
>
>
>
Because it means exactly what it says, it's not a... | For clarity on the expression itself:
[From Grammarist:](https://grammarist.com/usage/all-but/)
>
> The adverbial phrase all but (no need to hyphenate it) means almost,
> nearly, or on the verge of. It signals that the following word is
> almost but not quite the case. For example, if I say, I all but ran to
> ... |
17,699,169 | I wrote a program that reads from the serial port. No problem with the program run on the computer that has Visual Studio installed. Everything is OK. But when I copied release folder to another program and run it I have a error `System.IO.IOException`. I use this code to read data from serial port.
```
byte[] buffer ... | 2013/07/17 | [
"https://Stackoverflow.com/questions/17699169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1855844/"
] | It seems that you are reading more bytes than the port have transmitted, you should check the `BytesToRead` property to check how many they are.
```
byte[] buffer = new byte[port.BytesToRead];
int readBytes = 0;
int totalReadBytes = 0;
int offset = 0;
int remaining = port.BytesToRead;
try
{
do
{
readB... | May be helpful:
<http://zachsaw.blogspot.com/2010/07/net-serialport-woes.html>
<http://zachsaw.blogspot.com/2010/07/serialport-ioexception-workaround-in-c.html>
But I haven't tested it. |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | I figured it out. The below works in converting it to a 24 hr date format.
```
select date_parse('7/22/2016 6:05:04 PM','%m/%d/%Y %h:%i:%s %p')
```
See [`date_parse` documentation in Presto](https://prestosql.io/docs/current/functions/datetime.html#date_parse). | If your string is in ISO 8601 format, you can also use [from\_iso8601\_timestamp](https://prestosql.io/docs/current/functions/datetime.html#from_iso8601_timestamp) |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | You can also do something like this
date(cast('2016-03-22 15:19:34.0' as timestamp)) | Use: `cast(date_parse(inv.date_created,'%Y-%m-%d %h24:%i:%s') as date)`
Input: `String timestamp`
Output: `date format 'yyyy-mm-dd'` |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | I figured it out. The below works in converting it to a 24 hr date format.
```
select date_parse('7/22/2016 6:05:04 PM','%m/%d/%Y %h:%i:%s %p')
```
See [`date_parse` documentation in Presto](https://prestosql.io/docs/current/functions/datetime.html#date_parse). | ```sql
select date_format(date_parse(t.payDate,'%Y-%m-%d %H:%i:%S'),'%Y-%m-%d') as payDate
from testTable t
where t.paydate is not null and t.paydate <> '';
``` |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | Converted DateID having date in Int format to date format: Presto Query
```
Select CAST(date_format(date_parse(cast(dateid as varchar(10)), '%Y%m%d'), '%Y/%m-%d') AS DATE)
from
Table_Name
limit 10;
``` | `date_format` requires first argument as `timestamp` so not the best way to convert a string. Use `date_parse` instead.
Also, use `%c` for non zero-padded month, `%e` for non zero-padded day of the month and `%Y` for four digit year.
```
SELECT date_parse('7/22/2016 6:05:04 PM', '%c/%e/%Y %r')
``` |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | If your string is in ISO 8601 format, you can also use [from\_iso8601\_timestamp](https://prestosql.io/docs/current/functions/datetime.html#from_iso8601_timestamp) | SQL 2003 standard defines the format as follows:
```
<unquoted timestamp string> ::= <unquoted date string> <space> <unquoted time string>
<date value> ::= <years value> <minus sign> <months value> <minus sign> <days value>
<time value> ::= <hours value> <colon> <minutes value> <colon> <seconds value>
```
There are ... |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | You can also do something like this
date(cast('2016-03-22 15:19:34.0' as timestamp)) | If your string is in ISO 8601 format, you can also use [from\_iso8601\_timestamp](https://prestosql.io/docs/current/functions/datetime.html#from_iso8601_timestamp) |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | Converted DateID having date in Int format to date format: Presto Query
```
Select CAST(date_format(date_parse(cast(dateid as varchar(10)), '%Y%m%d'), '%Y/%m-%d') AS DATE)
from
Table_Name
limit 10;
``` | SQL 2003 standard defines the format as follows:
```
<unquoted timestamp string> ::= <unquoted date string> <space> <unquoted time string>
<date value> ::= <years value> <minus sign> <months value> <minus sign> <days value>
<time value> ::= <hours value> <colon> <minutes value> <colon> <seconds value>
```
There are ... |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | I figured it out. The below works in converting it to a 24 hr date format.
```
select date_parse('7/22/2016 6:05:04 PM','%m/%d/%Y %h:%i:%s %p')
```
See [`date_parse` documentation in Presto](https://prestosql.io/docs/current/functions/datetime.html#date_parse). | SQL 2003 standard defines the format as follows:
```
<unquoted timestamp string> ::= <unquoted date string> <space> <unquoted time string>
<date value> ::= <years value> <minus sign> <months value> <minus sign> <days value>
<time value> ::= <hours value> <colon> <minutes value> <colon> <seconds value>
```
There are ... |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | I figured it out. The below works in converting it to a 24 hr date format.
```
select date_parse('7/22/2016 6:05:04 PM','%m/%d/%Y %h:%i:%s %p')
```
See [`date_parse` documentation in Presto](https://prestosql.io/docs/current/functions/datetime.html#date_parse). | Converted DateID having date in Int format to date format: Presto Query
```
Select CAST(date_format(date_parse(cast(dateid as varchar(10)), '%Y%m%d'), '%Y/%m-%d') AS DATE)
from
Table_Name
limit 10;
``` |
39,880,540 | I'm on presto and have a date formatted as varchar that looks like -
```
7/14/2015 8:22:39 AM
```
I've looked the presto docs and tried various things(cast, date\_format, using split\_part to parse and then cast) and am not getting this to convert to a date format that I can use with functions like date\_diff.
I'v... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39880540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3749901/"
] | Use: `cast(date_parse(inv.date_created,'%Y-%m-%d %h24:%i:%s') as date)`
Input: `String timestamp`
Output: `date format 'yyyy-mm-dd'` | `date_format` requires first argument as `timestamp` so not the best way to convert a string. Use `date_parse` instead.
Also, use `%c` for non zero-padded month, `%e` for non zero-padded day of the month and `%Y` for four digit year.
```
SELECT date_parse('7/22/2016 6:05:04 PM', '%c/%e/%Y %r')
``` |
57,040,592 | I have two models in laravel project Item and ItemImgs
Item.php
```
class Item extends Model
{
protected $appends = [
'photo',
];
public function imgs()
{
return $this->hasMany(ItemImage::class);
}
public function getPhotoAttribute()
{
$img = $this->imgs->first(... | 2019/07/15 | [
"https://Stackoverflow.com/questions/57040592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3316483/"
] | You cannot use dot notation in PHP.
```
public function getPhotoAttribute()
{
$img = $this->imgs->first();
return $img.src; // Dot notation is not allowed
}
```
but you've to use:
```
public function getPhotoAttribute()
{
$img = $this->imgs->first();
return $img->src;
}
``` | if what you're trying to do is to get the items that have imgs() then what you should do is query by relationship existence, as mentioned in the docs
<https://laravel.com/docs/5.8/eloquent-relationships#querying-relationship-existence>
```
'items' => Item::has('imgs')->get()
``` |
57,040,592 | I have two models in laravel project Item and ItemImgs
Item.php
```
class Item extends Model
{
protected $appends = [
'photo',
];
public function imgs()
{
return $this->hasMany(ItemImage::class);
}
public function getPhotoAttribute()
{
$img = $this->imgs->first(... | 2019/07/15 | [
"https://Stackoverflow.com/questions/57040592",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3316483/"
] | You cannot use dot notation in PHP.
```
public function getPhotoAttribute()
{
$img = $this->imgs->first();
return $img.src; // Dot notation is not allowed
}
```
but you've to use:
```
public function getPhotoAttribute()
{
$img = $this->imgs->first();
return $img->src;
}
``` | It is not possible to refer to the linked model tables in attributes. It works in views but gives out a memory error when outputting an array through json.
```
public function getPhotoAttribute(){
$img = ItemImage::where('item', $this->id)-
>first();
}
```
It works that way, but it's not elegant. |
39,622,332 | I have a data file that I need to read in C. It is compirsed of alternating 16-bit integer stored in binary form, and I need only the first column (ie, every other entry starting at 0)
I have a simple python script that reads the files accurately:
```
import numpy as np
fname = '[filename]'
columntypes = np.dtype([(... | 2016/09/21 | [
"https://Stackoverflow.com/questions/39622332",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2521423/"
] | Perform the endian swap as unsigned math and then assign to `double`.
```
void swapByteOrder_int16(double *current, const int16_t *rawsignal, size_t length) {
for (size_t i = 0; i < length; i++) {
int16_t x = rawsignal[2*i];
x = (x*1u << 8) | (x*1u >> 8);
current[i] = x;
}
}
``` | Swapping bits with unsigned types will make things much easier:
```
void swapByteOrder_int16(double *current, void const *rawsignal_, size_t length)
{
uint16_t const *rawsignal = rawsignal_;
size_t i;
for (i=0; i<length; i++)
{
uint16_t tmp = rawsignal[2*i];
tmp = ((tmp >> 8) & 0xffu) | (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.