qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
54,301,925 | I am a beginner to python, I wanted to symbolic computations. I came to know with sympy installation into our pc we can do symbolic computation. I have installed python 3.6 and I am using anaconda nagavitor, through which I am using spyder as an editor. now I want to install symbolic package sympy how to do that.
I che... | 2019/01/22 | [
"https://Stackoverflow.com/questions/54301925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9049579/"
] | In anaconda navigator:
1. Click Environments (on the left)
2. Choose your environment (if you have more than one)
3. On the middle pick "All" from dropbox ("installed" by default)
4. Write sympy in search-box on the right
5. Check the package that showed out
6. Click apply | To use conda install, open the Anaconda Prompt and enter the *conda install sympy* command.
Alternatively, navigate to the scripts sub-directory in the Anaconda directory, and run *pip install sympy*. |
54,301,925 | I am a beginner to python, I wanted to symbolic computations. I came to know with sympy installation into our pc we can do symbolic computation. I have installed python 3.6 and I am using anaconda nagavitor, through which I am using spyder as an editor. now I want to install symbolic package sympy how to do that.
I che... | 2019/01/22 | [
"https://Stackoverflow.com/questions/54301925",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9049579/"
] | Agree with Dixit.
### First Solution:
It's okay to use `pip3 install sympy` on MacOS.
1. List item
2. Open your "Terminal".
3. Input `pip3 install sympy` and press enter.
4. It will automatically download and install the Sympy Package.
### Second Solution:
Using git.
# Notice: Before install Sympy, it's necessary ... | In anaconda navigator:
1. Click Environments (on the left)
2. Choose your environment (if you have more than one)
3. On the middle pick "All" from dropbox ("installed" by default)
4. Write sympy in search-box on the right
5. Check the package that showed out
6. Click apply |
31,014,333 | in the last days I'm starting to "play" with some Java 8 features, like stream (I studied a bit of documentation and several examples).
In my application I have a Map and I need to get the three element with highest value (the float part).
I tried different modifications to my code (and some of these solutions also: ... | 2015/06/23 | [
"https://Stackoverflow.com/questions/31014333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2459308/"
] | I think that the problem is the method createMapWith20Elements().
You are inserting elements in the map (probably a HashMap or a TreeMap) concurrently and both HashMap and TreeMap are not synchronized. So concurrent insertions (put method invocations) break the map structure (you get a corrupted map).
As you mention... | The issue is with the progressive resizing of the underlying not synchronized collection, I guess in your case your Map structure is not synchronized.
Due to the gradual re-size, not handled correctly in a multi threads context, it can bring to have a thread trying to insert an element out of the range of the current s... |
1,828,447 | How best to store the html for embedding?
the only ways I can think of are:
take the embed html and add `<?php echo $var1; ?>` where the id's go then store it in the db and use Eval to execute it.
or
insert a strange combination of characters to act as a marker to be replaced in php by the id's. | 2009/12/01 | [
"https://Stackoverflow.com/questions/1828447",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/187227/"
] | Option #2 is much safer - just in case someone manages to execute a SQL injection attack against your DB, they can't then exploit your embedding operation to execute injected PHP on the server side. The best they could hope for would be a phishing or XSS attack.
Another alternative is to format the appropriate data in... | Why not just store the 11-character video code and then build the HTML wherever you want to embed that video?
See this:
[How to embed YouTube videos in PHP?](https://stackoverflow.com/questions/412467/how-to-embed-youtube-videos-in-php) |
41,069,680 | Recently, my jQuery code using events stopped working. I don't understand why. Do I have a declaration issue?
This is my declaration in the header:
```
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">... | 2016/12/09 | [
"https://Stackoverflow.com/questions/41069680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7105551/"
] | you make mistake at your route:
```
Route::get('perekamans/proses', ['uses' => 'PerekamanController@listdata']);
Route::resource('perekamans', 'PerekamanController');
```
Change the sequence become like that.
And one more thing at Laravel you can make it simpler.
```
Route::get('perekamans/proses', 'PerekamanCont... | Your controller is missing all of the resource methods (index, create, store, show, etc..). You need all of the methods [mentioned in the documentation](https://laravel.com/docs/5.3/controllers#resource-controllers) in the "actions" column.
Its a good idea to use artisan to scaffold your controller when you plan on us... |
41,069,680 | Recently, my jQuery code using events stopped working. I don't understand why. Do I have a declaration issue?
This is my declaration in the header:
```
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">... | 2016/12/09 | [
"https://Stackoverflow.com/questions/41069680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7105551/"
] | you make mistake at your route:
```
Route::get('perekamans/proses', ['uses' => 'PerekamanController@listdata']);
Route::resource('perekamans', 'PerekamanController');
```
Change the sequence become like that.
And one more thing at Laravel you can make it simpler.
```
Route::get('perekamans/proses', 'PerekamanCont... | Add show() method in your PerekamanController.
Your route seem to be strange and that might be not work well . So make sure that your Http Webserver Rewrite is open.
If you use Apache,open your **mod\_rewrite** and try this code in your .htaccess file
```
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUES... |
22,524,363 | I'm trying to write driver for rtl8139 for linux 2.6 from scratch. I've already written TX path, but I have some problems with RX.
I put RX into promiscous mode and receiving RX irqs. I set RBSTART into physical address of allocated memory by kmalloc.
I don't know how to find out how many received packets there are... | 2014/03/20 | [
"https://Stackoverflow.com/questions/22524363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2699113/"
] | I answer to my question myself.
The received packets are located starting at RBSTART. The first two bytes of rx-ed packet are status bytes, and the next 2 are length of the frame + 4 bytes of crc.
Maybye someone find this info helpful. | On receiving a packet, the data received from the line is stored in the receive FIFO. When Early Receive Threshold is met, the data is moved from FIFO to Recieve Buffer.
So, once you get an interrupt. You need to check the Interrupt Status Register for ROK. Then check the Early Rx status register which gives you the ... |
36,193,893 | So I wrote this (Actually trying to see if realloc was O(n)-ish or not):
```
int main() {
time_t t1,t2;
char* x=malloc(sizeof(char));
char* y=x;
printf("%p %p\n",(void*)x,(void*)y);
double tot_time=0.0;
double time_r=0.0;
size_t s=2;
for(;;s++) {
t1=clock();
x=realloc(x,s*sizeof(char));
t2=clock();
if(... | 2016/03/24 | [
"https://Stackoverflow.com/questions/36193893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864169/"
] | The problem is `FrameLayout` has `Views` as children. The replace method will replace only prior fragments, if any added in the `FrameLayout` NOT the views.
To solve this, you could remove, the children from the `FrameLayout` and add it to a separate `Fragment`. Then add that `Fragment` in the `FrameLayout` as its on... | try this
```
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView"
/>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/progressBar"
android:layout_centerVer... |
13,748,811 | I am currently working on a script in Java to import a bunch of books from a lengthy plain text file to a database. I have all of the books parsed into book objects and am trying to write them to the database. However, I get a missing comma exception "ORA-00917: missing comma" on the Following String:
```
INSERT INTO ... | 2012/12/06 | [
"https://Stackoverflow.com/questions/13748811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1328015/"
] | `, 'This is for CRN's 15454 & 48456,`
Right there.
Notice how you missed a tick after (48456). Probably because the (CRN's) part.
Also, I recommend using a `record` for ease of programming. Inserting values like that is just messy. :) Keep up the good work. | `'Ember, Carol & Ember, Melvin,'` is probably causing the problem
Try `'Ember, Carol &' || ' Ember, Melvin,'` |
13,748,811 | I am currently working on a script in Java to import a bunch of books from a lengthy plain text file to a database. I have all of the books parsed into book objects and am trying to write them to the database. However, I get a missing comma exception "ORA-00917: missing comma" on the Following String:
```
INSERT INTO ... | 2012/12/06 | [
"https://Stackoverflow.com/questions/13748811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1328015/"
] | `, 'This is for CRN's 15454 & 48456,`
Right there.
Notice how you missed a tick after (48456). Probably because the (CRN's) part.
Also, I recommend using a `record` for ease of programming. Inserting values like that is just messy. :) Keep up the good work. | The error is obvious, you are missing a comma somewhere in your insert statement.
However, i strongly recommend you to use [**PreparedStatement**](http://docs.oracle.com/javase/6/docs/api/java/sql/PreparedStatement.html) rather than simple Statement when performing SQL queries using JDBC to prevent SQL INJECTION.
``... |
13,748,811 | I am currently working on a script in Java to import a bunch of books from a lengthy plain text file to a database. I have all of the books parsed into book objects and am trying to write them to the database. However, I get a missing comma exception "ORA-00917: missing comma" on the Following String:
```
INSERT INTO ... | 2012/12/06 | [
"https://Stackoverflow.com/questions/13748811",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1328015/"
] | The error is obvious, you are missing a comma somewhere in your insert statement.
However, i strongly recommend you to use [**PreparedStatement**](http://docs.oracle.com/javase/6/docs/api/java/sql/PreparedStatement.html) rather than simple Statement when performing SQL queries using JDBC to prevent SQL INJECTION.
``... | `'Ember, Carol & Ember, Melvin,'` is probably causing the problem
Try `'Ember, Carol &' || ' Ember, Melvin,'` |
9,749,026 | Heres my script for my homepage:
```
<?php
include('inc/connect.php');
mysql_select_db("hub");
?>
<html>
<head>
<title>CyberBat - Learning Tech</title>
<link type="text/css" rel="stylesheet" href="inc/style.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<?php include('inc/heade... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9749026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275573/"
] | *Declaring* a class, as opposed to *defining* it, is sufficient to make the compiler aware of the fact that a certain name refers to a type, and that allows you to use the type in certain settings. Specifically, a declared but not-yet-defined type is an *incomplete type*, and you can use incomplete types in several way... | The type of the class is entirely determined by its fully-qualified name (not sure that's the official term, but anyway), which includes its namespace and its name. It doesn't matter whether it was sourced from a header file or simply declared *in-situ*.
In fact, the inclusion of a header file basically just inserts t... |
9,749,026 | Heres my script for my homepage:
```
<?php
include('inc/connect.php');
mysql_select_db("hub");
?>
<html>
<head>
<title>CyberBat - Learning Tech</title>
<link type="text/css" rel="stylesheet" href="inc/style.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<?php include('inc/heade... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9749026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275573/"
] | Those are known as "[forward declarations](http://en.wikipedia.org/wiki/Forward_declaration)" of the classes. It is used to make the compiler know that those symbols refer to classes, which are going to be defined afterwards. Those can be used in a header file to declare a symbol to be a class avoiding an inclusion of ... | The type of the class is entirely determined by its fully-qualified name (not sure that's the official term, but anyway), which includes its namespace and its name. It doesn't matter whether it was sourced from a header file or simply declared *in-situ*.
In fact, the inclusion of a header file basically just inserts t... |
9,749,026 | Heres my script for my homepage:
```
<?php
include('inc/connect.php');
mysql_select_db("hub");
?>
<html>
<head>
<title>CyberBat - Learning Tech</title>
<link type="text/css" rel="stylesheet" href="inc/style.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<?php include('inc/heade... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9749026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275573/"
] | The type of the class is entirely determined by its fully-qualified name (not sure that's the official term, but anyway), which includes its namespace and its name. It doesn't matter whether it was sourced from a header file or simply declared *in-situ*.
In fact, the inclusion of a header file basically just inserts t... | I was just working on that example a few days ago. So here is the conclusion why I think you need those:
I'm guessing that if you'd look in the .pro file you'd see a line that's like:
```
QT += core
QT += gui
```
So the thing is you're telling the Qt translator and the compiler that you're using the QtGui and QtCor... |
9,749,026 | Heres my script for my homepage:
```
<?php
include('inc/connect.php');
mysql_select_db("hub");
?>
<html>
<head>
<title>CyberBat - Learning Tech</title>
<link type="text/css" rel="stylesheet" href="inc/style.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<?php include('inc/heade... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9749026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275573/"
] | *Declaring* a class, as opposed to *defining* it, is sufficient to make the compiler aware of the fact that a certain name refers to a type, and that allows you to use the type in certain settings. Specifically, a declared but not-yet-defined type is an *incomplete type*, and you can use incomplete types in several way... | I was just working on that example a few days ago. So here is the conclusion why I think you need those:
I'm guessing that if you'd look in the .pro file you'd see a line that's like:
```
QT += core
QT += gui
```
So the thing is you're telling the Qt translator and the compiler that you're using the QtGui and QtCor... |
9,749,026 | Heres my script for my homepage:
```
<?php
include('inc/connect.php');
mysql_select_db("hub");
?>
<html>
<head>
<title>CyberBat - Learning Tech</title>
<link type="text/css" rel="stylesheet" href="inc/style.css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<?php include('inc/heade... | 2012/03/17 | [
"https://Stackoverflow.com/questions/9749026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275573/"
] | Those are known as "[forward declarations](http://en.wikipedia.org/wiki/Forward_declaration)" of the classes. It is used to make the compiler know that those symbols refer to classes, which are going to be defined afterwards. Those can be used in a header file to declare a symbol to be a class avoiding an inclusion of ... | I was just working on that example a few days ago. So here is the conclusion why I think you need those:
I'm guessing that if you'd look in the .pro file you'd see a line that's like:
```
QT += core
QT += gui
```
So the thing is you're telling the Qt translator and the compiler that you're using the QtGui and QtCor... |
51,368,189 | Suppose I have the following query, which returns a filtered table:
```
select column1,column2,column3 from table1 where table1.column1 = 'dada'
```
Further, suppose I want to store the resulting values in a variable so that I can use the result later on.
I have read that I can store a single value like so:
```
de... | 2018/07/16 | [
"https://Stackoverflow.com/questions/51368189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10083113/"
] | Use a **view** instead.
From W3Schools:
>
> In SQL, a view is a virtual table based on the result-set of an SQL
> statement.
>
>
>
Here's how you create one:
```
create view view1 as select column1,column2,column3 from table1 where
table1.column1 = 'dada'
``` | ```
create view tempTable as select column1,column2,... from table1 where
table1.column1 = 'dada'
``` |
51,368,189 | Suppose I have the following query, which returns a filtered table:
```
select column1,column2,column3 from table1 where table1.column1 = 'dada'
```
Further, suppose I want to store the resulting values in a variable so that I can use the result later on.
I have read that I can store a single value like so:
```
de... | 2018/07/16 | [
"https://Stackoverflow.com/questions/51368189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10083113/"
] | I think you need to use collections in oracle. Below code can help you.
Sample Code:
```
CREATE TABLE example
("S_ID" NUMBER(1,0) ,
"S_NAME" VARCHAR2(8 CHAR)
);
Insert into example (S_ID,S_NAME) values (1,'A');
Insert into example (S_ID,S_NAME) values (1,'B');
Insert into example (S_ID,S_N... | Use a **view** instead.
From W3Schools:
>
> In SQL, a view is a virtual table based on the result-set of an SQL
> statement.
>
>
>
Here's how you create one:
```
create view view1 as select column1,column2,column3 from table1 where
table1.column1 = 'dada'
``` |
51,368,189 | Suppose I have the following query, which returns a filtered table:
```
select column1,column2,column3 from table1 where table1.column1 = 'dada'
```
Further, suppose I want to store the resulting values in a variable so that I can use the result later on.
I have read that I can store a single value like so:
```
de... | 2018/07/16 | [
"https://Stackoverflow.com/questions/51368189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10083113/"
] | Use a **view** instead.
From W3Schools:
>
> In SQL, a view is a virtual table based on the result-set of an SQL
> statement.
>
>
>
Here's how you create one:
```
create view view1 as select column1,column2,column3 from table1 where
table1.column1 = 'dada'
``` | ```
declare:
result varchar(20);
begin:
select column1 into result from table1 where table1.column1 = 'dada'; // only work if you have single column in your result
end;
```
// For Multiple values use implicit cursor like below
FOR c\_2151 in (
select column1 from table1 where table1.column1 = 'dada'
) LOOP
... |
51,368,189 | Suppose I have the following query, which returns a filtered table:
```
select column1,column2,column3 from table1 where table1.column1 = 'dada'
```
Further, suppose I want to store the resulting values in a variable so that I can use the result later on.
I have read that I can store a single value like so:
```
de... | 2018/07/16 | [
"https://Stackoverflow.com/questions/51368189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10083113/"
] | I think you need to use collections in oracle. Below code can help you.
Sample Code:
```
CREATE TABLE example
("S_ID" NUMBER(1,0) ,
"S_NAME" VARCHAR2(8 CHAR)
);
Insert into example (S_ID,S_NAME) values (1,'A');
Insert into example (S_ID,S_NAME) values (1,'B');
Insert into example (S_ID,S_N... | ```
create view tempTable as select column1,column2,... from table1 where
table1.column1 = 'dada'
``` |
51,368,189 | Suppose I have the following query, which returns a filtered table:
```
select column1,column2,column3 from table1 where table1.column1 = 'dada'
```
Further, suppose I want to store the resulting values in a variable so that I can use the result later on.
I have read that I can store a single value like so:
```
de... | 2018/07/16 | [
"https://Stackoverflow.com/questions/51368189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10083113/"
] | I think you need to use collections in oracle. Below code can help you.
Sample Code:
```
CREATE TABLE example
("S_ID" NUMBER(1,0) ,
"S_NAME" VARCHAR2(8 CHAR)
);
Insert into example (S_ID,S_NAME) values (1,'A');
Insert into example (S_ID,S_NAME) values (1,'B');
Insert into example (S_ID,S_N... | ```
declare:
result varchar(20);
begin:
select column1 into result from table1 where table1.column1 = 'dada'; // only work if you have single column in your result
end;
```
// For Multiple values use implicit cursor like below
FOR c\_2151 in (
select column1 from table1 where table1.column1 = 'dada'
) LOOP
... |
66,438,317 | I tried to use std::tuple as an element of std::set where std tuple consists of std::string and a bool (for this example only, in normal use case the tuple consists of 3 elements). The string of the tuple shall be unique, therefore I created comparator that would sort the elements on the first element of the tuple. How... | 2021/03/02 | [
"https://Stackoverflow.com/questions/66438317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9590736/"
] | `std::string::compare` returns `int` (neg, 0, positive) not `bool` (less than),
you want
```
std::get<0>(l).compare(std::get<0>(r)) < 0;
```
or
```
std::get<0>(l) < std::get<0>(r);
``` | `a.compare(b)` returns:
```
0 when the strings are equal
negative when a comes before b (ie a < b)
positive when b comes before a (ie b < a)
```
However, the comparators return value is converted to a `bool` and anything but `0` is converted to `true`, hence your comparator considers `a < b` to be `tr... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Extension isn't important for temporary file, but if you want use this file in code or save to another place. You can do it:
```
temp_file = open(params[:url])
def temp_file.original_filename; File.basename(base_uri.path); end
```
Now, you can save this temporary file to permanent space or use it in code; Original f... | Have you inclued the :extension in your path/url option?
For example:
```
has_attached_file :image,
...
:url => '/images/highlights/:id_partition/:style_:id.:extension',
:path => ':rails_root/files/images/highlights/:id_partition/:style_:id.:extension'
```
This will probably solve your problem.
You can force... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Im not sure if this will help in your case, but I was noticing similar issues in my project.
The issue turned out to be not caused by `Paperclip` nor `open-uri`, but the receiver of the paperclip file (in my case `Spree Commerce`). Check that you are assigning the paperclip object to the right object, and that it is ... | Yes, it is a problem but we can get around this with fancybox.
In the link tag(for image) add `:type => 'image'`
```
- @images.each do |image|
= link_to image_tag(image.attachment.url), image.attachment.url, class: "fancybox", type: 'image'
```
By specifying 'type', Fancybox overrides the type as image
<https:/... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Extension isn't important for temporary file, but if you want use this file in code or save to another place. You can do it:
```
temp_file = open(params[:url])
def temp_file.original_filename; File.basename(base_uri.path); end
```
Now, you can save this temporary file to permanent space or use it in code; Original f... | Im not sure if this will help in your case, but I was noticing similar issues in my project.
The issue turned out to be not caused by `Paperclip` nor `open-uri`, but the receiver of the paperclip file (in my case `Spree Commerce`). Check that you are assigning the paperclip object to the right object, and that it is ... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Don't use the temporary file! It's there as a placeholder as the file is read from the port, and should be considered a private resource for `OpenURI`. Instead, use `open(url).read` and work with the resulting content by saving it.
Do something like:
```
require 'uri'
require 'open-uri'
url = 'http://www.iana.org/do... | Extension isn't important for temporary file, but if you want use this file in code or save to another place. You can do it:
```
temp_file = open(params[:url])
def temp_file.original_filename; File.basename(base_uri.path); end
```
Now, you can save this temporary file to permanent space or use it in code; Original f... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Have you inclued the :extension in your path/url option?
For example:
```
has_attached_file :image,
...
:url => '/images/highlights/:id_partition/:style_:id.:extension',
:path => ':rails_root/files/images/highlights/:id_partition/:style_:id.:extension'
```
This will probably solve your problem.
You can force... | Yes, it is a problem but we can get around this with fancybox.
In the link tag(for image) add `:type => 'image'`
```
- @images.each do |image|
= link_to image_tag(image.attachment.url), image.attachment.url, class: "fancybox", type: 'image'
```
By specifying 'type', Fancybox overrides the type as image
<https:/... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Extension isn't important for temporary file, but if you want use this file in code or save to another place. You can do it:
```
temp_file = open(params[:url])
def temp_file.original_filename; File.basename(base_uri.path); end
```
Now, you can save this temporary file to permanent space or use it in code; Original f... | Yes, it is a problem but we can get around this with fancybox.
In the link tag(for image) add `:type => 'image'`
```
- @images.each do |image|
= link_to image_tag(image.attachment.url), image.attachment.url, class: "fancybox", type: 'image'
```
By specifying 'type', Fancybox overrides the type as image
<https:/... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Don't use the temporary file! It's there as a placeholder as the file is read from the port, and should be considered a private resource for `OpenURI`. Instead, use `open(url).read` and work with the resulting content by saving it.
Do something like:
```
require 'uri'
require 'open-uri'
url = 'http://www.iana.org/do... | >
> Update – Paperclip can do this on its own!
>
>
> Posted by Aditya Sanghi (thanks a lot!):
>
>
>
> ```
> current_comments.pictures.create!(file: URI.parse(image_url))
>
> ```
>
> Although keep in mind, that you still need to handle 500, 404, etc
> errors (Paperclip can raise them).
>
>
>
Thanks to: <htt... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Extension isn't important for temporary file, but if you want use this file in code or save to another place. You can do it:
```
temp_file = open(params[:url])
def temp_file.original_filename; File.basename(base_uri.path); end
```
Now, you can save this temporary file to permanent space or use it in code; Original f... | >
> Update – Paperclip can do this on its own!
>
>
> Posted by Aditya Sanghi (thanks a lot!):
>
>
>
> ```
> current_comments.pictures.create!(file: URI.parse(image_url))
>
> ```
>
> Although keep in mind, that you still need to handle 500, 404, etc
> errors (Paperclip can raise them).
>
>
>
Thanks to: <htt... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | Don't use the temporary file! It's there as a placeholder as the file is read from the port, and should be considered a private resource for `OpenURI`. Instead, use `open(url).read` and work with the resulting content by saving it.
Do something like:
```
require 'uri'
require 'open-uri'
url = 'http://www.iana.org/do... | Im not sure if this will help in your case, but I was noticing similar issues in my project.
The issue turned out to be not caused by `Paperclip` nor `open-uri`, but the receiver of the paperclip file (in my case `Spree Commerce`). Check that you are assigning the paperclip object to the right object, and that it is ... |
11,015,858 | I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.
My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.
Some example code:
```
uri = "http://featherfiles.aviary.com/2... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11015858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166658/"
] | >
> Update – Paperclip can do this on its own!
>
>
> Posted by Aditya Sanghi (thanks a lot!):
>
>
>
> ```
> current_comments.pictures.create!(file: URI.parse(image_url))
>
> ```
>
> Although keep in mind, that you still need to handle 500, 404, etc
> errors (Paperclip can raise them).
>
>
>
Thanks to: <htt... | Yes, it is a problem but we can get around this with fancybox.
In the link tag(for image) add `:type => 'image'`
```
- @images.each do |image|
= link_to image_tag(image.attachment.url), image.attachment.url, class: "fancybox", type: 'image'
```
By specifying 'type', Fancybox overrides the type as image
<https:/... |
20,245,048 | i have a collection of records as follows
```
{
"_id":417,
"ptime":ISODate("2013-11-26T11:18:42.961Z"),
"p":{
"type":"1",
"txt":"test message"
},
"users":[
{
"uid":"52872ed59542f",
"pt":ISODate("2013-11-26T11:18:42.961Z")
},
{
"uid":"524eb460986e4",
"pt":ISODate(... | 2013/11/27 | [
"https://Stackoverflow.com/questions/20245048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928585/"
] | If you want to do such a sort, you probably want to store your data in a different way. MongoDB in generally is not near as good with manipulating nested documents as top level fields. In your case, I would recommend splitting out ptime, pt and uid into their own collection:
**messages**
```
{
"_id":417,
"pti... | ```
db.yourcollection.find(
{
users:{
$elemMatch:{uid:"52872ed59542f"}
}
}).sort({ptime:-1})
```
But you will have problems with order by pt field. You should use Aggregation Framework to project data or use Derick's approach. |
20,245,048 | i have a collection of records as follows
```
{
"_id":417,
"ptime":ISODate("2013-11-26T11:18:42.961Z"),
"p":{
"type":"1",
"txt":"test message"
},
"users":[
{
"uid":"52872ed59542f",
"pt":ISODate("2013-11-26T11:18:42.961Z")
},
{
"uid":"524eb460986e4",
"pt":ISODate(... | 2013/11/27 | [
"https://Stackoverflow.com/questions/20245048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928585/"
] | You can use the Aggregation Framework to sort by first ptime and then users.pt field as follows.
```
db.users.aggregate(
{$sort : {'ptime' : 1}},
{$unwind : "$users"},
{$match: {"users.uid" : "52872ed59542f"}},
{$sort : {'users.pt' : 1}},
{$group : {_id : {id : "$_id", "ptime" : "$ptime", "p" : "$p"}, users ... | ```
db.yourcollection.find(
{
users:{
$elemMatch:{uid:"52872ed59542f"}
}
}).sort({ptime:-1})
```
But you will have problems with order by pt field. You should use Aggregation Framework to project data or use Derick's approach. |
51,338,512 | I am having the error :
>
> "Could not resolve symbol itemActivity."
>
>
>
This is in a method I want to use to open another activity. I have created the activity and i tried putting the name in the MainActivity. But its giving me error This is unusual as i have tried most of the solutions provide in previous que... | 2018/07/14 | [
"https://Stackoverflow.com/questions/51338512",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10025700/"
] | You could build a new index via
```
index = 100 * pd.RangeIndex(start=1, stop=7)
```
and use it to reindex your DataFrame and fill the created NaN values with forwardfill.
```
df = df.reindex(index).fillna(method='ffill')
``` | Not sure whether that is any better than what you have at the moment but it leads to the desired output:
```
index_delta = df.index[-1] - df.index[-2]
max_index = 700
df2 = pd.DataFrame({'values': df.values[-1]}, index=range(df.index[-1], max_index + index_delta, index_delta))
print(pd.concat([df, df2]))
```
yiel... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | This is a function that I used.
Start and end are dates in Unix timestamp format. Interval is graph interval.
And keep in mind Binance did not exist in Dec 2015 :-)
```py
def get_klines_iter(symbol, interval, start, end, limit=5000):
df = pd.DataFrame()
startDate = end
while startDate>start:
url =... | based on Mike Malyi and isnvi23h4's answer:
Please use python >= 3.7, the code does not need to install any dependencies
```py
import pandas as pd
from datetime import datetime, timezone, timedelta
import calendar
def get_klines_iter(symbol, interval, start, end = None, limit=1000):
# start and end must be isofo... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | I am using this out of the binance documentation : <https://python-binance.readthedocs.io/en/latest/binance.html?highlight=get_historical_klines#binance.client.Client.get_historical_klines>
```
import os
from binance.client import Client
import pandas as pd
import datetime, time
def GetHistoricalData(self, howLong):
... | based on Mike Malyi and isnvi23h4's answer:
Please use python >= 3.7, the code does not need to install any dependencies
```py
import pandas as pd
from datetime import datetime, timezone, timedelta
import calendar
def get_klines_iter(symbol, interval, start, end = None, limit=1000):
# start and end must be isofo... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | This is a function that I used.
Start and end are dates in Unix timestamp format. Interval is graph interval.
And keep in mind Binance did not exist in Dec 2015 :-)
```py
def get_klines_iter(symbol, interval, start, end, limit=5000):
df = pd.DataFrame()
startDate = end
while startDate>start:
url =... | I do it like this:
```
def get_binance_data(api_key, pair, countdown='open', interval='4h', start='1 Jan 2018', end=None):
client = Client(api_key=api_key)
intervals = {
'15m': Client.KLINE_INTERVAL_15MINUTE,
'1h': Client.KLINE_INTERVAL_1HOUR,
'4h': Client.KLINE_INTERVAL_4HOUR,
'1d'... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | based on Mike Malyi and isnvi23h4's answer:
Please use python >= 3.7, the code does not need to install any dependencies
```py
import pandas as pd
from datetime import datetime, timezone, timedelta
import calendar
def get_klines_iter(symbol, interval, start, end = None, limit=1000):
# start and end must be isofo... | I do it like this:
```
def get_binance_data(api_key, pair, countdown='open', interval='4h', start='1 Jan 2018', end=None):
client = Client(api_key=api_key)
intervals = {
'15m': Client.KLINE_INTERVAL_15MINUTE,
'1h': Client.KLINE_INTERVAL_1HOUR,
'4h': Client.KLINE_INTERVAL_4HOUR,
'1d'... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | I am using this out of the binance documentation : <https://python-binance.readthedocs.io/en/latest/binance.html?highlight=get_historical_klines#binance.client.Client.get_historical_klines>
```
import os
from binance.client import Client
import pandas as pd
import datetime, time
def GetHistoricalData(self, howLong):
... | ```
import requests
market = 'ETHEUR'
tick_interval = '1d'
url = 'https://api.binance.com/api/v3/klines?symbol='+market+'&interval='+tick_interval
data = requests.get(url).json()
print(data)
``` |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | I am using this out of the binance documentation : <https://python-binance.readthedocs.io/en/latest/binance.html?highlight=get_historical_klines#binance.client.Client.get_historical_klines>
```
import os
from binance.client import Client
import pandas as pd
import datetime, time
def GetHistoricalData(self, howLong):
... | ```
from datetime import datetime
import pandas as pd
import requests
from typing import *
import time
class BinanceClient:
def __init__(self, futures=False):
self.exchange = "BINANCE"
self.futures = futures
if self.futures:
self._base_url = "https://fapi.binance.com"
e... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | I am using this out of the binance documentation : <https://python-binance.readthedocs.io/en/latest/binance.html?highlight=get_historical_klines#binance.client.Client.get_historical_klines>
```
import os
from binance.client import Client
import pandas as pd
import datetime, time
def GetHistoricalData(self, howLong):
... | I do it like this:
```
def get_binance_data(api_key, pair, countdown='open', interval='4h', start='1 Jan 2018', end=None):
client = Client(api_key=api_key)
intervals = {
'15m': Client.KLINE_INTERVAL_15MINUTE,
'1h': Client.KLINE_INTERVAL_1HOUR,
'4h': Client.KLINE_INTERVAL_4HOUR,
'1d'... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | This is a function that I used.
Start and end are dates in Unix timestamp format. Interval is graph interval.
And keep in mind Binance did not exist in Dec 2015 :-)
```py
def get_klines_iter(symbol, interval, start, end, limit=5000):
df = pd.DataFrame()
startDate = end
while startDate>start:
url =... | ```
from datetime import datetime
import pandas as pd
import requests
from typing import *
import time
class BinanceClient:
def __init__(self, futures=False):
self.exchange = "BINANCE"
self.futures = futures
if self.futures:
self._base_url = "https://fapi.binance.com"
e... |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | This is a function that I used.
Start and end are dates in Unix timestamp format. Interval is graph interval.
And keep in mind Binance did not exist in Dec 2015 :-)
```py
def get_klines_iter(symbol, interval, start, end, limit=5000):
df = pd.DataFrame()
startDate = end
while startDate>start:
url =... | ```
import requests
market = 'ETHEUR'
tick_interval = '1d'
url = 'https://api.binance.com/api/v3/klines?symbol='+market+'&interval='+tick_interval
data = requests.get(url).json()
print(data)
``` |
66,295,193 | I am new to web development and I don't know how to retrieve the content from 4 urls of the same website, I always get empty values. I am using flutter and the package [web\_scraper: ^0.0.8](https://github.com/tusharojha/web_scraper)
I need to retrieve titles, images, descriptions and urls from the site, the pages I w... | 2021/02/20 | [
"https://Stackoverflow.com/questions/66295193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9078384/"
] | ```
from datetime import datetime
import pandas as pd
import requests
from typing import *
import time
class BinanceClient:
def __init__(self, futures=False):
self.exchange = "BINANCE"
self.futures = futures
if self.futures:
self._base_url = "https://fapi.binance.com"
e... | ```
import requests
market = 'ETHEUR'
tick_interval = '1d'
url = 'https://api.binance.com/api/v3/klines?symbol='+market+'&interval='+tick_interval
data = requests.get(url).json()
print(data)
``` |
3,493,186 | I'm looking at a proof that in the last step states the following:
$$
\frac{1}{\varepsilon} \int\_{y\_{0}}^{y\_{0}+\varepsilon}\left[f\left(u\left(x\_{2}, y\right)\right)-f\left(u\left(x\_{1}, y\right)\right)\right] d y \rightarrow f\left(u\left(x\_{2}, y\_{0}\right)\right)-f\left(u\left(x\_{1}, y\_{0}\right)\right), ... | 2019/12/31 | [
"https://math.stackexchange.com/questions/3493186",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/606687/"
] | Let$$F(y)=\int\_{y\_0}^yf\bigl(u(x\_2,t)\bigr)-f\bigl(u(x\_1,t)\bigr)\,\mathrm dt.$$Then $F(y\_0)=0$ and therefore$$F'(y\_0)=\lim\_{\varepsilon\to0}\frac{F(y\_0+\varepsilon)}\varepsilon.$$But, by the Fundamental Theorem of Calculus,$$F'(y\_0)=f\bigl(u(x\_2,y\_0)\bigr)-f\bigl(u(x\_1,y\_0)\bigr).$$ | Perhaps one could present this problem as an exercise in applying the fundamental theorem of calculus. Nonetheless, it seems to me that using the fundamental theorem of calculus on this problem is a bit of overkill. You can do this pretty directly with the definition of the definite integral.
Let me denote $g(y) = f(u... |
39,584,234 | Is it possible to implement a function like this?
```
function GetRttiFromInterface(AIntf: IInterface; out RttiType: TRttiType): Boolean;
```
I have the following code (on Firemonkey Android):
```
// Get the FWeb field of AWebBrowser, then get FJWebBrowser field of FWeb.
function GetNativeBrowserIntf(AWebBrowser: T... | 2016/09/20 | [
"https://Stackoverflow.com/questions/39584234",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4933223/"
] | After look into the source code of `System.Rtti` and some tests , I finally get it work.
As far as I know, there are four possibities.
1.The interface is obtianed from OLE object. In this case, the cast `AIntf as Object` will throw an exception. The type is `IDispatch`, I can get it by
```
TRttiContext.Create.Ge... | What you are asking for is not straight-forward, but it is possible.
First, convert the interface parameter back to its implementation object. In Delphi 2010 and later, you can use the `as` operator for that purpose (for earlier versions, [this blog](http://hallvards.blogspot.com/2006/09/hack11-get-guid-of-interface-r... |
26,944,238 | I'm going to use two different log files in an application. the Log4j config file is this:
```
log4j.rootLogger= false
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File= D\:\\default.log
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.Append=true
log4j.appender.file.layout=o... | 2014/11/15 | [
"https://Stackoverflow.com/questions/26944238",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2333459/"
] | try something like this:
```
echo "<pre>" . print_r($resolution, true) . "</pre>";
``` | For debuging purpuses you should use
```
var_dump($resolution);
```
If you want to use it
```
foreach ($resolution as $r => $ids){
echo "Resolution : $r\n";
foreach ($ids as $id) {
echo "$id\n";
}
}
``` |
12,567,177 | Is there a way to REMOVE a DIV of the master page? not hide, there are some hyperlinks in the div, so I want to remove them from the code as well. thanks | 2012/09/24 | [
"https://Stackoverflow.com/questions/12567177",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1202242/"
] | Hierarchical model–view–controller (HMVC) is a software architectural pattern, a variation of Model–view–controller (MVC) similar to Presentation-abstraction-control (PAC),[more info in wiki](http://en.wikipedia.org/wiki/HMVC)
I hope you have enjoyed [this tutorial](http://net.tutsplus.com/tutorials/php/hvmc-an-intr... | I suggest you use links placed in the directory you desire pointing to the folders in the application folder. I wouldn't recommend moving those folders out of the application folder.
Cheers. |
3,523,445 | the problem at hand is:
Prove that there is an irrational number $a$ such that $a{^\sqrt{3}}$ is rational.
Hint: Consider $\sqrt[3]{2}^\sqrt{3}$ and argue by cases.
Any help on this problem would be greatly appreciated! | 2020/01/26 | [
"https://math.stackexchange.com/questions/3523445",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/745223/"
] | Hint:
If $\sqrt[3]{2}^{\sqrt{3}}$ is rational, you are done. If it is irrational, then what is $\left(\sqrt[3]{2}^{\sqrt{3}}\right)^{\sqrt{3}}$? | Another approach is to compare the cardinalities of the rational numbers and irrational numbers. Assume $f(x)=x^{\sqrt{3}}$ is rational for every irrational number $x$ and define
$$A=\mathbb{R}^{+}-\mathbb{Q}\text{ (positive irrational numbers)}$$
$$B=\{r:f(x)=r\text{ for some }x\in A\}$$
Note that by our assumption... |
3,523,445 | the problem at hand is:
Prove that there is an irrational number $a$ such that $a{^\sqrt{3}}$ is rational.
Hint: Consider $\sqrt[3]{2}^\sqrt{3}$ and argue by cases.
Any help on this problem would be greatly appreciated! | 2020/01/26 | [
"https://math.stackexchange.com/questions/3523445",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/745223/"
] | $\alpha=\sqrt[3]{2}^{\sqrt{3}}$ is trascendental (hence irrational) by the [Gelfond-Schneider theorem](https://en.wikipedia.org/wiki/Gelfond%E2%80%93Schneider_theorem), hence $\alpha^{\sqrt{3}}=2$ proves the statement, but a simple dichotomy is sufficient to answer the question. If $\alpha=\sqrt[3]{2}^{\sqrt{3}}$ is ra... | Another approach is to compare the cardinalities of the rational numbers and irrational numbers. Assume $f(x)=x^{\sqrt{3}}$ is rational for every irrational number $x$ and define
$$A=\mathbb{R}^{+}-\mathbb{Q}\text{ (positive irrational numbers)}$$
$$B=\{r:f(x)=r\text{ for some }x\in A\}$$
Note that by our assumption... |
26,138,134 | this is my code
```
TimeZone timeZone = TimeZone.getTimeZone("UTC");
Calendar calendar = Calendar.getInstance(timeZone);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.set(Calendar.HOUR_OF_DAY, 0);
Timestamp start = new T... | 2014/10/01 | [
"https://Stackoverflow.com/questions/26138134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/454099/"
] | Once you call `Calendar.getTime()` you get a `Date` object which is an instant in time which has **no timezone info**.
When you want to print or present this instance, the formatter will use the default time zone if not explicitly specified, which in your case is not UTC but maybe CET.
When you convert this instant t... | I guest icza is right.
To be sure, try this :
```
Timestamp start = new Timestamp(calendar.getTime().getTime());
System.out.println(start.getTimezoneOffset());
``` |
1,430,644 | Are there short, common, and intuitive notations for intervals of real and natural numbers that explicitly use $\mathbb R$ and $\mathbb N$ as basis of their notation?
The main purpose of the notation is denote and distinguish between discrete and continuous intervals.
Currently, based on the following [notation examp... | 2015/09/11 | [
"https://math.stackexchange.com/questions/1430644",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/269191/"
] | In my document, I now use the following notations and conventions.
1. I use $[1,w]$ for real numbered intervals and $\{1,2,...,w\}$ for integer intervals.
2. If I reuse a specific interval several times, I introduce and name it once, e.g., as $\mathbb{N}\_w=\{1,2,...,w\}$, and then refer to it using its name, e.g., $\... | My currently preferred notations are listed below. However I have not understood your general problem yet, which might deserve a new notation.
>
> $$ \mathbb{R}^{>a}=\{x\in\mathbb{R} \mid x>a\} $$
>
>
>
$(a, \infty)$
>
> $$ \mathbb{R}^{\neq a}=\{x\in\mathbb{R} \mid x\neq a\} $$
>
>
>
$\mathbb{R} \setminus \... |
1,430,644 | Are there short, common, and intuitive notations for intervals of real and natural numbers that explicitly use $\mathbb R$ and $\mathbb N$ as basis of their notation?
The main purpose of the notation is denote and distinguish between discrete and continuous intervals.
Currently, based on the following [notation examp... | 2015/09/11 | [
"https://math.stackexchange.com/questions/1430644",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/269191/"
] | In my document, I now use the following notations and conventions.
1. I use $[1,w]$ for real numbered intervals and $\{1,2,...,w\}$ for integer intervals.
2. If I reuse a specific interval several times, I introduce and name it once, e.g., as $\mathbb{N}\_w=\{1,2,...,w\}$, and then refer to it using its name, e.g., $\... | I see sometimes $[\![1,n]\!]$ instead of $\{1,\dots,n\}.$ |
8,230,380 | I have a function that shows a menu when clicking on it, and I want it to disappear after 5 seconds. This is my javascript - it works properly on desktop browser but it doesn't disappear on the mobile ones.
```
$(function() {
$('#prod_btn').click(function() {
$(this).addClass('selected').next('ul').css('di... | 2011/11/22 | [
"https://Stackoverflow.com/questions/8230380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577614/"
] | I've just had the same problem. My code is running great in any browser on my Mac, but on iOs devices it doesn't work.
I use ".bind(this)" on my timeout function and that is what is causing the problem for me.
When I extend the function object with ".bind" in my script it works like a charm.
My code is something like... | I moved your example to a jsbin, and it's working on my iphone 4.
Please test it out going here from your devices: <http://jsbin.com/asihac/5>
You can see the code here <http://jsbin.com/asihac/5/edit>
The example is using jQuery - latest and I only added the required css class. |
8,230,380 | I have a function that shows a menu when clicking on it, and I want it to disappear after 5 seconds. This is my javascript - it works properly on desktop browser but it doesn't disappear on the mobile ones.
```
$(function() {
$('#prod_btn').click(function() {
$(this).addClass('selected').next('ul').css('di... | 2011/11/22 | [
"https://Stackoverflow.com/questions/8230380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577614/"
] | I moved your example to a jsbin, and it's working on my iphone 4.
Please test it out going here from your devices: <http://jsbin.com/asihac/5>
You can see the code here <http://jsbin.com/asihac/5/edit>
The example is using jQuery - latest and I only added the required css class. | Keep in mind also that any setTimeout function is actually likely fire while DOM elements are rendering if the delay is set to a value too short. While that might seem obvious, it can be easily confused with no method firing whatsoever. A good way to test is to have an alert prompt run.
```
window.onLoad(alert("hey!")... |
8,230,380 | I have a function that shows a menu when clicking on it, and I want it to disappear after 5 seconds. This is my javascript - it works properly on desktop browser but it doesn't disappear on the mobile ones.
```
$(function() {
$('#prod_btn').click(function() {
$(this).addClass('selected').next('ul').css('di... | 2011/11/22 | [
"https://Stackoverflow.com/questions/8230380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577614/"
] | I've just had the same problem. My code is running great in any browser on my Mac, but on iOs devices it doesn't work.
I use ".bind(this)" on my timeout function and that is what is causing the problem for me.
When I extend the function object with ".bind" in my script it works like a charm.
My code is something like... | this doesn't apply to your code, but a common problem with long-running scripts failing on iOS devices is that MobileSafari kills a javascript thread after 10 seconds have elapsed. you *should* be able to use setTimeout and/or setInterval to work around this, or you can avoid it by making a shortcut to it and thereby r... |
8,230,380 | I have a function that shows a menu when clicking on it, and I want it to disappear after 5 seconds. This is my javascript - it works properly on desktop browser but it doesn't disappear on the mobile ones.
```
$(function() {
$('#prod_btn').click(function() {
$(this).addClass('selected').next('ul').css('di... | 2011/11/22 | [
"https://Stackoverflow.com/questions/8230380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577614/"
] | I've just had the same problem. My code is running great in any browser on my Mac, but on iOs devices it doesn't work.
I use ".bind(this)" on my timeout function and that is what is causing the problem for me.
When I extend the function object with ".bind" in my script it works like a charm.
My code is something like... | Keep in mind also that any setTimeout function is actually likely fire while DOM elements are rendering if the delay is set to a value too short. While that might seem obvious, it can be easily confused with no method firing whatsoever. A good way to test is to have an alert prompt run.
```
window.onLoad(alert("hey!")... |
8,230,380 | I have a function that shows a menu when clicking on it, and I want it to disappear after 5 seconds. This is my javascript - it works properly on desktop browser but it doesn't disappear on the mobile ones.
```
$(function() {
$('#prod_btn').click(function() {
$(this).addClass('selected').next('ul').css('di... | 2011/11/22 | [
"https://Stackoverflow.com/questions/8230380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/577614/"
] | this doesn't apply to your code, but a common problem with long-running scripts failing on iOS devices is that MobileSafari kills a javascript thread after 10 seconds have elapsed. you *should* be able to use setTimeout and/or setInterval to work around this, or you can avoid it by making a shortcut to it and thereby r... | Keep in mind also that any setTimeout function is actually likely fire while DOM elements are rendering if the delay is set to a value too short. While that might seem obvious, it can be easily confused with no method firing whatsoever. A good way to test is to have an alert prompt run.
```
window.onLoad(alert("hey!")... |
42,609 | >
> The prime factors of 13195 are 5, 7, 13 and 29.
>
>
> What is the largest prime factor of the number 600851475143 ?
>
>
>
I wrote the following code with help of some Java 8, I'll explain the equivalent to Java 7 under the code. I'd like general comments. One note to give up ahead is that I did not write a p... | 2014/02/23 | [
"https://codereview.stackexchange.com/questions/42609",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/32231/"
] | Actually, your iterator is two iterators - one for the known primes (from previous 'warmups'), and one for unknown primes. Your known prime iterator's choice of implementation looks a bit cumbersome - you could have used a simple list of `Long`, and iterate over it:
```
private final static List<Long> KNOWN_PRIMES = n... | Some general observations.
* I agree with Uri that your use of the custom Linked-List is cumbersome. It also leads you to have redundant code, like you have an unused 'previous' node... Uri is right to syggest a List for this, but I would recommend an ArrayList as it will be faster (because it will use half the memory... |
42,609 | >
> The prime factors of 13195 are 5, 7, 13 and 29.
>
>
> What is the largest prime factor of the number 600851475143 ?
>
>
>
I wrote the following code with help of some Java 8, I'll explain the equivalent to Java 7 under the code. I'd like general comments. One note to give up ahead is that I did not write a p... | 2014/02/23 | [
"https://codereview.stackexchange.com/questions/42609",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/32231/"
] | Actually, your iterator is two iterators - one for the known primes (from previous 'warmups'), and one for unknown primes. Your known prime iterator's choice of implementation looks a bit cumbersome - you could have used a simple list of `Long`, and iterate over it:
```
private final static List<Long> KNOWN_PRIMES = n... | A few comments:
* I agree that using a custom implementation of a LinkedList without a need to is a bad practice.
* Public mutable fields are bad.
* It is considered pedantic to add final to arguments.
* I don't like your method of generating primes. You check if a number is prime by iterating over all smaller primes.... |
42,609 | >
> The prime factors of 13195 are 5, 7, 13 and 29.
>
>
> What is the largest prime factor of the number 600851475143 ?
>
>
>
I wrote the following code with help of some Java 8, I'll explain the equivalent to Java 7 under the code. I'd like general comments. One note to give up ahead is that I did not write a p... | 2014/02/23 | [
"https://codereview.stackexchange.com/questions/42609",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/32231/"
] | Some general observations.
* I agree with Uri that your use of the custom Linked-List is cumbersome. It also leads you to have redundant code, like you have an unused 'previous' node... Uri is right to syggest a List for this, but I would recommend an ArrayList as it will be faster (because it will use half the memory... | A few comments:
* I agree that using a custom implementation of a LinkedList without a need to is a bad practice.
* Public mutable fields are bad.
* It is considered pedantic to add final to arguments.
* I don't like your method of generating primes. You check if a number is prime by iterating over all smaller primes.... |
8,031,994 | Command completion in `bash(1)` is quite handy; I like this feature very much. But I have a question.
For example, we all have `Documents` and `Downloads` in `$HOME` directory.
So if I input `cd ~` and then press `TAB`, then it will traverse all the directory under `$HOME`. When `Documents` come up and the shell now ... | 2011/11/07 | [
"https://Stackoverflow.com/questions/8031994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674199/"
] | You could switch your shell to ZShell, which allows you to tab through directories without typing the first letter.
For example, you can type
```
cd ~/
```
Pressing `TAB` will bring up a list of all subfolders (like in bash), but pressing `TAB` multiple times will allow you to cycle through the subfolders. Pressing... | If you don't know what is in the directory, just press `TAB` one more time. |
8,031,994 | Command completion in `bash(1)` is quite handy; I like this feature very much. But I have a question.
For example, we all have `Documents` and `Downloads` in `$HOME` directory.
So if I input `cd ~` and then press `TAB`, then it will traverse all the directory under `$HOME`. When `Documents` come up and the shell now ... | 2011/11/07 | [
"https://Stackoverflow.com/questions/8031994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674199/"
] | You could switch your shell to ZShell, which allows you to tab through directories without typing the first letter.
For example, you can type
```
cd ~/
```
Pressing `TAB` will bring up a list of all subfolders (like in bash), but pressing `TAB` multiple times will allow you to cycle through the subfolders. Pressing... | Like the Jack Toole's zsh suggestion (which is a perfectly fine shell), if you have to use bash, you can stick this in your .bashrc for the same "continue to hit `tab` cycle through possibilities" feature:
```
test -n "$PS1" && bind TAB:menu-complete
```
There's also a project called [bash-completion](https://alioth... |
8,031,994 | Command completion in `bash(1)` is quite handy; I like this feature very much. But I have a question.
For example, we all have `Documents` and `Downloads` in `$HOME` directory.
So if I input `cd ~` and then press `TAB`, then it will traverse all the directory under `$HOME`. When `Documents` come up and the shell now ... | 2011/11/07 | [
"https://Stackoverflow.com/questions/8031994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/674199/"
] | Like the Jack Toole's zsh suggestion (which is a perfectly fine shell), if you have to use bash, you can stick this in your .bashrc for the same "continue to hit `tab` cycle through possibilities" feature:
```
test -n "$PS1" && bind TAB:menu-complete
```
There's also a project called [bash-completion](https://alioth... | If you don't know what is in the directory, just press `TAB` one more time. |
39,507,004 | [Serverless-1.0.0-rc.1](https://github.com/serverless/serverless) enables to deploy an API to be accessible via a AWS API Gateway.
The question: I need the deployed API exposed via a custom domain with SSL certificate instead of the randomly assigned one (URL `https://qwertylgbtqert.execute-api....`)?
Can that be d... | 2016/09/15 | [
"https://Stackoverflow.com/questions/39507004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/201644/"
] | You need to create the custom domain first and upload the certificates. This should not be part of this code or your deployment of this piece of software.
After you have a custom domain you need to think in terms of CloudFormation.
Like with everything else in Serverless Framework; you can leverage CloudFormation tem... | I think this topic deserves an update, so I will give it a try. Be sure to first create a certificate with Certificate Manager. Then be sure your "serverless user" has the right admin permissions to modify Route53 record sets. Then add the following to your serverless.yaml:
```
custom:
customDomain:
domainName: ... |
358,523 | Suppose i have a file with many words, i want to find only the first word with the pattern "xyz". How do I do it if there are multiple words with this pattern on the same line?
`-m` returns all the words in the first line in which it matches. I need only grep command. | 2017/04/12 | [
"https://unix.stackexchange.com/questions/358523",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/226580/"
] | By default `grep` prints the **lines** matching a pattern, so if the pattern appears one or more times into a line, `grep` will print that whole line.
Adding the flag `-m 7` will tell `grep` to print only the first 7 lines where the pattern appears.
So this should do what you want (I haven't tested it):
```
grep -o... | The answer to your question is in the grep man page:
```
grep -m1 'searchstring' file_name
```
The `-m<number>` option is the key. `-m1` will only show the first match, `-m2` the first 2 occurrences and so on. |
57,396,048 | I've been following this tutorial on how to create a backend service for my xamarin application:
<https://learn.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-xamarin-forms-get-started>
I have managed to create the Web App Service and have connected it to my Azure SQL database and have successfully in... | 2019/08/07 | [
"https://Stackoverflow.com/questions/57396048",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10972703/"
] | Your app seems to be connected to master.
```
CREATE TABLE permission denied in database 'master'
```
Add database name to connection string.
```
Server=myServerAddress;Database=myDataBase;User Id=myUsername;
``` | Edit your Azure SQL DB create permission for this app service. |
16,264,160 | I have an [Octopress](http://octopress.org) blog that I host on Heroku using [jgarber's custom buildpack](https://github.com/jgarber/heroku-buildpack-ruby-octopress). I had things working fairly well as long as I stuck with [`rdiscount`](https://github.com/rtomayko/rdiscount), but I recently decided to switch to [`kram... | 2013/04/28 | [
"https://Stackoverflow.com/questions/16264160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4203/"
] | You should use `this.GetType()`. That will provide you with the *actual* concrete type of the instance.
So in this case:
```
public virtual object GetAttributeValue<T>(string propertyName) where T : Attribute {
var attribute = this.GetType().GetCustomAttribute(typeof(T));
return attribute != null ? attribute.... | `typeof(this)` won't compile.
What you're searching for is `this.GetType()`. |
36,348,719 | Im a newbie to android. i want to create an application that sends the user1 location to the user2 using ServerSocket.
```
public class ToMain extends Activity {
TextView info, infoip, msg;
String message ="";
ServerSocket serverSocket;
String s="",t="";
public Double b,c;
public int i;
... | 2016/04/01 | [
"https://Stackoverflow.com/questions/36348719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6111490/"
] | Pass data through intents.
```
Intent data = new Intent(this,SecondActivity.class);
data.putExtra("keyA",a);
data.putExtra("keyB",b);
startActivity(data);
In second activity in onCreate()
Intent intent = getIntent();
Double a = intent.getDoubleExtra("keyA",0);
Double b = intent.getDoubleExtra("keyB",0);
``` | To pass data from one Activity to another, you can use Extras in Intent.
```
Intent intent = new Intent("ACTIVITY_INTENT");
intent.putExtra("selection", position);
startActivity(intent);
```
You can send Binary, Text and multiple pieces as listed here,
<http://developer.android.com/training/sharing/send.html>
To ... |
36,348,719 | Im a newbie to android. i want to create an application that sends the user1 location to the user2 using ServerSocket.
```
public class ToMain extends Activity {
TextView info, infoip, msg;
String message ="";
ServerSocket serverSocket;
String s="",t="";
public Double b,c;
public int i;
... | 2016/04/01 | [
"https://Stackoverflow.com/questions/36348719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6111490/"
] | Pass data through intents.
```
Intent data = new Intent(this,SecondActivity.class);
data.putExtra("keyA",a);
data.putExtra("keyB",b);
startActivity(data);
In second activity in onCreate()
Intent intent = getIntent();
Double a = intent.getDoubleExtra("keyA",0);
Double b = intent.getDoubleExtra("keyB",0);
``` | **Use Intent to pass data from one activity to another activity**
```
Intent intent = new Intent(this,SecondActivity.class);
intent .putExtra("key1",value);
intent .putExtra("key2",value);
startActivity(intent );
```
**In second activity in onCreate()**
```
Intent intent = getIntent();
Double a = intent.getDoub... |
36,348,719 | Im a newbie to android. i want to create an application that sends the user1 location to the user2 using ServerSocket.
```
public class ToMain extends Activity {
TextView info, infoip, msg;
String message ="";
ServerSocket serverSocket;
String s="",t="";
public Double b,c;
public int i;
... | 2016/04/01 | [
"https://Stackoverflow.com/questions/36348719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6111490/"
] | Pass data through intents.
```
Intent data = new Intent(this,SecondActivity.class);
data.putExtra("keyA",a);
data.putExtra("keyB",b);
startActivity(data);
In second activity in onCreate()
Intent intent = getIntent();
Double a = intent.getDoubleExtra("keyA",0);
Double b = intent.getDoubleExtra("keyB",0);
``` | In Android user interface is displayed through an activity. Activity is used to represent the data to user and allows user interaction. In an android application, we can have multiple activities and that can interact with each other. During activity interaction we might required to pass data from one activity to other.... |
311,492 | * imagine a server application that listens on localhost only,
* that has no settings to listen on other interfaces
* one wants to force make it listen on other interfaces such as eth0
[bindp](https://github.com/yongboy/bindp) (libindp.so) can do that. However, it is not available from Debian repositories, which makes... | 2016/09/22 | [
"https://unix.stackexchange.com/questions/311492",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/49297/"
] | This has been asked a dozen of times already and an acceptable answer is to use iptables:
```
sysctl -w net.ipv4.conf.all.route_localnet=1
iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to 127.0.0.1:8080
```
The first command is to allow redirections from the external network to the internal network (whi... | [socat](http://www.dest-unreach.org/socat/) tool ([Debian package](https://packages.debian.org/jessie/socat)) can help:
```
socat -d -d TCP4-LISTEN:80,bind=192.168.1.1,fork TCP4:localhost:80
``` |
311,492 | * imagine a server application that listens on localhost only,
* that has no settings to listen on other interfaces
* one wants to force make it listen on other interfaces such as eth0
[bindp](https://github.com/yongboy/bindp) (libindp.so) can do that. However, it is not available from Debian repositories, which makes... | 2016/09/22 | [
"https://unix.stackexchange.com/questions/311492",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/49297/"
] | [socat](http://www.dest-unreach.org/socat/) tool ([Debian package](https://packages.debian.org/jessie/socat)) can help:
```
socat -d -d TCP4-LISTEN:80,bind=192.168.1.1,fork TCP4:localhost:80
``` | With IPv6 the [iptables solution won't work](https://serverfault.com/questions/975558/nftables-ip6-route-to-localhost-ipv6-nat-to-loopback).
You can use @Artem's solution instead, like
```
sudo socat TCP6-LISTEN:80,bind=[2001::beef],fork TCP6:[2001::beef]:8080
``` |
311,492 | * imagine a server application that listens on localhost only,
* that has no settings to listen on other interfaces
* one wants to force make it listen on other interfaces such as eth0
[bindp](https://github.com/yongboy/bindp) (libindp.so) can do that. However, it is not available from Debian repositories, which makes... | 2016/09/22 | [
"https://unix.stackexchange.com/questions/311492",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/49297/"
] | This has been asked a dozen of times already and an acceptable answer is to use iptables:
```
sysctl -w net.ipv4.conf.all.route_localnet=1
iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to 127.0.0.1:8080
```
The first command is to allow redirections from the external network to the internal network (whi... | With IPv6 the [iptables solution won't work](https://serverfault.com/questions/975558/nftables-ip6-route-to-localhost-ipv6-nat-to-loopback).
You can use @Artem's solution instead, like
```
sudo socat TCP6-LISTEN:80,bind=[2001::beef],fork TCP6:[2001::beef]:8080
``` |
39,751,209 | I am using the query below which gives me all reports and its Excel Format ID
for example 1=Excel 2007, 2=XLSX, 3=CSV
```
SELECT Reportname AS 'ReportName', Excelformatid AS 'Excel Format' FROM reports;
```
Is it possible to get the actual format instead of the ID, in the output?
I went through the below link, but... | 2016/09/28 | [
"https://Stackoverflow.com/questions/39751209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5374725/"
] | You can use a `CASE` statement
```
SELECT
Reportname AS 'ReportName',
CASE
WHEN Excelformatid = 1 THEN 'Excel 2007'
WHEN Excelformatid = 2 THEN 'XLSX'
WHEN Excelformatid = 3 THEN 'CSV'
END CASE AS 'Excel Format'
FROM
reports
```
See [here](https://dev.mysql.com/doc/refman/5.7/... | Try:
```
SELECT
Reportname AS 'ReportName',
CASE
WHEN Excelformatid = '1' THEN 'Excel 2007'
WHEN Excelformatid = '2' THEN 'XLSX'
WHEN Excelformatid = '3' THEN 'CSV'
END AS 'Formate Not Available'
FROM
reports
```
Also You can make masterformat table and join with reports which give you dynamic r... |
39,751,209 | I am using the query below which gives me all reports and its Excel Format ID
for example 1=Excel 2007, 2=XLSX, 3=CSV
```
SELECT Reportname AS 'ReportName', Excelformatid AS 'Excel Format' FROM reports;
```
Is it possible to get the actual format instead of the ID, in the output?
I went through the below link, but... | 2016/09/28 | [
"https://Stackoverflow.com/questions/39751209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5374725/"
] | The easiest way would be to make a lookup table and do a join, but if you don't have that available a [CASE](https://dev.mysql.com/doc/refman/5.7/en/case.html) will do the trick.
```
SELECT
Reportname AS 'ReportName',
CASE Excelformatid
WHEN 1 THEN 'Excel 2007'
WHEN 2 THEN 'XLSX'
WHEN... | Try:
```
SELECT
Reportname AS 'ReportName',
CASE
WHEN Excelformatid = '1' THEN 'Excel 2007'
WHEN Excelformatid = '2' THEN 'XLSX'
WHEN Excelformatid = '3' THEN 'CSV'
END AS 'Formate Not Available'
FROM
reports
```
Also You can make masterformat table and join with reports which give you dynamic r... |
57,268,689 | I am using NextJS with Material UI and Apollo. Although, everything is working properly but the warning is not going. It seems to me that a lot of Material UI components are using **useLayoutEffect** which is warned by React. The error is below.
>
> Warning: useLayoutEffect does nothing on the server, because its eff... | 2019/07/30 | [
"https://Stackoverflow.com/questions/57268689",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2060913/"
] | The problem is solved. I was suspecting it occurred for Material UI but it is actually happening for Apollo. I am posting the solution here to let others know.
in Apollo configuration file I needed to say the application is using Server Side Rendering. Please check the code below. If you are not using TypeScript then ... | I had the same problem using jest, enzyme and Material UI, but I was not using Apollo. If you encounter this problem using Material UI, a simple work around is to add to your test config file (src/setupTests.js) the following:
```js
import React from 'react';
React.useLayoutEffect = React.useEffect;
```
Sources: [h... |
64,928,545 | So I am making a bot, and I wanted to make a cool little feature I rarely or almost never see on bots for "userinfo" command.
I am currently stuck on activities/game information. I have already made a map for all activities user has, in case user has more than one activities.
For example:
User has both Custom Status ... | 2020/11/20 | [
"https://Stackoverflow.com/questions/64928545",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11980154/"
] | As I know, the `.state` and `.name` are both working.
Actually, I tried them and it works with
```
console.log(message.member.user.presence.activities[0].state)
``` | ### Game
The Game class was removed in favor of the Activity class to be consistent with the API. It is also an **array of multiple Activities** since a user can have multiple.
As per the docs for v12, it is an array, you will need to either run a foreach on the activities or grab the first one.
A foreach:
```js
us... |
1,349,580 | In John Lee's book *Riemannian Manifolds*, a **covering transformation** (or deck transformation) of a smooth covering map $\pi:\tilde{M}\to M$ (of connected smooth manifolds) is defined to be a smooth map $\varphi:\tilde{M}\to\tilde{M}$ such that $\pi\circ\varphi=\pi$.
I was expecting that the definition includes the... | 2015/07/04 | [
"https://math.stackexchange.com/questions/1349580",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/252458/"
] | This is a mistake -- I should have written that a deck transformation is a *diffeomorphism* satisfying $\renewcommand\phi{\varphi}\pi\circ\varphi = \pi$. I've added this to my [online correction list](http://www.math.washington.edu/~lee/Books/riemannian.html). (It's amazing that nobody has noticed this in the 18 years ... | I thought the following was all true and perfectly standard just for topological covering maps $\pi$: If we say a deck transformation is just a continuous $\phi$ with $\pi\circ\phi=\pi$ then the deck transformations form a group, and in particular each one is bijective.
(Right? Say $\phi(p)=q$. You can certainly find ... |
51,578,062 | Just for the sake of learning this, I'm trying to grasp how to use [HLE prefixes](https://www.felixcloutier.com/x86/XACQUIRE:XRELEASE.html) `XACQUIRE` and `XRELEASE`. After reading the Intel documentation, my understanding was that after executing an instruction with the `XACQUIRE` prefix the CPU enters into some sort ... | 2018/07/29 | [
"https://Stackoverflow.com/questions/51578062",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3170929/"
] | You can answer your own questions, can't you?
Anyway. I think I got it. I'll try to stick with plain English, or go with how I understand it. Feel free to edit it out if I make an incorrect statement. (By the way, `Hardware Lock Elision`, what a cool name. Sounds like some Matt Damon movie. I even had to Google word ... | You say your CPU is a Haswell.
TSX (HLE and RTM) was disabled by a microcode update for all Haswell CPUs. You're running Windows, so we can safely assume that your system uses up-to-date microcode automatically. (You don't have to flash your BIOS; the OS can install updated CPU microcode on every boot.)
See [Which CP... |
594,236 | The scalar product in special relativity is given by
\begin{equation}
V \cdot W = V^{\mu} g\_{ \mu \nu} W^{\nu}
\end{equation}
and the components of the vectors $V^{\mu}$ and $W^{\nu}$. With the metric
\begin{equation}
\eta\_{ \mu \nu} = \mathrm{diag} (-1,1,1,1)
\end{equation}
if we using Cartesian coordinates.
a)... | 2020/11/16 | [
"https://physics.stackexchange.com/questions/594236",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/205112/"
] | a) Yes, this equation is valid even when we are in a coordinate system in which the metric is not the Minkowski metric. In fact, since the inner product of two vectors is a scalar (and thus, a coordinate *invariant* quantity) you will get exactly the same valued in a different coordinate system.
---
b) You have to be... | As Charlie explained, one way to treat Minkowski spacetime is as manifold, which is what one does when he computes metric components as function of coordinates or when one uses the transformation formula
$$V'^\mu=\frac{\partial x'^\mu}{\partial x^\nu}V^\nu.$$
Another way is to treat it as *affine space*, which is what... |
32,719,680 | My Spring Boot test configuration is as follows:
```
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {TestEnd2EndIntegrationConfiguration.class})
@WebAppConfiguration
@ActiveProfiles(Profiles.TEST)//=="test"
@Transactional
public abstract class AbstractEnd2EndIntegrationTest {
}
```... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32719680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/536299/"
] | You need 3 things to get your properties to be autowired in your integration test classes:
1. The `PropertySource` annotation. It looks like you're missing that.
You can add something like this to your Abstract Integration Test class:
```
@PropertySource(value= {"classpath:*.properties"})
```
2. The property file ... | I believe you should use `spring.jpa.hibernate.dll-auto` if you want to place your Hibernate properties in `application-${profile}.properties`, i.e. Spring properties file.
Likewise, `spring.jpa.database-platform=org.hibernate.dialect.H2Dialect` should be used.
I use Spring Boot with such configuration and I never ha... |
32,719,680 | My Spring Boot test configuration is as follows:
```
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {TestEnd2EndIntegrationConfiguration.class})
@WebAppConfiguration
@ActiveProfiles(Profiles.TEST)//=="test"
@Transactional
public abstract class AbstractEnd2EndIntegrationTest {
}
```... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32719680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/536299/"
] | The issue was actually with the following line of code:
```
@SpringApplicationConfiguration(classes = {TestEnd2EndIntegrationConfiguration.class})
```
`TestEnd2EndIntegrationConfiguration` is not a Spring Boot Application with a main and most importantly it is not annotated with a `@EnableAutoConfiguration` annotati... | You need 3 things to get your properties to be autowired in your integration test classes:
1. The `PropertySource` annotation. It looks like you're missing that.
You can add something like this to your Abstract Integration Test class:
```
@PropertySource(value= {"classpath:*.properties"})
```
2. The property file ... |
32,719,680 | My Spring Boot test configuration is as follows:
```
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {TestEnd2EndIntegrationConfiguration.class})
@WebAppConfiguration
@ActiveProfiles(Profiles.TEST)//=="test"
@Transactional
public abstract class AbstractEnd2EndIntegrationTest {
}
```... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32719680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/536299/"
] | The issue was actually with the following line of code:
```
@SpringApplicationConfiguration(classes = {TestEnd2EndIntegrationConfiguration.class})
```
`TestEnd2EndIntegrationConfiguration` is not a Spring Boot Application with a main and most importantly it is not annotated with a `@EnableAutoConfiguration` annotati... | I believe you should use `spring.jpa.hibernate.dll-auto` if you want to place your Hibernate properties in `application-${profile}.properties`, i.e. Spring properties file.
Likewise, `spring.jpa.database-platform=org.hibernate.dialect.H2Dialect` should be used.
I use Spring Boot with such configuration and I never ha... |
45,086,384 | This question is asked many time here but i am not getting the proper output as i am expecting:
I have a table in which i need to concatenate columns but i don't want NULL value in it. I want it in sql server 2008 concate function does not work in 2008.
Example:
OrderTable
```
Customer_Number order1 order2 ord... | 2017/07/13 | [
"https://Stackoverflow.com/questions/45086384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2455193/"
] | **Example**
```
Declare @YourTable Table ([Customer_Number] varchar(50),[order1] varchar(50),[order2] varchar(50),[order3] varchar(50),[order4] varchar(50))
Insert Into @YourTable Values
(1,NULL,'X','Y',NULL)
,(2,NULL,'A','B',NULL)
,(3,'V',NULL,'H',NULL)
Select Customer_Number
,[Order] = IsNull(stuff(
... | This is a bit unpleasant, it needs to be in a subquery to remove the trailing comma efficiently (though you could use a CTE):
```
SELECT
Customer_number,
SUBSTRING([Order], 0, LEN([Order])) AS [Order]
FROM(
SELECT
Customer_number,
COALESCE(order1+',', '') +
COALESCE(order2+',', '... |
45,086,384 | This question is asked many time here but i am not getting the proper output as i am expecting:
I have a table in which i need to concatenate columns but i don't want NULL value in it. I want it in sql server 2008 concate function does not work in 2008.
Example:
OrderTable
```
Customer_Number order1 order2 ord... | 2017/07/13 | [
"https://Stackoverflow.com/questions/45086384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2455193/"
] | **Example**
```
Declare @YourTable Table ([Customer_Number] varchar(50),[order1] varchar(50),[order2] varchar(50),[order3] varchar(50),[order4] varchar(50))
Insert Into @YourTable Values
(1,NULL,'X','Y',NULL)
,(2,NULL,'A','B',NULL)
,(3,'V',NULL,'H',NULL)
Select Customer_Number
,[Order] = IsNull(stuff(
... | You were on the right track with the Coalesce, or IsNull. Instead of trying to track the length and use substring, left or stuff, I just used a replace to remove the trailing comma that would show up from the coalesce.
```
Select Customer_number,
Replace(
Coalesce(Order1 + ',','')+
Coalesce(Order2... |
45,086,384 | This question is asked many time here but i am not getting the proper output as i am expecting:
I have a table in which i need to concatenate columns but i don't want NULL value in it. I want it in sql server 2008 concate function does not work in 2008.
Example:
OrderTable
```
Customer_Number order1 order2 ord... | 2017/07/13 | [
"https://Stackoverflow.com/questions/45086384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2455193/"
] | Another variation, for fun and profit, demonstrating the `FOR XML` trick to concatenate values pre-SQL Server 2012.
```
SELECT Customer_Number, STUFF(
(SELECT ',' + order1, ',' + order2, ',' + order3, ',' + order4 FOR XML PATH('')),
1, 1, ''
)
```
This is slight overkill for a constant number of columns (an... | This is a bit unpleasant, it needs to be in a subquery to remove the trailing comma efficiently (though you could use a CTE):
```
SELECT
Customer_number,
SUBSTRING([Order], 0, LEN([Order])) AS [Order]
FROM(
SELECT
Customer_number,
COALESCE(order1+',', '') +
COALESCE(order2+',', '... |
45,086,384 | This question is asked many time here but i am not getting the proper output as i am expecting:
I have a table in which i need to concatenate columns but i don't want NULL value in it. I want it in sql server 2008 concate function does not work in 2008.
Example:
OrderTable
```
Customer_Number order1 order2 ord... | 2017/07/13 | [
"https://Stackoverflow.com/questions/45086384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2455193/"
] | Another variation, for fun and profit, demonstrating the `FOR XML` trick to concatenate values pre-SQL Server 2012.
```
SELECT Customer_Number, STUFF(
(SELECT ',' + order1, ',' + order2, ',' + order3, ',' + order4 FOR XML PATH('')),
1, 1, ''
)
```
This is slight overkill for a constant number of columns (an... | You were on the right track with the Coalesce, or IsNull. Instead of trying to track the length and use substring, left or stuff, I just used a replace to remove the trailing comma that would show up from the coalesce.
```
Select Customer_number,
Replace(
Coalesce(Order1 + ',','')+
Coalesce(Order2... |
9,541,184 | I was reading about how **Virtual Memory** and **Memory management** works in an Operating System. I understood how each process has its own contiguous logical address space. This address space need not be contiguous in physical memory. For this purpose, paging is used. The page tables are used to do the mapping from l... | 2012/03/02 | [
"https://Stackoverflow.com/questions/9541184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/641752/"
] | I'll start with virtual address 8, it should illustrate things better.
8 = 2×4 + 0. The physical address is stored at offset 0 of page 2 of the process. We look up the second page. For P1, page 2's address is stored at PA 4 + 2, and it is 28. We look up the contents of PA 28, and get value 0. For P2, page 2's address ... | I'm assuming the diagram shows the physical memory and physical addresses on the left. It wouldn't make sense to let p1 and p2 directly access their own and each other's page tables.
Given that, for virtual address 0 you fetch -45 from page frame 1 for p1 and 0 from page frame 3 for p2.
For VA = 1 you fetch 8 and -12... |
32,644,942 | I am getting error "xapk file validation faild" after successfully download an obb file.
A progress reach at 99% then give an error "xapk file validation faild".
I debugging a code and then it thrown an exception "Not a zip archived" from
```
ZipResourceFile zrf = new ZipResourceFile(fileName);
```
in ZipResocuceF... | 2015/09/18 | [
"https://Stackoverflow.com/questions/32644942",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1731130/"
] | Also i have tried with ZipResourceFile but i had the same error.
You can try to mount and unmount your obb file with this class:
<https://gist.github.com/Clockers/11af3c136b5d283f3560>
My obb is created using JObb on a folder containing the file, you can find it here:
<http://developer.android.com/tools/help/jobb.html... | I got a solution,
create obb file without using of jobb command, using jobb command it create encrypted obb file, there is no need to create encrypted obb file
I am uploading unencrypted obb file to playstore,
here, are steps to create unencrypted obb file
1. copy you resources files into a folder
2. create zip file ... |
1,116,862 | What is the difference between routed protocol and routing protocol?. Clear answers will be highly appreciated. | 2016/08/23 | [
"https://superuser.com/questions/1116862",
"https://superuser.com",
"https://superuser.com/users/633316/"
] | A routed protocol is a protocol that is typically routed or is capable of being routed. IP is a routed protocol.
A routing protocol is a protocol used to maintain routing tables and provide information to support routing. [RIP](https://en.wikipedia.org/wiki/Routing_Information_Protocol) is a routing protocol. | Routed Protocol
===============
A routed protocol is a protocol by which data can be routed. Routed protocol are IP, AppleTalk, and IPX. In this kind of protocols we require an addressing scheme and subnetting. Addressing scheme will be used to determine the network to which a host belongs and to identifying that host... |
106,598 | I find it confusing when *tomorrow* is used to speak of a day in the future other than the following day. Is it proper to use it in reference to any specific day in the future?
I am aware that the dictionary defines tomorrow as a time in near future. To me this refers to an ambiguous time and it is not confusing when ... | 2013/03/08 | [
"https://english.stackexchange.com/questions/106598",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/39005/"
] | If you check with [a dictionary](http://oxforddictionaries.com/definition/english/tomorrow?q=tomorrow) you would realize
>
> **tomorrow** (adverb)
>
>
> on the day after today: *the show opens tomorrow.*
>
>
> in the **future**, esp. the **near future**: *East Germany will not disappear
> tomorrow.*
>
>
> **tom... | Many dictionaries (like [Collins](http://www.collinsdictionary.com/dictionary/english/tomorrow) and [Macmillan](http://www.macmillandictionary.com/dictionary/american/tomorrow_9)) list a secondary meaning for tomorrow, but that meaning is in an abstract sense, as in:
>
> *Today's graduates are the leaders of tomorrow... |
69,869,724 | I have a Students list that I would want to sort using Selection Sort algorithm. I want to sort Students list based on first name, age and id. My student class is a POJO class just with getters and setters. It has 4 instance variables- firstName, lastName, age and id.
My code below-
```
private static void selectionS... | 2021/11/07 | [
"https://Stackoverflow.com/questions/69869724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5515908/"
] | The `compareTo` method does not return a `boolean`, it returns an `int`. It returns either 1, 0 or -1.
* `1`: greater
* `-1`: less
* `0`: equal
You can achieve what you want by doing `foo.compareTo(boo) < 0`; | I suggest two different approaches to this question. If you are doing a homework assignement or similar and you don't want to complicate things, you may choose the first approach. It is not recommended to hardcode the field names of your class, but since you are looking for a way to get field values by names:
**SOLUTI... |
3,019,411 | I tried doing this by Eisenstein's criterion:
$2$ is prime in $\mathbb{Q}$ and I then proceeded to write that it divides $-2$, $-2$ and $0$ but doesn't divide $1$ and also $2^2=4$ doesn't divide $2$. I then noticed these last two are erroneous since we're in $\mathbb{Q}$ and we have that $(1/2)(2)=1$ and thus $2$ does... | 2018/11/29 | [
"https://math.stackexchange.com/questions/3019411",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/369375/"
] | You solve it by noting that the polynomial is monic, which means that a factorisation over the rationals gives a factorisation over the integers (or contrapositively: of the is no non-trivial factorisation over the integers, then there are none over the rationals). And over the integers you can use Eisenstein without a... | Suppose that $p/q\in\mathbb Q$ is a root of this polynomial, with $p,q$ coprime integers. Then you have that
$$\frac{p^3}{q^3}-2\frac{p}{q}-2=0$$
or, by doing a bit of algebra,
$$p^3=2q^2 (p+q)$$
from which you can derive a contradiction. |
3,019,411 | I tried doing this by Eisenstein's criterion:
$2$ is prime in $\mathbb{Q}$ and I then proceeded to write that it divides $-2$, $-2$ and $0$ but doesn't divide $1$ and also $2^2=4$ doesn't divide $2$. I then noticed these last two are erroneous since we're in $\mathbb{Q}$ and we have that $(1/2)(2)=1$ and thus $2$ does... | 2018/11/29 | [
"https://math.stackexchange.com/questions/3019411",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/369375/"
] | What you're missing here is the result known as ["Gauss' lemma"](https://en.wikipedia.org/wiki/Gauss%27s_lemma_(polynomial)). The result says the following.
**Theorem (Gauss' lemma)**
*Let $p(X) \in \mathbb{Z}[X]$ be a non-constant polynomial. Then $p(X)$ is irreducible over $\mathbb{Z}[X]$ if and only if it is irred... | Suppose that $p/q\in\mathbb Q$ is a root of this polynomial, with $p,q$ coprime integers. Then you have that
$$\frac{p^3}{q^3}-2\frac{p}{q}-2=0$$
or, by doing a bit of algebra,
$$p^3=2q^2 (p+q)$$
from which you can derive a contradiction. |
3,897,504 | I want to find the following limit without using series expansion or L'Hopital's rule. I tried replacing $x$ with $2x$.
>
> $$\begin{aligned}L\_{1}&=\lim\_{x\to 0}\left(\frac{2+\cos x}{x^3\sin x}-\frac{3}{x^4}\right)\end{aligned}$$
>
>
>
$$\begin{aligned}L\_{2}&=\lim\_{x\to 0}\left(\frac{4x+2x(\cos^2x-\sin^2x)-6\... | 2020/11/07 | [
"https://math.stackexchange.com/questions/3897504",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/478779/"
] | *Sorry for my previous misunderstanding on the question.* I will add some detail for the path from @user's Hint.
Above all, for first order we have
$$
A\_1=\lim\_{x\to0} \frac{x-\sin x}{x^3}=\frac1{6}, \quad B\_1=\lim\_{x\to0} \frac{1-\cos x}{x^2} =\frac1{2}
$$
which is proved in that post before.
To pursue higher or... | **HINT**
To simplify the derivation we can proceed starting to prove the followings
$$L\_1: \frac{\cos x-1}{x^2}\to \frac12 \implies L\_2: \frac{x\cos x-x+\frac12x^3}{x^5}\to \frac1{24}$$
$$L\_3:\frac{x-\sin x}{x^3}\to \frac16 \implies L\_4:\frac{3(x-\sin x)-\frac12 x^3}{x^5}\to -\frac1{40}$$
and then use that
$$\... |
10,624,760 | I am trying to learn about Latent Dirichlet Allocation (LDA). I have basic knowledge of machine learning and probability theory and based on this blog post <http://goo.gl/ccPvE> I was able to develop the intuition behind LDA. However I still haven't got complete understanding of the various calculations that goes in it... | 2012/05/16 | [
"https://Stackoverflow.com/questions/10624760",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/737128/"
] | Edwin Chen (who works at Twitter btw) has [an example](http://blog.echen.me/2011/08/22/introduction-to-latent-dirichlet-allocation/) in his blog. 5 sentences, 2 topics:
* I like to eat broccoli and bananas.
* I ate a banana and spinach smoothie for breakfast.
* Chinchillas and kittens are cute.
* My sister adopted a k... | LDA Procedure
Step1: Go through each document and randomly assign each word in the document to one of K topics (K is chosen beforehand)
Step2: This random assignment gives topic representations of all documents and word distributions of all the topics, albeit not very good ones
So, to improve upon them:
For each doc... |
28,797 | I basically jog for 30 minutes just after work at about 9:00 pm, before dinner. I sometimes have a full lunch at about 3:00 pm, but most of the time I have some fruit because I reach the office at about 12:00 pm, having had morning breakfast at 10:00 am.
1) Is it safe to jog if I am feeling my stomach is empty? (somet... | 2016/01/31 | [
"https://fitness.stackexchange.com/questions/28797",
"https://fitness.stackexchange.com",
"https://fitness.stackexchange.com/users/3864/"
] | I think you're over thinking this.
If you personally feel like you need to have something because you feel lightheaded when you've previously jogged on an empty stomach you should definitely have something to eat prior to exercise.
Likewise if you've felt worse eating before a jog, then don't eat.
Any option you cho... | To be completely honest, not eating before a workout or run is actually best. That way you burn fat directly instead of working through what you just ate. However you'll probably feel tired if you've been fasting for a long time (ie: Workout before breakfast). If you do want to eat before a workout I'd give yourself at... |
73,518 | I've been reading many opinions from the United State Supreme Court and discovered the phrase "inter alia," meaning "among other things." I have not encountered this phrase outside of these opinions.
Is the phrase "inter alia" primarily localized to legalese? Or would it be acceptable to use it in general writing? | 2012/07/04 | [
"https://english.stackexchange.com/questions/73518",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/6523/"
] | The best course, undoubtedly, is to use "among others", a phrase that can refer to people or things.
It should be noted that "inter alia" is Latin for "among others" when "others" are things. If the others are persons, "alia" must be changed to "alios" (the OED quotes, from 1670, *The lords produce **inter alios** Jo... | It is certainly used more widely, but it says nothing that *among other things* doesn't say. The English version will be understood by all readers, and removes the risk that you will be perceived as someone who likes to show you know a bit of Latin. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.