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
31,527,846
I am trying to get display name of a month through this: ``` final Calendar c = Calendar.getInstance(); String monthName=c.getDisplayName(monthOfYear, Calendar.SHORT, Locale.US);//monthOfYear: 6 ``` but the function is always returning `null` please help me.
2015/07/20
[ "https://Stackoverflow.com/questions/31527846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/971741/" ]
```css body { padding: 3em; } img { transition: transform .5s; } img:hover { transform: scale(2.5); } ``` ```html <img src="//www.gravatar.com/avatar/9708ca3dca5969e124d0730acf48d2e7?s=32&d=identicon&r=PG&f=1"> ``` See <http://caniuse.com/#feat=transforms2d> and <http://caniuse.com/#search=transition>...
Try this. Change the src with your image name. Regards! ``` <html> <head> <style> .pop-out { transition: transform .5s; } .pop-out:hover { -ms-transform: scale(1.5, 1.5); -webkit-transform: scale(1.5, 1.5); transform: scale(1.5, 1.5); } </style> </head> <body> ...
31,527,846
I am trying to get display name of a month through this: ``` final Calendar c = Calendar.getInstance(); String monthName=c.getDisplayName(monthOfYear, Calendar.SHORT, Locale.US);//monthOfYear: 6 ``` but the function is always returning `null` please help me.
2015/07/20
[ "https://Stackoverflow.com/questions/31527846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/971741/" ]
```css body { padding: 3em; } img { transition: transform .5s; } img:hover { transform: scale(2.5); } ``` ```html <img src="//www.gravatar.com/avatar/9708ca3dca5969e124d0730acf48d2e7?s=32&d=identicon&r=PG&f=1"> ``` See <http://caniuse.com/#feat=transforms2d> and <http://caniuse.com/#search=transition>...
I have two great solutions :) --- *Option 1)* ----------- **HTML** ``` <img id="image" src=""> ``` **CSS** ``` #image { width: 100%; } #image:hover { width: 150%; } ``` --- *Option 2)* ----------- **HTML** ``` <img id="image" src=""> ``` **CSS** ``` #image { width: 100%; } #image:hover { ...
31,527,846
I am trying to get display name of a month through this: ``` final Calendar c = Calendar.getInstance(); String monthName=c.getDisplayName(monthOfYear, Calendar.SHORT, Locale.US);//monthOfYear: 6 ``` but the function is always returning `null` please help me.
2015/07/20
[ "https://Stackoverflow.com/questions/31527846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/971741/" ]
Try this. Change the src with your image name. Regards! ``` <html> <head> <style> .pop-out { transition: transform .5s; } .pop-out:hover { -ms-transform: scale(1.5, 1.5); -webkit-transform: scale(1.5, 1.5); transform: scale(1.5, 1.5); } </style> </head> <body> ...
I have two great solutions :) --- *Option 1)* ----------- **HTML** ``` <img id="image" src=""> ``` **CSS** ``` #image { width: 100%; } #image:hover { width: 150%; } ``` --- *Option 2)* ----------- **HTML** ``` <img id="image" src=""> ``` **CSS** ``` #image { width: 100%; } #image:hover { ...
134,418
I have an exterior service door on my garage I'd like to remove and wall off. The exterior of the garage is cedar siding. Replacing that and framing the doorway in is not the issue. My concern is pouring concrete over the existing floor. There is a foundation on the exterior wall, maybe 8" as the garage is attached to ...
2018/03/12
[ "https://diy.stackexchange.com/questions/134418", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/82469/" ]
I understand the question to be about filling in the foundation wall through the former doorway opening over the top of the floor slab. I would not do so because the slab will have a tendency to move with seasonal soil movement, etc. Presuming that the slab is poured over a lowered area in the foundation wall, I'd cu...
If I understand what you are asking it is only about the slab, can you pour inside the foundation, yes this is done all the time adding some rebar pins around the perimeter will help lock everything together I do this when repairing areas I had to cut out usually in a slab repair I will use heavy wire to keep the patch...
46,225,137
If I am correct, `with` statement doesn't introduce a local scope for the `with` statement. These are examples from Learning Python: ``` with open(r'C:\misc\data') as myfile: for line in myfile: print(line) ...more code here... ``` and ``` lock = threading.Lock() # After:...
2017/09/14
[ "https://Stackoverflow.com/questions/46225137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156458/" ]
When `with` enters a context, it calls a hook on the context manager object, called `__enter__`, and the return value of that hook can optionally be assigned to a name using `as <name>`. Many context managers return `self` from their `__enter__` hook. If they do, then you can indeed take your pick between creating the ...
[Here's a good explanation](http://effbot.org/zone/python-with-statement.htm). I'll paraphrase the key part: > > The `with` statement could be thought of like this code: > > > > ``` > set things up > try: > do something > finally: > tear things down > > ``` > > Here, “set things up” could be opening a fi...
362,854
Context ------- This morning while watching a video of Wolfenstein 3D from 1992 and [Doom (1993)](https://youtu.be/xcwlOllUdK8?t=171) I noticed that weapons don’t need to be compensated for any recoil. Then on my trip down memory lane I watched a Half Life (1998) video and there, automatic weapons at least seemed to h...
2020/01/16
[ "https://gaming.stackexchange.com/questions/362854", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/242748/" ]
The first shooter to display weapon recoil, that I have managed to find, is the [Dirty Harry (1990)](https://en.wikipedia.org/wiki/Dirty_Harry_(1990_video_game)) video game. > > The game is a side-scroller in which players must guide Dirty Harry throughout San Francisco. He wears a blue suit, although it can be excha...
More of an RPG with FPS elements than a pure FPS, but the original [System Shock](https://www.ttlg.com/ss1/faq/#3.1) from 1994 had projectile weapon recoil. > > This full-sized combat rifle is based on the 2064 Interlocutor KR-5. > It's not quite as powerful as it sounds, and it produces a big recoil and thus has a ...
362,854
Context ------- This morning while watching a video of Wolfenstein 3D from 1992 and [Doom (1993)](https://youtu.be/xcwlOllUdK8?t=171) I noticed that weapons don’t need to be compensated for any recoil. Then on my trip down memory lane I watched a Half Life (1998) video and there, automatic weapons at least seemed to h...
2020/01/16
[ "https://gaming.stackexchange.com/questions/362854", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/242748/" ]
More of an RPG with FPS elements than a pure FPS, but the original [System Shock](https://www.ttlg.com/ss1/faq/#3.1) from 1994 had projectile weapon recoil. > > This full-sized combat rifle is based on the 2064 Interlocutor KR-5. > It's not quite as powerful as it sounds, and it produces a big recoil and thus has a ...
According to [Phoenix: The Rise & Fall of Video Games, 3rd edition](https://retrocdn.net/images/e/e6/PhoenixtheFallandRiseofVideoGames_Book_US_3rd.pdf) : In **1989** : > > Konix developed other controllers for the system. One was a light gun that had attachments to turn it into a light rifle. It even had a recoil w...
362,854
Context ------- This morning while watching a video of Wolfenstein 3D from 1992 and [Doom (1993)](https://youtu.be/xcwlOllUdK8?t=171) I noticed that weapons don’t need to be compensated for any recoil. Then on my trip down memory lane I watched a Half Life (1998) video and there, automatic weapons at least seemed to h...
2020/01/16
[ "https://gaming.stackexchange.com/questions/362854", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/242748/" ]
More of an RPG with FPS elements than a pure FPS, but the original [System Shock](https://www.ttlg.com/ss1/faq/#3.1) from 1994 had projectile weapon recoil. > > This full-sized combat rifle is based on the 2064 Interlocutor KR-5. > It's not quite as powerful as it sounds, and it produces a big recoil and thus has a ...
Quite frankly, I think you answered your own question by posting CS:GO's AK spray pattern. Counter strike 1.6 was released in 2000 and was a mod for half-life even before it's 2000 release. Most certainly the first game to implement a mechanic for compensating recoil(not recoil itself, but compensating for it) that was...
362,854
Context ------- This morning while watching a video of Wolfenstein 3D from 1992 and [Doom (1993)](https://youtu.be/xcwlOllUdK8?t=171) I noticed that weapons don’t need to be compensated for any recoil. Then on my trip down memory lane I watched a Half Life (1998) video and there, automatic weapons at least seemed to h...
2020/01/16
[ "https://gaming.stackexchange.com/questions/362854", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/242748/" ]
The first shooter to display weapon recoil, that I have managed to find, is the [Dirty Harry (1990)](https://en.wikipedia.org/wiki/Dirty_Harry_(1990_video_game)) video game. > > The game is a side-scroller in which players must guide Dirty Harry throughout San Francisco. He wears a blue suit, although it can be excha...
According to [Phoenix: The Rise & Fall of Video Games, 3rd edition](https://retrocdn.net/images/e/e6/PhoenixtheFallandRiseofVideoGames_Book_US_3rd.pdf) : In **1989** : > > Konix developed other controllers for the system. One was a light gun that had attachments to turn it into a light rifle. It even had a recoil w...
362,854
Context ------- This morning while watching a video of Wolfenstein 3D from 1992 and [Doom (1993)](https://youtu.be/xcwlOllUdK8?t=171) I noticed that weapons don’t need to be compensated for any recoil. Then on my trip down memory lane I watched a Half Life (1998) video and there, automatic weapons at least seemed to h...
2020/01/16
[ "https://gaming.stackexchange.com/questions/362854", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/242748/" ]
The first shooter to display weapon recoil, that I have managed to find, is the [Dirty Harry (1990)](https://en.wikipedia.org/wiki/Dirty_Harry_(1990_video_game)) video game. > > The game is a side-scroller in which players must guide Dirty Harry throughout San Francisco. He wears a blue suit, although it can be excha...
Quite frankly, I think you answered your own question by posting CS:GO's AK spray pattern. Counter strike 1.6 was released in 2000 and was a mod for half-life even before it's 2000 release. Most certainly the first game to implement a mechanic for compensating recoil(not recoil itself, but compensating for it) that was...
362,854
Context ------- This morning while watching a video of Wolfenstein 3D from 1992 and [Doom (1993)](https://youtu.be/xcwlOllUdK8?t=171) I noticed that weapons don’t need to be compensated for any recoil. Then on my trip down memory lane I watched a Half Life (1998) video and there, automatic weapons at least seemed to h...
2020/01/16
[ "https://gaming.stackexchange.com/questions/362854", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/242748/" ]
According to [Phoenix: The Rise & Fall of Video Games, 3rd edition](https://retrocdn.net/images/e/e6/PhoenixtheFallandRiseofVideoGames_Book_US_3rd.pdf) : In **1989** : > > Konix developed other controllers for the system. One was a light gun that had attachments to turn it into a light rifle. It even had a recoil w...
Quite frankly, I think you answered your own question by posting CS:GO's AK spray pattern. Counter strike 1.6 was released in 2000 and was a mod for half-life even before it's 2000 release. Most certainly the first game to implement a mechanic for compensating recoil(not recoil itself, but compensating for it) that was...
19,338,772
I have problem incrementing this by one per click. ``` class window extends JPanel implements MouseListener{ int a=0; public void paint(Graphics g){ super.paint(); g.drawLine(5, 5, 200, 200); // TEST draw } @Override public void mousePressed(MouseEvent e) { a++; // increment by one System.out.prin...
2013/10/12
[ "https://Stackoverflow.com/questions/19338772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2857955/" ]
You need to **instantiate** – that is, [create an instance of](http://docs.oracle.com/javase/tutorial/java/javaOO/objectcreation.html) – `DataManage`, before you can call a method on it. Everything else looks fine. So where you currently have this: ``` DataManage object; object.FileCreate(); ``` use `new` to creat...
In OOP programing , there are many kinds of classes you can use: You are lookin for creating new instance for a class - which means the class is dynamic. [There are two parts of "creating" a new instance to a class,](http://java.about.com/od/workingwithobjects/ss/designobjects_6.htm) First - the decleration (the type ...
17,863,180
I am trying to call a label dynamically but have no idea how to do it. I want to make a label visible depending on the integer. So if `int i = 1`, then `label1` should turn visible and if `i = 2`, then `label2` should turn visible, and so on and so forth. How do I do this? ``` int i = word.indexOf("t"); //This is...
2013/07/25
[ "https://Stackoverflow.com/questions/17863180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2452737/" ]
Here's a dynamic solution: ``` foreach (var label in Controls.OfType<Label>()) label.Visible = (label.Name == "label" + i); ``` Note that: 1. this will hide all labels that are not named `"label" + i`. You may need additional filtering logic if there are any other labels on the form/container 2. the above code ...
Label1.Visible = (i == 1); // if i is not 1, then label1 is not visible
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
Let's try the Pythagorean theorem: Side $AB = [1- -3,0-2] = [4,-2]$, with length $\sqrt{20}$ Side $BC = [4- 1,6-0] = [3,6]$, with length $\sqrt{45}$ Side $AC = [4- -3,6-2] = [7,4]$, with length $\sqrt{65}$ $|AB|^2 + |BC|^2 = (\sqrt{20})^2+(\sqrt{45})^2 = 20 + 45 = 65 = (\sqrt{65})^2 = |AC|^2$ So the triangle must ...
If you calculate again the distances you will see that $$AC^2=AB^2+BC^2$$
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
I tried to solve it using the slope concept and indeed $A$, $B$ and $C$ are endpoints of a right triangle. The slope of the line connecting $AB$ is $\frac{-1}{2}$. The slope of the line connecting $AC$ is $\frac{4}{7}$. Lastly, the slope of the line connecting $BC$ is 2. Now since the product of the slope of line ...
If you calculate again the distances you will see that $$AC^2=AB^2+BC^2$$
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
Translate the triangle by $(-1,0)$. The new coordinates of the vertices become: $$ A(-4,2),\quad B(0,0),\quad C(3,6) $$ and since the dot product between $A$ and $C$ is zero, $\widehat{ABC}$ is a right angle.
If you calculate again the distances you will see that $$AC^2=AB^2+BC^2$$
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
[![enter image description here](https://i.stack.imgur.com/OgtCk.png)](https://i.stack.imgur.com/OgtCk.png) Add points $D=(-3,0)$ and $E=(4,0)$ and show that $\Delta ABD \sim\Delta BCE$. Then show that $\measuredangle ABC=90^\circ$. Do you see why the slopes of perpendicular lines are negative reciprocals of each oth...
If you calculate again the distances you will see that $$AC^2=AB^2+BC^2$$
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
Let's try the Pythagorean theorem: Side $AB = [1- -3,0-2] = [4,-2]$, with length $\sqrt{20}$ Side $BC = [4- 1,6-0] = [3,6]$, with length $\sqrt{45}$ Side $AC = [4- -3,6-2] = [7,4]$, with length $\sqrt{65}$ $|AB|^2 + |BC|^2 = (\sqrt{20})^2+(\sqrt{45})^2 = 20 + 45 = 65 = (\sqrt{65})^2 = |AC|^2$ So the triangle must ...
Translate the triangle by $(-1,0)$. The new coordinates of the vertices become: $$ A(-4,2),\quad B(0,0),\quad C(3,6) $$ and since the dot product between $A$ and $C$ is zero, $\widehat{ABC}$ is a right angle.
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
Let's try the Pythagorean theorem: Side $AB = [1- -3,0-2] = [4,-2]$, with length $\sqrt{20}$ Side $BC = [4- 1,6-0] = [3,6]$, with length $\sqrt{45}$ Side $AC = [4- -3,6-2] = [7,4]$, with length $\sqrt{65}$ $|AB|^2 + |BC|^2 = (\sqrt{20})^2+(\sqrt{45})^2 = 20 + 45 = 65 = (\sqrt{65})^2 = |AC|^2$ So the triangle must ...
[![enter image description here](https://i.stack.imgur.com/OgtCk.png)](https://i.stack.imgur.com/OgtCk.png) Add points $D=(-3,0)$ and $E=(4,0)$ and show that $\Delta ABD \sim\Delta BCE$. Then show that $\measuredangle ABC=90^\circ$. Do you see why the slopes of perpendicular lines are negative reciprocals of each oth...
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
I tried to solve it using the slope concept and indeed $A$, $B$ and $C$ are endpoints of a right triangle. The slope of the line connecting $AB$ is $\frac{-1}{2}$. The slope of the line connecting $AC$ is $\frac{4}{7}$. Lastly, the slope of the line connecting $BC$ is 2. Now since the product of the slope of line ...
Translate the triangle by $(-1,0)$. The new coordinates of the vertices become: $$ A(-4,2),\quad B(0,0),\quad C(3,6) $$ and since the dot product between $A$ and $C$ is zero, $\widehat{ABC}$ is a right angle.
1,448,703
Am I missing something here? My homework says to prove that the given triangle is a right triangle, but it does not appear to be a right triangle mathematically. > > Let $A =(-3, 2)$, $B=(1, 0)$, and $C=(4,6)$. > > > Prove that $\blacktriangle ABC$ is a right triangle. > > > I have tried the slope method and i...
2015/09/23
[ "https://math.stackexchange.com/questions/1448703", "https://math.stackexchange.com", "https://math.stackexchange.com/users/273585/" ]
I tried to solve it using the slope concept and indeed $A$, $B$ and $C$ are endpoints of a right triangle. The slope of the line connecting $AB$ is $\frac{-1}{2}$. The slope of the line connecting $AC$ is $\frac{4}{7}$. Lastly, the slope of the line connecting $BC$ is 2. Now since the product of the slope of line ...
[![enter image description here](https://i.stack.imgur.com/OgtCk.png)](https://i.stack.imgur.com/OgtCk.png) Add points $D=(-3,0)$ and $E=(4,0)$ and show that $\Delta ABD \sim\Delta BCE$. Then show that $\measuredangle ABC=90^\circ$. Do you see why the slopes of perpendicular lines are negative reciprocals of each oth...
42,954,927
I recently discovered that the `<<<` trick in `gdb` to feed the `stdin` of the debugged program is filtering the null bytes out from the stream. Here is a small example (that anybody should be able to reproduce at home) to testify that it filters out the null bytes: ``` $> python -c 'print("A\x00" * 10)' | cat -A A^@...
2017/03/22
[ "https://Stackoverflow.com/questions/42954927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717822/" ]
> > So, I always though that `<<<` and `<()` were doing about the same thing which is now obviously wrong. > > > Those don't do *at all* the same thing. The `<<<` operator *redirects* a "here string" to the associated process's standard input. Process substitution via `<()` *expands to* the name of a file (general...
As already mentioned, these two methods are not the same thing (though in some cases can be used for the same reason) This `<<<` is a here string and is subject to variable expansion rules. Bash does not allow null bytes present at variable values. On the other hand the process substitution `<()` is treated as a fil...
349,517
Problem: I have 200k data samples which are class imblanced (10% positive class, 90% negative class). I split the data in exactly half so my training set is 100k samples and my test set os 100k samples. I train algorithms A and B. Algorithm A discriminates between the two classes using the test set and it achieves a...
2018/06/02
[ "https://stats.stackexchange.com/questions/349517", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/87408/" ]
... because the mean of the $n$ values is not $\mu$. A sample mean would normally be denoted as $\bar{x}$; it's not the case that $\bar{x}=μ$ in general. Consider the case where I have 99 tickets labelled 1,2,...,99. The population average of those values, $μ$, is 50. I draw five of them and get 76, 48, 34, 8, 71, whi...
Can't help you with a formal answer but I have been thinking about this topic. I guess that it is about the concept of a restrain. When you observe the values of a population, if you calculate the population mean you are not actually setting anny restrain, just describing the population with a parameter that happens ...
8,100
I want to understand what the `gamma` parameter does in an SVM. According to [this page](http://scikit-learn.org/stable/auto_examples/svm/plot_rbf_parameters.html). > > Intuitively, the `gamma` parameter defines how far the influence of a single training example reaches, with low values meaning ‘far’ and high values ...
2018/09/23
[ "https://ai.stackexchange.com/questions/8100", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/18464/" ]
I've summarized the [key ideas of SVMs](https://martin-thoma.com/svm-with-sklearn/). So this is how $\gamma$ is used with a gaussian Kernel: $$K\_{\text{Gauss}}(\mathbf{x}\_i, \mathbf{x}\_j) = e^{\frac{-\gamma\|\mathbf{x}\_i - \mathbf{x}\_j\|^2}{2 \sigma^2}}$$ The bigger the $\gamma$, the more "linear" the decision b...
Rougly speaking, the higher the gamma, the more complex the model, the higher the risk of overfitting. In fact, as you can read on the page you linked: > > If **gamma is too large**, the radius of the area of influence of the > support vectors **only includes the support vector itself**[...] > > > When **gamma is...
5,250,394
I have a C# code behind file that gets dynamically generated HTML from a server and converts it to a PDF. In the HTML there are `<link rel="stylesheet">` elements that reference external stylesheets as well as many `<img>` tags. All of these files, images and stylesheets, come from `www.example.com`, and I'm trying t...
2011/03/09
[ "https://Stackoverflow.com/questions/5250394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578961/" ]
You may use filestream to get the file and then replace by the code you have used.Other approaches are open You may find this like helpful [CSS Parser](http://www.codeproject.com/KB/recipes/CSSParser.aspx) [Reading and Parsing a CSS file](http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/3095/)
Aha, so here's an idea I had. This might be inefficient, but here's what I think I could do: Change each `<link rel="stylesheet">` into a `<style> ... </style>` tag and read the file contents, replacing the external stylesheet with an embedded one. This might be inefficient, thoughts? Thank you!
5,250,394
I have a C# code behind file that gets dynamically generated HTML from a server and converts it to a PDF. In the HTML there are `<link rel="stylesheet">` elements that reference external stylesheets as well as many `<img>` tags. All of these files, images and stylesheets, come from `www.example.com`, and I'm trying t...
2011/03/09
[ "https://Stackoverflow.com/questions/5250394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578961/" ]
Since you say "code behind file"... are you doing this in ASP.NET? You could use String.Replace functions in the HTML code to change `<link href="www.example.com/cssfile.css">` to `<link href="fixcss.ashx?file=www.example.com/cssfile.css">`. Then write a fixcss.ashx to retrieve the CSS file and perform the string repl...
You may use filestream to get the file and then replace by the code you have used.Other approaches are open You may find this like helpful [CSS Parser](http://www.codeproject.com/KB/recipes/CSSParser.aspx) [Reading and Parsing a CSS file](http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/3095/)
5,250,394
I have a C# code behind file that gets dynamically generated HTML from a server and converts it to a PDF. In the HTML there are `<link rel="stylesheet">` elements that reference external stylesheets as well as many `<img>` tags. All of these files, images and stylesheets, come from `www.example.com`, and I'm trying t...
2011/03/09
[ "https://Stackoverflow.com/questions/5250394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578961/" ]
You may use filestream to get the file and then replace by the code you have used.Other approaches are open You may find this like helpful [CSS Parser](http://www.codeproject.com/KB/recipes/CSSParser.aspx) [Reading and Parsing a CSS file](http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/3095/)
Just for some variety (and for other folks who might be in a different environment), if you have access to the to it, you can (and should) use the [URL Rewrite module](http://www.iis.net/download/urlrewrite). It can not only redirect (like .htaccess in PHP apps would) but also rewrite the URL in files that are served (...
5,250,394
I have a C# code behind file that gets dynamically generated HTML from a server and converts it to a PDF. In the HTML there are `<link rel="stylesheet">` elements that reference external stylesheets as well as many `<img>` tags. All of these files, images and stylesheets, come from `www.example.com`, and I'm trying t...
2011/03/09
[ "https://Stackoverflow.com/questions/5250394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578961/" ]
Since you say "code behind file"... are you doing this in ASP.NET? You could use String.Replace functions in the HTML code to change `<link href="www.example.com/cssfile.css">` to `<link href="fixcss.ashx?file=www.example.com/cssfile.css">`. Then write a fixcss.ashx to retrieve the CSS file and perform the string repl...
Aha, so here's an idea I had. This might be inefficient, but here's what I think I could do: Change each `<link rel="stylesheet">` into a `<style> ... </style>` tag and read the file contents, replacing the external stylesheet with an embedded one. This might be inefficient, thoughts? Thank you!
5,250,394
I have a C# code behind file that gets dynamically generated HTML from a server and converts it to a PDF. In the HTML there are `<link rel="stylesheet">` elements that reference external stylesheets as well as many `<img>` tags. All of these files, images and stylesheets, come from `www.example.com`, and I'm trying t...
2011/03/09
[ "https://Stackoverflow.com/questions/5250394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578961/" ]
Since you say "code behind file"... are you doing this in ASP.NET? You could use String.Replace functions in the HTML code to change `<link href="www.example.com/cssfile.css">` to `<link href="fixcss.ashx?file=www.example.com/cssfile.css">`. Then write a fixcss.ashx to retrieve the CSS file and perform the string repl...
Just for some variety (and for other folks who might be in a different environment), if you have access to the to it, you can (and should) use the [URL Rewrite module](http://www.iis.net/download/urlrewrite). It can not only redirect (like .htaccess in PHP apps would) but also rewrite the URL in files that are served (...
19,936,522
I have a 1000s of files in a directory with and I want to be able to divide them into sub-directories, with each sub-directory containing a specific number of files. I don't care what files go into what directories, just as long as each contain a specific number. All the file names have a common ending (e.g. .txt) but ...
2013/11/12
[ "https://Stackoverflow.com/questions/19936522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1308144/" ]
Assuming you only have files ending in `*.txt`, no hidden files and no directories: ``` #!/bin/bash shopt -s nullglob maxf=42 files=( *.txt ) for ((i=0;maxf*i<${#files[@]};++i)); do s=subdir$i mkdir -p "$s" mv -t "$s" -- "${files[@]:i*maxf:maxf}" done ``` This will create directories `subdirX` with `X...
``` max_per_subdir=1000 start=1 while [ -e $(printf %03d $start) ]; do start=$((start + 1)) done find -maxdepth 1 -type f ! -name '.*' -name '*.txt' -print0 \ | xargs -0 -n $max_per_subdir echo \ | while read -a files; do subdir=$(printf %03d $start) mkdir $subdir || exit 1 mv "${files[@]}" $subdir/ || exit 1 ...
19,936,522
I have a 1000s of files in a directory with and I want to be able to divide them into sub-directories, with each sub-directory containing a specific number of files. I don't care what files go into what directories, just as long as each contain a specific number. All the file names have a common ending (e.g. .txt) but ...
2013/11/12
[ "https://Stackoverflow.com/questions/19936522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1308144/" ]
Assuming you only have files ending in `*.txt`, no hidden files and no directories: ``` #!/bin/bash shopt -s nullglob maxf=42 files=( *.txt ) for ((i=0;maxf*i<${#files[@]};++i)); do s=subdir$i mkdir -p "$s" mv -t "$s" -- "${files[@]:i*maxf:maxf}" done ``` This will create directories `subdirX` with `X...
How about ``` find *.txt -print0 | xargs -0 -n 100 | xargs -I {} echo cp {} '$(md5sum <<< "{}")' | sh ``` This will create several directories each containing 100 files. The name of each created directory is a md5 hash of the filenames it contains.
19,936,522
I have a 1000s of files in a directory with and I want to be able to divide them into sub-directories, with each sub-directory containing a specific number of files. I don't care what files go into what directories, just as long as each contain a specific number. All the file names have a common ending (e.g. .txt) but ...
2013/11/12
[ "https://Stackoverflow.com/questions/19936522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1308144/" ]
``` max_per_subdir=1000 start=1 while [ -e $(printf %03d $start) ]; do start=$((start + 1)) done find -maxdepth 1 -type f ! -name '.*' -name '*.txt' -print0 \ | xargs -0 -n $max_per_subdir echo \ | while read -a files; do subdir=$(printf %03d $start) mkdir $subdir || exit 1 mv "${files[@]}" $subdir/ || exit 1 ...
How about ``` find *.txt -print0 | xargs -0 -n 100 | xargs -I {} echo cp {} '$(md5sum <<< "{}")' | sh ``` This will create several directories each containing 100 files. The name of each created directory is a md5 hash of the filenames it contains.
2,257,022
Show that if $a$ is a quadratic residue mod $p$, then $a$ is not a primitive root mod $p$. I know that a quadratic residue is a perfect square, and a primitive root has order equal to $\varphi(p)$, but I do not see any relationship between the 2 that would imply the desired conclusion.
2017/04/29
[ "https://math.stackexchange.com/questions/2257022", "https://math.stackexchange.com", "https://math.stackexchange.com/users/382939/" ]
If $a \equiv x^2 \pmod{p}$, then $a^{\phi(p)/2} \equiv x^{\phi(p)} \equiv 1 \pmod{p}$; the order of $a$ would not be $\phi(p)$.
If $a$ is a $k-$adic Residue, there exists $b$ such that $b^n\equiv a\pmod p$ We know, ord$\_mb=d,$ ord$\_m(b^k)=\dfrac d{(d,k)}$ ([Proof](http://archive.org/details/NumberTheory_862) @Page#95) What is the maximum value of $d$ here?
29,584,911
I have a Button that I want to bind to the listview's selectedItem count. I cannot find where my error is. The button state is always enabled regardless of testListView.SelectedItems.Count. Do I need a converter of some sort? If the Count is zero, it should implicitly convert that to a false no ? ``` <ListView x:Name...
2015/04/12
[ "https://Stackoverflow.com/questions/29584911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82383/" ]
Swift 1.2 has introduced a native `Set` type, but unlike `NSSet` it doesn't have the `anyObject` method. You have a couple of options. You can use the `first()` method or you can take advantage of the ability to bridge a Swift Set to NSSet - ``` let touch = touches.first() as? UITouch ``` or ``` let touchesSet=touc...
I've noticed that, too. I'm not sure if this is the actual alternation for the original code these days... I'm sure it isn't. But I've simply changed that code to this: ``` (touches: NSObject, withEvent event: UIEvent) ``` Sorry if that doesn't work for you. It's been working for me perfectly fine.
12,967,673
My Servlet mapping looks like: ```xml <servlet-mapping> <servlet-name>myservlet</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> ``` So my Servlet responds to requests such as `http://bla.com/myservlet/bla/bla/bla` How can I make it respond to `http://bla.com/bla/bla/bla` and get rid of the `myse...
2012/10/19
[ "https://Stackoverflow.com/questions/12967673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1172468/" ]
If you are using Jetty installation. There are two ways to do it 1. you can rename your war file as `root.war`, makes it's context root as `/` 2. create context.xml for your webapp ```xml <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Required minimal context configuration : ...
You can add multiple url patterns to map to same servlet ``` <servlet-mapping> <servlet-name>myservlet</servlet-name> <url-pattern>/bla</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>myservlet</servlet-name> <url-pattern>/bla/bla</url-pattern> </servlet-mapping> ```
71,297,267
I have a tree from which I want to return its children as a list through a function. In this function, I needed to iterate over a list of strings. At first I did it by using the inline *for loop* ``` def get_children(root): Data = [ ] Data.append( root.data ) for child in root.children: ...
2022/02/28
[ "https://Stackoverflow.com/questions/71297267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15012657/" ]
Because you didn't wrap your list comprehension with [], the return value of it is a generator expression (which generates the list you made). You can fix this by simply wrapping the expression with []
The problem is here at `Data.append( elem for elem in get_children(child))`, you haven't wrapped the list comprehension. So the solution is `Data.append([elem for elem in get_children(child)])` to just add `[` at start and `]` at end of list comprehension. I think yo are trying to get all child of the root, well here'...
71,297,267
I have a tree from which I want to return its children as a list through a function. In this function, I needed to iterate over a list of strings. At first I did it by using the inline *for loop* ``` def get_children(root): Data = [ ] Data.append( root.data ) for child in root.children: ...
2022/02/28
[ "https://Stackoverflow.com/questions/71297267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15012657/" ]
you used Generator expressions instead of list comprehension Generator Expressions are somewhat similar to list comprehensions, but the former doesn’t construct list object. Instead of creating a list and keeping the whole sequence in the memory the generator generates the next element in demand.
The problem is here at `Data.append( elem for elem in get_children(child))`, you haven't wrapped the list comprehension. So the solution is `Data.append([elem for elem in get_children(child)])` to just add `[` at start and `]` at end of list comprehension. I think yo are trying to get all child of the root, well here'...
120,522
I've got a web application where I want to be able to add qualifications to a user. When I open the *Edit Employee* form there is an *Add* button and a *Delete* button. When clicking on the Add button, a Bootstrap modal opens, with another form in it, where you can choose the *Qualification* as well as a *Date Of Issu...
2018/08/25
[ "https://ux.stackexchange.com/questions/120522", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/118286/" ]
You should save when the user knows they are saving the data. In my experience, users think of forms as hierarchies with the saved data being at the top and the submit button linking to the next level up, so in your case: ``` Saved data -> Edit Employee -> Add Qualification ``` Added qualifications are sent to the ...
In your case I would recommend the following: The user clicks on the `Add` button in the modal. Then write the created qualification into the element on your main page by AJAX and Show the user a yellow warning like `You have unsaved data at the form. Please save your work.` [![enter image description here](https://i...
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
It's called [Revision Control](http://en.wikipedia.org/wiki/Revision_control).
Please read this thread here at SO: [Keeping track of changes I make by copying project folders](https://stackoverflow.com/questions/1050441/keeping-track-of-changes-i-make-by-copying-project-folders).
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
The term you are looking for is Source Control. Modern source control's provide all the functionality you described plus much more. Team Foundation Server seamlessly integrates into VS2010 and is very useful. Read through [Source Control for Visual Studio](http://msdn.microsoft.com/en-us/library/zxd4dfad%28v=VS.80%29....
I'm not familiar with Visual Studio, but generally there are two approaches to implementing this: 1) Source/Revision control - But the problem is that it is very low-granularity, you usually commit a file when it is ready, but lose any interim changes. There are a lot of solutions compatible with visual studio. 2) A ...
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
subversion has a lot of mind share these days, but it's very old-school, first-gen tech. Distributed revision control is gaining a lot of momentum and I'd highly recommend that you become familiar with it if you're going to be a code monkey professional. Look up mercurial (also referred to as hg) or bazaar. If nothing ...
Every source control does that, you know ;) YOu have a legal VIsual Studio 2010? Try Team System.
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
Please read this thread here at SO: [Keeping track of changes I make by copying project folders](https://stackoverflow.com/questions/1050441/keeping-track-of-changes-i-make-by-copying-project-folders).
Every source control does that, you know ;) YOu have a legal VIsual Studio 2010? Try Team System.
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
I'm not familiar with Visual Studio, but generally there are two approaches to implementing this: 1) Source/Revision control - But the problem is that it is very low-granularity, you usually commit a file when it is ready, but lose any interim changes. There are a lot of solutions compatible with visual studio. 2) A ...
Every source control does that, you know ;) YOu have a legal VIsual Studio 2010? Try Team System.
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
It's called [Revision Control](http://en.wikipedia.org/wiki/Revision_control).
The term you are looking for is Source Control. Modern source control's provide all the functionality you described plus much more. Team Foundation Server seamlessly integrates into VS2010 and is very useful. Read through [Source Control for Visual Studio](http://msdn.microsoft.com/en-us/library/zxd4dfad%28v=VS.80%29....
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
you could use **SVN** or **GIT** but for local use, I would prefer SVN. its free and its easy. For visual studio there are a few SVN client plugins (like VisualSVN). But, I would suggest TortoiseSVN as the client. To be clear, SVN is the server, TortoiseSVN is the client. (Both are free open source tools)
The term you are looking for is Source Control. Modern source control's provide all the functionality you described plus much more. Team Foundation Server seamlessly integrates into VS2010 and is very useful. Read through [Source Control for Visual Studio](http://msdn.microsoft.com/en-us/library/zxd4dfad%28v=VS.80%29....
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
you could use **SVN** or **GIT** but for local use, I would prefer SVN. its free and its easy. For visual studio there are a few SVN client plugins (like VisualSVN). But, I would suggest TortoiseSVN as the client. To be clear, SVN is the server, TortoiseSVN is the client. (Both are free open source tools)
subversion has a lot of mind share these days, but it's very old-school, first-gen tech. Distributed revision control is gaining a lot of momentum and I'd highly recommend that you become familiar with it if you're going to be a code monkey professional. Look up mercurial (also referred to as hg) or bazaar. If nothing ...
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
The term you are looking for is Source Control. Modern source control's provide all the functionality you described plus much more. Team Foundation Server seamlessly integrates into VS2010 and is very useful. Read through [Source Control for Visual Studio](http://msdn.microsoft.com/en-us/library/zxd4dfad%28v=VS.80%29....
subversion has a lot of mind share these days, but it's very old-school, first-gen tech. Distributed revision control is gaining a lot of momentum and I'd highly recommend that you become familiar with it if you're going to be a code monkey professional. Look up mercurial (also referred to as hg) or bazaar. If nothing ...
2,782,923
Forgive me, but I don't know the technical term to know what to search for. I am trying to find a way to keep track of changes in my code during the development of my program. something that would allow me to go back to a section of code that I deleted. I am not talking about "undo". But rather a way that would let me...
2010/05/06
[ "https://Stackoverflow.com/questions/2782923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326129/" ]
The term you are looking for is Source Control. Modern source control's provide all the functionality you described plus much more. Team Foundation Server seamlessly integrates into VS2010 and is very useful. Read through [Source Control for Visual Studio](http://msdn.microsoft.com/en-us/library/zxd4dfad%28v=VS.80%29....
Every source control does that, you know ;) YOu have a legal VIsual Studio 2010? Try Team System.
2,306,080
In views, is it possible to configure a cck taxonomy field so that a user search for higher level taxonomy terms also matches its parents? Say that I have this taxonomy called Places: ``` Asia China Shanghai Beijing Japan Tokyo Nagoya Indonesia Bandung Banjar...
2010/02/21
[ "https://Stackoverflow.com/questions/2306080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250213/" ]
This isn't really a direct answer ... somewhat oblique to the question. For TCP/IP, even if you determine what the maximum size is on your system, it would probably be best to implement the code to not rely on that. With stream-oriented sockets, the excess data is not lost. So you can call the receive function again to...
I think that max is `65535` bytes. It does not depend upon MTU since it's handled by protocol stack by itself.. so basically you have a good abstraction prom the effective packets that are sent on network. The choice of 2^16 should be so because it's the max size of the TCP window (usually it's not 64kb anyway, but sm...
64,502,107
I'm trying to solve a problem in VBA and after a long time of browsing the web for solutions, I really hope someone is able to help me. It's actually not a very hard task, but with very little programming and VBA knowledge as a new learner, I hope I can find a useful tip or solution with the help of the community. ...
2020/10/23
[ "https://Stackoverflow.com/questions/64502107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13947354/" ]
This works for your example so perhaps you can generalise it. The formula in D2 is ``` =IF(A2=A1,"",MAX(IF($A$2:$A$10=A2,COUNTIF($B$2:$B$10,$C$2:$C$10)))) ``` and is an array formula so must be confirmed with CTRL, SHIFT and ENTER. [![enter image description here](https://i.stack.imgur.com/fLGYI.png)](https://i.sta...
First enter this user defined function in a standard module: ``` Public Function zool(r1, r2, r3) As Integer Dim i As Long, v1 As Long, v2 As String Dim top As Long, bottom As Long zool = 0 v1 = r1.Value top = r1.Row ' determine limits to check For i = top To 9999 If v1 <> r1.O...
64,502,107
I'm trying to solve a problem in VBA and after a long time of browsing the web for solutions, I really hope someone is able to help me. It's actually not a very hard task, but with very little programming and VBA knowledge as a new learner, I hope I can find a useful tip or solution with the help of the community. ...
2020/10/23
[ "https://Stackoverflow.com/questions/64502107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13947354/" ]
This works for your example so perhaps you can generalise it. The formula in D2 is ``` =IF(A2=A1,"",MAX(IF($A$2:$A$10=A2,COUNTIF($B$2:$B$10,$C$2:$C$10)))) ``` and is an array formula so must be confirmed with CTRL, SHIFT and ENTER. [![enter image description here](https://i.stack.imgur.com/fLGYI.png)](https://i.sta...
**Array alternative via **`Match()` function**** This approach compares the string items of columns `B` and `C` by passing two arrays (named `b`,`c`) as arguments *(c.f. section `[1]`)*: ``` chk = Application.Match(b, c, 0) ``` The resulting `chk` array reflects all findings of the first array's items via (1-based)...
83,396
I have a sort function that needed to sort in a certain way. That position was sorted by mobile-top first, then empty position followed by mobile-bottom. Then on these I needed to sort by their priority, with priority 1, 2 and then blank. ``` widgetInfo = [ ['box1','mobile-bottom',''], ['box2','mobile-top','priority...
2015/03/06
[ "https://codereview.stackexchange.com/questions/83396", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/41768/" ]
You can write a function to compare two "position" strings and a function to compare "priority" strings. Then a resulting comparison function could be written easily by calling the two already defined functions. Now for the actual review, you don't need the `if(b[1] == 'mobile-bottom')` check in the `if(a[1] == 'mobil...
What about calculating a priority hash? ``` var mobilePrios = ['mobile-top', 'mobile-bottom']; function calculatePriority(widgInf) { return (mobilePrios.indexOf(widgInf[0]) + 2) * 4 + widgInf[1].replace('priority-', '') * 0.10; } ``` the just call this for the two widgInfo - Elements you want to compare and o...
83,396
I have a sort function that needed to sort in a certain way. That position was sorted by mobile-top first, then empty position followed by mobile-bottom. Then on these I needed to sort by their priority, with priority 1, 2 and then blank. ``` widgetInfo = [ ['box1','mobile-bottom',''], ['box2','mobile-top','priority...
2015/03/06
[ "https://codereview.stackexchange.com/questions/83396", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/41768/" ]
first check if the priority 1 are unequal and then return 1/-1 accordingly otherwise check priority 2 and repeat If you reach the end then all terms will be equal: ``` function(a, b){ if(a[1] != b[1]){ if(a[1] == 'mobile-bottom' || b[1]== '') //b[1] will be -top or empty => a<b return 1; ...
What about calculating a priority hash? ``` var mobilePrios = ['mobile-top', 'mobile-bottom']; function calculatePriority(widgInf) { return (mobilePrios.indexOf(widgInf[0]) + 2) * 4 + widgInf[1].replace('priority-', '') * 0.10; } ``` the just call this for the two widgInfo - Elements you want to compare and o...
3,122
Why do posts from people with >50k reputation show up in the Low Quality queue? Would it not make sense to have a filter where answers from users with more than `$arbitrary_high_number` reputation do not appear in that queue? For example, I just had to review [this answer](https://unix.stackexchange.com/a/151344/6761...
2014/08/21
[ "https://unix.meta.stackexchange.com/questions/3122", "https://unix.meta.stackexchange.com", "https://unix.meta.stackexchange.com/users/6761/" ]
We had problems with a datacenter test that left our caching layer in a partially broken state. All issues should now be resolved. See also <https://meta.stackoverflow.com/questions/268957/topbar-notifications-dont-go-away>
Yes, there is! And: ------------------- ![](https://i.stack.imgur.com/gEOLw.png) More information: * <https://meta.stackoverflow.com/q/268957/792066> * [Reputation and inbox notification shows up again after refresh](https://meta.stackexchange.com/q/238155/213575)
9,416,779
Simple example I get error malformed string. How to solve this? I use Firebird 2.5, character set is none in the database. ``` set term ^ ; create or alter procedure test4 as declare s varchar(20); begin s='öööööáé'; END^ set term ; ^ ``` I tried this in FlameRobin and with isql, Same result. I used set names w...
2012/02/23
[ "https://Stackoverflow.com/questions/9416779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135807/" ]
I don't advice you to use charset none in any database and it is also true for Firebird. Even if it is supposed to be converted with [Flamerobin](http://www.firebirdfaq.org/faq342/), I advice you to recreate your database with the charset you want and "pump" you data from your old database to your new database with an...
what happened to me; i used ems sql manger firebird lite. my db infos like this default charset : utf8 default collation: unicode\_ci\_ai my connection charset was none ; and i tried to insert ``` INSERT INTO CARI (CARI_ID, CARI_ADI, CARI_KOD ) VALUES ('8', 'FİLA UNİCODE_TEXT', 'FİŞA' ); ``` then i get Malf...
31,897,187
As I am exploring kubernetes I started with the docker based getting-started guide as suggested by the docs. The guide can be found here: <https://github.com/GoogleCloudPlatform/kubernetes/blob/release-1.0/docs/getting-started-guides/docker.md> Breaking down the guid, it suggests to run the following commands: ``` do...
2015/08/08
[ "https://Stackoverflow.com/questions/31897187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/808723/" ]
Popup menu anchored to an `ImageView` (star) in a `RecyclerView` item: [![popup menu anchored to image view](https://i.stack.imgur.com/4bbwv.png)](https://i.stack.imgur.com/4bbwv.png) Position of `RecyclerView` item displayed when a popup menu item is selected: [![popup menu recyclerview item position](https://i.sta...
``` public class MyAdapter extends RecyclerView.Adapter<MyAdapter. XInfoHolder > { public MyAdapter(Context ctx,ArrayList<Data> dataInfo) { .......... ........ } @Override public PersonInfoHolder onCreateViewHolder(ViewGroup viewGroup, int i) { //* creating view from the layout for child element in the listvi...
64,702,880
[![enter image description here](https://i.stack.imgur.com/EwyHk.png)](https://i.stack.imgur.com/EwyHk.png) Hello, I'm learning CSS and was wondering how can I implement the styling above. What kind of effect/style is it called? I've never implemented something like that before so I don't know where to even start.
2020/11/05
[ "https://Stackoverflow.com/questions/64702880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11157701/" ]
I have implemented something. Which is very resembles the design you have shared. ```css .button { position: relative; padding: 20px 25px; background: #0977d0; color: #fff; border: 0; font-size: 14px; font-weight: 700; border-radius: 5px; overflow...
``` <button>Click Me!</button> ``` And Css code ``` <style type="text/css"> @keyframes gradient { 0% { background: radial-gradient(circle at center, rgba( 255, 125 , 125, 0 ) 0%, #fff 0%, #fff 100%); } 25% { background: radial-gradient(circle at center, rgba( 255, 125, 125, 0.3 ) 24%, #fff 25%, #ff...
64,702,880
[![enter image description here](https://i.stack.imgur.com/EwyHk.png)](https://i.stack.imgur.com/EwyHk.png) Hello, I'm learning CSS and was wondering how can I implement the styling above. What kind of effect/style is it called? I've never implemented something like that before so I don't know where to even start.
2020/11/05
[ "https://Stackoverflow.com/questions/64702880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11157701/" ]
I have implemented something. Which is very resembles the design you have shared. ```css .button { position: relative; padding: 20px 25px; background: #0977d0; color: #fff; border: 0; font-size: 14px; font-weight: 700; border-radius: 5px; overflow...
Can also be achieved using JS and CSS classes ``` <div class='button'></div> ``` **CSS** ``` .button { width: 220px; height: 70px; background-color:blue; overflow: hidden; position: relative; cursor: pointer; transition: 0.3s; } .ripple { border-radius: 50%; background-color: rgba(255, 255, 255, ...
36,658,290
I am using a firebase-collection element to fetch an array of objects from my Firebase repository in a Polymer application. The data fetches with no problem. Now that I have the objects, how do I update a child property on one of them? ``` <firebase-collection id="myfb" location="https://dinosaur-facts.firebaseio....
2016/04/15
[ "https://Stackoverflow.com/questions/36658290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/831893/" ]
I think you are getting the pointer of the mouse styles confused with actual events firing. All it seems you are doing is hiding the mouse pointer. If you want to disable click or mouse events you must do so by attaching an event listener. Listen for the event and add ``` document.on("mouseleave","#elementid",functio...
You could use the addEventListener and removeEventListener functions like this: ``` let div = document.querySelector('div'); div.onclick = function() { console.log('click!'); this.classList.add('nopointer'); div.removeEventListener("mouseleave", mymouseout); }; function mymouseout() { console.log('mous...
36,658,290
I am using a firebase-collection element to fetch an array of objects from my Firebase repository in a Polymer application. The data fetches with no problem. Now that I have the objects, how do I update a child property on one of them? ``` <firebase-collection id="myfb" location="https://dinosaur-facts.firebaseio....
2016/04/15
[ "https://Stackoverflow.com/questions/36658290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/831893/" ]
Remove the backticks in your code and use single quotes instead. [Updated CodePen](http://codepen.io/rahul-desai/pen/XdqdXX) ``` console.clear(); let div = document.querySelector('div'); div.onclick = function() { console.log('click!'); div.classList.add('nopointer'); }; div.onmouseout = function() { co...
You could use the addEventListener and removeEventListener functions like this: ``` let div = document.querySelector('div'); div.onclick = function() { console.log('click!'); this.classList.add('nopointer'); div.removeEventListener("mouseleave", mymouseout); }; function mymouseout() { console.log('mous...
145,275
i have two tables with the schema below: ``` INCOME TABLE: INCOME_ID, INCOME_NAME, INCOME_DATE OUTCOME TABLE: OUTCOME_ID, OUTCOME_NAME, OUTCOME_DATE EXAMPLE DATA INCOME INCOME_ID | INCOME_NAME | INCOME_DATE 1 | FIRST EXMPL | 24-07-2016 2 | SEC EXAMPLE | 25-07-2016 ETC EXAMPLE DATA OUTCOME OUTCOME_...
2016/07/28
[ "https://dba.stackexchange.com/questions/145275", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/101323/" ]
Assuming that the two date columns are indeed `DATE` columns, the problem is that you are not using proper format in the date literals. Use ANSI format: ``` SELECT * FROM V_BALANCE WHERE DATE BETWEEN '2016-07-24' AND '2016-08-03' ; ``` See the documentation for other options: **[Date and time liter...
You have a typo in your code: You wrote * `SELECT * FROM V_BALANCE WHERE DATE BETWEEN = '24-07-2016' AND '03-08-2016'` whereas you should have written * `SELECT * FROM V_BALANCE WHERE DATE BETWEEN '24-07-2016' AND '03-08-2016'` I know that that this sort of thing is very difficult to spot when you're reading back ...
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
> > > ``` > table.show-my-request-table > td:first-child { > background-color: #ff0000; > } > > ``` > > This selector tries to target a `td` that is a *direct* child of the `table` element. As your own code shows: > > > ``` > <table class="show-my-request-table center"> > <!-- snip --> > <tr > > ...
``` table.show-my-request-table > td:nth-child(1) { background: #25a3c2; } ```
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
Try this: ``` table.show-my-request-table tr > td:first-child { background-color: #ff0000; } ```
You just need to target the element inside the table Try this ``` table.show-my-request-table tr td:first-child { background-color: #ff0000; } ``` Here's a code pen <http://codepen.io/anon/pen/LkrmqK> Cheers and happy coding.
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
> > > ``` > table.show-my-request-table > td:first-child { > background-color: #ff0000; > } > > ``` > > This selector tries to target a `td` that is a *direct* child of the `table` element. As your own code shows: > > > ``` > <table class="show-my-request-table center"> > <!-- snip --> > <tr > > ...
``` /* grab 2nd row, then color the first cell */ tr:nth-child(2) td:first-child { background-color: #ff0000; } ``` See it in action below ====================== ```css table.show-my-request-table { border: 1px solid black; margin-left: auto; margin-right: auto; border-collapse: collapse; } tr.show-m...
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
Try this: ``` table.show-my-request-table tr > td:first-child { background-color: #ff0000; } ```
> > > ``` > table.show-my-request-table > td:first-child { > background-color: #ff0000; > } > > ``` > > This selector tries to target a `td` that is a *direct* child of the `table` element. As your own code shows: > > > ``` > <table class="show-my-request-table center"> > <!-- snip --> > <tr > > ...
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
You don't need to use `>` (immediate children selector) just put a `space` Try this: ``` table.show-my-request-table td:first-child { background-color: #ff0000; } ```
You just need to target the element inside the table Try this ``` table.show-my-request-table tr td:first-child { background-color: #ff0000; } ``` Here's a code pen <http://codepen.io/anon/pen/LkrmqK> Cheers and happy coding.
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
You don't need to use `>` (immediate children selector) just put a `space` Try this: ``` table.show-my-request-table td:first-child { background-color: #ff0000; } ```
``` table.show-my-request-table > td:nth-child(1) { background: #25a3c2; } ```
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
Try this: ``` table.show-my-request-table tr > td:first-child { background-color: #ff0000; } ```
``` /* grab 2nd row, then color the first cell */ tr:nth-child(2) td:first-child { background-color: #ff0000; } ``` See it in action below ====================== ```css table.show-my-request-table { border: 1px solid black; margin-left: auto; margin-right: auto; border-collapse: collapse; } tr.show-m...
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
> > > ``` > table.show-my-request-table > td:first-child { > background-color: #ff0000; > } > > ``` > > This selector tries to target a `td` that is a *direct* child of the `table` element. As your own code shows: > > > ``` > <table class="show-my-request-table center"> > <!-- snip --> > <tr > > ...
You just need to target the element inside the table Try this ``` table.show-my-request-table tr td:first-child { background-color: #ff0000; } ``` Here's a code pen <http://codepen.io/anon/pen/LkrmqK> Cheers and happy coding.
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
Try this: ``` table.show-my-request-table tr > td:first-child { background-color: #ff0000; } ```
``` table.show-my-request-table > td:nth-child(1) { background: #25a3c2; } ```
38,897,898
Question: How to make it like ul and li in the same line. Can anyone help me with this problem. Thanks a lot. ``` Product product product product Drink Drink Drink Drink Food Food Food Food ``` CSS: ``` #footer{ display:inline; } #footer .footer_container{ display:inline; b...
2016/08/11
[ "https://Stackoverflow.com/questions/38897898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4729303/" ]
You don't need to use `>` (immediate children selector) just put a `space` Try this: ``` table.show-my-request-table td:first-child { background-color: #ff0000; } ```
``` /* grab 2nd row, then color the first cell */ tr:nth-child(2) td:first-child { background-color: #ff0000; } ``` See it in action below ====================== ```css table.show-my-request-table { border: 1px solid black; margin-left: auto; margin-right: auto; border-collapse: collapse; } tr.show-m...
70,816,539
Is there a way to add a specific behavior that should only be executed on (and **follow**) the Ignite Coordinator ServerNode? Is there a add-on hook to add some customer specific behavior? Thanks in advance. Greg
2022/01/22
[ "https://Stackoverflow.com/questions/70816539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17639135/" ]
AFAIK, there is not any built-in hook to achieve this. However, it can be achieved through **Node Singleton Ignite Service** and using an api on `TcpDiscoverySpi.isLocalNodeCoordinator()`. If different discovery mechanism other than TcpDiscovery, is used, above mentioned way by @Alexandr can be used to get a co-ordina...
In case of a low-level logic, you can extend Ignite with [custom plugins](https://ignite.apache.org/docs/latest/plugins). I'm not sure if there is an easy way to check if a node is indeed the coordinator, but you might check for the oldest one: ``` private boolean isCoordinator() { ClusterNode node = ((IgniteE...
51,105,386
I have created the header with title and right icon by using native base. However, there are two headers showing on my simulator. I have no idea what is going on. Can someone help me with this? ``` import React, { Component }from 'react'; import { StyleSheet } from 'react-native'; import { Icon, Button, Container, He...
2018/06/29
[ "https://Stackoverflow.com/questions/51105386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10011760/" ]
I think you are using `StackNavigator`. if yes then change to: ``` const Navigator = StackNavigator( { Landing: { screen: Landing}, Home: { screen: Home} }, { headerMode: 'none' } ); ```
If you are `react-navigation` then you have to set navigation Options as follows: ``` static navigationOptions = { header: null }; ```
51,105,386
I have created the header with title and right icon by using native base. However, there are two headers showing on my simulator. I have no idea what is going on. Can someone help me with this? ``` import React, { Component }from 'react'; import { StyleSheet } from 'react-native'; import { Icon, Button, Container, He...
2018/06/29
[ "https://Stackoverflow.com/questions/51105386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10011760/" ]
I think you are using `StackNavigator`. if yes then change to: ``` const Navigator = StackNavigator( { Landing: { screen: Landing}, Home: { screen: Home} }, { headerMode: 'none' } ); ```
In [react-router-flux](https://github.com/aksonov/react-native-router-flux) is the same idea of the accepted answer at routes/navigators: ```js <Scene key='dashboardContainer' component={(localProps) => <DashboardContainer {...props} {...localProps} />} hideNavBar /> ```
51,105,386
I have created the header with title and right icon by using native base. However, there are two headers showing on my simulator. I have no idea what is going on. Can someone help me with this? ``` import React, { Component }from 'react'; import { StyleSheet } from 'react-native'; import { Icon, Button, Container, He...
2018/06/29
[ "https://Stackoverflow.com/questions/51105386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10011760/" ]
If you are `react-navigation` then you have to set navigation Options as follows: ``` static navigationOptions = { header: null }; ```
In [react-router-flux](https://github.com/aksonov/react-native-router-flux) is the same idea of the accepted answer at routes/navigators: ```js <Scene key='dashboardContainer' component={(localProps) => <DashboardContainer {...props} {...localProps} />} hideNavBar /> ```
1,806,774
I found the following approximation for the function $$f=\ln(x+1)$$ $$f\simeq\Psi\left(x+\dfrac{3}{2}\right)-2+\gamma+\ln(2)$$ where $\Psi(x)$ is the 'Digamma' function: $\Psi(x)=\dfrac{\dfrac{d}{dx}\Gamma(x)}{\Gamma(x)}$ and $\gamma$ is the Euler - Mascheroni constant. The following inequality holds: $$\left|\ln(x+1)-...
2016/05/31
[ "https://math.stackexchange.com/questions/1806774", "https://math.stackexchange.com", "https://math.stackexchange.com/users/24089/" ]
I'm not sure why there is a $(-2+\gamma+\ln 2)$, because $\left|\ln(x+1) - \Psi(x+\frac32)\right| < 0.0365$ itself is already satisfied. The approximation comes from the [series expansion of $\exp\left(\Psi(x+\frac12)\right)$](https://en.wikipedia.org/wiki/Digamma_function#Computation_and_approximation), which states,...
I doubt your approximation. First I guess you missed a factor $2$ for $\ln 2$, the approximation should be $$f(x) =\ln(x+1)-\Psi(x+3/2)-2+\gamma+2\ln 2 \cdot$$ If you omit the $2$ you have $$f(0)= 0 -(2-\gamma-2\ln2) -2+\gamma+ \ln 2 = -4 + 2\gamma + 3\ln 2 \approx -0.766$$ while with the factor $2$ you have $$f(0)= 0...
51,307,323
I've `MainActivity.kt` where I show different fragments for different needs. At some point, I press button 'X' that calls `startScanner()` function: ``` private fun startScanner() { IntentIntegrator(this) .setOrientationLocked(false) .setPrompt("SCANNING?") .initiateScan() } ``...
2018/07/12
[ "https://Stackoverflow.com/questions/51307323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8358447/" ]
There is a shortcut to do this. Just add this to the manifest: ``` <activity android:name="com.journeyapps.barcodescanner.CaptureActivity" android:screenOrientation="portrait" tools:replace="android:screenOrientation" android:stateNotNeeded="true"/> ```
in addition of this answer <https://stackoverflow.com/a/35465968/7666442> I found way to change Orientation of `zxing` scanner activity automatically when device Orientation change Try this way > > **CaptureActivityPortrait** > > > ``` public class CaptureActivityPortrait extends CaptureActivity { //Nothing in ...
51,307,323
I've `MainActivity.kt` where I show different fragments for different needs. At some point, I press button 'X' that calls `startScanner()` function: ``` private fun startScanner() { IntentIntegrator(this) .setOrientationLocked(false) .setPrompt("SCANNING?") .initiateScan() } ``...
2018/07/12
[ "https://Stackoverflow.com/questions/51307323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8358447/" ]
in addition of this answer <https://stackoverflow.com/a/35465968/7666442> I found way to change Orientation of `zxing` scanner activity automatically when device Orientation change Try this way > > **CaptureActivityPortrait** > > > ``` public class CaptureActivityPortrait extends CaptureActivity { //Nothing in ...
You can set the orientation programmatically (in your activity): [ActivityInfo.SCREEN\_ORIENTATION\_LANDSCAPE](http://developer.android.com/reference/android/content/pm/ActivityInfo.html#SCREEN_ORIENTATION_LANDSCAPE) ``` setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); ``` [ActivityInfo.SCREEN\_O...
51,307,323
I've `MainActivity.kt` where I show different fragments for different needs. At some point, I press button 'X' that calls `startScanner()` function: ``` private fun startScanner() { IntentIntegrator(this) .setOrientationLocked(false) .setPrompt("SCANNING?") .initiateScan() } ``...
2018/07/12
[ "https://Stackoverflow.com/questions/51307323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8358447/" ]
There is a shortcut to do this. Just add this to the manifest: ``` <activity android:name="com.journeyapps.barcodescanner.CaptureActivity" android:screenOrientation="portrait" tools:replace="android:screenOrientation" android:stateNotNeeded="true"/> ```
You can set the orientation programmatically (in your activity): [ActivityInfo.SCREEN\_ORIENTATION\_LANDSCAPE](http://developer.android.com/reference/android/content/pm/ActivityInfo.html#SCREEN_ORIENTATION_LANDSCAPE) ``` setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); ``` [ActivityInfo.SCREEN\_O...
29,835,030
I need to know how to pass arguments to a call to a JavaScript function made from an Html checkbox helper that is generated at run time. This is my dynamic generation of checkbox controls: ``` @foreach (var app in ViewData["Applications"] as List<RenderController.Models.Application>) { <td> @*@Html.Chec...
2015/04/23
[ "https://Stackoverflow.com/questions/29835030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1532561/" ]
You can use `data-` attributes to add additional data to html elements and access then in the script, for example `@Html.CheckBox("..", new { data_networkname = item.NetworkName })`. However there is no point using `@Html.CheckBox()` in your case since you not binding to anything and your just generating a lot of unnec...
You're passing `app.Name` instead of `app.ProcessName` in your `String.Format` example. Otherwise, I see no reason why that code shouldn't work.
64,139,839
I have below XML and my table name is table1 ``` <Details > <RelatedDetails> <Name>name 1</Name> <Position>User</Position> <Relationship>User</Relationship> <Salary>5000</Salary> <Type>Company</Type> </RelatedDetails> <RelatedDetails> <Name>name 2</Name> <Position>User...
2020/09/30
[ "https://Stackoverflow.com/questions/64139839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/759100/" ]
``` select x.n.value('(Name)[1]', 'nvarchar(50)') from @xml.nodes('/Details/RelatedDetails[Salary[text() > 6000]]') as x(n); ```
Assuming you have your XML in a SQL Server variable: ``` DECLARE @Input XML = '<Details> <RelatedDetails> <Name>name 1</Name> <Position>User</Position> <Relationship>User</Relationship> <Salary>5000</Salary> <Type>Company</Type> </RelatedDetails> <RelatedDetails> <Name>name 2...
25,112,339
I am using asp.net table where I have to get the number of columns, I wonder there is no any property for asp.net table like grid has "Gridview.columns.count". Please suggest.
2014/08/04
[ "https://Stackoverflow.com/questions/25112339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3563851/" ]
`SELECT * from reviews where rating = (select min(rating ) from reviews )` here you go !!!
``` SELECT * from reviews where rating = (SELECT MIN(rating) from reviews ) ```
25,112,339
I am using asp.net table where I have to get the number of columns, I wonder there is no any property for asp.net table like grid has "Gridview.columns.count". Please suggest.
2014/08/04
[ "https://Stackoverflow.com/questions/25112339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3563851/" ]
`SELECT * from reviews where rating = (select min(rating ) from reviews )` here you go !!!
Below query also provides similar results. ``` SELECT * FROM REVIEWS ORDER BY RATING LIMIT 1 ```
25,112,339
I am using asp.net table where I have to get the number of columns, I wonder there is no any property for asp.net table like grid has "Gridview.columns.count". Please suggest.
2014/08/04
[ "https://Stackoverflow.com/questions/25112339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3563851/" ]
``` SELECT * from reviews where rating = (SELECT MIN(rating) from reviews ) ```
Below query also provides similar results. ``` SELECT * FROM REVIEWS ORDER BY RATING LIMIT 1 ```
36,840,317
``` SELECT SUM(Marks) AS tot FROM [Tbl_Results] WHERE [month] = 'Mar' AND [year] = '2016' GROUP BY sname ``` the output of the above query i want to pass to the another query stating that max of the "Marks" ``` select MAX(?) from [Tbl_Results] ? how to pass an argument to get an max of marks from the table `...
2016/04/25
[ "https://Stackoverflow.com/questions/36840317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5333637/" ]
There are a number of ways to do this. You can create a [cte](https://msdn.microsoft.com/en-us/library/ms175972.aspx) from your first query, like this: ``` ;WITH cte AS ( SELECT SUM(Marks) AS tot FROM [Tbl_Results] WHERE [month] = 'Mar' AND [year] = '2016' GROUP BY sname ) SELECT MAX(tot) FRO...
You can go with an older style and `select` your first set of results into a temp table. This can be helpful if you need to perform other operations on that intermediate set of results. For example: ``` SELECT SUM(Marks) AS tot INTO #results FROM [Tbl_Results] WHERE [month] = 'Mar' AND [year] = '2016' GROUP BY sna...
36,840,317
``` SELECT SUM(Marks) AS tot FROM [Tbl_Results] WHERE [month] = 'Mar' AND [year] = '2016' GROUP BY sname ``` the output of the above query i want to pass to the another query stating that max of the "Marks" ``` select MAX(?) from [Tbl_Results] ? how to pass an argument to get an max of marks from the table `...
2016/04/25
[ "https://Stackoverflow.com/questions/36840317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5333637/" ]
There are a number of ways to do this. You can create a [cte](https://msdn.microsoft.com/en-us/library/ms175972.aspx) from your first query, like this: ``` ;WITH cte AS ( SELECT SUM(Marks) AS tot FROM [Tbl_Results] WHERE [month] = 'Mar' AND [year] = '2016' GROUP BY sname ) SELECT MAX(tot) FRO...
you can use a subquery. since you're using a groupby clause you also need to add sname to your select statement. ``` select MAX(tot) from ( SELECT sname, SUM(Marks) AS tot FROM [Tbl_Results] WHERE [month] = 'Mar' AND [year] = '2016' GROUP BY sname ) b ```
42,231,775
To manage emails I am using the php library PHPMailer. On the client side, I validate the email address using the `email` method of jquery validator plugin. ``` $("#regForm").validate({ rules:{ email: { required: true, em...
2017/02/14
[ "https://Stackoverflow.com/questions/42231775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7064754/" ]
You just have to store the font in a global variable : ``` var myFont, fontReady = false; function fontRead(){ fontReady = true; } function preload() { myFont = loadFont("./fonts/MyfontFile.ttf", fontRead); } //replace with correct path function setup() { createCanvas(720, 400); doyourSetup(); } fu...
Your question is answered in [the P5.js reference](https://p5js.org/reference/#/p5/loadFont): > > You can also use the string name of the font to style other HTML > elements. > > > > ``` > var myFont; > > function preload() { > myFont = loadFont('assets/Avenir.otf'); > } > > function setup() { > var myDiv =...
10,964
I have the following list representing a permutation on 26 characters: ``` {{G, G}, {O, P}, {V, L}, {Y, Y}, {C, X}, {H, I}, {P, S}, {W, R}, {I, H}, {Q, D}, {X, C}, {J, B}, {D, M}, {K, O}, {R, N}, {Z, K}, {L, Q}, {M, F}, {S, A}, {N, Z}, {A, T}, {E, U}, {T, W}, {B, V}, {F, E}, {U, J}} ``` How can I "simplify" this ...
2012/09/23
[ "https://mathematica.stackexchange.com/questions/10964", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/2174/" ]
My interpretation of your question is: What cycles describe the permutation from `order1` to `order2`? ``` order1 = {"G", "O", "V", "Y", "C", "H", "P", "W", "I", "Q", "X", "J", "D", "K", "R", "Z", "L", "M", "S", "N", "A", "E", "T", "B", "F", "U"}; order2 = {"G", "P", "L", "Y", "X", "I", "S", "R", "H", "D", "C", "B", "...
Here is a simpler example that illustrates the steps and built-in functions that can be used: ``` transpositionlist = {{1, 2}, {1, 5}, {3, 7}, {6, 8}, {6, 10}, {4, 4}, {9, 9}} (* First delete elements corresponding to points fixed `{i,i}` *) DeleteCases[transpositionlist, {x_, x_}]; (* Then make a cycle out of each e...
5,631,956
I'm planning to do some data mining on my django app which uses appengine for storing data, however, one of my tables stores images in two of it's columns, and because of that, it is gigabytes in size so it's far too slow to download every time I want to analyse new data. For data mining, I only care about the plan tex...
2011/04/12
[ "https://Stackoverflow.com/questions/5631956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708/" ]
You can't. The AppEngine datastore API, and the underlying GQL, only do two sorts of SELECT queries: `__key__` only, and all fields. There's no way of getting a subset of fields.
As you've observed, the bulkloader downloads the entire record using remote\_api, then outputs only the fields you care about to the CSV. If you want to only download selected fields, you'll have to write your own code to do this on the server-side - possibly by using the new Files API in a mapreduce, to write a file y...
5,631,956
I'm planning to do some data mining on my django app which uses appengine for storing data, however, one of my tables stores images in two of it's columns, and because of that, it is gigabytes in size so it's far too slow to download every time I want to analyse new data. For data mining, I only care about the plan tex...
2011/04/12
[ "https://Stackoverflow.com/questions/5631956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708/" ]
You can't. The AppEngine datastore API, and the underlying GQL, only do two sorts of SELECT queries: `__key__` only, and all fields. There's no way of getting a subset of fields.
Kind of late here but all I did in a similar situation was delete the unwanted property from the automatically generated bulkloader.yaml file. Here is an example using the [Google documentation](https://developers.google.com/appengine/docs/python/tools/uploadingdata?csw=1) to exclude the "account" property from the cs...
5,631,956
I'm planning to do some data mining on my django app which uses appengine for storing data, however, one of my tables stores images in two of it's columns, and because of that, it is gigabytes in size so it's far too slow to download every time I want to analyse new data. For data mining, I only care about the plan tex...
2011/04/12
[ "https://Stackoverflow.com/questions/5631956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11708/" ]
As you've observed, the bulkloader downloads the entire record using remote\_api, then outputs only the fields you care about to the CSV. If you want to only download selected fields, you'll have to write your own code to do this on the server-side - possibly by using the new Files API in a mapreduce, to write a file y...
Kind of late here but all I did in a similar situation was delete the unwanted property from the automatically generated bulkloader.yaml file. Here is an example using the [Google documentation](https://developers.google.com/appengine/docs/python/tools/uploadingdata?csw=1) to exclude the "account" property from the cs...
2,353,308
What is the limit of $2x/(x^2+\epsilon^2)$ in the distributional sense, as $\epsilon\to 0$? For any $\phi\in C\_c^\infty(\Bbb R)$, $\int \frac{2x}{x^2+\epsilon^2}\phi(x)dx\to what$? as $\epsilon\to 0$? then we have the limit. If the limit do not have an explicit formula, how can we show the convergence of $2x/(x^2+\...
2017/07/10
[ "https://math.stackexchange.com/questions/2353308", "https://math.stackexchange.com", "https://math.stackexchange.com/users/378203/" ]
A rigorous treatment isn't very hard: Let $u\_\epsilon(x) = \frac{2x}{x^2+\epsilon^2}$ and take $\phi \in C\_c^\infty(\mathbb R)$. Then $$ \langle u\_\epsilon, \phi \rangle = \int \frac{2x}{x^2+\epsilon^2} \, \phi(x) \, dx = \int \left( \ln |x^2+\epsilon^2| \right)' \, \phi(x) \, dx \\ = \{ \text{ partial integration ...
WARNING: The following contains the kind of „physicist’s“ reasoning that some viewers might find offensive $$\lim \_{\epsilon \to 0} \int \frac{2x}{x^2+\epsilon^2} \phi(x) \mathrm{d}x = \lim \_{\epsilon \to 0} 2 \int \frac{x^2}{x^2+\epsilon^2} \frac{\phi(x)}{x} \mathrm{d}x = 2 \mathcal{P} \int \frac{\phi(x)}{x} $$ ...
121,526
I'm having a problem where my site users are submitting a form before the files they are uploading into filefield are finished, this is causing an ajax error to pop up along the lines of "**an ajax HTTP request terminated abnormally**". To stop this mistake from happening is there a way to hide the **"Submit"/"Save"*...
2014/07/05
[ "https://drupal.stackexchange.com/questions/121526", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/23479/" ]
Havent tried this, but you might be able to use jquery's [global ajax event handlers](http://api.jquery.com/category/ajax/global-ajax-event-handlers/), to hide the submit button, in particular the `.ajaxStart()` and `.ajaxComplete()` handlers. Something like the following, added in a .js file in a custom module (not te...
try this.... ``` $('#edit-submit').bind('click',function() { $('#edit-submit').hide(); $.ajax({ url: Drupal.settings.life_style.secure_base_url+'path_to_form', data: data, type:'POST', async:true, cache:true, success: function(result) { // $('#edit-submit').show(); }...
29,642,231
Eclipse is giving me the error "The left-hand side must be a variable" at this part of my code: ``` else { for(int i=0; i>=cellphoneArr.length; i++) {if (cell_1.equals2(cellphoneArr[i])) System.out.println(cellphoneArr[i]); else (cell_1.equals3(cellphoneArr[i])); ---> this is...
2015/04/15
[ "https://Stackoverflow.com/questions/29642231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4590338/" ]
Try it as: ``` else { for(int i=0; i>=cellphoneArr.length; i++) {if (cell_1.equals2(cellphoneArr[i])) System.out.println(cellphoneArr[i]); else if(cell_1.equals3(cellphoneArr[i])) System.out.println(cellphoneArr[i]); } ``` and the method equals3 must return a boolean values as: ``` public b...
You need an if following the else **EDIT** The code should be ``` if (cell_1.equals2(cellphoneArr[i])) { System.out.println(cellphoneArr[i]); } else if (cell_1.equals3(cellphoneArr[i])) { System.out.println(cellphoneArr[i]); } ``` Formatting allows you to pin point these kind of errors easily. If you are using...
29,642,231
Eclipse is giving me the error "The left-hand side must be a variable" at this part of my code: ``` else { for(int i=0; i>=cellphoneArr.length; i++) {if (cell_1.equals2(cellphoneArr[i])) System.out.println(cellphoneArr[i]); else (cell_1.equals3(cellphoneArr[i])); ---> this is...
2015/04/15
[ "https://Stackoverflow.com/questions/29642231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4590338/" ]
Try it as: ``` else { for(int i=0; i>=cellphoneArr.length; i++) {if (cell_1.equals2(cellphoneArr[i])) System.out.println(cellphoneArr[i]); else if(cell_1.equals3(cellphoneArr[i])) System.out.println(cellphoneArr[i]); } ``` and the method equals3 must return a boolean values as: ``` public b...
Remove `;` at the end of `else`, Just like you did for `if`. ``` else(cell_1.equals3(cellphoneArr[i])); ^ ``` Return a Boolean value from you function, instead of `if` ``` public boolean equals3(Cellphone phone) { return (brand.equals(phone)); } ```
29,642,231
Eclipse is giving me the error "The left-hand side must be a variable" at this part of my code: ``` else { for(int i=0; i>=cellphoneArr.length; i++) {if (cell_1.equals2(cellphoneArr[i])) System.out.println(cellphoneArr[i]); else (cell_1.equals3(cellphoneArr[i])); ---> this is...
2015/04/15
[ "https://Stackoverflow.com/questions/29642231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4590338/" ]
Try it as: ``` else { for(int i=0; i>=cellphoneArr.length; i++) {if (cell_1.equals2(cellphoneArr[i])) System.out.println(cellphoneArr[i]); else if(cell_1.equals3(cellphoneArr[i])) System.out.println(cellphoneArr[i]); } ``` and the method equals3 must return a boolean values as: ``` public b...
You need to add an `if`: ``` else if (cell_1.equals3(cellphoneArr[i])) ```
366,857
I've got a really weird issue. I have two laptops, both Sony Vaio. The first is a VGN-SZ1HP with the following specs: * Intel Core Duo T2300 * 2GB RAM * GeForce Go 7400 (128MB) The second is a VGN-SZ3XP with the following specs: * Intel Core Duo 2 T7200 * 2GB RAM * GeForce Go 7400 (128MB) Both have 13" screens an...
2011/12/11
[ "https://superuser.com/questions/366857", "https://superuser.com", "https://superuser.com/users/16742/" ]
You could use a tool such as [Driver Magician Lite](http://www.drivermagician.com/Lite.htm) to backup the video driver from your first computer. This will create a directory with all the required files and including the inf file, which you can transfer to the second computer. In the second computer, go into the Devic...
Strange, but your Geforce Go drivers are clearly on [the Nvidia Website](http://www.geforce.com/Drivers/Results/8971). I'd try the official drivers, since it is quite likely that the modded drivers are causing the stuttering.
929,638
I have my digitalocean droplets setup so I can login to ssh via keyfiles. This works fine for the root account but if I create a secondary account via `useradd`, the only way I'm able to get into the account is via `su`. If I try to login with ssh using the same keyfile, I get: ``` Permission denied (publickey,gssapi-...
2018/09/05
[ "https://serverfault.com/questions/929638", "https://serverfault.com", "https://serverfault.com/users/241137/" ]
Be sure to restart `sshd` after you've made changes to `/etc/ssh/sshd_config`.
The problem I had was that my key was of **4096** bits size and was not acceptable. I created a **2048** bits key and it worked! ``` ssh-keygen -t rsa -b 2048 -C "<email>" ```
50,982,187
I have the AuthorizationServer. Besides standard functions i have controller who let to create user. After successful user creates the method must to return token for this user. The problem is that the method return valid token only at first call. At next calls - following users will get the first user's token. I tried...
2018/06/22
[ "https://Stackoverflow.com/questions/50982187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3832393/" ]
Three important things I can advice you to do: 1. Use explicit `JOIN` syntax: don't write your tables separately with comma, use explicit JOINs against them so it forces you to write their link at that moment and it's easier to read later. Your attempt was missing a link between the orders and the order details, proba...
I think you want to do the join like this... ``` SELECT DISTINCT Orders.OrderID, Customers.ContactName, Orders.OrderDate, [Order Details].Quantity * [Order Details].UnitPrice FROM Orders left join Customers on Orders.CustomerID = Customers.CustomerID left join [Order Details] on Orders.CustomerID = ...
3,325,499
I would like to know why most Common Lisp code I see has things like `(mapcar #'(lambda (x) (* x x)) '(1 2 3))` instead of just `(mapcar (lambda (x) (* x x)) '(1 2 3))`, which seems to work as well. I am beginning to learn Common Lisp, and having some background in Scheme, this intrigues me. **Edit:** I know that ...
2010/07/24
[ "https://Stackoverflow.com/questions/3325499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/388239/" ]
`#'foo` is an [abbreviation](http://www.lispworks.com/documentation/lw51/CLHS/Body/02_dhb.htm) for `(function foo)` by the reader. In CL, there are several different namespaces, `#'foo` or `(function foo)` will return the *functional value* of `foo`. You may want to [search for "Lisp-1 vs. Lisp-2"](https://www.startp...
It is best to avoid #' in most instances because it is "mostly" unnecessary and makes your code more verbose. There are a few exceptions when some form of quoting is necessary (see Example 4 below). **Note:** All the examples in this post have been tested in Emacs Lisp (GNU Emacs 25.2.1), but they should work identica...