qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
211,243 | I have code looking something like this:
```
$data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory
$hash = md5($data);
$query = "INSERT INTO some_table
SET BlobData = '" . mysql_real_escape_string($data) . "',
BlobHash = '$hash'
";
mysql_query($query);
`... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28835/"
] | You have two issues here:
#1, there are several different ways you can compute the MD5 hash:
* Do as you do and load into PHP as a string and use PHP's `md5()`
* Use PHP's `md5_file()`
* As of PHP 5.1+ you can use PHP's streams API with either of `md5` or `md5_file` to avoid loading entirely into memory
* Use `exec()... | If you are using PDO, and prepared statments you can use the PDO::PARAM\_LOB type. See example #2 on the LOB page showing how to insert an image to a database using the file pointer.
<http://us2.php.net/manual/en/pdo.lobs.php> |
211,243 | I have code looking something like this:
```
$data = file_get_contents($tempFile); // perhaps 30MB of file data, now in PHP's memory
$hash = md5($data);
$query = "INSERT INTO some_table
SET BlobData = '" . mysql_real_escape_string($data) . "',
BlobHash = '$hash'
";
mysql_query($query);
`... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/28835/"
] | You have two issues here:
#1, there are several different ways you can compute the MD5 hash:
* Do as you do and load into PHP as a string and use PHP's `md5()`
* Use PHP's `md5_file()`
* As of PHP 5.1+ you can use PHP's streams API with either of `md5` or `md5_file` to avoid loading entirely into memory
* Use `exec()... | Would it make any difference if you didn't put the query into another variable, but instead passed it directly into the MySQL command. I've never tried this, but it may make a difference as the whole string isn't stored in another variable. |
972,554 | For example, 4 is converted to "Four" and 33333 is converted to "Thirty three thousands three hundred and thirty three". I am thinking of using JQUERY instead of plain JAVASCRIPT.
Here is the code in its entirety:
```
<script language="javascript" type="text/javascript">
function NumberToTextConverter()
{
... | 2009/06/09 | [
"https://Stackoverflow.com/questions/972554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50395/"
] | If it's already done this way and it's working I don't see why spending time implementing this in jQuery.
Unless if you want to learn/practice jQuery. | I think a better place for this would be <http://refactormycode.com/>
Stackoverflow is more geared towards direct Question and Answers, and less for discussions. |
972,554 | For example, 4 is converted to "Four" and 33333 is converted to "Thirty three thousands three hundred and thirty three". I am thinking of using JQUERY instead of plain JAVASCRIPT.
Here is the code in its entirety:
```
<script language="javascript" type="text/javascript">
function NumberToTextConverter()
{
... | 2009/06/09 | [
"https://Stackoverflow.com/questions/972554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50395/"
] | What exactly do you mean by "convert to jQuery code"? jQuery has really pretty much nothing to do with the code you posted. It is not a different language, it has no magic that will make the Javascript any different. jQuery is a library intended to make it easy to manipulate DOM elements and perform common Javascript t... | I think a better place for this would be <http://refactormycode.com/>
Stackoverflow is more geared towards direct Question and Answers, and less for discussions. |
972,554 | For example, 4 is converted to "Four" and 33333 is converted to "Thirty three thousands three hundred and thirty three". I am thinking of using JQUERY instead of plain JAVASCRIPT.
Here is the code in its entirety:
```
<script language="javascript" type="text/javascript">
function NumberToTextConverter()
{
... | 2009/06/09 | [
"https://Stackoverflow.com/questions/972554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50395/"
] | If your code works, then **no**, don't refactor. Why? Because we don't have much time here, on Earth. | I think a better place for this would be <http://refactormycode.com/>
Stackoverflow is more geared towards direct Question and Answers, and less for discussions. |
972,554 | For example, 4 is converted to "Four" and 33333 is converted to "Thirty three thousands three hundred and thirty three". I am thinking of using JQUERY instead of plain JAVASCRIPT.
Here is the code in its entirety:
```
<script language="javascript" type="text/javascript">
function NumberToTextConverter()
{
... | 2009/06/09 | [
"https://Stackoverflow.com/questions/972554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50395/"
] | What exactly do you mean by "convert to jQuery code"? jQuery has really pretty much nothing to do with the code you posted. It is not a different language, it has no magic that will make the Javascript any different. jQuery is a library intended to make it easy to manipulate DOM elements and perform common Javascript t... | If it's already done this way and it's working I don't see why spending time implementing this in jQuery.
Unless if you want to learn/practice jQuery. |
972,554 | For example, 4 is converted to "Four" and 33333 is converted to "Thirty three thousands three hundred and thirty three". I am thinking of using JQUERY instead of plain JAVASCRIPT.
Here is the code in its entirety:
```
<script language="javascript" type="text/javascript">
function NumberToTextConverter()
{
... | 2009/06/09 | [
"https://Stackoverflow.com/questions/972554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/50395/"
] | What exactly do you mean by "convert to jQuery code"? jQuery has really pretty much nothing to do with the code you posted. It is not a different language, it has no magic that will make the Javascript any different. jQuery is a library intended to make it easy to manipulate DOM elements and perform common Javascript t... | If your code works, then **no**, don't refactor. Why? Because we don't have much time here, on Earth. |
12,326,554 | I have some code that I put in a destructor to ensure it is run both on normal exit and exception stack unwinding:
```
struct withProtectedClose {
~withProtectedClose() {
// Do some cleanup here...
}
};
void test() {
withProtectedClose close;
// Do some work before closing
}
```
Yet the g++ compiler (... | 2012/09/07 | [
"https://Stackoverflow.com/questions/12326554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115751/"
] | I'd tend to think it is a bug in the compiler. It is still present in g++ 4.7.1.
As a work around, you may try to define a constructor which does nothing. It suppresses the warning with g++ 4.7.1, I don't know with 3.4.6. | MSVC doesn't issue this warning in such a case. If your gcc version does, try suppressing it this way:
```
withProtectedClose close;
(close);
``` |
12,326,554 | I have some code that I put in a destructor to ensure it is run both on normal exit and exception stack unwinding:
```
struct withProtectedClose {
~withProtectedClose() {
// Do some cleanup here...
}
};
void test() {
withProtectedClose close;
// Do some work before closing
}
```
Yet the g++ compiler (... | 2012/09/07 | [
"https://Stackoverflow.com/questions/12326554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115751/"
] | I'd tend to think it is a bug in the compiler. It is still present in g++ 4.7.1.
As a work around, you may try to define a constructor which does nothing. It suppresses the warning with g++ 4.7.1, I don't know with 3.4.6. | Since it seems to be solely a GCC issue, you can "fix" it by declaring your struct like this:
```
struct __attribute__ ((__unused__)) withProtectedClose
```
This reliably silences the warning on my version 4.6.3 compiler (and the destructor is demonstrably run, in accordance with the standard). It will however **sti... |
12,326,554 | I have some code that I put in a destructor to ensure it is run both on normal exit and exception stack unwinding:
```
struct withProtectedClose {
~withProtectedClose() {
// Do some cleanup here...
}
};
void test() {
withProtectedClose close;
// Do some work before closing
}
```
Yet the g++ compiler (... | 2012/09/07 | [
"https://Stackoverflow.com/questions/12326554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/115751/"
] | Since it seems to be solely a GCC issue, you can "fix" it by declaring your struct like this:
```
struct __attribute__ ((__unused__)) withProtectedClose
```
This reliably silences the warning on my version 4.6.3 compiler (and the destructor is demonstrably run, in accordance with the standard). It will however **sti... | MSVC doesn't issue this warning in such a case. If your gcc version does, try suppressing it this way:
```
withProtectedClose close;
(close);
``` |
118,850 | Suppose I want to copy the red channel of an image (thus creating a new channel). How do I do that with Python-Fu?
EDIT: basically, I need to create luminosity masks. So far, I tryed the following code:
```
# get active layer
layer = pdb.gimp_image_get_active_layer(image)
# copy the selected layer
layer_copy = pdb.gi... | 2019/01/07 | [
"https://graphicdesign.stackexchange.com/questions/118850",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/131559/"
] | Your third argument should be None:
```
pdb.gimp_image_insert_channel(i, c, None,0)
```
The doc is mostly written with the script-fu point if view, where items are just integer ids, and "no item" is therefore 0. In python-fu, you pass object references, so "no item" is `None`.
You can do the same thing more simply ... | The R/G/B channels you see at the top of the Channels list are somewhat virtual since they are the result of the composition of the layers.
To get a layer with only the red component you can use the channel mixer:
```
pdb.plug_in_colors_channel_mixer(img, l, False, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
```
(... |
8,039,185 | Let's say I have a database with two tables `Persons` and `PhoneNumbers`, where the `PhoneNumbers` table has a foreign key to `Persons`. If I want to insert a person with a phone number in a single transaction, I can write a query like this:
```
BEGIN TRANSACTION;
INSERT INTO Persons(Name) VALUES(...);
INSERT INTO Pho... | 2011/11/07 | [
"https://Stackoverflow.com/questions/8039185",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/70915/"
] | You can store last\_insert\_rowid() after person insertion to temporary table or this might work too:
```
BEGIN TRANSACTION;
INSERT INTO Persons(Name) VALUES(...);
INSERT INTO PhoneNumbers(PersonForeignKey, Number)
VALUES(last_insert_rowid(), 'number 1');
INSERT INTO PhoneNumbers(PersonForeignKey, Number)
SELECT P... | Something like this might work, although it is far from ideal:
```
BEGIN TRANSACTION;
INSERT INTO Persons(Name) VALUES(...);
INSERT INTO PhoneNumbers(PersonForeignKey, Number) VALUES(last_insert_rowid(), ...);
INSERT INTO PhoneNumbers(PersonForeignKey, Number) SELECT PersonForeignKey, 123 WHERE PhoneNumber... |
63,928,668 | I'm working on a project where i have to detect a red vehicle (please see image below).
[](https://i.stack.imgur.com/hhri1.jpg)
As i believe that this can be achieved with out using Deep learning (overkill in this case), i used histogram Back projection depending on t... | 2020/09/16 | [
"https://Stackoverflow.com/questions/63928668",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12356895/"
] | You can get shape descriptors and use some kind of rules (or machine learning) to decide if that's the right object you're searching for :
```
import numpy as np
import argparse
import cv2
import sys
target = cv2.imread('YourPath\\target.jpg' ,
cv2.IMREAD_COLOR)
mask = cv2.imread('YourPath\\mask.jpg',cv2.IMREAD_GRAY... | You can use approxPolyDp and calculate the approximate area of the shape and set a threshold for a range where it can be termed as the shape that you're looking for. |
37,243 | I'm trying to create a bilingual critical edition with Latin on the left page and English on the right. I'm trying to figure out `ledpar` and I can't get the following example to compile. It compiles just fine if I comment out the two section headings, but with the section headings LaTeX throws the error on line 19 (wh... | 2011/12/06 | [
"https://tex.stackexchange.com/questions/37243",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/9830/"
] | Hmm, I actually don't use ledpar very often; I thought it was much more similar to `ledmac`. There are a few things wrong with the code you have above, but they are not the problem. This should work:
```
\documentclass[10pt]{article}
\usepackage{ledmac, ledpar}
\begin{document}
\begin{pages}
\begin{Leftside}
\beginnum... | The new version of eledmac/eledpar (1.12 / 1.8) which will be released soon provide better tool to manage your case. It provides eledsection.
That is a MWE
```
\documentclass[10pt]{article}
\usepackage{ledmac, ledpar}
\begin{document}
\begin{pages}
\begin{Leftside}
\beginnumbering
\pstart
\eledsection{blah}
\pend
\... |
37,243 | I'm trying to create a bilingual critical edition with Latin on the left page and English on the right. I'm trying to figure out `ledpar` and I can't get the following example to compile. It compiles just fine if I comment out the two section headings, but with the section headings LaTeX throws the error on line 19 (wh... | 2011/12/06 | [
"https://tex.stackexchange.com/questions/37243",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/9830/"
] | The new version of eledmac (1.1) provides commands for sectioning inside numbered text (and with critical notes) | The new version of eledmac/eledpar (1.12 / 1.8) which will be released soon provide better tool to manage your case. It provides eledsection.
That is a MWE
```
\documentclass[10pt]{article}
\usepackage{ledmac, ledpar}
\begin{document}
\begin{pages}
\begin{Leftside}
\beginnumbering
\pstart
\eledsection{blah}
\pend
\... |
10,343,190 | in my edit view i can retain value of the fields but the radio button.
like wen i select the row from grid and click edit it gives me previously saved value for all othr field bt not for radio buttons
how can i set those value
lik if the saved data contain value of gender as F then
```
if(gender='f')
{
<input ty... | 2012/04/27 | [
"https://Stackoverflow.com/questions/10343190",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1320898/"
] | You could use [Razor](http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx) in this case:
```
@Html.RadioButtonFor(x => x.Gender, "radioValue", new { @checked = true })
```
More about it here:
[How to set Html.RadioButtonFor as selected by default in Asp.net MVC3](http://dotnetech.wordpress.com/... | or try this.
```
if(gender = 'f')
{
@Html.RadioButtonFor(x => x.Gender, "radioValue", new { @checked = "true"})
}
else
{
@Html.RadioButtonFor(x => x.Gender, "radioValue", new {@checked = "true"})
}
```
hope to help you out.. thanks. |
57,491,386 | I've read the introduction to R's dplyr programming (<https://cran.r-project.org/web/packages/dplyr/vignettes/programming.html>), which is very useful.
I often build quite complex functions which include several sets of grouping variables. For example, given a dataset df, I may want the function to summarise by some v... | 2019/08/14 | [
"https://Stackoverflow.com/questions/57491386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7969026/"
] | You can try
```
TAB3<-function(data, y, grouping_list){
require(tidyverse)
map(grouping_list, ~group_by_at(data, .) %>%
summarise_at(y, list(Mean= mean), na.rm=T)) }
TAB3(df, "xV", list(c("G1", "G2"), c("G3")))
[[1]]
# A tibble: 2 x 3
# Groups: G1 [2]
G1 G2 Mean
<dbl> <dbl> <dbl>
1 0 ... | If you wanted to use the ellipsis as per your TAB2 example, you could try:
**update based on new info:**
```r
TAB3<-function(df,x,...){
args <- substitute(list(...))
names_env <- setNames(as.list(names(df)), names(df))
arg_list <- eval(args, names_env)
out <- vector(mode = "list", length(arg_list))
for(i... |
16,540,936 | When we try to authenticate using the spring authentication manager, its says "bad credentials":
```
Authentication request = new UsernamePasswordAuthenticationToken("john", "johnldap");
result = authenticationManager.authenticate(request);
```
Here the SecurityApplicationContext.xml file:
```
<authentication-man... | 2013/05/14 | [
"https://Stackoverflow.com/questions/16540936",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1051277/"
] | If I remember correctly the `user-dn-pattern` should not contain the root dn, as it will be automatically appended. So try using:
```
user-dn-pattern="uid={0},ou=People">
```
And I don't think you need the `password-encoder` if you only want to do a simple bind authentication. | I spent a lot of time trying to connect with spring security, looking at stackoverflow I also thought that it may be problem with encoding, because passwords are in md5, though **I had to add mentioned above root dn separately**, password gets encoded by ldap server. Below is my working version:
```
<ldap-server url="... |
1,829,056 | I know this isn't a math question but this has been on my mind for quite some time. I am a second year university student who is planning on getting a degree in pure mathematics. I really enjoy the rigour and depth of understanding that comes from studying pure mathematics but I was wondering whether getting a degree i... | 2016/06/16 | [
"https://math.stackexchange.com/questions/1829056",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/347585/"
] | If you just want money, go into something like finance or even engineering. It's vastly easier, it's vastly easier to find a job, and you're paid better (at least until you're a well-established professor). It's not hard to find a job in industry with a pure math degree; but if that's all you want, there are far better... | If all you are concerned with is **salary** then, no, it is not financially worth it. |
1,829,056 | I know this isn't a math question but this has been on my mind for quite some time. I am a second year university student who is planning on getting a degree in pure mathematics. I really enjoy the rigour and depth of understanding that comes from studying pure mathematics but I was wondering whether getting a degree i... | 2016/06/16 | [
"https://math.stackexchange.com/questions/1829056",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/347585/"
] | An academical pursuit in pure mathematics is most likely not a lucrative decision, but it should not be a question about money. Indeed it is easy to say so, since money governs a lot of things in life including choice of education, but mathematics takes a lot of enthusiasm.
There are however more applicable pure math... | If all you are concerned with is **salary** then, no, it is not financially worth it. |
1,829,056 | I know this isn't a math question but this has been on my mind for quite some time. I am a second year university student who is planning on getting a degree in pure mathematics. I really enjoy the rigour and depth of understanding that comes from studying pure mathematics but I was wondering whether getting a degree i... | 2016/06/16 | [
"https://math.stackexchange.com/questions/1829056",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/347585/"
] | If you just want money, go into something like finance or even engineering. It's vastly easier, it's vastly easier to find a job, and you're paid better (at least until you're a well-established professor). It's not hard to find a job in industry with a pure math degree; but if that's all you want, there are far better... | An academical pursuit in pure mathematics is most likely not a lucrative decision, but it should not be a question about money. Indeed it is easy to say so, since money governs a lot of things in life including choice of education, but mathematics takes a lot of enthusiasm.
There are however more applicable pure math... |
39,246,465 | I am creating a table in which first column is column header and second column will be column data. Now I don't know is that possible to get data either via c# or javascript. Below is the example
```
<html>
<body>
<h1>Small Bakery Products</h1>
<table border="1" width="100%">
<tr>
<td>Id</td>
<td>@data.id</td>
... | 2016/08/31 | [
"https://Stackoverflow.com/questions/39246465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think you're mixing something up.
```
class MySingleton
include Singleton
attr_reader :data
def initialize
@data = {a: 1, b: 2}
end
end
foo = MySingleton.instance.data.clone
#=> {:a=>1, :b=>2}
foo[:c] = 3
#=> 3
foo
#=> {:a=>1, :b=>2, :c=>3}
MySingleton.instance.data
#=> {:a=>1, :b=>2}
``` | The concept of singleton pattern in Ruby has changed over time. Using `include Singleton` to implement explicit singleton classes has become fringe practice. Normally, you contruct an object eg. by calling `Object.new` and work with its singleton class `Object.new.singleton_class`, like this:
```
o = Object.new
class ... |
39,246,465 | I am creating a table in which first column is column header and second column will be column data. Now I don't know is that possible to get data either via c# or javascript. Below is the example
```
<html>
<body>
<h1>Small Bakery Products</h1>
<table border="1" width="100%">
<tr>
<td>Id</td>
<td>@data.id</td>
... | 2016/08/31 | [
"https://Stackoverflow.com/questions/39246465",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I've tried with `.clone` and `.dup` and they both seem to work for me.
```
require 'singleton'
class MySingleton
include Singleton
attr_accessor :data
end
MySingleton.instance.data = {}
foo = MySingleton.instance.data
foo[:bar] = 'buzz'
puts foo # {:bar=>"buzz"}
puts MySingleton.instance.data # {:bar=>"buzz"... | The concept of singleton pattern in Ruby has changed over time. Using `include Singleton` to implement explicit singleton classes has become fringe practice. Normally, you contruct an object eg. by calling `Object.new` and work with its singleton class `Object.new.singleton_class`, like this:
```
o = Object.new
class ... |
32,694,304 | MySQL table name demo with below listed values peter and john with edit links
**Example**
```
Peter EDIT
John EDIT
```
on clicking **edit** link i'm opening edit\_name.php page. In edit\_name.php i'm updating my clicked edited value with update button..
My requirement is in edit\_name.php i should receive clicked... | 2015/09/21 | [
"https://Stackoverflow.com/questions/32694304",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5303332/"
] | You could give the name as URL parameter to the load URL:
```
('.show_edit_page').on('click','.ajax_edit',function(){
var id = $(this).attr('data-id');
$('#content').load('edit_name.php?name='+id);
});
```
then catch the name parameter in edit\_name.php file with:
```
$theName = $_REQUEST('name');
```
That s... | You have to update for accordingly.First you have to send that name via jQuery then you will receive that value in **PHP page**
```
$('.show_edit_page').on('click','.ajax_edit',function(){
var id = $(this).data('data-id');
var name = FetchNameValue; //Get this value using jQuery
$('#content').load('edit_na... |
14,244,602 | I am trying to do to a user-pass validation. Updated code:
```
$username="------";
$password="------";
$database="------";
$host = "------";
mysql_connect($host,$username,$password);
mysql_select_db($database) or die( "Unable to select database");
$username = $_POST['username'];
$password = $_POST['password'];
echo... | 2013/01/09 | [
"https://Stackoverflow.com/questions/14244602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571648/"
] | Let's set aside the issues with mysql interface (not good to use going forward) and the fact that **you really really don't want to** put any kind of user affected variables straight into your sql strings [SQL injection!!!!], you say the following in your description that this:
`$result = mysql_query("SELECT * FROM RE... | Here's a solution using `mysqli_`:
```
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$city = "Amersfoort";
/* create a prepared statement */
if ($stmt = mysqli_pre... |
14,244,602 | I am trying to do to a user-pass validation. Updated code:
```
$username="------";
$password="------";
$database="------";
$host = "------";
mysql_connect($host,$username,$password);
mysql_select_db($database) or die( "Unable to select database");
$username = $_POST['username'];
$password = $_POST['password'];
echo... | 2013/01/09 | [
"https://Stackoverflow.com/questions/14244602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571648/"
] | OK now we have the WHOLE code it's obvious.
`$username` and `$password` aren't global. The function doesn't know what they are set to.
```
$username = $_POST['username'];
$password = $_POST['password'];
echo 'username: ' . $username . '<br>'; //myname
echo 'password: ' . $password . '<br>'; //mypass
function chec... | Here's a solution using `mysqli_`:
```
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$city = "Amersfoort";
/* create a prepared statement */
if ($stmt = mysqli_pre... |
14,244,602 | I am trying to do to a user-pass validation. Updated code:
```
$username="------";
$password="------";
$database="------";
$host = "------";
mysql_connect($host,$username,$password);
mysql_select_db($database) or die( "Unable to select database");
$username = $_POST['username'];
$password = $_POST['password'];
echo... | 2013/01/09 | [
"https://Stackoverflow.com/questions/14244602",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/571648/"
] | OK now we have the WHOLE code it's obvious.
`$username` and `$password` aren't global. The function doesn't know what they are set to.
```
$username = $_POST['username'];
$password = $_POST['password'];
echo 'username: ' . $username . '<br>'; //myname
echo 'password: ' . $password . '<br>'; //mypass
function chec... | Let's set aside the issues with mysql interface (not good to use going forward) and the fact that **you really really don't want to** put any kind of user affected variables straight into your sql strings [SQL injection!!!!], you say the following in your description that this:
`$result = mysql_query("SELECT * FROM RE... |
44,781 | At what point in time does a person's sense of self (or soul) arrive when using a transporter?
Is there any time where a person would have no sense of self during transport? | 2013/11/09 | [
"https://scifi.stackexchange.com/questions/44781",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/12012/"
] | In the Next Generation episode "Realm of Fear" we saw a transporter cycle from Reginald Barclay's point of view. Barclay was aware of himself and his surroundings throughout transport. So we can conclude that the sense of self is always present during transport.
However, in the episode "Relics" we learned that Scotty ... | While @KyleJones's answer is the first thing to pop into my head, there's also a short bit of dialogue at the end of ENT 2x10, [Vanishing Point](http://en.memory-alpha.org/wiki/Vanishing_Point_%28episode%29), that helps here:
>
> Trip: "You were sorta... trapped in the pattern buffer. But only for a few seconds."
>... |
121,468 | So I'm fairly new to more secure forms of key management, I've been used to storing my keys inside key files on my computer.
Recently I wanted to try and see if I could setup SSH authentication to my webserver using a key stored on my Nitrokey Pro making my keychain more portable and secure in the process.
I followed ... | 2016/04/25 | [
"https://security.stackexchange.com/questions/121468",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/68045/"
] | >
> I have a feeling that upon exporting my key it somehow got added to my local key storage making the NitroKey redundant but I am not knowledgable enough about the exact workings to be sure.
>
>
>
If that was done properly, it should not be possible. If the private key is stored in the "smartcard", it should not... | Nitrokey's guide you mention focused specifically on Linux, which can quickly lead to confusion and frustration for Mac users, since it is so close yet so far away from being the same. I'm not familiar with Nitrokey, but anything using the PCKS11 standard should be cross-compatible once you get it working. :-)
For Mac... |
222,854 | I am trying to set up Nginx so that all connections to my numeric ip are denied, with the exception of a few arbitrary directories and files. So if someone goes to my IP, they are allowed to access the index.php file, and the phpmyadmin directory for example, but should they try to access any other directories, they wi... | 2011/01/15 | [
"https://serverfault.com/questions/222854",
"https://serverfault.com",
"https://serverfault.com/users/48051/"
] | Creative use of the location and deny rules negated in regex, something like:
```
location / {
root html;
index index.html index.htm index.php;
}
location ~* !^/(index.(php|html|htm)$)|(phpmyadmin/) {
deny all;
}
location ~ \.php$ {
root html;
... | It is easier to declare *servers* that are called with a domain name, and declare a *default* server that will include direct-IP accesses.
For instance your domain configuration could be used for, say, `mydomain.com`
```
server {
listen 80;
server_name mydomain.com *.mydomain.com;
root ... |
222,854 | I am trying to set up Nginx so that all connections to my numeric ip are denied, with the exception of a few arbitrary directories and files. So if someone goes to my IP, they are allowed to access the index.php file, and the phpmyadmin directory for example, but should they try to access any other directories, they wi... | 2011/01/15 | [
"https://serverfault.com/questions/222854",
"https://serverfault.com",
"https://serverfault.com/users/48051/"
] | The easiest path would be to start out by denying all access, then only granting access to those directories you want. As ring0 pointed out, you can use the default (default\_server in 0.8) flag on the listen directive. However, if you already have a server you want to use as a default for unknown named access to your ... | It is easier to declare *servers* that are called with a domain name, and declare a *default* server that will include direct-IP accesses.
For instance your domain configuration could be used for, say, `mydomain.com`
```
server {
listen 80;
server_name mydomain.com *.mydomain.com;
root ... |
222,854 | I am trying to set up Nginx so that all connections to my numeric ip are denied, with the exception of a few arbitrary directories and files. So if someone goes to my IP, they are allowed to access the index.php file, and the phpmyadmin directory for example, but should they try to access any other directories, they wi... | 2011/01/15 | [
"https://serverfault.com/questions/222854",
"https://serverfault.com",
"https://serverfault.com/users/48051/"
] | It is easier to declare *servers* that are called with a domain name, and declare a *default* server that will include direct-IP accesses.
For instance your domain configuration could be used for, say, `mydomain.com`
```
server {
listen 80;
server_name mydomain.com *.mydomain.com;
root ... | You can setting directly all path to the index.php and setting only on this file fastcgi php7 for nginx
```
//redirect all to index.php
location / {
autoindex off;
set $redirect_url $uri;
try_files $uri $uri/ /index.php$is_args$query_string;
}
location = /index.php {
in... |
222,854 | I am trying to set up Nginx so that all connections to my numeric ip are denied, with the exception of a few arbitrary directories and files. So if someone goes to my IP, they are allowed to access the index.php file, and the phpmyadmin directory for example, but should they try to access any other directories, they wi... | 2011/01/15 | [
"https://serverfault.com/questions/222854",
"https://serverfault.com",
"https://serverfault.com/users/48051/"
] | The easiest path would be to start out by denying all access, then only granting access to those directories you want. As ring0 pointed out, you can use the default (default\_server in 0.8) flag on the listen directive. However, if you already have a server you want to use as a default for unknown named access to your ... | Creative use of the location and deny rules negated in regex, something like:
```
location / {
root html;
index index.html index.htm index.php;
}
location ~* !^/(index.(php|html|htm)$)|(phpmyadmin/) {
deny all;
}
location ~ \.php$ {
root html;
... |
222,854 | I am trying to set up Nginx so that all connections to my numeric ip are denied, with the exception of a few arbitrary directories and files. So if someone goes to my IP, they are allowed to access the index.php file, and the phpmyadmin directory for example, but should they try to access any other directories, they wi... | 2011/01/15 | [
"https://serverfault.com/questions/222854",
"https://serverfault.com",
"https://serverfault.com/users/48051/"
] | Creative use of the location and deny rules negated in regex, something like:
```
location / {
root html;
index index.html index.htm index.php;
}
location ~* !^/(index.(php|html|htm)$)|(phpmyadmin/) {
deny all;
}
location ~ \.php$ {
root html;
... | You can setting directly all path to the index.php and setting only on this file fastcgi php7 for nginx
```
//redirect all to index.php
location / {
autoindex off;
set $redirect_url $uri;
try_files $uri $uri/ /index.php$is_args$query_string;
}
location = /index.php {
in... |
222,854 | I am trying to set up Nginx so that all connections to my numeric ip are denied, with the exception of a few arbitrary directories and files. So if someone goes to my IP, they are allowed to access the index.php file, and the phpmyadmin directory for example, but should they try to access any other directories, they wi... | 2011/01/15 | [
"https://serverfault.com/questions/222854",
"https://serverfault.com",
"https://serverfault.com/users/48051/"
] | The easiest path would be to start out by denying all access, then only granting access to those directories you want. As ring0 pointed out, you can use the default (default\_server in 0.8) flag on the listen directive. However, if you already have a server you want to use as a default for unknown named access to your ... | You can setting directly all path to the index.php and setting only on this file fastcgi php7 for nginx
```
//redirect all to index.php
location / {
autoindex off;
set $redirect_url $uri;
try_files $uri $uri/ /index.php$is_args$query_string;
}
location = /index.php {
in... |
13,376,644 | I've an application which is a scrollView filled with over 150 images .. I've followed this [tutorial](http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content%27) to create it .. the application is over 550MBs and it has about 500 (150 for iPhone 5 & 150 for Retina & 150 for non-retina & b... | 2012/11/14 | [
"https://Stackoverflow.com/questions/13376644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1766119/"
] | Try to load only those images needed for displaying. ie while scrolling those images that are hidden should be taken off from the scrollview. Maybe you can make a design similar to the working of reusable UITableViewCell. ie a custom implementation for showing only the needed images and reusing them while scrolling.
T... | It is not an good way to do that ,u can upload your photo on server side and when open the app. loading the image from server.
```
id path = @"http://upload.wikimedia.org/wikipedia/commons/c/c7/Sholay-Main_Male_Cast.jpg";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIIma... |
25,774 | Where can we find Deligne's paper " Theorie de Hodge I"? | 2010/05/24 | [
"https://mathoverflow.net/questions/25774",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3945/"
] | [Voici](http://math.harvard.edu/~tdp/Deligne-Theorie.de.Hodge-1-single-page.pdf). | It is in the conference volume of the 1970 ICM at Nice. Not so easy to find online, it seems, if that is what you meant. There is a summary in a review:
<http://www.ams.org/journals/bull/2009-46-04/S0273-0979-09-01268-3/S0273-0979-09-01268-3.pdf> |
25,774 | Where can we find Deligne's paper " Theorie de Hodge I"? | 2010/05/24 | [
"https://mathoverflow.net/questions/25774",
"https://mathoverflow.net",
"https://mathoverflow.net/users/3945/"
] | Amazingly, ALL the ICM talks since the beginning of time can now be found online at [<http://mathunion.org/ICM/>](http://mathunion.org/ICM/) | It is in the conference volume of the 1970 ICM at Nice. Not so easy to find online, it seems, if that is what you meant. There is a summary in a review:
<http://www.ams.org/journals/bull/2009-46-04/S0273-0979-09-01268-3/S0273-0979-09-01268-3.pdf> |
60,487,295 | example data :
```
var data = [
{a:{id: "1",name: "alex",class: "1"}},
{a:{id: "2",name: "john",class: "2"}},
{a:{id: "3",name: "ketty",class: "3"}}
]
```
if i pass id as 1 result : [{name:"john",class:"1"}].
please help me with the above question please. | 2020/03/02 | [
"https://Stackoverflow.com/questions/60487295",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12964227/"
] | You can use `_.find()` to get an item with the path of `a.id` that equals the `id` you are looking for. Then use `_.get()` to take the item out of the `a` property, and omit the `id`.
**Note**: This will give you a single item, and not an array of a single item. You can always wrap it in an array, if you absolutely n... | its really simple to do:-
```
var data = [
{a:{id: "1",name: "alex",class: "1"}},
{a:{id: "2",name: "john",class: "2"}},
{a:{id: "3",name: "ketty",class: "3"}}
]
let idToFind = 1;
let filtered = data.filter(f=>f['a']['id']==idToFind);
``` |
40,588,209 | I have classes as
```
class Citizen{
var name:String
var age:Int
var lawPrevilige = 0
init(name:String,age:Int){
self.name = name
self.age = age
}
}
class Politician{
var name:String
var age:Int
var lawPrevilige = 1
init(name:String,age:Int){
self.nam... | 2016/11/14 | [
"https://Stackoverflow.com/questions/40588209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Big O notations assume that n is large. n=4 is irrelevant to the complexity analysis.
In the general case, if you look at the ratio between both : `n.log(n) / n = log(n)` provided that n>0.
When n becomes large, this ratio tends to infinity, meaning that `n.log(n)` takes "infinitely" more time than `n`, and thus `n.l... | [big-o](/questions/tagged/big-o "show questions tagged 'big-o'") describes how fast functions grow asymphotically. `nlogn` grows faster than `n` so in your notation, `O(nlogn) > O(n)`, however it's not a proper notation.
Actually `O(nlogn)` is a set as well as `O(n)` is. There is also a relation between them:
[![![en... |
16,177,459 | I'm using `setlocale` and `strftime` to display localized month names in Brazilian Portuguese:
```
setlocale(LC_ALL, 'pt_BR');
$meses = array();
for($m=1; $m<=12; $m++) {
$meses[$m] = strftime('%B', mktime(0, 0, 0, $m, 1));
}
```
This works fine in my dev environment, but on the production server it fails for Ma... | 2013/04/23 | [
"https://Stackoverflow.com/questions/16177459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/825789/"
] | Use
```
echo setlocale(LC_CTYPE, 0); // en_US.UTF-8
```
to get the current encoding and then work around it.
Passing zero to `setLocale` gives you locale values. In this case we are getting the value for `LC_CTYPE` setting. | To get the encoding used by strftime use
```
mb_internal_encoding()
```
to convert the stftime encoded string to utf-8, use
```
mb_convert_encoding(strftime($format, $timestamp), 'UTF-8', mb_internal_encoding());
``` |
16,177,459 | I'm using `setlocale` and `strftime` to display localized month names in Brazilian Portuguese:
```
setlocale(LC_ALL, 'pt_BR');
$meses = array();
for($m=1; $m<=12; $m++) {
$meses[$m] = strftime('%B', mktime(0, 0, 0, $m, 1));
}
```
This works fine in my dev environment, but on the production server it fails for Ma... | 2013/04/23 | [
"https://Stackoverflow.com/questions/16177459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/825789/"
] | In comments below the question we could resolve the problem. It was caused because the locale names differed on both systems one used `pt_BR.uft-8` the other `pt_BR.UTF8`.
Finally we agreed to define the locale in a config file and use that. | To get the encoding used by strftime use
```
mb_internal_encoding()
```
to convert the stftime encoded string to utf-8, use
```
mb_convert_encoding(strftime($format, $timestamp), 'UTF-8', mb_internal_encoding());
``` |
685,608 | given the 2 PDE
$$ \Delta u-au\_{tt}+u\_{t}=0$$
and $$ \Delta u + Du\*Df=0 $$
here $ \Delta u $ is the Laplacian $ Du= grad(u) $ is the gradient and \* means scalar product $u\_{t} = \frac{\partial u}{\partial t}$
my doubt is what term should i include to get the linear part of the equations $ u\_{t} $ and $Du\*Df ... | 2014/02/18 | [
"https://math.stackexchange.com/questions/685608",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/17341/"
] | Well, for the second case, the Lagrangian you want is
$$
\Lambda\_D(u) = \tfrac12 \int\_D\ e^{f(x)}\ |\nabla u|^2\ \mathrm{d}x
$$
where $D$ is an appropriate domain in $\mathbb{R}^n$. The first case is similar (if you are assuming that $a$ is a constant), for then, it will just be
$$
\Lambda\_D(u) = \tfrac12 \int\_{D'}... | Here we will assume that the definition of the [Laplacian](http://en.wikipedia.org/wiki/Laplace_operator) is $\Delta=\vec{\nabla}^2$, and that $a$ is a non-zero constant.
I) The [Lagrangian density](http://en.wikipedia.org/wiki/Lagrangian)
>
> $$\tag{1a} {\cal L}\_1~=~ \frac{e^{-t/a}}{2}\left(a\dot{u}^2 - (\vec{\na... |
33,436,494 | Trying to use the statement:
```
SELECT *
FROM data.example
WHERE TIMESTAMP(timeCollected) < DATE_ADD(USEC_TO_TIMESTAMP(NOW()), 60, 'MINUTE')
```
to get data from my bigquery data. It seems to return same set of result even when time is not within the range. `timeCollected` is of the format `2015-10-29 16:05:06`.... | 2015/10/30 | [
"https://Stackoverflow.com/questions/33436494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3100757/"
] | The query you made means "return to me anything that has a collection time smaller than an hour in the future" which will literally mean your whole table. You want the following (from what I got through your comment, at least) :
```
SELECT *
FROM data.example
WHERE TIMESTAMP(timeCollected) > DATE_ADD(USEC_TO_TIMESTA... | To get table data collected within the last hour:
```
SELECT * FROM [data.example@-3600000--1]
```
<https://cloud.google.com/bigquery/table-decorators> |
33,436,494 | Trying to use the statement:
```
SELECT *
FROM data.example
WHERE TIMESTAMP(timeCollected) < DATE_ADD(USEC_TO_TIMESTAMP(NOW()), 60, 'MINUTE')
```
to get data from my bigquery data. It seems to return same set of result even when time is not within the range. `timeCollected` is of the format `2015-10-29 16:05:06`.... | 2015/10/30 | [
"https://Stackoverflow.com/questions/33436494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3100757/"
] | The query you made means "return to me anything that has a collection time smaller than an hour in the future" which will literally mean your whole table. You want the following (from what I got through your comment, at least) :
```
SELECT *
FROM data.example
WHERE TIMESTAMP(timeCollected) > DATE_ADD(USEC_TO_TIMESTA... | Using Standard SQL:
```
SELECT * FROM data WHERE timestamp > **TIMESTAMP_SUB**(CURRENT_TIMESTAMP(), INTERVAL 60 MINUTE)
``` |
33,436,494 | Trying to use the statement:
```
SELECT *
FROM data.example
WHERE TIMESTAMP(timeCollected) < DATE_ADD(USEC_TO_TIMESTAMP(NOW()), 60, 'MINUTE')
```
to get data from my bigquery data. It seems to return same set of result even when time is not within the range. `timeCollected` is of the format `2015-10-29 16:05:06`.... | 2015/10/30 | [
"https://Stackoverflow.com/questions/33436494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3100757/"
] | Using Standard SQL:
```
SELECT * FROM data
WHERE timestamp > TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL -60 MINUTE)
``` | To get table data collected within the last hour:
```
SELECT * FROM [data.example@-3600000--1]
```
<https://cloud.google.com/bigquery/table-decorators> |
33,436,494 | Trying to use the statement:
```
SELECT *
FROM data.example
WHERE TIMESTAMP(timeCollected) < DATE_ADD(USEC_TO_TIMESTAMP(NOW()), 60, 'MINUTE')
```
to get data from my bigquery data. It seems to return same set of result even when time is not within the range. `timeCollected` is of the format `2015-10-29 16:05:06`.... | 2015/10/30 | [
"https://Stackoverflow.com/questions/33436494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3100757/"
] | To get table data collected within the last hour:
```
SELECT * FROM [data.example@-3600000--1]
```
<https://cloud.google.com/bigquery/table-decorators> | Using Standard SQL:
```
SELECT * FROM data WHERE timestamp > **TIMESTAMP_SUB**(CURRENT_TIMESTAMP(), INTERVAL 60 MINUTE)
``` |
33,436,494 | Trying to use the statement:
```
SELECT *
FROM data.example
WHERE TIMESTAMP(timeCollected) < DATE_ADD(USEC_TO_TIMESTAMP(NOW()), 60, 'MINUTE')
```
to get data from my bigquery data. It seems to return same set of result even when time is not within the range. `timeCollected` is of the format `2015-10-29 16:05:06`.... | 2015/10/30 | [
"https://Stackoverflow.com/questions/33436494",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3100757/"
] | Using Standard SQL:
```
SELECT * FROM data
WHERE timestamp > TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL -60 MINUTE)
``` | Using Standard SQL:
```
SELECT * FROM data WHERE timestamp > **TIMESTAMP_SUB**(CURRENT_TIMESTAMP(), INTERVAL 60 MINUTE)
``` |
44,721,213 | How can I plot 3D figures in scilab? I'm looking for something like [pcshow](https://in.mathworks.com/help/vision/ref/pcshow.html) in matlab. | 2017/06/23 | [
"https://Stackoverflow.com/questions/44721213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8205017/"
] | Do this instead:
```
bool (*myArray)[2] = calloc(N, sizeof(*myArray));
```
---
Or, if you do not wish to modify your declaration, just get rid of the first calloc here and modify your for loop:
```
myArray = calloc(N, 2*sizeof(bool)); // you do not need that
for (int i=0; i < 2; i++)
{
myArray[i] = calloc(N, s... | The reason you can't reallocate `myArray` is that `myArray` is not a pointer. It is an array of two pointers to `bool`. It is also, contrary to your description, not a "2-dimension array".
All you need to do is
```
for (int i=0; i < 2; ++i)
{
myArray[i] = calloc(N, sizeof(bool));
}
```
and you can then use as a... |
44,721,213 | How can I plot 3D figures in scilab? I'm looking for something like [pcshow](https://in.mathworks.com/help/vision/ref/pcshow.html) in matlab. | 2017/06/23 | [
"https://Stackoverflow.com/questions/44721213",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8205017/"
] | This code:
```
bool* myArray[2];
int N;
```
doesn't declare a 2-dimensional array but an array of pointers. This is an important difference because 2-dimensional arrays are not *arrays of pointers to arrays* -- they are just stored contiguously, like 1-dimensional arrays are (one "row" after the other).
So, as you ... | The reason you can't reallocate `myArray` is that `myArray` is not a pointer. It is an array of two pointers to `bool`. It is also, contrary to your description, not a "2-dimension array".
All you need to do is
```
for (int i=0; i < 2; ++i)
{
myArray[i] = calloc(N, sizeof(bool));
}
```
and you can then use as a... |
939,971 | Setfocus() only works on windows, not browser tabs. Any ideas? | 2009/06/02 | [
"https://Stackoverflow.com/questions/939971",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17675/"
] | if you are talking about switching tabs, you cant do it. sorry. | If this is strictly for IE and for an intranet where you have significant control over software versions, etc, you might be able to solve this by making an addon for IE. |
299,518 | I have installed the latest version of iTerm2 and I have found that INSERT while inserting a file under vim is not showing on the screen. Also, I am not able to see parameters under top command.
[](https://i.stack.imgur.com/FC8wC.png) | 2017/09/24 | [
"https://apple.stackexchange.com/questions/299518",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/256830/"
] | That was the issue of the colour. I have previously changed the background colour to white Hence, it was not showing. I have changed the colour of the "BOLD" text to black and now I am able to see the `--- INSERT ---` and the bold text on the TOP.
Also, I have deleted all of the setting to check.
Ref: <http://iterm2... | Not sure about top, but in Vim, try `:set showmode`. |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | The iPhone SDK requires Mac OS, and you need to install the SDK even if you plan to develop applications with, say, [MonoTouch](http://www.mono-project.com/MonoTouch) or [Corona](http://www.anscamobile.com/faq/).
I don't know if Mac OS can be run as a virtual machine inside Linux. Anyway, you may consider buying a Mac... | xCode without Mac OS is definitely not possible. The real question here is, wether it's possible to install the complete Mac operating system in a virtual environment or not. |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | The [OSX86](http://www.osx86project.org/) project might solve your problem. It's not as convenient as buying a cheap Mac, but you can install it on a regular PC and it seems there are ways to install XCode on it.
If you end up buying a Mac, be sure to look at the specs for IPhone development first. If I remember corr... | As far as I know iPhone development under unix is only possible if you jailbreak your iPhone. Which I would not recommend. You could try to buy a used Intel mac mini to develop for the iPhone. |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | The iPhone SDK requires Mac OS, and you need to install the SDK even if you plan to develop applications with, say, [MonoTouch](http://www.mono-project.com/MonoTouch) or [Corona](http://www.anscamobile.com/faq/).
I don't know if Mac OS can be run as a virtual machine inside Linux. Anyway, you may consider buying a Mac... | The [OSX86](http://www.osx86project.org/) project might solve your problem. It's not as convenient as buying a cheap Mac, but you can install it on a regular PC and it seems there are ways to install XCode on it.
If you end up buying a Mac, be sure to look at the specs for IPhone development first. If I remember corr... |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | The iPhone SDK requires Mac OS, and you need to install the SDK even if you plan to develop applications with, say, [MonoTouch](http://www.mono-project.com/MonoTouch) or [Corona](http://www.anscamobile.com/faq/).
I don't know if Mac OS can be run as a virtual machine inside Linux. Anyway, you may consider buying a Mac... | Last Saturday I tested a very nice soft called... VMware !
So is it possible to install mac OSX leopard on this kind of virtual machine ? |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | xCode without Mac OS is definitely not possible. The real question here is, wether it's possible to install the complete Mac operating system in a virtual environment or not. | Martin,
I am doing some apps development for an iPhone and I have a Windows 7. You can install VMWare and install the Mac OS 10.6 through this and load xCode from Mac. The key is in finding the correct place to download VMWare and Mac OS.
Good Luck. |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | The [OSX86](http://www.osx86project.org/) project might solve your problem. It's not as convenient as buying a cheap Mac, but you can install it on a regular PC and it seems there are ways to install XCode on it.
If you end up buying a Mac, be sure to look at the specs for IPhone development first. If I remember corr... | Martin,
I am doing some apps development for an iPhone and I have a Windows 7. You can install VMWare and install the Mac OS 10.6 through this and load xCode from Mac. The key is in finding the correct place to download VMWare and Mac OS.
Good Luck. |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | The iPhone SDK requires Mac OS, and you need to install the SDK even if you plan to develop applications with, say, [MonoTouch](http://www.mono-project.com/MonoTouch) or [Corona](http://www.anscamobile.com/faq/).
I don't know if Mac OS can be run as a virtual machine inside Linux. Anyway, you may consider buying a Mac... | Martin,
I am doing some apps development for an iPhone and I have a Windows 7. You can install VMWare and install the Mac OS 10.6 through this and load xCode from Mac. The key is in finding the correct place to download VMWare and Mac OS.
Good Luck. |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | xCode without Mac OS is definitely not possible. The real question here is, wether it's possible to install the complete Mac operating system in a virtual environment or not. | Last Saturday I tested a very nice soft called... VMware !
So is it possible to install mac OSX leopard on this kind of virtual machine ? |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | xCode without Mac OS is definitely not possible. The real question here is, wether it's possible to install the complete Mac operating system in a virtual environment or not. | As far as I know iPhone development under unix is only possible if you jailbreak your iPhone. Which I would not recommend. You could try to buy a used Intel mac mini to develop for the iPhone. |
1,372,372 | My question is very simple:
* Is there any solution to install xCode, or equivalent, under unix OS, like ubuntu ?
Indeed, i don't want to buy an expensive macbook to develop my private iPhone applications. | 2009/09/03 | [
"https://Stackoverflow.com/questions/1372372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/127493/"
] | The iPhone SDK requires Mac OS, and you need to install the SDK even if you plan to develop applications with, say, [MonoTouch](http://www.mono-project.com/MonoTouch) or [Corona](http://www.anscamobile.com/faq/).
I don't know if Mac OS can be run as a virtual machine inside Linux. Anyway, you may consider buying a Mac... | As far as I know iPhone development under unix is only possible if you jailbreak your iPhone. Which I would not recommend. You could try to buy a used Intel mac mini to develop for the iPhone. |
2,632,400 | I'm trying to compute this limit $\lim\_{(x,y) \to (0,0)}2x\sin^2(\frac{1}{y})$, but WolframAlpha says that it does not exist.
I'm not quite sure why. I do understand that there are oscillations coming from the $\sin(1/y)$. However, $x \to 0$ as well. Shouldn't that crush the function to zero?
Also, I know that $\li... | 2018/02/02 | [
"https://math.stackexchange.com/questions/2632400",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/99142/"
] | It is equal to $0$ according to Wolfram alpha.
[](https://i.stack.imgur.com/rklfM.png)
The domain of the function should exclude the $x$-axis, that is the domain $D = \{ (x,y) : y \neq 0\}$.
Let $\epsilon > 0$, we choose $\delta = \frac{\epsilon}2$,... | $$|2x\sin^2(1/y)|\le 2|x|\cdot |1|\le 2|x|.$$
Since $2|x|\to 0$ as $x\to 0$, the limit is not undefined. |
43,698,606 | I have a simple web application that I've deployed to Microsoft Azure.
```
User.aspx
Admin.aspx
```
I am going to be the only admin so I don't want to put in authorization system if I don't have to. What are some simple ways to lock down my admin page so I can be the only admin and not have to login? Just looking t... | 2017/04/29 | [
"https://Stackoverflow.com/questions/43698606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139698/"
] | Best solution would be *not to publish the admin page* to a public server. If possible, run a local instance instead which connects to the database.
Otherwise you can think of some possible (not the best) options, which you can also combine:
* set some sort of identification in the url: Admin.aspx?user=admin&pwd=admi... | Do a redirect based on client's IP address.
In the admin.aspx Page\_load event check the IP address and if not whitelisted then redirect to Users.aspx.
To get users's IP address see [this](https://stackoverflow.com/a/19286308/1093508) question. |
578,641 | Please tell me if my assumption is correct.
So nuclear fusion does not occur with nuclei (with a nucleon number higher than 56) because the binding energy of the product nucleus is lower than the binding energy of the nuclei fusing together.
Due to the product nucleus having a lower binding energy (and thus lower mass ... | 2020/09/09 | [
"https://physics.stackexchange.com/questions/578641",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/273464/"
] | This notation seems a bit confusing to me and I would recommend reading a different text on the topic.
However, in the terms that you present, $\Omega(N,V,E)$ is the number of different (non-repeated) microstates compatible with the macrostate $(N,V,E)$. This is different from $\mathcal{N}$, which is the random collec... | This notation seems familiar. There is a small error here, if all the *quantum* states were equally likely, then degenerate eigenvalues would be more likely observed and $P\_i \neq \dfrac{1}{\Omega}$. I have given the corrected statement here. Besides that, let me answer your questions.
>
> My question is, isn't $\ma... |
11,173,363 | Below is some jQuery code the i wrote to make a simple animation. However I'm SO new to it i have no idea how to condense it down and get baffled by tutorials!
```
<!-- Login Form Div Animation -->
<script type="text/javascript">
$(document).ready(function() {
$('#button-active').hide();
if ($("#LoginButton").... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11173363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477407/"
] | One big thing regarding optimization in jQuery is knowing that the jQuery function `jQuery()` often aliased as `$()` is indeed a function.
That means that using `$('#some_id')` is actually calling a function which **looks for** the HTML element with the id #some\_id. This is costly performance wise because **looking f... | Best i get can do. You had a lot of repeating functions
```
$(document).ready(function() {
//Start hidden
$('#button-active').hide();
$("#TopLoginForm").hide();
// clicking "login"
$("#LoginButton").click( function() {
if ($("#LoginButton").hasClass("inactive")) {
$("#LoginButton").ani... |
11,173,363 | Below is some jQuery code the i wrote to make a simple animation. However I'm SO new to it i have no idea how to condense it down and get baffled by tutorials!
```
<!-- Login Form Div Animation -->
<script type="text/javascript">
$(document).ready(function() {
$('#button-active').hide();
if ($("#LoginButton").... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11173363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477407/"
] | The big thing you can do is avoid running the same query twice, if you know the results haven't changed. Chain or cache the results of your jQuery calls! Instead of:
```
$('#button-active').hide();
$('#button-active').delay(30).fadeIn(1000);
```
you can use the chainability of jQuery objects. In fact, you're already... | Best i get can do. You had a lot of repeating functions
```
$(document).ready(function() {
//Start hidden
$('#button-active').hide();
$("#TopLoginForm").hide();
// clicking "login"
$("#LoginButton").click( function() {
if ($("#LoginButton").hasClass("inactive")) {
$("#LoginButton").ani... |
11,173,363 | Below is some jQuery code the i wrote to make a simple animation. However I'm SO new to it i have no idea how to condense it down and get baffled by tutorials!
```
<!-- Login Form Div Animation -->
<script type="text/javascript">
$(document).ready(function() {
$('#button-active').hide();
if ($("#LoginButton").... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11173363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477407/"
] | One big thing regarding optimization in jQuery is knowing that the jQuery function `jQuery()` often aliased as `$()` is indeed a function.
That means that using `$('#some_id')` is actually calling a function which **looks for** the HTML element with the id #some\_id. This is costly performance wise because **looking f... | Here's my take on simplifying it:
```
<script type="text/javascript">
$(document).ready(function() {
var loginButton = $("#LoginButton");
var topLoginForm = $("#TopLoginForm").toggle(!loginButton.hasClass("inactive"));
loginButton.click( function() {
var this$ = $(this);
if (this$.hasClass(... |
11,173,363 | Below is some jQuery code the i wrote to make a simple animation. However I'm SO new to it i have no idea how to condense it down and get baffled by tutorials!
```
<!-- Login Form Div Animation -->
<script type="text/javascript">
$(document).ready(function() {
$('#button-active').hide();
if ($("#LoginButton").... | 2012/06/23 | [
"https://Stackoverflow.com/questions/11173363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1477407/"
] | The big thing you can do is avoid running the same query twice, if you know the results haven't changed. Chain or cache the results of your jQuery calls! Instead of:
```
$('#button-active').hide();
$('#button-active').delay(30).fadeIn(1000);
```
you can use the chainability of jQuery objects. In fact, you're already... | Here's my take on simplifying it:
```
<script type="text/javascript">
$(document).ready(function() {
var loginButton = $("#LoginButton");
var topLoginForm = $("#TopLoginForm").toggle(!loginButton.hasClass("inactive"));
loginButton.click( function() {
var this$ = $(this);
if (this$.hasClass(... |
13,723,536 | We want to create logical folders within a bucket but not more than for 100 buckets. Assuming that we only have only one AWS account, we want to distribute the uploaded documents among those 100 buckets. What would be the best practice to enforce a IAM policy for all buckets, so that having multiple users, only the doc... | 2012/12/05 | [
"https://Stackoverflow.com/questions/13723536",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I'm not sure that I fully understand your use case. Why do you want to distribute your buckets among your users?
Regarding the best practices for using IAM for "home directory" for a user, you can find in [AWS Docs](http://docs.amazonwebservices.com/AmazonS3/latest/dev/UsingIAMPolicies.html):
```
{
"Statement":[{... | As [mentioned by @Guy](https://stackoverflow.com/a/13747567/1037948), folders per user is better than buckets per user, but in either case you can use the [policy variable](http://docs.aws.amazon.com/IAM/latest/UserGuide/PolicyVariables.html) `${aws:username}` for one rule rather than multiple rules. See [example in th... |
8,540 | Presumably people in Okinawa didn't walk around barefoot. If the original purpose of karate is self-defense, wouldn't it make more sense to train in similar clothing to what you'd be wearing if you were attacked? | 2018/09/07 | [
"https://martialarts.stackexchange.com/questions/8540",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/9320/"
] | Whilst I cannot answer the origins, there are many reasons why I still instruct barefoot to a barefoot class.
1. Safety - when we involve blocks of kicks - any design in the shoes worn, hard plastics or metal especially, could damage the blocker in an inconsistent way (making it harder for the blocker to build confide... | Some kicking styles do use shoes: in [Savate](https://en.wikipedia.org/wiki/Savate), shoes are worn in training and sparing.
In Japanese culture, wearing shoes indoor is considered impolite and dirty. Thus, shoes are taken off at the front door. All dojo are indoor buildings thus I can safely assume that shoes would n... |
8,540 | Presumably people in Okinawa didn't walk around barefoot. If the original purpose of karate is self-defense, wouldn't it make more sense to train in similar clothing to what you'd be wearing if you were attacked? | 2018/09/07 | [
"https://martialarts.stackexchange.com/questions/8540",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/9320/"
] | In Japanese styles, it is unquestionably about cleanliness. They don't wear outside shoes in one's home, and zori are used for that purpose. But zori make it somewhat difficult to train in, and as well, expensive tatami mats do not wear well with shoes worn. So, they train barefoot. I've seen many a Japanese instructor... | Whilst I cannot answer the origins, there are many reasons why I still instruct barefoot to a barefoot class.
1. Safety - when we involve blocks of kicks - any design in the shoes worn, hard plastics or metal especially, could damage the blocker in an inconsistent way (making it harder for the blocker to build confide... |
8,540 | Presumably people in Okinawa didn't walk around barefoot. If the original purpose of karate is self-defense, wouldn't it make more sense to train in similar clothing to what you'd be wearing if you were attacked? | 2018/09/07 | [
"https://martialarts.stackexchange.com/questions/8540",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/9320/"
] | This answer does not directly address the karate aspect, but I think it is still relevant, as Collett89 has pointed out in his comment.
The development of your feet and legs depends upon the environment you put them in. Training barefoot forces you to use your feet to a greater degree than when in shoes. For some peo... | Some kicking styles do use shoes: in [Savate](https://en.wikipedia.org/wiki/Savate), shoes are worn in training and sparing.
In Japanese culture, wearing shoes indoor is considered impolite and dirty. Thus, shoes are taken off at the front door. All dojo are indoor buildings thus I can safely assume that shoes would n... |
8,540 | Presumably people in Okinawa didn't walk around barefoot. If the original purpose of karate is self-defense, wouldn't it make more sense to train in similar clothing to what you'd be wearing if you were attacked? | 2018/09/07 | [
"https://martialarts.stackexchange.com/questions/8540",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/9320/"
] | In Japanese styles, it is unquestionably about cleanliness. They don't wear outside shoes in one's home, and zori are used for that purpose. But zori make it somewhat difficult to train in, and as well, expensive tatami mats do not wear well with shoes worn. So, they train barefoot. I've seen many a Japanese instructor... | This answer does not directly address the karate aspect, but I think it is still relevant, as Collett89 has pointed out in his comment.
The development of your feet and legs depends upon the environment you put them in. Training barefoot forces you to use your feet to a greater degree than when in shoes. For some peo... |
8,540 | Presumably people in Okinawa didn't walk around barefoot. If the original purpose of karate is self-defense, wouldn't it make more sense to train in similar clothing to what you'd be wearing if you were attacked? | 2018/09/07 | [
"https://martialarts.stackexchange.com/questions/8540",
"https://martialarts.stackexchange.com",
"https://martialarts.stackexchange.com/users/9320/"
] | In Japanese styles, it is unquestionably about cleanliness. They don't wear outside shoes in one's home, and zori are used for that purpose. But zori make it somewhat difficult to train in, and as well, expensive tatami mats do not wear well with shoes worn. So, they train barefoot. I've seen many a Japanese instructor... | Some kicking styles do use shoes: in [Savate](https://en.wikipedia.org/wiki/Savate), shoes are worn in training and sparing.
In Japanese culture, wearing shoes indoor is considered impolite and dirty. Thus, shoes are taken off at the front door. All dojo are indoor buildings thus I can safely assume that shoes would n... |
35,081,658 | I am using Jenkins for continuous build for java projects and i am using deploy plugin,it takes a war/ear file and deploys that to a running remote application server at the end of a build successful.
I am stuck at one scenario of deployment,if my new build fails then we have to push rollback version of build to a tomc... | 2016/01/29 | [
"https://Stackoverflow.com/questions/35081658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311960/"
] | This CSS causes the issue:
```
@media screen and (max-width: 800px)
.title {
width: 440px;
}
```
At VERY small screen sizes the 440px will exceed the screen. Try 90% or something instead. | you apply fix `width` change all `width` to media query
Example
```
.footer {
margin:0 auto;
width: 1024px;
height: 350px;
}
c2leftimage {
margin: 0 auto;
width: 453px;
}
.c2rightimage {
margin: 0 auto;
width: 453px;
height: 453px;
}
``` |
35,081,658 | I am using Jenkins for continuous build for java projects and i am using deploy plugin,it takes a war/ear file and deploys that to a running remote application server at the end of a build successful.
I am stuck at one scenario of deployment,if my new build fails then we have to push rollback version of build to a tomc... | 2016/01/29 | [
"https://Stackoverflow.com/questions/35081658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311960/"
] | Fixed widths are your problem(of images or texts) - try to have it in percent, not fixed(in pixels)...at least for device widths smaller that 500px or so. | you apply fix `width` change all `width` to media query
Example
```
.footer {
margin:0 auto;
width: 1024px;
height: 350px;
}
c2leftimage {
margin: 0 auto;
width: 453px;
}
.c2rightimage {
margin: 0 auto;
width: 453px;
height: 453px;
}
``` |
35,081,658 | I am using Jenkins for continuous build for java projects and i am using deploy plugin,it takes a war/ear file and deploys that to a running remote application server at the end of a build successful.
I am stuck at one scenario of deployment,if my new build fails then we have to push rollback version of build to a tomc... | 2016/01/29 | [
"https://Stackoverflow.com/questions/35081658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311960/"
] | This CSS causes the issue:
```
@media screen and (max-width: 800px)
.title {
width: 440px;
}
```
At VERY small screen sizes the 440px will exceed the screen. Try 90% or something instead. | As i have seen you have add width in PX you have used only one media query
```
@media screen and (max-width: 800px)
```
try to add more query and rest all widths and also you need to make images responsive to do for images add these properties
img{display: block;
max-width:100%;
height: auto;} |
35,081,658 | I am using Jenkins for continuous build for java projects and i am using deploy plugin,it takes a war/ear file and deploys that to a running remote application server at the end of a build successful.
I am stuck at one scenario of deployment,if my new build fails then we have to push rollback version of build to a tomc... | 2016/01/29 | [
"https://Stackoverflow.com/questions/35081658",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2311960/"
] | Fixed widths are your problem(of images or texts) - try to have it in percent, not fixed(in pixels)...at least for device widths smaller that 500px or so. | As i have seen you have add width in PX you have used only one media query
```
@media screen and (max-width: 800px)
```
try to add more query and rest all widths and also you need to make images responsive to do for images add these properties
img{display: block;
max-width:100%;
height: auto;} |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Note that
$$\begin{align}
\int\_1^{2^n}\frac{1}{u}\,du&=\int\_1^2\frac{1}{u}\,du+\int\_2^4\frac{1}{u}\,du+\int\_4^8\frac{1}{u}\,du+\cdots +\int\_{2^{n-1}}^{2^n}\frac{1}{u}\,du\\\\
&\ge \left(\frac{1}{1}\right)\left(2-1\right)+\left(\frac{1}{2}\right)\left(4-2\right)+\left(\frac{1}{4}\right)\left(8-4\right)+\cdots +\l... | $$\int\_{ac}^{bc}\frac{dx}{x}=\int\_{cx=ac}^{cx=bc}\frac{d(cx)}{cx}=\int\_{a}^{b}\frac{dx}{x}$$
$$\therefore\int\_{1}^{\infty}\frac{dx}{x}=\sum\_{n=0}^\infty\int\_{2^n}^{2^{n+1}}\frac{dx}{x}=\\
\sum\_{n=0}^\infty\int\_{1}^{2}\frac{dx}{x}=+\infty$$ |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Let $x = y/2.$ Then
$$\int\_1^\infty\frac{dx}{x} = \int\_2^\infty\frac{dy}{y}.$$
That is a contradiction unless both integrals equal $\infty.$ | $$\int\_{ac}^{bc}\frac{dx}{x}=\int\_{cx=ac}^{cx=bc}\frac{d(cx)}{cx}=\int\_{a}^{b}\frac{dx}{x}$$
$$\therefore\int\_{1}^{\infty}\frac{dx}{x}=\sum\_{n=0}^\infty\int\_{2^n}^{2^{n+1}}\frac{dx}{x}=\\
\sum\_{n=0}^\infty\int\_{1}^{2}\frac{dx}{x}=+\infty$$ |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Maybe this one. Change variables $x=t^{1/2}, dx = (1/2)t^{-1/2}\,dt$.
Then
$$
\int\_1^\infty \frac{1}{x}\;dx =
\int\_1^\infty \frac{1}{t^{1/2}}\;\frac{t^{-1/2}}{2}\;dt
= \frac{1}{2}\int\_1^\infty \frac{1}{t}\;dt
$$
Now $\int\_1^\infty \frac{dx}{x} > \int\_1^2 \frac{dx}{2} = \frac{1}{2} > 0$. So conclude it is $+\inf... | Note that
$$\begin{align}
\int\_1^{2^n}\frac{1}{u}\,du&=\int\_1^2\frac{1}{u}\,du+\int\_2^4\frac{1}{u}\,du+\int\_4^8\frac{1}{u}\,du+\cdots +\int\_{2^{n-1}}^{2^n}\frac{1}{u}\,du\\\\
&\ge \left(\frac{1}{1}\right)\left(2-1\right)+\left(\frac{1}{2}\right)\left(4-2\right)+\left(\frac{1}{4}\right)\left(8-4\right)+\cdots +\l... |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | This was pointed out in the comments above, so since no one else wrote this in an answer, I will.
You have (by definition)
$$\begin{align}
\int\_1^\infty \frac{1}{x}\; dx
&= \lim\_{t\to \infty}\int\_1^t \frac{1}{x}\; dx \\
&= \lim\_{t\to \infty} \ln(x)\large]\_1^t \\
&= \lim\_{t\to \infty} \ln(t) - \ln(1) \\
&= \lim\... | $$\int\_{ac}^{bc}\frac{dx}{x}=\int\_{cx=ac}^{cx=bc}\frac{d(cx)}{cx}=\int\_{a}^{b}\frac{dx}{x}$$
$$\therefore\int\_{1}^{\infty}\frac{dx}{x}=\sum\_{n=0}^\infty\int\_{2^n}^{2^{n+1}}\frac{dx}{x}=\\
\sum\_{n=0}^\infty\int\_{1}^{2}\frac{dx}{x}=+\infty$$ |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Since
$$
\int\_a^{2a}\frac{\mathrm{d}x}x=\log(2)
$$
we have that
$$
\begin{align}
\int\_1^{2^n}\frac{\mathrm{d}x}x
&=\int\_1^2\frac{\mathrm{d}x}x+\int\_2^4\frac{\mathrm{d}x}x+\cdots+\int\_{2^{n-1}}^{2^n}\frac{\mathrm{d}x}x\\[6pt]
&=n\log(2)
\end{align}
$$
Let $n\to\infty$. | Note that
$$\begin{align}
\int\_1^{2^n}\frac{1}{u}\,du&=\int\_1^2\frac{1}{u}\,du+\int\_2^4\frac{1}{u}\,du+\int\_4^8\frac{1}{u}\,du+\cdots +\int\_{2^{n-1}}^{2^n}\frac{1}{u}\,du\\\\
&\ge \left(\frac{1}{1}\right)\left(2-1\right)+\left(\frac{1}{2}\right)\left(4-2\right)+\left(\frac{1}{4}\right)\left(8-4\right)+\cdots +\l... |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Since
$$
\int\_a^{2a}\frac{\mathrm{d}x}x=\log(2)
$$
we have that
$$
\begin{align}
\int\_1^{2^n}\frac{\mathrm{d}x}x
&=\int\_1^2\frac{\mathrm{d}x}x+\int\_2^4\frac{\mathrm{d}x}x+\cdots+\int\_{2^{n-1}}^{2^n}\frac{\mathrm{d}x}x\\[6pt]
&=n\log(2)
\end{align}
$$
Let $n\to\infty$. | $$\int\_{ac}^{bc}\frac{dx}{x}=\int\_{cx=ac}^{cx=bc}\frac{d(cx)}{cx}=\int\_{a}^{b}\frac{dx}{x}$$
$$\therefore\int\_{1}^{\infty}\frac{dx}{x}=\sum\_{n=0}^\infty\int\_{2^n}^{2^{n+1}}\frac{dx}{x}=\\
\sum\_{n=0}^\infty\int\_{1}^{2}\frac{dx}{x}=+\infty$$ |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Maybe this one. Change variables $x=t^{1/2}, dx = (1/2)t^{-1/2}\,dt$.
Then
$$
\int\_1^\infty \frac{1}{x}\;dx =
\int\_1^\infty \frac{1}{t^{1/2}}\;\frac{t^{-1/2}}{2}\;dt
= \frac{1}{2}\int\_1^\infty \frac{1}{t}\;dt
$$
Now $\int\_1^\infty \frac{dx}{x} > \int\_1^2 \frac{dx}{2} = \frac{1}{2} > 0$. So conclude it is $+\inf... | $$\int\_{ac}^{bc}\frac{dx}{x}=\int\_{cx=ac}^{cx=bc}\frac{d(cx)}{cx}=\int\_{a}^{b}\frac{dx}{x}$$
$$\therefore\int\_{1}^{\infty}\frac{dx}{x}=\sum\_{n=0}^\infty\int\_{2^n}^{2^{n+1}}\frac{dx}{x}=\\
\sum\_{n=0}^\infty\int\_{1}^{2}\frac{dx}{x}=+\infty$$ |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Let $x = y/2.$ Then
$$\int\_1^\infty\frac{dx}{x} = \int\_2^\infty\frac{dy}{y}.$$
That is a contradiction unless both integrals equal $\infty.$ | Note that
$$\begin{align}
\int\_1^{2^n}\frac{1}{u}\,du&=\int\_1^2\frac{1}{u}\,du+\int\_2^4\frac{1}{u}\,du+\int\_4^8\frac{1}{u}\,du+\cdots +\int\_{2^{n-1}}^{2^n}\frac{1}{u}\,du\\\\
&\ge \left(\frac{1}{1}\right)\left(2-1\right)+\left(\frac{1}{2}\right)\left(4-2\right)+\left(\frac{1}{4}\right)\left(8-4\right)+\cdots +\l... |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Let $x = y/2.$ Then
$$\int\_1^\infty\frac{dx}{x} = \int\_2^\infty\frac{dy}{y}.$$
That is a contradiction unless both integrals equal $\infty.$ | Maybe this one. Change variables $x=t^{1/2}, dx = (1/2)t^{-1/2}\,dt$.
Then
$$
\int\_1^\infty \frac{1}{x}\;dx =
\int\_1^\infty \frac{1}{t^{1/2}}\;\frac{t^{-1/2}}{2}\;dt
= \frac{1}{2}\int\_1^\infty \frac{1}{t}\;dt
$$
Now $\int\_1^\infty \frac{dx}{x} > \int\_1^2 \frac{dx}{2} = \frac{1}{2} > 0$. So conclude it is $+\inf... |
1,363,900 | I was reading up on the harmonic series,
$H=\sum\limits\_{n=1}^\infty\frac1n$, on Wikipedia, and it's divergent, as can be shown by a comparison test using the fact that
$\begin{aligned}H&=1+\frac12+\left(\frac13+\frac14\right)+\left(\frac15+\frac16+\frac17+\frac18\right)+\cdots\\&\geq 1+\frac12+\left(\frac14+\frac14\... | 2015/07/16 | [
"https://math.stackexchange.com/questions/1363900",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/215489/"
] | Let $x = y/2.$ Then
$$\int\_1^\infty\frac{dx}{x} = \int\_2^\infty\frac{dy}{y}.$$
That is a contradiction unless both integrals equal $\infty.$ | This was pointed out in the comments above, so since no one else wrote this in an answer, I will.
You have (by definition)
$$\begin{align}
\int\_1^\infty \frac{1}{x}\; dx
&= \lim\_{t\to \infty}\int\_1^t \frac{1}{x}\; dx \\
&= \lim\_{t\to \infty} \ln(x)\large]\_1^t \\
&= \lim\_{t\to \infty} \ln(t) - \ln(1) \\
&= \lim\... |
60,173,826 | Got this API response:
```
...
"campaigns": [
{
"id": 2,
"name": {
"en": "Example Campaign",
"de": "Beispiel Kampagne"
},
"targetagegroup": null,
...
```
I'm decoding into:
```swift
cl... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60173826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12596139/"
] | Your second object doesn't appear to be valid JSON.
```
{
"someproperty": null,
"slogan": {
"en": "foo",
"de": "bar"
},
"someotherproperty": null,
}
```
That decodes for me just fine. | Like I said in my comment, i think you receive a plain string into your "slogan" property in your JSON result. And not an object like you describe.
I tried in a playground :
```swift
struct Campain: Codable {
var slogan: [String:String]?
}
let json = "{\"slogan\": \"\"}"
let campain = JSONDecoder().decode(Campai... |
60,173,826 | Got this API response:
```
...
"campaigns": [
{
"id": 2,
"name": {
"en": "Example Campaign",
"de": "Beispiel Kampagne"
},
"targetagegroup": null,
...
```
I'm decoding into:
```swift
cl... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60173826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12596139/"
] | The error clearly says
>
> The value for key `slogan`
>
> at index 1 of array `participants`
>
> at index 0 of array `element`
>
> in `detailresponse`
>
>
>
is a string rather than the expected dictionary.
Please check the JSON | Like I said in my comment, i think you receive a plain string into your "slogan" property in your JSON result. And not an object like you describe.
I tried in a playground :
```swift
struct Campain: Codable {
var slogan: [String:String]?
}
let json = "{\"slogan\": \"\"}"
let campain = JSONDecoder().decode(Campai... |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | Use `[disabled]` attribute with one flag for it.
**component.html**
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input" [(ngModel)]="isDisabled" id="remember-me" name="rememberMe">
<label class="form-check-label" for="remember-me">I have signed the agreements</label>
</div>
<button... | use `ng-disabled` property :
```html
<!DOCTYPE html>
<html ng-app>
<head>
<script src="http://code.angularjs.org/1.2.0/angular.min.js"></script>
</head>
<body> <input type="checkbox" class="form-check-input id="agreements" ng-model="checked">
<label clas... |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | Use `[disabled]` attribute with one flag for it.
**component.html**
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input" [(ngModel)]="isDisabled" id="remember-me" name="rememberMe">
<label class="form-check-label" for="remember-me">I have signed the agreements</label>
</div>
<button... | I think having a Reactive Form in place with required validators would give you more control over the form implementation.
You could create a Reactive Form that looks something like this:
```
import { Component } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
... |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | Use `[disabled]` attribute with one flag for it.
**component.html**
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input" [(ngModel)]="isDisabled" id="remember-me" name="rememberMe">
<label class="form-check-label" for="remember-me">I have signed the agreements</label>
</div>
<button... | You can use [disabled] attribute to enable/disable submit button:
>
> TS file:
>
>
>
```
export class AppComponent {
isDisabled: boolean = true;
updateStatus($event){
$event.target.checked === true ? this.isDisabled = false: this.isDisabled = true;
}
}
```
>
> HTML file
>
>
>
```
<div>
<input... |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | Use `[disabled]` attribute with one flag for it.
**component.html**
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input" [(ngModel)]="isDisabled" id="remember-me" name="rememberMe">
<label class="form-check-label" for="remember-me">I have signed the agreements</label>
</div>
<button... | Here is a sample working demo
<https://stackblitz.com/edit/angular-fz73re> |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | I think having a Reactive Form in place with required validators would give you more control over the form implementation.
You could create a Reactive Form that looks something like this:
```
import { Component } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
... | use `ng-disabled` property :
```html
<!DOCTYPE html>
<html ng-app>
<head>
<script src="http://code.angularjs.org/1.2.0/angular.min.js"></script>
</head>
<body> <input type="checkbox" class="form-check-input id="agreements" ng-model="checked">
<label clas... |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | use `ng-disabled` property :
```html
<!DOCTYPE html>
<html ng-app>
<head>
<script src="http://code.angularjs.org/1.2.0/angular.min.js"></script>
</head>
<body> <input type="checkbox" class="form-check-input id="agreements" ng-model="checked">
<label clas... | You can use [disabled] attribute to enable/disable submit button:
>
> TS file:
>
>
>
```
export class AppComponent {
isDisabled: boolean = true;
updateStatus($event){
$event.target.checked === true ? this.isDisabled = false: this.isDisabled = true;
}
}
```
>
> HTML file
>
>
>
```
<div>
<input... |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | I think having a Reactive Form in place with required validators would give you more control over the form implementation.
You could create a Reactive Form that looks something like this:
```
import { Component } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
... | You can use [disabled] attribute to enable/disable submit button:
>
> TS file:
>
>
>
```
export class AppComponent {
isDisabled: boolean = true;
updateStatus($event){
$event.target.checked === true ? this.isDisabled = false: this.isDisabled = true;
}
}
```
>
> HTML file
>
>
>
```
<div>
<input... |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | I think having a Reactive Form in place with required validators would give you more control over the form implementation.
You could create a Reactive Form that looks something like this:
```
import { Component } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
@Component({
... | Here is a sample working demo
<https://stackblitz.com/edit/angular-fz73re> |
59,409,741 | I have an Angular component with a checkbox and a button that should be disabled if the checkbox is unchecked.
What is the correct way for this?
```
<div class="form-check my-5">
<input type="checkbox" class="form-check-input id="agreements">
<label class="form-check-label" for="agreements">I have signed the agree... | 2019/12/19 | [
"https://Stackoverflow.com/questions/59409741",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8526376/"
] | Here is a sample working demo
<https://stackblitz.com/edit/angular-fz73re> | You can use [disabled] attribute to enable/disable submit button:
>
> TS file:
>
>
>
```
export class AppComponent {
isDisabled: boolean = true;
updateStatus($event){
$event.target.checked === true ? this.isDisabled = false: this.isDisabled = true;
}
}
```
>
> HTML file
>
>
>
```
<div>
<input... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.