qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
62,997,978
This behavior is odd and difficult to describe so I will give it my best shot. 1. With Outlook closed, file attaches normally time after time. 2. With Outlook open, file attaches normally for the first time and then creates a 0B temp file each time after. 3. Deleting Content.Outlook has no effect. 4. No matter what th...
2020/07/20
[ "https://Stackoverflow.com/questions/62997978", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5248780/" ]
With `regex` module you could use: ``` import regex arr = ['abc,, def', 'abc, def geh', 'abc def', 'abc, def , geh,, , ijk lmn \n opq'] res = [regex.split(r'\b(?=\W)(?! +\b)|(?<=\b\W*[^\w ]+\W*\b)',x) for x in arr] print(res) ``` Prints: ``` [['abc', ',, ', 'def'], ['abc', ', ', 'def geh'], ['abc def'], ['ab...
You may use ``` import re delimiters = [r'\r\n', r'\.\.\.', r'[^\w\s]'] d = r"|".join(delimiters) pattern = re.compile(rf'((?:\s*(?:{d}))+\s*)') s = 'abc, def , geh,, , ijk lmn' print( pattern.split(s) ) # => ['abc', ', ', 'def', ' , ', 'geh', ',, , ', 'ijk lmn'] ``` See the [Python demo](https://tio.run/#...
3,230,426
I'm admittedly favour DIV, but am working on a project that uses nested tables. I have a need to move some fields that already exist, and create new fields, into what I would describe as a grid (think gridview in .NET). What is the most painless way to add columns to the nested HTML tables? Alternatively, should I inv...
2010/07/12
[ "https://Stackoverflow.com/questions/3230426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123213/" ]
You would have to add <TD> cells to each row. Since you said you also need to move things around, you should consider re-writing the output structure to a DIV format or a re-written table structure. I prefer table structures for data grids, personally.
First off, i don't know what Gridview looks like...but... If i understand the question correctly, you could try adding a `<td>` with a `<table>` inside it, then use that table as the column. When you are done with the column add in a `</table></td>` and things should be the same as before. this method can get really m...
3,230,426
I'm admittedly favour DIV, but am working on a project that uses nested tables. I have a need to move some fields that already exist, and create new fields, into what I would describe as a grid (think gridview in .NET). What is the most painless way to add columns to the nested HTML tables? Alternatively, should I inv...
2010/07/12
[ "https://Stackoverflow.com/questions/3230426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123213/" ]
You would have to add <TD> cells to each row. Since you said you also need to move things around, you should consider re-writing the output structure to a DIV format or a re-written table structure. I prefer table structures for data grids, personally.
jQuery has a great selection of DOM traversing functions. Lets say that for instance, you start with ``` <html> <body> <table id="aTable"></table> </body> </html> ``` You can then use jQuery to add to the table: ``` <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/...
3,230,426
I'm admittedly favour DIV, but am working on a project that uses nested tables. I have a need to move some fields that already exist, and create new fields, into what I would describe as a grid (think gridview in .NET). What is the most painless way to add columns to the nested HTML tables? Alternatively, should I inv...
2010/07/12
[ "https://Stackoverflow.com/questions/3230426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123213/" ]
jQuery has a great selection of DOM traversing functions. Lets say that for instance, you start with ``` <html> <body> <table id="aTable"></table> </body> </html> ``` You can then use jQuery to add to the table: ``` <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/...
First off, i don't know what Gridview looks like...but... If i understand the question correctly, you could try adding a `<td>` with a `<table>` inside it, then use that table as the column. When you are done with the column add in a `</table></td>` and things should be the same as before. this method can get really m...
4,227,234
I am reading "Analysis on Manifolds" by James R. Munkres. On p.77, > > Example 4. Let $f:\mathbb{R}^2\to\mathbb{R}$ be given by the equation $$f(x,y)=y^2-x^4.$$ > Then $(0,0)$ is a solution of the equation $f(x,y)=0$. Because $\frac{\partial f}{\partial y}$ vanishes at $(0,0)$, we do not expect to be able to solve f...
2021/08/18
[ "https://math.stackexchange.com/questions/4227234", "https://math.stackexchange.com", "https://math.stackexchange.com/users/384082/" ]
What about $$f(x,y)=y^3-x^9$$ around the origin? Assuming you are only interested in real solutions. Or $$f(x,y)=(x-y)^2?$$ A double root makes the partial derivative vanish :-)
$f(x,y)=y^3-x$ around the origin would work.
65,598,374
I'm currently working on a chat app for school, but I want to make it scroll to the bottom automatically as most chat apps do. I've tried every solution I can find so far, and I have only been getting react errors. I'm new to react so there could be some mistakes I don't realize I'm making. Here is what I have ``` cla...
2021/01/06
[ "https://Stackoverflow.com/questions/65598374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6548833/" ]
I suggest you should do this with css The chatbox content need the following markup, where the content is aligned to bottom. ``` .container { height: 100px; overflow: auto; display: flex; flex-direction: column-reverse; } ```
You should use refs instead of document query ```js class Messages extends React.Component { constructor() { super() this.messagesRef = React.createRef() } updateScroll() { this.messagesRef.current.scrollTo(0, this.messagesRef.current.scrollHeight) } render() { const mess...
65,598,374
I'm currently working on a chat app for school, but I want to make it scroll to the bottom automatically as most chat apps do. I've tried every solution I can find so far, and I have only been getting react errors. I'm new to react so there could be some mistakes I don't realize I'm making. Here is what I have ``` cla...
2021/01/06
[ "https://Stackoverflow.com/questions/65598374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6548833/" ]
I suggest you should do this with css The chatbox content need the following markup, where the content is aligned to bottom. ``` .container { height: 100px; overflow: auto; display: flex; flex-direction: column-reverse; } ```
create a dummy div below messages. ``` <div ref={messagesEndRef}></div> ``` ```js const messagesEndRef = useRef(null) const [msglist, setMsglist] = useState([]); ``` if msglist is the list of new messages, use useEffect to handle the change. ``` useEffect(() => { messagesEndRef.current.scrol...
65,598,374
I'm currently working on a chat app for school, but I want to make it scroll to the bottom automatically as most chat apps do. I've tried every solution I can find so far, and I have only been getting react errors. I'm new to react so there could be some mistakes I don't realize I'm making. Here is what I have ``` cla...
2021/01/06
[ "https://Stackoverflow.com/questions/65598374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6548833/" ]
I suggest you should do this with css The chatbox content need the following markup, where the content is aligned to bottom. ``` .container { height: 100px; overflow: auto; display: flex; flex-direction: column-reverse; } ```
Try calling the `updateScroll` function inside `componentDidMount` if you are just fetching messages from state. You can also use a ref to your `message` div and get the height from there instead of using `querySelector`
10,099,554
``` class Employee implements Comparable{ private String name; private String gender; Employee(String name, String gender) { this.name = name; this.gender = gender; } public String getName() { return name; } public void setNa...
2012/04/11
[ "https://Stackoverflow.com/questions/10099554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1325571/" ]
The sorting is based on the return value of `compareTo` (slightly reformatted for readability): ``` @Override public int compareTo(Object o) { int gendarComp = this.getGender().compareTo(((Employee)o).getGender()); return (gendarComp != 0 ? gendarComp : this.name.compareTo( ((Empl...
``` @Override public int compareTo(Object o) { int gendarComp=this.getGender().compareTo(((Employee)o).getGender()); return (gendarComp!=0 ? gendarComp : this.name.compareTo(((Employee)o).getName())); } ``` As you can see, the code first compares the ge...
10,099,554
``` class Employee implements Comparable{ private String name; private String gender; Employee(String name, String gender) { this.name = name; this.gender = gender; } public String getName() { return name; } public void setNa...
2012/04/11
[ "https://Stackoverflow.com/questions/10099554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1325571/" ]
The sorting is based on the return value of `compareTo` (slightly reformatted for readability): ``` @Override public int compareTo(Object o) { int gendarComp = this.getGender().compareTo(((Employee)o).getGender()); return (gendarComp != 0 ? gendarComp : this.name.compareTo( ((Empl...
Two people already explained what the compareTo() method does, but since you said > > but I dont really understand how it is getting called > > > I'll explain that part. When Collections.sort(allEmpls) is called, all of the list objects' compareTo() methods are called against each others', since they all implemen...
10,099,554
``` class Employee implements Comparable{ private String name; private String gender; Employee(String name, String gender) { this.name = name; this.gender = gender; } public String getName() { return name; } public void setNa...
2012/04/11
[ "https://Stackoverflow.com/questions/10099554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1325571/" ]
``` @Override public int compareTo(Object o) { int gendarComp=this.getGender().compareTo(((Employee)o).getGender()); return (gendarComp!=0 ? gendarComp : this.name.compareTo(((Employee)o).getName())); } ``` As you can see, the code first compares the ge...
Two people already explained what the compareTo() method does, but since you said > > but I dont really understand how it is getting called > > > I'll explain that part. When Collections.sort(allEmpls) is called, all of the list objects' compareTo() methods are called against each others', since they all implemen...
8,057
Holy Spirit conceives Jesus =========================== **Matthew 1:20 ESV** > > But as he considered these things, behold, an angel of the Lord > appeared to him in a dream, saying, “Joseph, son of David, do not fear > to take Mary as your wife, for that which is conceived in her is from > the **Holy Spirit**. S...
2012/06/15
[ "https://christianity.stackexchange.com/questions/8057", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/-1/" ]
The Holy Spirit is not the Father of Jesus, God the Father is. What you are asking about is the nature of the Trinity. **Trinity** Christians have always believed the Son of God was preexisting before the creation of the world and is God who created the world. The Father spoke through the Son and the Spirit performed...
Since you are pushing for more answers, I will go out on a limb and "play the heretic" with a theory I've had for a while. God, in a nutshell. ------------------- It is difficult to wrap our [3 lb. brains](http://en.wikipedia.org/wiki/Human_brain#Structure) around a God who [***is*** love](http://www.biblegateway.com...
8,057
Holy Spirit conceives Jesus =========================== **Matthew 1:20 ESV** > > But as he considered these things, behold, an angel of the Lord > appeared to him in a dream, saying, “Joseph, son of David, do not fear > to take Mary as your wife, for that which is conceived in her is from > the **Holy Spirit**. S...
2012/06/15
[ "https://christianity.stackexchange.com/questions/8057", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/-1/" ]
The Holy Spirit is not the Father of Jesus, God the Father is. What you are asking about is the nature of the Trinity. **Trinity** Christians have always believed the Son of God was preexisting before the creation of the world and is God who created the world. The Father spoke through the Son and the Spirit performed...
No.The Holy Spirit was not Jesus' Father. Rather, God fathered Jesus in Mary through the Holy Spirit: > > Matthew 1:18 (NIV) > > > This is how the birth of Jesus the Messiah came about: His mother Mary > was pledged to be married to Joseph, but before they came together, > she was found to be pregnant **through t...
8,057
Holy Spirit conceives Jesus =========================== **Matthew 1:20 ESV** > > But as he considered these things, behold, an angel of the Lord > appeared to him in a dream, saying, “Joseph, son of David, do not fear > to take Mary as your wife, for that which is conceived in her is from > the **Holy Spirit**. S...
2012/06/15
[ "https://christianity.stackexchange.com/questions/8057", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/-1/" ]
Since you are pushing for more answers, I will go out on a limb and "play the heretic" with a theory I've had for a while. God, in a nutshell. ------------------- It is difficult to wrap our [3 lb. brains](http://en.wikipedia.org/wiki/Human_brain#Structure) around a God who [***is*** love](http://www.biblegateway.com...
No.The Holy Spirit was not Jesus' Father. Rather, God fathered Jesus in Mary through the Holy Spirit: > > Matthew 1:18 (NIV) > > > This is how the birth of Jesus the Messiah came about: His mother Mary > was pledged to be married to Joseph, but before they came together, > she was found to be pregnant **through t...
72,351,618
This morning I started Google's foo.bar challenge. The quest was comparing 2 lists and returning non-same values. > > For example, given the lists x = [13, 5, 6, 2, 5] and y = [5, 2, 5, > 13], the function solution(x, y) would return 6 because the list x > contains the integer 6 and the list y doesn't. > > > So I...
2022/05/23
[ "https://Stackoverflow.com/questions/72351618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14368480/" ]
You're supposed to return `6`, not `[6]`.
Use [sets](https://docs.python.org/3/tutorial/datastructures.html#sets), which are faster than lists: ``` x = [13, 5, 6, 2, 5] y = [5, 2, 5, 13] def solution(x, y): return list(set(x) ^ set (y)) print(solution(x, y)) # [6] ``` Otherwise, you code seems correct (just not as efficient): ``` def solution2(x, y):...
2,177,312
How to prove the following? $$\frac{d^a{(x}^a)}{dx^a}+\frac{d^{a-1}{(x}^a)}{dx^{a-1}}+\frac{d^{a-2}{(x}^a)}{dx^{a-2}}+\dots +\frac{d^2{(x}^a)}{dx^2}+\frac{d^1{(x}^a)}{dx^1}+\frac{d^0{(x}^a)}{dx^0}+\int^x\_0{{(x}^a)dx}+\int^x\_0{\int^x\_0{{(x}^a)dx}dx}+\int^x\_0{\int^x\_0{\int^x\_0{{(x}^a)dx}}dxdx}+\dots =a!e^x $$ whe...
2017/03/08
[ "https://math.stackexchange.com/questions/2177312", "https://math.stackexchange.com", "https://math.stackexchange.com/users/413087/" ]
Your expression conatisn a finite sum of derivatives and an infinite sum of integrals of $x^a$. Let's look at them separately. Each derivative lowers the power by one and provides a factor of the power in front, so we have $$ \frac{\text{d}^p}{\text{d}x^p} x^a=a\cdot(a-1)\dotsm(a-p+1) \cdot x^{a-p}\\ =a\cdot(a-1)\dot...
$$a!\;e^x=a!\sum\limits\_{n=0}^{\infty}\frac{x^n}{n!}=\sum\limits\_{n=-a}^{\infty}\frac{a!\;x^{a+n}}{(a+n)!}=\sum\limits\_{n=-a}^{\infty}\frac{d^{-n}(x^a)}{dx^{-n}}$$ $$=\sum\limits\_{n=-a}^{0}\frac{d^{-n}(x^a)}{dx^{-n}}+\sum\limits\_{n=1}^{\infty}\frac{d^{-n}(x^a)}{dx^{-n}}=\sum\limits\_{n=0}^{a}\frac{d^{n}(x^a)}{dx^...
47,516,615
I use laravel 5.3 My migration like this : ``` <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateUsersTable extends Migration { public function up() { Schema::create('users', function (Blueprint $table) { ...
2017/11/27
[ "https://Stackoverflow.com/questions/47516615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5281051/" ]
You can use the schema to update an existing table. Create a new migration using the artisan command then add something like ``` Schema::table('users', function (Blueprint $table) { $table->string('mobile_number',20)->nullable(); }); ``` If you really wanted to do RAW sql you can do something like ``` DB::state...
In the command line, execute artisan command to add new migration for your table: ``` php artisan make:migration add_mobile_number_to_users_table --table=users ``` Then you can put your code inside the newly created migration file: ``` public function up() { Schema::table('users', function (Blueprint $table) { ...
27,130,775
Is spying the setter of a property something that can be achieved via Reflection? Let's say, for instance, that I have a method somewhere that receives the following: ``` private void LogPropertySetter(string propertyName, string newPropertyValue) { Logger.Log("Property " + propertyName + " has been set to " + ne...
2014/11/25
[ "https://Stackoverflow.com/questions/27130775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/787856/" ]
No, nothing like this can ever be done with reflection. Reflection is not a debugger. The debugger API can.
If you are using .net 4.5 you can call a method and get the callerpropertyname For instance: ``` protected void OnPropertyChanged([CallerMemberName] string propertyName = null) {} ``` From .net 3.5 to 4 you can use this method: ``` protected virtual void RaisePropertyChanged<T>(Expression<Func<T>> expProperty) ...
27,130,775
Is spying the setter of a property something that can be achieved via Reflection? Let's say, for instance, that I have a method somewhere that receives the following: ``` private void LogPropertySetter(string propertyName, string newPropertyValue) { Logger.Log("Property " + propertyName + " has been set to " + ne...
2014/11/25
[ "https://Stackoverflow.com/questions/27130775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/787856/" ]
No, nothing like this can ever be done with reflection. Reflection is not a debugger. The debugger API can.
Pre-.NET 4.5, it is possible to get the current property name using the following: ``` private int _x; public int X { get { return _x; } set { _x = value; string propName = MethodInfo.GetCurrentMethod().Name.Substring(4); LogPropertySetter(propName, value); } } ``` The Current...
27,130,775
Is spying the setter of a property something that can be achieved via Reflection? Let's say, for instance, that I have a method somewhere that receives the following: ``` private void LogPropertySetter(string propertyName, string newPropertyValue) { Logger.Log("Property " + propertyName + " has been set to " + ne...
2014/11/25
[ "https://Stackoverflow.com/questions/27130775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/787856/" ]
If you are using .net 4.5 you can call a method and get the callerpropertyname For instance: ``` protected void OnPropertyChanged([CallerMemberName] string propertyName = null) {} ``` From .net 3.5 to 4 you can use this method: ``` protected virtual void RaisePropertyChanged<T>(Expression<Func<T>> expProperty) ...
Pre-.NET 4.5, it is possible to get the current property name using the following: ``` private int _x; public int X { get { return _x; } set { _x = value; string propName = MethodInfo.GetCurrentMethod().Name.Substring(4); LogPropertySetter(propName, value); } } ``` The Current...
59,799,417
i want to **fit image with parent** div (image-container) with **corect ratio** ```css .image-container{ height: 195px; border-radius: 10px; position: relative; width: 482px; width: 482px; } img{ border-top-left-radius: 10px; border-top-right-radius: 10px; object-fit: c...
2020/01/18
[ "https://Stackoverflow.com/questions/59799417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12267205/" ]
In order to achieve what you want you need to use `esc`: ``` macro t(a, b, c) quote local a1 = $(esc(a)) local b1 = $(esc(b)) local c1 = $(esc(c)) println(:c, " = ", c1) (a1, b1, c1) end end ``` Note that I define variables `a1`, `b1`, and `c1` once and then reuse them...
Such macros are evaluated in such a way that any variable names not local to the macro function itself are considered global. The calling scope at the point of macro is not used. So this works: ``` macro t(a, b, c) quote println(:c, " = " , $c) ($a, $b, $c) end end function test() # works...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
**For clarity the answer below is a pre-release trailer based answer** There are many possible answers to this question you will not find out for certain until you watch the film. 1. Something she is wearing, he is not pulling her but pulling something she has on. 2. Like stated in the comments it's the iron in her b...
I am sure that he has lifted human beings in the comics since his post-Asteroid M power-up, and also as a way for the comic writers to reference [diamagnetic levitation](http://www.physics.org/facts/frog-really.asp). Basically, the right magnetic field causes objects with a high water content to become briefly magnetic...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
**For clarity the answer below is a pre-release trailer based answer** There are many possible answers to this question you will not find out for certain until you watch the film. 1. Something she is wearing, he is not pulling her but pulling something she has on. 2. Like stated in the comments it's the iron in her b...
He's the master of magnitism. It isn't limited to metal objects - he doesn't need any metal around his body to fly. He uses magnetic force fields to manipulate things, he can rip a large tree out of the ground, and launch it miles away. The movies have so much good material to work with out of the comic books; from ast...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
**Spoiler alert** After watching the film, > > Magneto shot her in the leg and is pulling the bullet towards him; > hence Mystique is being pulled as well. That is why in your screenshot, her leg is lifted a little. > After he had brought her close enough, he pulled the bullet out of her leg. > > > For thos...
**For clarity the answer below is a pre-release trailer based answer** There are many possible answers to this question you will not find out for certain until you watch the film. 1. Something she is wearing, he is not pulling her but pulling something she has on. 2. Like stated in the comments it's the iron in her b...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
**For clarity the answer below is a pre-release trailer based answer** There are many possible answers to this question you will not find out for certain until you watch the film. 1. Something she is wearing, he is not pulling her but pulling something she has on. 2. Like stated in the comments it's the iron in her b...
She had been shot before. The bullet in her leg is his 'leverage'.
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
I am sure that he has lifted human beings in the comics since his post-Asteroid M power-up, and also as a way for the comic writers to reference [diamagnetic levitation](http://www.physics.org/facts/frog-really.asp). Basically, the right magnetic field causes objects with a high water content to become briefly magnetic...
He's the master of magnitism. It isn't limited to metal objects - he doesn't need any metal around his body to fly. He uses magnetic force fields to manipulate things, he can rip a large tree out of the ground, and launch it miles away. The movies have so much good material to work with out of the comic books; from ast...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
**Spoiler alert** After watching the film, > > Magneto shot her in the leg and is pulling the bullet towards him; > hence Mystique is being pulled as well. That is why in your screenshot, her leg is lifted a little. > After he had brought her close enough, he pulled the bullet out of her leg. > > > For thos...
I am sure that he has lifted human beings in the comics since his post-Asteroid M power-up, and also as a way for the comic writers to reference [diamagnetic levitation](http://www.physics.org/facts/frog-really.asp). Basically, the right magnetic field causes objects with a high water content to become briefly magnetic...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
**Spoiler alert** After watching the film, > > Magneto shot her in the leg and is pulling the bullet towards him; > hence Mystique is being pulled as well. That is why in your screenshot, her leg is lifted a little. > After he had brought her close enough, he pulled the bullet out of her leg. > > > For thos...
He's the master of magnitism. It isn't limited to metal objects - he doesn't need any metal around his body to fly. He uses magnetic force fields to manipulate things, he can rip a large tree out of the ground, and launch it miles away. The movies have so much good material to work with out of the comic books; from ast...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
She had been shot before. The bullet in her leg is his 'leverage'.
He's the master of magnitism. It isn't limited to metal objects - he doesn't need any metal around his body to fly. He uses magnetic force fields to manipulate things, he can rip a large tree out of the ground, and launch it miles away. The movies have so much good material to work with out of the comic books; from ast...
56,266
As seen in this screencap, Magneto seems to be pulling Mystique towards him using his powers. What I don't understand is, **how** can Magneto affect Mystique? Since when did he gain the ability to manipulate human beings using his powers? Or is there anything unique about Mystique that makes her vulnerable to this? Any...
2014/05/14
[ "https://scifi.stackexchange.com/questions/56266", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/12551/" ]
**Spoiler alert** After watching the film, > > Magneto shot her in the leg and is pulling the bullet towards him; > hence Mystique is being pulled as well. That is why in your screenshot, her leg is lifted a little. > After he had brought her close enough, he pulled the bullet out of her leg. > > > For thos...
She had been shot before. The bullet in her leg is his 'leverage'.
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
You can filter 404 (NotFoundHttpException) error form your log file. **File location : app/start/global.php** ``` App::error(function(Exception $exception, $errorCode) { $requestUrl = Request::fullUrl(); $userAgent = Request::header('user-agent'); if($errorCode != 404){ Log::error('Exception', ...
I got this error because i used method="post" in my form instead of method="POST". Might be useful to someone.
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
A `NotFoundHttpException` is basically just a 404 in your application. Unfortunately the exception message doesn't even tell you the URL of the request that triggered the exception, which makes it difficult to understand these errors when you see them in your logs. To give you more debugging information, set up your o...
It's really hard to say for sure what is causing this without knowing your code. Looking at the stack trace of the error, it's clear that the Router is dispatching it and I guess it has nothing to do with the background job itself, but rather the API's it calls. In your specific case, the exception is throw after a [R...
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
A `NotFoundHttpException` is basically just a 404 in your application. Unfortunately the exception message doesn't even tell you the URL of the request that triggered the exception, which makes it difficult to understand these errors when you see them in your logs. To give you more debugging information, set up your o...
I got this problem because I had capitalized the name of a parent directory and didn't capitalize it in the URL. That's why I got the error. I was using this url **localhost/laravel/todo2/public/foo** and in fact it worked if all I typed was: **localhost/Laravel/todo2/public/** but if I typed anything after the publi...
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
I got this problem because I had capitalized the name of a parent directory and didn't capitalize it in the URL. That's why I got the error. I was using this url **localhost/laravel/todo2/public/foo** and in fact it worked if all I typed was: **localhost/Laravel/todo2/public/** but if I typed anything after the publi...
You can filter 404 (NotFoundHttpException) error form your log file. **File location : app/start/global.php** ``` App::error(function(Exception $exception, $errorCode) { $requestUrl = Request::fullUrl(); $userAgent = Request::header('user-agent'); if($errorCode != 404){ Log::error('Exception', ...
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
My project is in **C:\xampp\htdocs\ColorTex** I got this error by typing `http://localhost/myproject/public/image` instead of `http://localhost/MyProject/public/image` I'm in windows, so I thought it will ignore capitalization, but... Be careful with that.
I got this error because i used method="post" in my form instead of method="POST". Might be useful to someone.
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
It's really hard to say for sure what is causing this without knowing your code. Looking at the stack trace of the error, it's clear that the Router is dispatching it and I guess it has nothing to do with the background job itself, but rather the API's it calls. In your specific case, the exception is throw after a [R...
I got this error because i used method="post" in my form instead of method="POST". Might be useful to someone.
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
I got this problem because I had capitalized the name of a parent directory and didn't capitalize it in the URL. That's why I got the error. I was using this url **localhost/laravel/todo2/public/foo** and in fact it worked if all I typed was: **localhost/Laravel/todo2/public/** but if I typed anything after the publi...
My project is in **C:\xampp\htdocs\ColorTex** I got this error by typing `http://localhost/myproject/public/image` instead of `http://localhost/MyProject/public/image` I'm in windows, so I thought it will ignore capitalization, but... Be careful with that.
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
A `NotFoundHttpException` is basically just a 404 in your application. Unfortunately the exception message doesn't even tell you the URL of the request that triggered the exception, which makes it difficult to understand these errors when you see them in your logs. To give you more debugging information, set up your o...
My project is in **C:\xampp\htdocs\ColorTex** I got this error by typing `http://localhost/myproject/public/image` instead of `http://localhost/MyProject/public/image` I'm in windows, so I thought it will ignore capitalization, but... Be careful with that.
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
I got this problem because I had capitalized the name of a parent directory and didn't capitalize it in the URL. That's why I got the error. I was using this url **localhost/laravel/todo2/public/foo** and in fact it worked if all I typed was: **localhost/Laravel/todo2/public/** but if I typed anything after the publi...
It's really hard to say for sure what is causing this without knowing your code. Looking at the stack trace of the error, it's clear that the Router is dispatching it and I guess it has nothing to do with the background job itself, but rather the API's it calls. In your specific case, the exception is throw after a [R...
15,843,265
My Laravel 4 application's logs sometimes show a `NotFoundHttpException`: ``` exception 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException' in /var/www/laravel4/bootstrap/compiled.php:7420 Stack trace: #0 /var/www/laravel4/bootstrap/compiled.php(7137): Illuminate\Routing\Router->handleRoutingException(Objec...
2013/04/05
[ "https://Stackoverflow.com/questions/15843265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/741099/" ]
A `NotFoundHttpException` is basically just a 404 in your application. Unfortunately the exception message doesn't even tell you the URL of the request that triggered the exception, which makes it difficult to understand these errors when you see them in your logs. To give you more debugging information, set up your o...
I got this error because i used method="post" in my form instead of method="POST". Might be useful to someone.
14,693,419
I've got a TextView with the height set to wrap\_content - however, it's leaving a lot of extra space in my app. The text from the textview is coming in from a @+string and it seems as though the wrap\_content is setting it's height to the height of the string variable, not the actual text that's being inserted. If...
2013/02/04
[ "https://Stackoverflow.com/questions/14693419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/222155/" ]
i guess you also have a lot categories for each product. Let try this open catalog\controller\module\category.php Search : `$total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id']));` Replace with `$total = '';` and Search : `$product_total = $this->model_ca...
Site speed is dependent on a number of things, the main one being overcrowded servers and poor configuration. If you're unable to pay for top end servers then the best option for smaller stores is something like [this pagecache mod](http://www.opencart.com/index.php?route=extension/extension/info&extension_id=3477) - e...
14,693,419
I've got a TextView with the height set to wrap\_content - however, it's leaving a lot of extra space in my app. The text from the textview is coming in from a @+string and it seems as though the wrap\_content is setting it's height to the height of the string variable, not the actual text that's being inserted. If...
2013/02/04
[ "https://Stackoverflow.com/questions/14693419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/222155/" ]
i guess you also have a lot categories for each product. Let try this open catalog\controller\module\category.php Search : `$total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id']));` Replace with `$total = '';` and Search : `$product_total = $this->model_ca...
I would recommend using: Dedicated server for your PHP files. Dedicated server for mySQL only having phpMyAdmin on it. On the MySQL and PHP, you can use a number of cache plugins in the extension library. You can use Memcache or another accelerator. Cache is a good idea. For a bonus I would also use a CDN. If you have...
14,693,419
I've got a TextView with the height set to wrap\_content - however, it's leaving a lot of extra space in my app. The text from the textview is coming in from a @+string and it seems as though the wrap\_content is setting it's height to the height of the string variable, not the actual text that's being inserted. If...
2013/02/04
[ "https://Stackoverflow.com/questions/14693419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/222155/" ]
i guess you also have a lot categories for each product. Let try this open catalog\controller\module\category.php Search : `$total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id']));` Replace with `$total = '';` and Search : `$product_total = $this->model_ca...
Check out my post here: <https://stackoverflow.com/a/18063515/2653932>. If you are using product counts on your site you may want to look at this patch. Can't say for sure if it will work with 1.5.4 but I'll be happy to help modify it if necessary.
35,937,111
I have to make a web page with two different window and let they share some variables. When the main window is loaded, the second windows is opened, and here I can store the second window object and access its vars: **Main window** ``` var mainvar=1; var secondwindow=open('second.htm'); $("button").click(function(){...
2016/03/11
[ "https://Stackoverflow.com/questions/35937111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/861646/" ]
You should create custom filter function: ``` $scope.myFilter = function (x) { return function (y) { if (x.n==y.n) { return true; } else { return false; } } }; ``` Use it in inner ng-repeat: ``` <div ng-repeat="y in amt | orderBy:'v' | filter:myFilter(x) | limitTo:1"> <div>{{y.v}}</d...
`(...) < /tr> < /thead> < tbody> < tr ng-repeat="object in objects | SOME_FILTER"> (...) {{object.get("element")}} {{(object.get("element2")).innerElement}} (...) < /tr> < /tbody> < /table> (...)` The 3 dots means that there was some code cut out. "element2" is the one with a JSON inside. "innerElement" is...
48,961,319
I have made 2 buttons one for increment and another for decrement. When I click on minus button it should not display negative values but in my case when I click on minus button (initially value zero ) it shows -1 and again on click it shows zero why is this happening when I click on minus button the value inside the i...
2018/02/24
[ "https://Stackoverflow.com/questions/48961319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9224312/" ]
> > Why it's not working in your case? > > > Because you are checking the wrong condition here: ``` if(this.state.counter < 0){...} ``` It should be: ``` if(this.state.counter == 0){...} ``` --- **Solution:** Decrement the value only when the counter value is greater than 0. Like this: ``` decrement(){ ...
You decrement function needs to change the logic, since you are checking `this.state.counter < 0` which which will be false when counter is 0, and only in the next click will it be true. Also when you are using previous state to update the next state use `functional setState`. Check this [When to use functional setSt...
48,961,319
I have made 2 buttons one for increment and another for decrement. When I click on minus button it should not display negative values but in my case when I click on minus button (initially value zero ) it shows -1 and again on click it shows zero why is this happening when I click on minus button the value inside the i...
2018/02/24
[ "https://Stackoverflow.com/questions/48961319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9224312/" ]
You decrement function needs to change the logic, since you are checking `this.state.counter < 0` which which will be false when counter is 0, and only in the next click will it be true. Also when you are using previous state to update the next state use `functional setState`. Check this [When to use functional setSt...
one thing you can do is use ternary operator and use check the value of count. like this: ``` function Usestate() { const [count, setCount] = useState(0) return ( <div> <button onClick={() => setCount(count + 1)}>Count {count}</button> <button onClick={() => { (count == 0) ? s...
48,961,319
I have made 2 buttons one for increment and another for decrement. When I click on minus button it should not display negative values but in my case when I click on minus button (initially value zero ) it shows -1 and again on click it shows zero why is this happening when I click on minus button the value inside the i...
2018/02/24
[ "https://Stackoverflow.com/questions/48961319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9224312/" ]
> > Why it's not working in your case? > > > Because you are checking the wrong condition here: ``` if(this.state.counter < 0){...} ``` It should be: ``` if(this.state.counter == 0){...} ``` --- **Solution:** Decrement the value only when the counter value is greater than 0. Like this: ``` decrement(){ ...
**You can also uses like this.** ``` decrement = () =>{ if(this.state.value< 1){ this.setState({ value:0 }); }else { this.setState({ value: this.state.value- 1 }); } }; ```
48,961,319
I have made 2 buttons one for increment and another for decrement. When I click on minus button it should not display negative values but in my case when I click on minus button (initially value zero ) it shows -1 and again on click it shows zero why is this happening when I click on minus button the value inside the i...
2018/02/24
[ "https://Stackoverflow.com/questions/48961319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9224312/" ]
> > Why it's not working in your case? > > > Because you are checking the wrong condition here: ``` if(this.state.counter < 0){...} ``` It should be: ``` if(this.state.counter == 0){...} ``` --- **Solution:** Decrement the value only when the counter value is greater than 0. Like this: ``` decrement(){ ...
This would be the simplest approach ``` import React, {useState} from 'react'; function Counter(){ const [count, setCount] = useState(0); const dec = () => { if(count <= 0) { return; } else { setCount(count - 1); } } return ( <button onClick={dec}> - </button> <button onClick={...
48,961,319
I have made 2 buttons one for increment and another for decrement. When I click on minus button it should not display negative values but in my case when I click on minus button (initially value zero ) it shows -1 and again on click it shows zero why is this happening when I click on minus button the value inside the i...
2018/02/24
[ "https://Stackoverflow.com/questions/48961319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9224312/" ]
> > Why it's not working in your case? > > > Because you are checking the wrong condition here: ``` if(this.state.counter < 0){...} ``` It should be: ``` if(this.state.counter == 0){...} ``` --- **Solution:** Decrement the value only when the counter value is greater than 0. Like this: ``` decrement(){ ...
one thing you can do is use ternary operator and use check the value of count. like this: ``` function Usestate() { const [count, setCount] = useState(0) return ( <div> <button onClick={() => setCount(count + 1)}>Count {count}</button> <button onClick={() => { (count == 0) ? s...
48,961,319
I have made 2 buttons one for increment and another for decrement. When I click on minus button it should not display negative values but in my case when I click on minus button (initially value zero ) it shows -1 and again on click it shows zero why is this happening when I click on minus button the value inside the i...
2018/02/24
[ "https://Stackoverflow.com/questions/48961319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9224312/" ]
**You can also uses like this.** ``` decrement = () =>{ if(this.state.value< 1){ this.setState({ value:0 }); }else { this.setState({ value: this.state.value- 1 }); } }; ```
one thing you can do is use ternary operator and use check the value of count. like this: ``` function Usestate() { const [count, setCount] = useState(0) return ( <div> <button onClick={() => setCount(count + 1)}>Count {count}</button> <button onClick={() => { (count == 0) ? s...
48,961,319
I have made 2 buttons one for increment and another for decrement. When I click on minus button it should not display negative values but in my case when I click on minus button (initially value zero ) it shows -1 and again on click it shows zero why is this happening when I click on minus button the value inside the i...
2018/02/24
[ "https://Stackoverflow.com/questions/48961319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9224312/" ]
This would be the simplest approach ``` import React, {useState} from 'react'; function Counter(){ const [count, setCount] = useState(0); const dec = () => { if(count <= 0) { return; } else { setCount(count - 1); } } return ( <button onClick={dec}> - </button> <button onClick={...
one thing you can do is use ternary operator and use check the value of count. like this: ``` function Usestate() { const [count, setCount] = useState(0) return ( <div> <button onClick={() => setCount(count + 1)}>Count {count}</button> <button onClick={() => { (count == 0) ? s...
204,543
I have a minor typesetting problem inside the `longtable` environment. I am writing my CV and I need to write a list of skills inside a table cell. Since I'd like to keep the document length down to one page, I am not using `itemize` to save up some space, so I have written the list manually using hyphens ("-"). I'...
2014/10/04
[ "https://tex.stackexchange.com/questions/204543", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/63681/" ]
Using `\\` (double backslash) at the end of each row, and inserting `&` (column separators) fixes the issue you're encountering. Incidentally, as @egreg has noted in a comment, you shouldn't be using `-`; at the very least, consider using en-dashes (created by typing `--`). ![enter image description here](https://i.st...
Not sure what microtype is doing there but you can hide it with a box and a zero space: ![enter image description here](https://i.stack.imgur.com/wAfj0.png) ``` \documentclass[a4paper,12pt,]{report} \usepackage[swedish, italian]{babel} \usepackage[utf8]{inputenc} \usepackage{pslatex} \usepackage{booktabs} \usepackage...
204,543
I have a minor typesetting problem inside the `longtable` environment. I am writing my CV and I need to write a list of skills inside a table cell. Since I'd like to keep the document length down to one page, I am not using `itemize` to save up some space, so I have written the list manually using hyphens ("-"). I'...
2014/10/04
[ "https://tex.stackexchange.com/questions/204543", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/63681/" ]
Using `\\` (double backslash) at the end of each row, and inserting `&` (column separators) fixes the issue you're encountering. Incidentally, as @egreg has noted in a comment, you shouldn't be using `-`; at the very least, consider using en-dashes (created by typing `--`). ![enter image description here](https://i.st...
The problem is that `microtype` lets hyphens and dashes protrude in the margins. Let's look at a couple of examples: ``` \documentclass{article} \usepackage{microtype,longtable} \begin{document} \setlength{\tabcolsep}{0pt} % no intercolumn space to show the problem \begin{longtable}{l|p{3cm}} xxx &- abc - abc\\ \end...
204,543
I have a minor typesetting problem inside the `longtable` environment. I am writing my CV and I need to write a list of skills inside a table cell. Since I'd like to keep the document length down to one page, I am not using `itemize` to save up some space, so I have written the list manually using hyphens ("-"). I'...
2014/10/04
[ "https://tex.stackexchange.com/questions/204543", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/63681/" ]
Using `\\` (double backslash) at the end of each row, and inserting `&` (column separators) fixes the issue you're encountering. Incidentally, as @egreg has noted in a comment, you shouldn't be using `-`; at the very least, consider using en-dashes (created by typing `--`). ![enter image description here](https://i.st...
You can use the `itemize` environment, with the `wide` and `nosep` options of the `enumitem` package. I give two variants, to take into account dash protrusion: ``` \documentclass[a4paper,12pt,]{report} \usepackage[italian]{babel}%swedish, \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage{booktabs} \usepack...
7,686,987
I'm just beginning to (hopefully!) learn programming / ruby on rails and trying to push the results of a hash to an array using: ApplicationController: ``` def css_class css = Array.new product = {@product.oil => ' oil', @product.pressure_meters => ' pressure_meters', @product.commercial => 'commercial'} produ...
2011/10/07
[ "https://Stackoverflow.com/questions/7686987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/983921/" ]
In Ruby `Hash` can't have duplicate keys so ``` def css_class css = Array.new product = { @product.oil => ' oil', @product.pressure_meters => ' pressure_meters', @product.commercial => 'commercial' } product.each do |key, value| if key == true css.push(value) end e...
You can use [`Hash#values`](http://www.ruby-doc.org/core/Hash.html#method-i-values) to get an array of your hash's values. So: ``` product_values = product.values ``` And conditionally, you could pick the ones you want using `select`, like this: ``` product_values = product.select {|k,v| k == true }.values ``` W...
7,686,987
I'm just beginning to (hopefully!) learn programming / ruby on rails and trying to push the results of a hash to an array using: ApplicationController: ``` def css_class css = Array.new product = {@product.oil => ' oil', @product.pressure_meters => ' pressure_meters', @product.commercial => 'commercial'} produ...
2011/10/07
[ "https://Stackoverflow.com/questions/7686987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/983921/" ]
In Ruby `Hash` can't have duplicate keys so ``` def css_class css = Array.new product = { @product.oil => ' oil', @product.pressure_meters => ' pressure_meters', @product.commercial => 'commercial' } product.each do |key, value| if key == true css.push(value) end e...
Thanks for pointing me in the right direction. I kept getting a 500 internal server error with your code Bohdan, not sure why, but played around with it and eventually found this to work: ``` def css_class css = Array.new product = { ' oil' => @product.oil, ' pressure_meters' => @product.pressure_meter...
33,036,554
I am using Laravel 4.2, with server side jQuery data-tables. Package: <https://github.com/Chumper/Datatable> How can I add custom sorting ? like for columns of currency, time, etc
2015/10/09
[ "https://Stackoverflow.com/questions/33036554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486348/" ]
NOTE: this did not make use of the Chumper/Datatable package, but it does use jQuery datatables so may be of some use. Here is how I did it. This was a scenario in which I had a table with American football teams in it. Each team was a member of a Conference, that was part of a Division. The teams could be sorted by t...
Haven't you checked the documentation? Because it's explained there: ``` public function getDatatable() { return Datatable::collection(User::all(array('id','name'))) ->showColumns('id', 'name') ->searchColumns('name') ->orderColumns('id','name') ->make(); } ```
33,036,554
I am using Laravel 4.2, with server side jQuery data-tables. Package: <https://github.com/Chumper/Datatable> How can I add custom sorting ? like for columns of currency, time, etc
2015/10/09
[ "https://Stackoverflow.com/questions/33036554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486348/" ]
this is how I do it n.b. it's not optimized. more or less a complete code snippet without error checking laravel controller function (it's L5.2 but easily downgrade-able to 4.2): ``` $response = array(); $query = MyModel::query(); $response['recordsTotal'] = MyModel::count(); $response['draw'] = Inp...
Haven't you checked the documentation? Because it's explained there: ``` public function getDatatable() { return Datatable::collection(User::all(array('id','name'))) ->showColumns('id', 'name') ->searchColumns('name') ->orderColumns('id','name') ->make(); } ```
33,036,554
I am using Laravel 4.2, with server side jQuery data-tables. Package: <https://github.com/Chumper/Datatable> How can I add custom sorting ? like for columns of currency, time, etc
2015/10/09
[ "https://Stackoverflow.com/questions/33036554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486348/" ]
If you are trying to sort the collection or query result in any order, you can do something like this: ``` $orders = Order::all()->SortBy('currency','desc'); ``` or ``` $customers = Customers::where('age',$age)->orderBy('currency','desc')->get(); ``` By the way, why are you still on Laravel 4 when there is Larave...
Haven't you checked the documentation? Because it's explained there: ``` public function getDatatable() { return Datatable::collection(User::all(array('id','name'))) ->showColumns('id', 'name') ->searchColumns('name') ->orderColumns('id','name') ->make(); } ```
33,036,554
I am using Laravel 4.2, with server side jQuery data-tables. Package: <https://github.com/Chumper/Datatable> How can I add custom sorting ? like for columns of currency, time, etc
2015/10/09
[ "https://Stackoverflow.com/questions/33036554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486348/" ]
NOTE: this did not make use of the Chumper/Datatable package, but it does use jQuery datatables so may be of some use. Here is how I did it. This was a scenario in which I had a table with American football teams in it. Each team was a member of a Conference, that was part of a Division. The teams could be sorted by t...
Not sure if by `custom sorting` you mean sorting the rows by clicking on the headers? If that is what you mean then you can define them on the client side by defining the datatable settings. ``` oSettings = $("#{{$table->getId()}}").dataTable().fnSettings(); oSettings.aaSorting = [[6, 'desc']]; ``` But if you want t...
33,036,554
I am using Laravel 4.2, with server side jQuery data-tables. Package: <https://github.com/Chumper/Datatable> How can I add custom sorting ? like for columns of currency, time, etc
2015/10/09
[ "https://Stackoverflow.com/questions/33036554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486348/" ]
this is how I do it n.b. it's not optimized. more or less a complete code snippet without error checking laravel controller function (it's L5.2 but easily downgrade-able to 4.2): ``` $response = array(); $query = MyModel::query(); $response['recordsTotal'] = MyModel::count(); $response['draw'] = Inp...
Not sure if by `custom sorting` you mean sorting the rows by clicking on the headers? If that is what you mean then you can define them on the client side by defining the datatable settings. ``` oSettings = $("#{{$table->getId()}}").dataTable().fnSettings(); oSettings.aaSorting = [[6, 'desc']]; ``` But if you want t...
33,036,554
I am using Laravel 4.2, with server side jQuery data-tables. Package: <https://github.com/Chumper/Datatable> How can I add custom sorting ? like for columns of currency, time, etc
2015/10/09
[ "https://Stackoverflow.com/questions/33036554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486348/" ]
If you are trying to sort the collection or query result in any order, you can do something like this: ``` $orders = Order::all()->SortBy('currency','desc'); ``` or ``` $customers = Customers::where('age',$age)->orderBy('currency','desc')->get(); ``` By the way, why are you still on Laravel 4 when there is Larave...
Not sure if by `custom sorting` you mean sorting the rows by clicking on the headers? If that is what you mean then you can define them on the client side by defining the datatable settings. ``` oSettings = $("#{{$table->getId()}}").dataTable().fnSettings(); oSettings.aaSorting = [[6, 'desc']]; ``` But if you want t...
58,036,759
I am new to VB.NET and trying to develop a GIS system. There is a txt file like this. ![the data file](https://i.stack.imgur.com/5yQV9.png) I want to read the longitude and latitude, but I don't know how to read them into two different arrays. Also, there is "# -b" line in the file, I don't know how to skip these lin...
2019/09/21
[ "https://Stackoverflow.com/questions/58036759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12097976/" ]
You can use the [useEffect](https://reactjs.org/docs/hooks-effect.html) hook: ``` const Dropzone = () => { const [dropzoneFiles, setDropzoneFiles] = useState([]); const [dropzoneIsLoading, setDropzoneIsLoading] = useState(false); const onDropAccepted = useCallback( acceptedFiles => { ...
The answers you will find online will point you to using `useEffect`, but this is simply a coverup for a bigger underlying issue. As mentioned in [this post by Lenz Weber](https://github.com/reactjs/rfcs/issues/98#issuecomment-479188615) as to why there is no callback in `useState()`: > > Because it invokes a though...
17,386,203
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' WHERE username=32112' at line 1 PHP code: ``` mysql_query ("SELECT * FROM '$iAccount_table' WHERE username=$user") or die(mysql_error()); ```
2013/06/30
[ "https://Stackoverflow.com/questions/17386203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2465955/" ]
Use **`** instead of **'** with the $iAccount\_table variable. Its erroring out because of that. Update: ``` mysql_query ("SELECT * FROM `$iAccount_table` WHERE username=$user") or die(mysql_error()); ```
Change ``` mysql_query ("SELECT * FROM '$iAccount_table' WHERE username=$user") or die(mysql_error()); ``` to ``` mysql_query ("SELECT * FROM `$iAccount_table` WHERE username=$user") or die(mysql_error()); ``` Hope this helps.
17,386,203
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' WHERE username=32112' at line 1 PHP code: ``` mysql_query ("SELECT * FROM '$iAccount_table' WHERE username=$user") or die(mysql_error()); ```
2013/06/30
[ "https://Stackoverflow.com/questions/17386203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2465955/" ]
Use **`** instead of **'** with the $iAccount\_table variable. Its erroring out because of that. Update: ``` mysql_query ("SELECT * FROM `$iAccount_table` WHERE username=$user") or die(mysql_error()); ```
Use back ticks (grave accent) ` instead of single quotes so ``` "SELECT * FROM `$iAccount_table` WHERE username=$user" ```
17,386,203
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' WHERE username=32112' at line 1 PHP code: ``` mysql_query ("SELECT * FROM '$iAccount_table' WHERE username=$user") or die(mysql_error()); ```
2013/06/30
[ "https://Stackoverflow.com/questions/17386203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2465955/" ]
Use **`** instead of **'** with the $iAccount\_table variable. Its erroring out because of that. Update: ``` mysql_query ("SELECT * FROM `$iAccount_table` WHERE username=$user") or die(mysql_error()); ```
I assume that 'username' is a text/char field in your db. Try this code: ``` mysql_query ("SELECT * FROM " . $iAccount_table . " WHERE username='" . $user . "'") or die(mysql_error()); ``` I hope you find this helpful.
17,386,203
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' WHERE username=32112' at line 1 PHP code: ``` mysql_query ("SELECT * FROM '$iAccount_table' WHERE username=$user") or die(mysql_error()); ```
2013/06/30
[ "https://Stackoverflow.com/questions/17386203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2465955/" ]
I assume that 'username' is a text/char field in your db. Try this code: ``` mysql_query ("SELECT * FROM " . $iAccount_table . " WHERE username='" . $user . "'") or die(mysql_error()); ``` I hope you find this helpful.
Change ``` mysql_query ("SELECT * FROM '$iAccount_table' WHERE username=$user") or die(mysql_error()); ``` to ``` mysql_query ("SELECT * FROM `$iAccount_table` WHERE username=$user") or die(mysql_error()); ``` Hope this helps.
17,386,203
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' WHERE username=32112' at line 1 PHP code: ``` mysql_query ("SELECT * FROM '$iAccount_table' WHERE username=$user") or die(mysql_error()); ```
2013/06/30
[ "https://Stackoverflow.com/questions/17386203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2465955/" ]
I assume that 'username' is a text/char field in your db. Try this code: ``` mysql_query ("SELECT * FROM " . $iAccount_table . " WHERE username='" . $user . "'") or die(mysql_error()); ``` I hope you find this helpful.
Use back ticks (grave accent) ` instead of single quotes so ``` "SELECT * FROM `$iAccount_table` WHERE username=$user" ```
5,962,672
I am looking to create a javascript/jquery function to wrap a piece of highlighted text from a textarea in strong tags - similar to the WYSIWYG editor here. Is this possible and if so can you point me in the right direction. **EDIT:** OK so here's a hopefully clearer description of what I want... I have a textbox o...
2011/05/11
[ "https://Stackoverflow.com/questions/5962672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/457148/" ]
My [Rangy inputs](http://code.google.com/p/rangyinputs/) (terrible name, I know) jQuery plug-in does this. Example code: ``` $("#foo").surroundSelectedText("<strong>", "</strong>"); ``` jsFiddle: <http://jsfiddle.net/aGJDa/>
I love Rangy! Use it often! But I didn't want to include the whole thing just for this little application, so I did it using document.execCommand to wrap the selected text, then used the href (third parameter of the CreateLink execCommand) to find the element, wrap it with what I wanted, and then remove the link: ``` ...
39,297,859
The following SQL query slows down my website **extremely** much! From 0-1.5 seconds to easily over 20 seconds. How can I optimize it? ``` SELECT DATE(a.datetime_logged) AS date, (SELECT COUNT(aa.data_status) FROM activity AS aa WHERE aa.id_user = '1' AND DATE(aa.datetime_logged) != CURDATE() AND DATE(a.datetime_logge...
2016/09/02
[ "https://Stackoverflow.com/questions/39297859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/718990/" ]
you can use `sum(case data_status when 'online' then 1 end) as status_a` to replace nested heavy sub-queries
You have subqueries of this form: ``` SELECT COUNT(aa.data_status) FROM activity AS aa WHERE aa.id_user = '1' AND DATE(aa.datetime_logged) != CURDATE() AND DATE(a.datetime_logged) = DATE(aa.datetime_logged) AND aa.data_status = 'online' ``` These are nasty, especially if the cardinality of your `id_user` an...
5,566,235
In .NET `System.Object` defines a static method ``` bool Equals(object a, object b); ``` That is a useful alternative to `a.Equals(b)` in cases where `a` may be `null`. It also returns true if both `a` and `b` are `null`. I can't find an equivalent method in Java's framework (my Java is a bit rusty these days.) The...
2011/04/06
[ "https://Stackoverflow.com/questions/5566235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24874/" ]
I think what you want is [ObjectUtils.equals](http://commons.apache.org/lang/api-2.6/org/apache/commons/lang/ObjectUtils.html#equals%28java.lang.Object,%20java.lang.Object%29). ``` ObjectUtils.equals(null, null) = true ObjectUtils.equals(null, "") = false ObjectUtils.equals("", n...
[ObjectUtils](http://commons.apache.org/lang/api-release/org/apache/commons/lang/ObjectUtils.html) in [Apache Common](http://commons.apache.org/)s provides such a [method](http://commons.apache.org/lang/api-release/org/apache/commons/lang/ObjectUtils.html#equals%28java.lang.Object,%20java.lang.Object%29).
5,566,235
In .NET `System.Object` defines a static method ``` bool Equals(object a, object b); ``` That is a useful alternative to `a.Equals(b)` in cases where `a` may be `null`. It also returns true if both `a` and `b` are `null`. I can't find an equivalent method in Java's framework (my Java is a bit rusty these days.) The...
2011/04/06
[ "https://Stackoverflow.com/questions/5566235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24874/" ]
Currently, this does not exist in the core library, but it is one of the improvements that is being added with Java 1.7. In Java 1.7, you can use `Objects.equals(Object a, Object b)`. Until then, I recommend implementing it yourself if you do not want to add an external dependency. [source](http://download.oracle.com...
[ObjectUtils](http://commons.apache.org/lang/api-release/org/apache/commons/lang/ObjectUtils.html) in [Apache Common](http://commons.apache.org/)s provides such a [method](http://commons.apache.org/lang/api-release/org/apache/commons/lang/ObjectUtils.html#equals%28java.lang.Object,%20java.lang.Object%29).
5,566,235
In .NET `System.Object` defines a static method ``` bool Equals(object a, object b); ``` That is a useful alternative to `a.Equals(b)` in cases where `a` may be `null`. It also returns true if both `a` and `b` are `null`. I can't find an equivalent method in Java's framework (my Java is a bit rusty these days.) The...
2011/04/06
[ "https://Stackoverflow.com/questions/5566235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24874/" ]
Currently, this does not exist in the core library, but it is one of the improvements that is being added with Java 1.7. In Java 1.7, you can use `Objects.equals(Object a, Object b)`. Until then, I recommend implementing it yourself if you do not want to add an external dependency. [source](http://download.oracle.com...
I think what you want is [ObjectUtils.equals](http://commons.apache.org/lang/api-2.6/org/apache/commons/lang/ObjectUtils.html#equals%28java.lang.Object,%20java.lang.Object%29). ``` ObjectUtils.equals(null, null) = true ObjectUtils.equals(null, "") = false ObjectUtils.equals("", n...
45,949,051
I have a script in javascript that load more information on page scroll down. The problem is that when I scroll down the script is executed twice and I have the same result twice or even more. I want to execute the script once each time I scroll down and not execute it twice or even more each time. This is the script...
2017/08/29
[ "https://Stackoverflow.com/questions/45949051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8534501/" ]
The second argument to `get_variable` takes an integer or string, but as the error say, you've given it a tensor `[dim, 384]`. See: <https://www.tensorflow.org/api_docs/python/tf/get_variable>
`tf.shape` returns a tensor, so *dim* in `[dim, 384]` is a Tensor; here is an int needed. Try `dim = reshape.get_shape().as_list()[1]` # output is of int type
45,949,051
I have a script in javascript that load more information on page scroll down. The problem is that when I scroll down the script is executed twice and I have the same result twice or even more. I want to execute the script once each time I scroll down and not execute it twice or even more each time. This is the script...
2017/08/29
[ "https://Stackoverflow.com/questions/45949051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8534501/" ]
Thanks everyone for trying to help. Given that I'm flattening the output of **pool2** to perform just one matmul, the solution is to explicitly compute the length of the second dimension of the reshape. This is computed on lines 1 and 2, where the **[1:]** offset on the first line comes from the variable batch size. ...
`tf.shape` returns a tensor, so *dim* in `[dim, 384]` is a Tensor; here is an int needed. Try `dim = reshape.get_shape().as_list()[1]` # output is of int type
254,875
Last week I challenged myself to create the smallest possible code for a Tic Tac Toe game with an AI as opponent. Smallest possible in regards to say least number of characters used. The requirements on the game are as follows: * A "nice" playing experience (ability to get user input and print the board after every mo...
2021/01/18
[ "https://codereview.stackexchange.com/questions/254875", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/236119/" ]
Your > > > ``` > def evaluate(board, turn): > for pos in ([0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]): > if board[pos[0]] == board[pos[1]] == board[pos[2]] == turn: > return 1 > > ``` > > could be ``` def evaluate(board, turn): for i, j, k in [0, 1, 2]...
you can type over an already filled square
2,568,111
Given the integral: $$ I = \int\_{0}^{\frac{\pi}{2}} \frac{\sin\left(4\,\cos^2\theta\right)}{2}\,\text{d}\theta$$ thanks to the composite formula of Cavalieri-Simpson I managed to calculate $I = 0.16$ with an error $\epsilon < 0.01$. Could it be done in another way, avoiding numerical calculation? Thank you!
2017/12/15
[ "https://math.stackexchange.com/questions/2568111", "https://math.stackexchange.com", "https://math.stackexchange.com/users/247735/" ]
Taking $z=e^{i\theta}$ after changing a bit the initial inetgral we aplly the Cauchy formula in the following, $$I = \int\_{0}^{\frac{\pi}{2}} \frac{\sin\left(4\,\cos^2\theta\right)}{4}\,\text{d}\theta = \int\_{0}^{\pi} \frac{\sin\left(4\,\cos^2\theta\right)}{2}\,\text{d}\theta \\= \int\_{-\pi}^{\pi} \frac{\sin\left(4\...
We write $$ \sin(4\cos^2\theta)=\sin(2+2\cos(2\theta))=\sin 2\cos(2\cos(2\theta))+\cos 2\sin(2\cos(2\theta)). $$ The second term is odd in the line $\theta=\pi/4$, so it gives no contribution to your integral. Thus $$ \begin{aligned} \int\_0^{\pi/2}\frac{1}{2}\sin(4\cos^2\theta)\,d\theta &=\frac{\sin 2}{2}\int\_0^{\pi/...
36,008,108
I'm new to both java and javafx. How can I check if any object like Rectangle or Button exists in the Stack Pane or in the scene ? Tried searching in google but couldn't find anything related to the same.
2016/03/15
[ "https://Stackoverflow.com/questions/36008108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2990728/" ]
To check if a `Node` (could be `Button`, `Rectangle` or any other UI node) is a direct child of another node (parent assumed, `StackPane` in your question) you can do the following: ``` stackPane = ... if (stackPane.getChildren().contains(node)) { // node is a direct child of stackPane } ``` Alternatively, you c...
It seems to me that you are also searching for a way to check if a certain [`Node`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/Node.html) is a **direct or indirect child** of another [`Node`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/Node.html) or [`Scene`](https://docs.oracle.com/javase/8/...
38,095,199
I have the below RSS to parse, something like: ``` <?xml version="1.0" encoding="utf-8"?> <rss xmlns:x-wr="http://www.w3.org/2002/12/cal/prod/Apple_Comp_628d9d8459c556fa#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:x-example="http://www.example.com/rss/x-ex...
2016/06/29
[ "https://Stackoverflow.com/questions/38095199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/775856/" ]
Use [getElementsByTagNameNS()](http://php.net/manual/en/domdocument.getelementsbytagnamens.php): ``` $node->getElementsByTagNameNS("urn:ietf:params:xml:ns:xcal", "description")->item(0)->nodeValue ```
While using the namespace aware variants of the DOM methods is a correct answer, you might want to take a look at Xpath. It is a much more comfortable way to fetch data from a DOM. For the Xpath expression, you can register own prefixes for the namespaces as needed. ``` $rss = new DOMDocument(); $rss->load("http://ww...
52,136,375
I have a dataframe that contains nan values in particular column. while iterating through the rows, if it come across `nan`(using `isnan()` method) then I need to change it to some other value(since I have some conditions). I tried using `replace()` and `fillna()` with `limit` parameter also but they are modifying whol...
2018/09/02
[ "https://Stackoverflow.com/questions/52136375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4732694/" ]
I believe need replace `NaN`s values to `1` only for indexes specified in list `idx`: ``` mask = df['target_class'].isnull() idx = [1,2,3] df.loc[mask, 'target_class'] = df[mask].index.isin(idx).astype(int) print (df) points sundar cate king varun vicky john charlie target_class 1 x2 5 'cat' ...
I suppose your conditions for imputing the `nan` values does not depend on the number of them in a column. In the code below I stored all the imputation rules in one function that receives as parameters the entire row (containing the `nan`) and the column you are investigating for. If you also need all the dataframe fo...
52,136,375
I have a dataframe that contains nan values in particular column. while iterating through the rows, if it come across `nan`(using `isnan()` method) then I need to change it to some other value(since I have some conditions). I tried using `replace()` and `fillna()` with `limit` parameter also but they are modifying whol...
2018/09/02
[ "https://Stackoverflow.com/questions/52136375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4732694/" ]
I believe need replace `NaN`s values to `1` only for indexes specified in list `idx`: ``` mask = df['target_class'].isnull() idx = [1,2,3] df.loc[mask, 'target_class'] = df[mask].index.isin(idx).astype(int) print (df) points sundar cate king varun vicky john charlie target_class 1 x2 5 'cat' ...
The only thing that you should do is making the right assignation. That is, make an assignation in the rows that contain nulls. Example dataset: ``` ,event_id,type,timestamp,label 0,asd12e,click,12322232,0.0 1,asj123,click,212312312,0.0 2,asd321,touch,12312323,0.0 3,asdas3,click,33332233, 4,sdsaa3,touch,33211333, ``...
675,756
Within different media the frequency of a sound wave doesn't change. However, the wavelength and velocity changes, but when we see that frequency and wavelength are inversely proportional, that means that when the wavelength increases the frequency will decrease.
2021/11/07
[ "https://physics.stackexchange.com/questions/675756", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/318587/" ]
The relationship between wavelength and frequency is $v=\lambda f$, where $\lambda$ is the wavelength, $f$ is the frequency, and $v$ is the speed. In order for a wave to be continuous at the interface between two media, the frequency must not change. This gives us $v\propto\lambda$, so when the wavelength increases, th...
The frequency of wave depends on its source ,look if a tuning fork has 256 hz frequency then frequency of sound produced by it will also be 256 hz .frequency is constant and it depends on characteristics of source only . Sound is a longitudinal wave , for a wave to be continuous at interface of two boundary media,frequ...
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
Rather than trying to do this yourself, I would suggest that you use the builtin XML or JSON serialiation. However, if you are going to implement this yourself, then I would suggest that you perform a switch on the type of field and convert the value according to the data type of the field. For example: ``` s...
If you wrote it out, you should know what order you wrote it out in, and read it in the same order.
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
Rather than trying to do this yourself, I would suggest that you use the builtin XML or JSON serialiation. However, if you are going to implement this yourself, then I would suggest that you perform a switch on the type of field and convert the value according to the data type of the field. For example: ``` s...
go to your Project Properties -> Settings -> Create the settings you want, then to get at them ``` var x = Properties.Settings.Default.MyCoolSetting; ``` (you can read and write them) these settings will be stored in your applications .config file under user settings, where you can edit them
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
Rather than trying to do this yourself, I would suggest that you use the builtin XML or JSON serialiation. However, if you are going to implement this yourself, then I would suggest that you perform a switch on the type of field and convert the value according to the data type of the field. For example: ``` s...
I'd definitely add that this is a perfect case for serialization. However, if you want, you can also use: ``` Convert.ChangeType(object value, Type type) ``` So in the example above it would be something like: ``` f.SetValue(current, Convert.ChangeType(f.GetType().Parse(line.Split(new char[] {'='})[1])), f.GetType...
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
Rather than trying to do this yourself, I would suggest that you use the builtin XML or JSON serialiation. However, if you are going to implement this yourself, then I would suggest that you perform a switch on the type of field and convert the value according to the data type of the field. For example: ``` s...
Are you looking for something like this? Assuming you know what order your objects are coming in: ``` var converter = TypeDescriptor.GetConverter(f.GetType()); var result = converter.ConvertFrom(line.Split(new char[] {'='})[1])); ```
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
I'd definitely add that this is a perfect case for serialization. However, if you want, you can also use: ``` Convert.ChangeType(object value, Type type) ``` So in the example above it would be something like: ``` f.SetValue(current, Convert.ChangeType(f.GetType().Parse(line.Split(new char[] {'='})[1])), f.GetType...
If you wrote it out, you should know what order you wrote it out in, and read it in the same order.
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
Are you looking for something like this? Assuming you know what order your objects are coming in: ``` var converter = TypeDescriptor.GetConverter(f.GetType()); var result = converter.ConvertFrom(line.Split(new char[] {'='})[1])); ```
If you wrote it out, you should know what order you wrote it out in, and read it in the same order.
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
I'd definitely add that this is a perfect case for serialization. However, if you want, you can also use: ``` Convert.ChangeType(object value, Type type) ``` So in the example above it would be something like: ``` f.SetValue(current, Convert.ChangeType(f.GetType().Parse(line.Split(new char[] {'='})[1])), f.GetType...
go to your Project Properties -> Settings -> Create the settings you want, then to get at them ``` var x = Properties.Settings.Default.MyCoolSetting; ``` (you can read and write them) these settings will be stored in your applications .config file under user settings, where you can edit them
8,334,730
For a game I'm developing on (in C#), we need to be able to save and load options files, and for ease of use, we decided to do it as plain text. I have a problem however when I try to load the text back into their variables as I don't always know what type of variable it needs to be loaded into. The following line of ...
2011/11/30
[ "https://Stackoverflow.com/questions/8334730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1074449/" ]
Are you looking for something like this? Assuming you know what order your objects are coming in: ``` var converter = TypeDescriptor.GetConverter(f.GetType()); var result = converter.ConvertFrom(line.Split(new char[] {'='})[1])); ```
go to your Project Properties -> Settings -> Create the settings you want, then to get at them ``` var x = Properties.Settings.Default.MyCoolSetting; ``` (you can read and write them) these settings will be stored in your applications .config file under user settings, where you can edit them
22,038,101
I have the following HTML on my ASP.Net website: ``` <tr> <td><asp:TextBox runat="server" Text="Email" ID="LoginEmail" CssClass="usernamepassword" Width="160px"></asp:TextBox></td> <td><asp:RequiredFieldValidator runat="server" ID="req...
2014/02/26
[ "https://Stackoverflow.com/questions/22038101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2339664/" ]
You have to fix height and line-height of all text boxes as below : ``` .usernamepassword { height : 18px; line-height : 18px; } ``` Line height will take care of the text filled in text-box. IE is more sensitive to CSS. So you have to define all rules in CSS so that it should be same in all browsers.
It looks like you have to set a fixed `height`. Try setting a `height` to the `.usernamepassword`: ``` .usernamepassword { ... height: 1.5em; } ```
5,985
If I use Tor to log into my personal accounts (gmail, facebook, hotmail) I know I won't be anonymous anymore but is there any way they can trace my IP address? Either my ISP or anyone else? I"m mostly concerned about someone finding my location rather than knowing which sites and when I visit them. Thank you
2015/01/10
[ "https://tor.stackexchange.com/questions/5985", "https://tor.stackexchange.com", "https://tor.stackexchange.com/users/6498/" ]
Use Virtualbox with USB Wi-Fi dongle. Your host(Windows) will go to the Internet directly, and the Linux VM will be routed through it(NAT or bridge) - and USB 2.0(not 3.0 !) will be a mapping forwarding of USB dongle to VM and via hostapd you will securely do the trick. It is the simpliest *secure* way to do this.
If you're looking for an easy way to run Tor on Windows, the [Tor Browser Bundle](https://torproject.org) is the easiest way. If you install it on every Windows machine, practically all traffic going to pass in the wireless access point will go through the Tor network. Smartphone have their own apps that allow them to ...
5,985
If I use Tor to log into my personal accounts (gmail, facebook, hotmail) I know I won't be anonymous anymore but is there any way they can trace my IP address? Either my ISP or anyone else? I"m mostly concerned about someone finding my location rather than knowing which sites and when I visit them. Thank you
2015/01/10
[ "https://tor.stackexchange.com/questions/5985", "https://tor.stackexchange.com", "https://tor.stackexchange.com/users/6498/" ]
Use Virtualbox with USB Wi-Fi dongle. Your host(Windows) will go to the Internet directly, and the Linux VM will be routed through it(NAT or bridge) - and USB 2.0(not 3.0 !) will be a mapping forwarding of USB dongle to VM and via hostapd you will securely do the trick. It is the simpliest *secure* way to do this.
Simply use **Tortilla** **adapter** by the and tor community. New adapter will be installed along side. Two methods are available 1. Executable 2. Manually create the tortilla bundle adapter with the help of solution. You can follow build instruction from this git. <https://github.com/CrowdStrike/Tortilla>
26,406,084
I have two arrays. "a", a 2d numpy array. ``` import numpy.random as npr a = array([[5,6,7,8,9],[10,11,12,14,15]]) array([[ 5, 6, 7, 8, 9], [10, 11, 12, 14, 15]]) ``` "idx", a 3d numpy array constituting three index variants I want to use to index "a". ``` idx = npr.randint(5, size=(nsamp,shape(a)[0],...
2014/10/16
[ "https://Stackoverflow.com/questions/26406084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2369943/" ]
You can use [`choose`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.choose.html) to make the selection from `a`: ``` >>> np.choose(idx, a.T[:,:,np.newaxis]) array([[[ 6, 7, 6, 8, 9], [12, 10, 12, 10, 11]], [[ 5, 5, 8, 7, 5], [11, 14, 12, 10, 14]], [[ 7, 6, 5, 6, ...
You can use [`take`](http://docs.scipy.org/doc/numpy/reference/generated/numpy.take.html#numpy.take) array method: ``` import numpy a = numpy.array([[5,6,7,8,9],[10,11,12,14,15]]) idx = numpy.random.randint(5, size=(3, a.shape[0], a.shape[1])) print a.take(idx) ```
49,960,193
I have a URL that returns the following JSON response (for multiple restaurants). What is the simplest way to parse the response and display individual fields in a HTML page? ``` [ { restaurant_name: 'R_name', address: { longitude: -121.483693, city: 'City Name', zip: '00000', latitu...
2018/04/21
[ "https://Stackoverflow.com/questions/49960193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8672885/" ]
In main, you declare a variable named num which is local to the main function. You never pass it as an argument to the randgen function. However, you print it in your main function. When you print num in your main function, it is not printing the num variable from the randgen function, but the num variable from the mai...
`num` is never assigned any value in `main()`. Instead of just `randgen(y);` you need `num = randgen( y );` `randgen()` is declared as void - if you want to return something (a random integer in this case) you need to declare it as such. You're passing `y` as a parameter to `randgen()` before it is assigned any value...
47,855,350
I'm currently developing an app which has features like half Uber, half Tinder. I would like to create a TableView for editing profile to make it look like a view of Tinder's profile editing view. I successfully made a first cell for picking up profile image and second cell for textLabel. I want to make a third cel...
2017/12/17
[ "https://Stackoverflow.com/questions/47855350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9099031/" ]
I see in your code that seems you have 29 boxes, not 12, numbered from 1 to 29. I understant that you want 7 of them in blue and 5 in yellow. Right? You could make an array with the 28 ids (numbers 1 to 29), them "shuffle" it, and asign class blue to the first 7, yellow to the next 5... (and remove the classes for the...
You can use `$("#" + randome).length > 0` to verify if the id is already added or `$(".myClass").length > 0` if you want use a class for this. You can also use a array and verify the numbers and just pick different numbers. ```js var numbers = []; while(numbers.length < 5){ var number = Math.floor(Math.random()...
47,855,350
I'm currently developing an app which has features like half Uber, half Tinder. I would like to create a TableView for editing profile to make it look like a view of Tinder's profile editing view. I successfully made a first cell for picking up profile image and second cell for textLabel. I want to make a third cel...
2017/12/17
[ "https://Stackoverflow.com/questions/47855350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9099031/" ]
I see in your code that seems you have 29 boxes, not 12, numbered from 1 to 29. I understant that you want 7 of them in blue and 5 in yellow. Right? You could make an array with the 28 ids (numbers 1 to 29), them "shuffle" it, and asign class blue to the first 7, yellow to the next 5... (and remove the classes for the...
To avoid repeating numbers make an arraylist with every number you generate.
29,271,421
I have a full screen fixed image and I would like to add an overlay over top but nothing I've tried has worked. ``` <div class="container"> <div class="overlay"> <img src="image.jpg" /> </div> </div> .container { width: 100%; padding: 0; } .container>.overlay>img { position: fixed; } .cont...
2015/03/26
[ "https://Stackoverflow.com/questions/29271421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4274475/" ]
The best idea to go with this would be making the image the background image of the body. Here is a solution following this idea. If you really want it to be an image element let me know I will post a solution on that. The main idea is to use ``` background-color: rgba(...); ``` <https://jsfiddle.net/j1quLk7h/>
If I understand your question. That can be an approach. ```css .container { width: 100%; padding: 0; } .container>img { } .container>.overlay { width: 100%; height: 100%; background: red; z-index: 3; position: fixed; opacity:0.4; } ``` ```html <link href="https://maxcdn.b...
49,154,368
So I am working on a recipe book rails application. A user can create a recipe, view the recipe, and update the recipe. However, when I update a particular ingredient's quantity (i.e. Pasta "2 Cups" ) it changes all the other recipes that contain pasta to that new quantity ("2 Cups"). I can see in my rails console and ...
2018/03/07
[ "https://Stackoverflow.com/questions/49154368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9383539/" ]
Add `$('.submenu').hide();` in your click event: ```js $(document).ready(function() { $('.submenu').hide(); $("li:has(ul)").click(function() { $('.submenu').hide(); $("ul", this).toggle('slow'); }); }); ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery....
Add `$('ul li:has(ul)').not(this).find('.submenu:visible').toggle('slow');` to the click function. ```js $(document).ready(function() { $('.submenu').hide(); $("li:has(ul)").click(function() { $('ul li:has(ul)').not(this).find('.submenu:visible').toggle('slow'); $("ul", this).toggle('slow'); }); })...
49,154,368
So I am working on a recipe book rails application. A user can create a recipe, view the recipe, and update the recipe. However, when I update a particular ingredient's quantity (i.e. Pasta "2 Cups" ) it changes all the other recipes that contain pasta to that new quantity ("2 Cups"). I can see in my rails console and ...
2018/03/07
[ "https://Stackoverflow.com/questions/49154368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9383539/" ]
Add `$('.submenu').hide();` in your click event: ```js $(document).ready(function() { $('.submenu').hide(); $("li:has(ul)").click(function() { $('.submenu').hide(); $("ul", this).toggle('slow'); }); }); ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery....
You can use: ``` $(this).siblings().children(".submenu:visible").toggle('slow'); ``` Like this: ```js $(document).ready(function() { $('.submenu').hide(); $("li:has(ul)").click(function() { $(this).siblings().children(".submenu:visible").toggle('slow'); $("ul", this).toggle('slow'); }); }); ``` ...