qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
678,833
How can you calculate with them and what can you actually make up from the calculations? And what is exactly meant by normed division-algebras?
2014/02/16
[ "https://math.stackexchange.com/questions/678833", "https://math.stackexchange.com", "https://math.stackexchange.com/users/129287/" ]
The flaw in your proof (unless I misunderstood what you're doing) is that you're taking the statement "$f$ is a mapping from $[0,1]$ to $[0,1]$" as "$f$ maps $[0,1]$ to $[0,1]$" (i.e. $f([0,1])=[0,1]$). This is not the case—$f$ need not be surjective. A proof of the result you seek: * $f\colon[0,1]\to[0,1]$ is contin...
We first suppose $f$ is increasing on $[0, 1]$.Let $h(x) = g(x) - x$, then $h$ is continous on $[0, 1]$, and $h(0) = g(0) > 0$ and $h(1) = g(1) - 1 < 0$. So the intermediate value theorem implies there is an $r$ in $[0, 1]$ with $h(r) = 0$ or $g(r) = r$. Now if $f(r) = r$, then we're done. If $f(r) \ne r$, define a se...
678,833
How can you calculate with them and what can you actually make up from the calculations? And what is exactly meant by normed division-algebras?
2014/02/16
[ "https://math.stackexchange.com/questions/678833", "https://math.stackexchange.com", "https://math.stackexchange.com/users/129287/" ]
The flaw in your proof (unless I misunderstood what you're doing) is that you're taking the statement "$f$ is a mapping from $[0,1]$ to $[0,1]$" as "$f$ maps $[0,1]$ to $[0,1]$" (i.e. $f([0,1])=[0,1]$). This is not the case—$f$ need not be surjective. A proof of the result you seek: * $f\colon[0,1]\to[0,1]$ is contin...
Without loss of generality some $\epsilon >0$ exists such that $f(x)\geq g(x)+\epsilon$ for all $x\in [0,1]$. Take $n\in \mathbb Z^+$. We now prove $f^n\geq g^n + n\epsilon$ for all $n\in \mathbb Z^+$. We proceed by induction, $n=1$ is clear. Inductive step: $f^{n+1}(x)\geq g(f^n(x))+\epsilon = f^n(g(x))+\epsilon \...
678,833
How can you calculate with them and what can you actually make up from the calculations? And what is exactly meant by normed division-algebras?
2014/02/16
[ "https://math.stackexchange.com/questions/678833", "https://math.stackexchange.com", "https://math.stackexchange.com/users/129287/" ]
Without loss of generality some $\epsilon >0$ exists such that $f(x)\geq g(x)+\epsilon$ for all $x\in [0,1]$. Take $n\in \mathbb Z^+$. We now prove $f^n\geq g^n + n\epsilon$ for all $n\in \mathbb Z^+$. We proceed by induction, $n=1$ is clear. Inductive step: $f^{n+1}(x)\geq g(f^n(x))+\epsilon = f^n(g(x))+\epsilon \...
We first suppose $f$ is increasing on $[0, 1]$.Let $h(x) = g(x) - x$, then $h$ is continous on $[0, 1]$, and $h(0) = g(0) > 0$ and $h(1) = g(1) - 1 < 0$. So the intermediate value theorem implies there is an $r$ in $[0, 1]$ with $h(r) = 0$ or $g(r) = r$. Now if $f(r) = r$, then we're done. If $f(r) \ne r$, define a se...
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
Here is one solution with `base R` using `mapply` ``` est <- d[grep('^est|section', colnames(d))] var1 <- d[grep('^var|section', colnames(d))] lstest <- split(est[-1], est$section) lstvar <- split(var1[-1], var1$section) res <- t(mapply(function(x,y) mapply(function(.x, .y) var(.x)/mean(.y), x, y), lstest,...
This pipeline with `dplyr` skips the intermediate table. ``` library(dplyr) library(tidyr) d %>% gather(key, value, est_v1:var_v5) %>% separate(key, into = c("type", "var")) %>% group_by(section, var) %>% summarise( result = var(value[type == "est"]) / mean(value[type == "var"]) ) ```
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
Here is one solution with `base R` using `mapply` ``` est <- d[grep('^est|section', colnames(d))] var1 <- d[grep('^var|section', colnames(d))] lstest <- split(est[-1], est$section) lstvar <- split(var1[-1], var1$section) res <- t(mapply(function(x,y) mapply(function(.x, .y) var(.x)/mean(.y), x, y), lstest,...
An "etc" solution: ``` library(splitstackshape) Reshape(data = d, id.vars = "section", var.stubs = c("est", "var"), sep = "_") # section .id time est var # 1: S1 1 1 0.3893008 0.16208821 # 2: S1 2 1 0.8221099 0.32806300 # 3: S1 3 1 0.8023230 0.18628100 # 4: ...
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
Here is one solution with `base R` using `mapply` ``` est <- d[grep('^est|section', colnames(d))] var1 <- d[grep('^var|section', colnames(d))] lstest <- split(est[-1], est$section) lstvar <- split(var1[-1], var1$section) res <- t(mapply(function(x,y) mapply(function(.x, .y) var(.x)/mean(.y), x, y), lstest,...
Yet another try: ``` cbind(levels(d$section), aggregate(. ~ section, d[c(1, grep("^est_", names(d)))], var)[-1] / aggregate(. ~ section, d[c(1, grep("^var_", names(d)))], mean)[-1]) # levels(d$section) est_v1 est_v2 est_v3 est_v4 est_v5 #1 S1 0.5874458 3.504169 3.676488 1.1716...
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
This should do the trick: ``` dd <- reshape(d, varying = 2:11, direction = 'long', sep="_", timevar="variable") head(dd) # section variable est var id # 1.v1 S1 v1 0.3893008 0.1620882 1 # 2.v1 S1 v1 0.8221099 0.3280630 2 # 3.v1 S1 v1 0.8023230 0.1862810 3 # 4.v...
This pipeline with `dplyr` skips the intermediate table. ``` library(dplyr) library(tidyr) d %>% gather(key, value, est_v1:var_v5) %>% separate(key, into = c("type", "var")) %>% group_by(section, var) %>% summarise( result = var(value[type == "est"]) / mean(value[type == "var"]) ) ```
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
This should do the trick: ``` dd <- reshape(d, varying = 2:11, direction = 'long', sep="_", timevar="variable") head(dd) # section variable est var id # 1.v1 S1 v1 0.3893008 0.1620882 1 # 2.v1 S1 v1 0.8221099 0.3280630 2 # 3.v1 S1 v1 0.8023230 0.1862810 3 # 4.v...
An "etc" solution: ``` library(splitstackshape) Reshape(data = d, id.vars = "section", var.stubs = c("est", "var"), sep = "_") # section .id time est var # 1: S1 1 1 0.3893008 0.16208821 # 2: S1 2 1 0.8221099 0.32806300 # 3: S1 3 1 0.8023230 0.18628100 # 4: ...
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
This should do the trick: ``` dd <- reshape(d, varying = 2:11, direction = 'long', sep="_", timevar="variable") head(dd) # section variable est var id # 1.v1 S1 v1 0.3893008 0.1620882 1 # 2.v1 S1 v1 0.8221099 0.3280630 2 # 3.v1 S1 v1 0.8023230 0.1862810 3 # 4.v...
Yet another try: ``` cbind(levels(d$section), aggregate(. ~ section, d[c(1, grep("^est_", names(d)))], var)[-1] / aggregate(. ~ section, d[c(1, grep("^var_", names(d)))], mean)[-1]) # levels(d$section) est_v1 est_v2 est_v3 est_v4 est_v5 #1 S1 0.5874458 3.504169 3.676488 1.1716...
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
An "etc" solution: ``` library(splitstackshape) Reshape(data = d, id.vars = "section", var.stubs = c("est", "var"), sep = "_") # section .id time est var # 1: S1 1 1 0.3893008 0.16208821 # 2: S1 2 1 0.8221099 0.32806300 # 3: S1 3 1 0.8023230 0.18628100 # 4: ...
This pipeline with `dplyr` skips the intermediate table. ``` library(dplyr) library(tidyr) d %>% gather(key, value, est_v1:var_v5) %>% separate(key, into = c("type", "var")) %>% group_by(section, var) %>% summarise( result = var(value[type == "est"]) / mean(value[type == "var"]) ) ```
28,052,822
I have a data frame of multiple pairs of estimates and variances for several model parameters each within one of a number of sections. Here's a function that generates the illustrative sample: ``` samplerats <- function(){ set.seed(310366) d = data.frame(section=c(rep("S1",10),rep("S2",10),rep("S3",5))) nr...
2015/01/20
[ "https://Stackoverflow.com/questions/28052822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211116/" ]
An "etc" solution: ``` library(splitstackshape) Reshape(data = d, id.vars = "section", var.stubs = c("est", "var"), sep = "_") # section .id time est var # 1: S1 1 1 0.3893008 0.16208821 # 2: S1 2 1 0.8221099 0.32806300 # 3: S1 3 1 0.8023230 0.18628100 # 4: ...
Yet another try: ``` cbind(levels(d$section), aggregate(. ~ section, d[c(1, grep("^est_", names(d)))], var)[-1] / aggregate(. ~ section, d[c(1, grep("^var_", names(d)))], mean)[-1]) # levels(d$section) est_v1 est_v2 est_v3 est_v4 est_v5 #1 S1 0.5874458 3.504169 3.676488 1.1716...
6,436,837
I want to test if a method appears in a header file. These are the three cases I have: ``` void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here ``` Here's what I have so far: ``` re.search("(?<!\/\/)\s*void aMethod",buffer) ``` Buf this will only match the f...
2011/06/22
[ "https://Stackoverflow.com/questions/6436837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
EDIT: Ok, after your edit, Geo, it is this: ``` ^(?<!\/\/)\s*void aMethod ```
Try this regexp. ``` (\/\/)?\s*void aMethod ```
6,436,837
I want to test if a method appears in a header file. These are the three cases I have: ``` void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here ``` Here's what I have so far: ``` re.search("(?<!\/\/)\s*void aMethod",buffer) ``` Buf this will only match the f...
2011/06/22
[ "https://Stackoverflow.com/questions/6436837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
EDIT: Ok, after your edit, Geo, it is this: ``` ^(?<!\/\/)\s*void aMethod ```
For the three options: `(?:\/\/)?\s*void aMethod`
6,436,837
I want to test if a method appears in a header file. These are the three cases I have: ``` void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here ``` Here's what I have so far: ``` re.search("(?<!\/\/)\s*void aMethod",buffer) ``` Buf this will only match the f...
2011/06/22
[ "https://Stackoverflow.com/questions/6436837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
EDIT: Ok, after your edit, Geo, it is this: ``` ^(?<!\/\/)\s*void aMethod ```
If you simply want to find all appearances for 'void aMethod(params' then you can use the following: ``` a = """void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here""" from re import findall findall(r'\bvoid aMethod\b', a) ``` OR: ``` findall(r'(?:\/\/)?[ ]*vo...
6,436,837
I want to test if a method appears in a header file. These are the three cases I have: ``` void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here ``` Here's what I have so far: ``` re.search("(?<!\/\/)\s*void aMethod",buffer) ``` Buf this will only match the f...
2011/06/22
[ "https://Stackoverflow.com/questions/6436837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
If you simply want to find all appearances for 'void aMethod(params' then you can use the following: ``` a = """void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here""" from re import findall findall(r'\bvoid aMethod\b', a) ``` OR: ``` findall(r'(?:\/\/)?[ ]*vo...
Try this regexp. ``` (\/\/)?\s*void aMethod ```
6,436,837
I want to test if a method appears in a header file. These are the three cases I have: ``` void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here ``` Here's what I have so far: ``` re.search("(?<!\/\/)\s*void aMethod",buffer) ``` Buf this will only match the f...
2011/06/22
[ "https://Stackoverflow.com/questions/6436837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31610/" ]
If you simply want to find all appearances for 'void aMethod(params' then you can use the following: ``` a = """void aMethod(params ...) //void aMethod(params // void aMethod(params ^ can have any number of spaces here""" from re import findall findall(r'\bvoid aMethod\b', a) ``` OR: ``` findall(r'(?:\/\/)?[ ]*vo...
For the three options: `(?:\/\/)?\s*void aMethod`
27,741,599
I'm a long time WPF user but new to WinRT. I'm wondering if there's a built in way or easy way to integrate swapping functionality in containers so that a swap exchanges two items in the container. The behavior desired is drag an item and drop it on another item and have both the dragged item and the item it's dragged ...
2015/01/02
[ "https://Stackoverflow.com/questions/27741599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196886/" ]
Both existing answers will do the swapping for you, at the data level. Here's what can be done to make the UI more user-friendly. IMHO, the best UX to handle the swapping is, when you drag an item and move it over another, the latter should *appear* to where the dragged item was originally at. This clearly tells the u...
The easiest way is to leverage `ObservableCollection`, and let the `ListBox` or w/e control take care of the rest. All you have to do is, basically, create drag & drop handler, figure out which item client wanted to move where(keep track of oldIndex / newIndex), and implement the swap: ``` var dragSourceItem = yourOb...
27,741,599
I'm a long time WPF user but new to WinRT. I'm wondering if there's a built in way or easy way to integrate swapping functionality in containers so that a swap exchanges two items in the container. The behavior desired is drag an item and drop it on another item and have both the dragged item and the item it's dragged ...
2015/01/02
[ "https://Stackoverflow.com/questions/27741599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196886/" ]
Both existing answers will do the swapping for you, at the data level. Here's what can be done to make the UI more user-friendly. IMHO, the best UX to handle the swapping is, when you drag an item and move it over another, the latter should *appear* to where the dragged item was originally at. This clearly tells the u...
Here's how I did it (with thanks to this [blog](http://dotnetbyexample.blogspot.com/2010/11/swapping-two-elements-in-bound.html)): XAML code: ``` <ListView x:Name="MyListView" CanDragItems="True" AllowDrop="True" HorizontalAlignment="Center" VerticalAlignment="Center" DragItemsStarting="MyListView_DragItemsStarting"...
63,954,795
I`m quiet new to the whole semantic web topic. My main goal is to create an own vocabulary like schema.org. It provides it´s data via RDFa, a serialization-Format for RDF. So I searched for some RDF-Development Tools like Protege for OWL, but I poorly found any. Do you have any ideas ?
2020/09/18
[ "https://Stackoverflow.com/questions/63954795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8176338/" ]
You can create ontologies with the [Cameo Concept Modeler Plug-In](https://www.nomagic.com/product-addons/magicdraw-addons/cameo-concept-modeler-plugin) of [Magic Draw](https://www.nomagic.com/products/magicdraw). There is also [PoolParty](https://www.poolparty.biz/). I'm also aware of [Gra.fo](https://gra.fo/faq/). ...
Apache jena, mobi, xmp,etc. Try w3 tools `https://www.w3.org/2001/sw/wiki/Tools`
41,281,881
Here is a link for the type of image slider I want. It is by W3schools but, they are using a big css file for that...i only want the relevant parts of it...I mean a css only for the image slider...do you guys know any link or something, not necessarily W3...but any site, from where i can have that ? **Link**: <http:/...
2016/12/22
[ "https://Stackoverflow.com/questions/41281881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7315174/" ]
I use this one <https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj> which permits you to edit the request headers. It works fine for User-Agent switching. You can have a look to developer tools under "Network" tab to see if the switching was effective Hope it helps (fun fact: I'm on...
It's probably because GA only checks your UA once. After that it can identify your browser by cookie <https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage> > > ga.js – cookie usage > > > The ga.js JavaScript library uses first-party cookies to: * Determine which domain to measur...
110,503
i have a bash script that i need help with: ``` #!/bin/bash if [ -f "/suid.old" ] then find / -perm -4000 -o -perm -2000 ls > suid.old else find / -perm 4000 -o -perm -2000 ls > suid.new diff suid.old suid.new > newchanges.list fi ``` when i run it it gives me an error saying: diff: suid.old: No such file or direct...
2010/02/08
[ "https://serverfault.com/questions/110503", "https://serverfault.com", "https://serverfault.com/users/-1/" ]
Remove the slash from the filename in the `if` statement. The way you have it, it's checking for the file in the root directory, but later it's created in whatever is the current directory. Also, your script basically says "if suid.old **doesn't** exist then do a diff". You might want something like: ``` #!/bin/bash...
Remove the 'ls' from your find lines. They should look like `find / -perm -4000 -0 -perm -2000 > suid.old` the way you have it setup find thinks that ls is a path argument. Since find prints the results to STDOUT, just doing a normal redirect will get the output you want.
110,503
i have a bash script that i need help with: ``` #!/bin/bash if [ -f "/suid.old" ] then find / -perm -4000 -o -perm -2000 ls > suid.old else find / -perm 4000 -o -perm -2000 ls > suid.new diff suid.old suid.new > newchanges.list fi ``` when i run it it gives me an error saying: diff: suid.old: No such file or direct...
2010/02/08
[ "https://serverfault.com/questions/110503", "https://serverfault.com", "https://serverfault.com/users/-1/" ]
Remove the slash from the filename in the `if` statement. The way you have it, it's checking for the file in the root directory, but later it's created in whatever is the current directory. Also, your script basically says "if suid.old **doesn't** exist then do a diff". You might want something like: ``` #!/bin/bash...
My version: ``` #!/bin/bash if [ ! -f "/suid.old" ]; then # note: ! find / -perm -4000 -o -perm -2000 -ls > /suid.old # note: dash before ls; slash before file else find / -perm 4000 -o -perm -2000 -ls > /suid.new diff /suid.old /suid.new > /newchanges.list mv /suid.new /suid.ol...
55,841,007
I'm trying to fetch some data from my Firebase using Firestore.instance.collection(currentUser), but the currentUser is a Future.How can I accomplish this? I have the following ``` class FoodCart extends StatefulWidget { @override _FoodCartState createState() => _FoodCartState(); } class _FoodCartState extends S...
2019/04/25
[ "https://Stackoverflow.com/questions/55841007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10634887/" ]
This shows one of the ways you can bypass access control in C++ and shuffle the underlying container of the `std::stack` directly. Which is almost certainly not the point of your assignment... ``` using stack_c_ptr_t = std::deque<Card*> std::stack<Card*>::*; constexpr stack_c_ptr_t stack_c_ptr(); template<stack_c_pt...
To be able to use [`std::random_shuffle`](https://en.cppreference.com/w/cpp/algorithm/random_shuffle) or [`std::shuffle`](https://en.cppreference.com/w/cpp/algorithm/random_shuffle), the input type must meet the following requirement: > > RandomIt must meet the requirements of [ValueSwappable](https://en.cppreference...
14,758,267
``` "member.php?1-ricarod&amp;s=50793b6188295f764bc938b1737b0a18" class="avatarlink"><img src="images/misc/unknown.gif" class="userlist_avatar_1" alt="" border="0" ``` I need to parse ricarod from it. I try code `name = Regex.Match(content, @"\.php?1-(.*?)&.+"".class=""avatarlink").Groups[1].Value;` but it doesn'...
2013/02/07
[ "https://Stackoverflow.com/questions/14758267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051944/" ]
You forgot to escape a `?` ``` name = Regex.Match(content, @"\.php\?1-(.*?)&.+"".class=""avatarlink").Groups[1].Value; ```
Try escaping the question mark after "php". I don't guarantee that'll fix it, but that's probably part of the problem. There's a good online regex tester at [regexlib.com](http://regexlib.com)
14,758,267
``` "member.php?1-ricarod&amp;s=50793b6188295f764bc938b1737b0a18" class="avatarlink"><img src="images/misc/unknown.gif" class="userlist_avatar_1" alt="" border="0" ``` I need to parse ricarod from it. I try code `name = Regex.Match(content, @"\.php?1-(.*?)&.+"".class=""avatarlink").Groups[1].Value;` but it doesn'...
2013/02/07
[ "https://Stackoverflow.com/questions/14758267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2051944/" ]
The question mark has special meaning for regular expressions. Try ``` var name = Regex.Match(content, @"\.php\?1-(.*?)&").Groups[1].Value; ``` Note that the '?' is escaped. Also, if you're only interested in 'ricardo', you can simplify your regex as well.
Try escaping the question mark after "php". I don't guarantee that'll fix it, but that's probably part of the problem. There's a good online regex tester at [regexlib.com](http://regexlib.com)
41,648,952
I have a question regarding the status bar in byobu. When I use byobu on my own computer the name of the current window is just the window number (starting from 0; looks like "0:" "1:", etc.). However, I installed byobu on a remote server (ssh) and there the name of the window is the full path to the current directory ...
2017/01/14
[ "https://Stackoverflow.com/questions/41648952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5107540/" ]
Try this ``` AsyncTask fileTask = new AsyncTask() { @Override protected Object doInBackground(Object[] objects) { File directory = new File(Environment.getExternalStorageDirectory() + File.separator + "MyApplication"); if (!directory.exists()) { directory.mkdirs(); ...
Late but might be helpful ``` private void saveimage(Bitmap img) { try { String imageName = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date()); boolean imageSaved = false; if (!(img == null || img.isRecycled())) { ...
32,007,938
I would like to write something like this: ``` template <class T> using MyTypeOrTupple = typename std::conditional<has_member_type_MyType<T>::value, typename T::MyType, std::tuple<> >::type; ``` I implemented `has_membe...
2015/08/14
[ "https://Stackoverflow.com/questions/32007938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2280111/" ]
Do not use that crazy thing from Wikibooks. ``` template <class T> using MyType_t = typename T::MyType; template<class T> using MyTypeOrTuple = detected_or_t<std::tuple<>, MyType_t, T>; ``` Where `detected_or_t` is [`std::experimental::detected_or_t`](http://en.cppreference.com/w/cpp/experimental/is_detected) from...
I think it's required 2 level of indirection: ``` template<typename ...> struct void_type { using type = void; }; template<typename ...T> using void_t = typename void_type<T...>::type; #define HAS_TYPE(NAME) \ template<typename, typename = void> \ struct has_type_##NAME: std::false_type \ {}; \ template<typename...
32,007,938
I would like to write something like this: ``` template <class T> using MyTypeOrTupple = typename std::conditional<has_member_type_MyType<T>::value, typename T::MyType, std::tuple<> >::type; ``` I implemented `has_membe...
2015/08/14
[ "https://Stackoverflow.com/questions/32007938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2280111/" ]
Do not use that crazy thing from Wikibooks. ``` template <class T> using MyType_t = typename T::MyType; template<class T> using MyTypeOrTuple = detected_or_t<std::tuple<>, MyType_t, T>; ``` Where `detected_or_t` is [`std::experimental::detected_or_t`](http://en.cppreference.com/w/cpp/experimental/is_detected) from...
Version keeping `std::conditional`: ``` template <typename T> struct identity { using type = T; }; template <typename T> struct MyType { using type = typename T::MyType; }; template <class T> using MyTypeOrTupple = typename std::conditional<has_member_type_MyType<T>::value, MyType<T>...
32,007,938
I would like to write something like this: ``` template <class T> using MyTypeOrTupple = typename std::conditional<has_member_type_MyType<T>::value, typename T::MyType, std::tuple<> >::type; ``` I implemented `has_membe...
2015/08/14
[ "https://Stackoverflow.com/questions/32007938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2280111/" ]
``` template <typename...> struct voider { using type = void; }; template <typename... Ts> using void_t = typename voider<Ts...>::type; template <typename, typename = void_t<>> struct MyTypeOrTupple { using type = std::tuple<>; }; template <typename T> struct MyTypeOrTupple<T, void_t<typename T::MyType>> { using ty...
I think it's required 2 level of indirection: ``` template<typename ...> struct void_type { using type = void; }; template<typename ...T> using void_t = typename void_type<T...>::type; #define HAS_TYPE(NAME) \ template<typename, typename = void> \ struct has_type_##NAME: std::false_type \ {}; \ template<typename...
32,007,938
I would like to write something like this: ``` template <class T> using MyTypeOrTupple = typename std::conditional<has_member_type_MyType<T>::value, typename T::MyType, std::tuple<> >::type; ``` I implemented `has_membe...
2015/08/14
[ "https://Stackoverflow.com/questions/32007938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2280111/" ]
``` template <typename...> struct voider { using type = void; }; template <typename... Ts> using void_t = typename voider<Ts...>::type; template <typename, typename = void_t<>> struct MyTypeOrTupple { using type = std::tuple<>; }; template <typename T> struct MyTypeOrTupple<T, void_t<typename T::MyType>> { using ty...
Version keeping `std::conditional`: ``` template <typename T> struct identity { using type = T; }; template <typename T> struct MyType { using type = typename T::MyType; }; template <class T> using MyTypeOrTupple = typename std::conditional<has_member_type_MyType<T>::value, MyType<T>...
7,517,906
I'm looking for a free bug tracking software (hosted preferably, as my host doesn't allow me to use ssh, so i can't really install anything). What i want to do with it, is put a form on my website, and allow my beta testers to send in bugs (for now, only beta testers know of the site, so no login required). I do have...
2011/09/22
[ "https://Stackoverflow.com/questions/7517906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/583447/" ]
If you have normal hosting with just PHP/MySQL and FTP access, you could try to install the bug tracking software on our own linux box and then just FTP transfer the php files, maybe after you manually edit some setup files. You will also need to specify the connection to the database, but then use exactly the same set...
Have a look at OnTime11 from [axosoft](http://www.axosoft.com/). It's hosted, free for 2 users and looks extremely polished with a great feature set. There's a slick 2 min demo link on the homepage.
44,766,223
I have the following two tables: ``` dept_emp{emp_no(pk), dept_no(pk)} departments{dept_no(pk), dept_name} ``` The question is: `Retrieve the emp\_no of employees who had worked in the ‘Education’ department but had not worked in the "development" department. I came up with the following query: ``` SELECT t1.emp...
2017/06/26
[ "https://Stackoverflow.com/questions/44766223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2309279/" ]
If you are working with files in node, bodyParser will not work. Your form needs the following attributes ``` <form action="/account/edit" method="post" enctype="multipart/form-data"></form> ``` In node you need to require multer ``` var multer = require('multer'); ``` ```js // this is a simple reqex filter to ...
Your form is multipart, so the req.body cannot retrieve data that is sent from the HTML form. You need to use Multer, it is explained here: <https://www.npmjs.com/package/multer> In summary, to handle request from multer. You need to provide configuration to the multer object. Here is a code example, this code takes t...
13,815,888
I need to read and edit existing pdf in win 8 app. Editing pdf include adding text and images at any position on pdf. Shall i go for xaml or javascript based coding. which link should i follow that will give info for editing pdf.
2012/12/11
[ "https://Stackoverflow.com/questions/13815888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1670743/" ]
Maybe this can help you : .... <http://social.msdn.microsoft.com/forums/en-US/wpf/thread/d115b1a4-bbcd-415d-81c4-fc167bf918f6/>
PDF is a beast of a file format. If you don't have lots of software development experience (which your question suggests you do not), writing a PDF editor from the ground up (especially if you have no team) can be a daunting task, even only considering the non-UI aspects of it. Even should you implement a library that...
13,815,888
I need to read and edit existing pdf in win 8 app. Editing pdf include adding text and images at any position on pdf. Shall i go for xaml or javascript based coding. which link should i follow that will give info for editing pdf.
2012/12/11
[ "https://Stackoverflow.com/questions/13815888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1670743/" ]
Maybe this can help you : .... <http://social.msdn.microsoft.com/forums/en-US/wpf/thread/d115b1a4-bbcd-415d-81c4-fc167bf918f6/>
If you want ready framework, you can look at [Foxit Software](http://www.foxitsoftware.com/) solutions. They already have framework for Win8, but it can be expensive.
43,462,031
Although the rules of chess don't allow Kings to threaten each other, this is a good geometric analogy for the real problem. Given the following geometry ``` K1 [] [] [] [] K2 K3 [] [] [] [] K4 [] K5 [] ``` the result of the required algorithm should be a data structure with the following entries: `[K1, K2], [K1, K...
2017/04/18
[ "https://Stackoverflow.com/questions/43462031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803551/" ]
Here's a way to do it using streams. I think this isolates the components to create better readability. However, If you're looking for speed, it probably has to do with a better algorithm rather than using Streams. ``` List<List<King>> conflicts = kings.stream() .flatMap(k1 ->...
**UPDATE** I've created some code that does what you want without comparing indexes: ``` List<King> kings = new ArrayList<>(kingsColl); Map<King,List<King>> conflicts = kings.parallelStream() //Initiating Stream API (Stream<King>) .collect(Collectors.toMap( //To Map ...
43,462,031
Although the rules of chess don't allow Kings to threaten each other, this is a good geometric analogy for the real problem. Given the following geometry ``` K1 [] [] [] [] K2 K3 [] [] [] [] K4 [] K5 [] ``` the result of the required algorithm should be a data structure with the following entries: `[K1, K2], [K1, K...
2017/04/18
[ "https://Stackoverflow.com/questions/43462031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803551/" ]
This is an invitation to rethink the data structures. Your data structure is not only inefficient, it has redundancy which is a potential source of errors. You have a collection of `Square` object containing a position. What happens, if two `Square` objects in that collection have the same position? Then, a `Square` i...
**UPDATE** I've created some code that does what you want without comparing indexes: ``` List<King> kings = new ArrayList<>(kingsColl); Map<King,List<King>> conflicts = kings.parallelStream() //Initiating Stream API (Stream<King>) .collect(Collectors.toMap( //To Map ...
43,462,031
Although the rules of chess don't allow Kings to threaten each other, this is a good geometric analogy for the real problem. Given the following geometry ``` K1 [] [] [] [] K2 K3 [] [] [] [] K4 [] K5 [] ``` the result of the required algorithm should be a data structure with the following entries: `[K1, K2], [K1, K...
2017/04/18
[ "https://Stackoverflow.com/questions/43462031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803551/" ]
This is an invitation to rethink the data structures. Your data structure is not only inefficient, it has redundancy which is a potential source of errors. You have a collection of `Square` object containing a position. What happens, if two `Square` objects in that collection have the same position? Then, a `Square` i...
Here's a way to do it using streams. I think this isolates the components to create better readability. However, If you're looking for speed, it probably has to do with a better algorithm rather than using Streams. ``` List<List<King>> conflicts = kings.stream() .flatMap(k1 ->...
46,531,829
I have a windows form application written in C# that passes a query to a SQL Server database and then displays the results in a dataviewgrid. The query that is passed to the database depends on the option selected in the form. One particular query takes a little over a minute to run in management studio, but timeouts ...
2017/10/02
[ "https://Stackoverflow.com/questions/46531829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265780/" ]
*Connection timeout* and *command timeout* are two different things. A *connection timeout* occurs when a connection cannot be retrieved from the connection pool within the allotted timeout period. A *command timeout* occurs when a connection has been retrieved, but the query being executed against it doesn't return...
There's a "CommandTimeout" property on the SQL command. Try setting that.
46,531,829
I have a windows form application written in C# that passes a query to a SQL Server database and then displays the results in a dataviewgrid. The query that is passed to the database depends on the option selected in the form. One particular query takes a little over a minute to run in management studio, but timeouts ...
2017/10/02
[ "https://Stackoverflow.com/questions/46531829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265780/" ]
There's a "CommandTimeout" property on the SQL command. Try setting that.
Try this for unlimited time of query execution if you are using SqlDataAdapter. I have use this one, solved my problem. ``` SqlDataAdapter dscmd = new SqlDataAdapter(sql, cnn); dscmd.SelectCommand.CommandTimeout = 0; ```
46,531,829
I have a windows form application written in C# that passes a query to a SQL Server database and then displays the results in a dataviewgrid. The query that is passed to the database depends on the option selected in the form. One particular query takes a little over a minute to run in management studio, but timeouts ...
2017/10/02
[ "https://Stackoverflow.com/questions/46531829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265780/" ]
*Connection timeout* and *command timeout* are two different things. A *connection timeout* occurs when a connection cannot be retrieved from the connection pool within the allotted timeout period. A *command timeout* occurs when a connection has been retrieved, but the query being executed against it doesn't return...
Try this for unlimited time of query execution if you are using SqlDataAdapter. I have use this one, solved my problem. ``` SqlDataAdapter dscmd = new SqlDataAdapter(sql, cnn); dscmd.SelectCommand.CommandTimeout = 0; ```
3,458,280
Want some handy guidelines prior starting the HTML Prototype of this application. Please find below the mockup screen. [Mockup screen](http://picasaweb.google.co.in/yadav.lokesh/ApplicationMockup?feat=directlink#5504129507461564194) I need to make this structurewith liquid layout so that it will adjust as per the res...
2010/08/11
[ "https://Stackoverflow.com/questions/3458280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/341188/" ]
Seems like a good div approach to me. Floats seem to be the typical way to achieve this, but I've personally always found `display: inline-block` as an extremely helpful tool to implement these sorts of layouts.
Personally, I'd build that in divs. I'd have a formrow div, then contain each of the columns in left floated divs with a specified width.
3,458,280
Want some handy guidelines prior starting the HTML Prototype of this application. Please find below the mockup screen. [Mockup screen](http://picasaweb.google.co.in/yadav.lokesh/ApplicationMockup?feat=directlink#5504129507461564194) I need to make this structurewith liquid layout so that it will adjust as per the res...
2010/08/11
[ "https://Stackoverflow.com/questions/3458280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/341188/" ]
Using table would be much easier. Forms are naturally tabular. Never seen a form that is non-tabular. the whole table vs div is totally overblown. I do agree that it's not a good idea to use tables for designing layouts but it's what it was back in the old days where CSS support was limited. however for those to go...
Personally, I'd build that in divs. I'd have a formrow div, then contain each of the columns in left floated divs with a specified width.
3,458,280
Want some handy guidelines prior starting the HTML Prototype of this application. Please find below the mockup screen. [Mockup screen](http://picasaweb.google.co.in/yadav.lokesh/ApplicationMockup?feat=directlink#5504129507461564194) I need to make this structurewith liquid layout so that it will adjust as per the res...
2010/08/11
[ "https://Stackoverflow.com/questions/3458280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/341188/" ]
Seems like a good div approach to me. Floats seem to be the typical way to achieve this, but I've personally always found `display: inline-block` as an extremely helpful tool to implement these sorts of layouts.
Using table would be much easier. Forms are naturally tabular. Never seen a form that is non-tabular. the whole table vs div is totally overblown. I do agree that it's not a good idea to use tables for designing layouts but it's what it was back in the old days where CSS support was limited. however for those to go...
3,458,280
Want some handy guidelines prior starting the HTML Prototype of this application. Please find below the mockup screen. [Mockup screen](http://picasaweb.google.co.in/yadav.lokesh/ApplicationMockup?feat=directlink#5504129507461564194) I need to make this structurewith liquid layout so that it will adjust as per the res...
2010/08/11
[ "https://Stackoverflow.com/questions/3458280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/341188/" ]
Seems like a good div approach to me. Floats seem to be the typical way to achieve this, but I've personally always found `display: inline-block` as an extremely helpful tool to implement these sorts of layouts.
I think: * **the optimal way** is to use a DIV with floating but its harder to code because you want a table-style and you must calc the exact width of any div (in pixel or percent). * **the easyer way** is to use TABLES with colspan.
3,458,280
Want some handy guidelines prior starting the HTML Prototype of this application. Please find below the mockup screen. [Mockup screen](http://picasaweb.google.co.in/yadav.lokesh/ApplicationMockup?feat=directlink#5504129507461564194) I need to make this structurewith liquid layout so that it will adjust as per the res...
2010/08/11
[ "https://Stackoverflow.com/questions/3458280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/341188/" ]
Using table would be much easier. Forms are naturally tabular. Never seen a form that is non-tabular. the whole table vs div is totally overblown. I do agree that it's not a good idea to use tables for designing layouts but it's what it was back in the old days where CSS support was limited. however for those to go...
I think: * **the optimal way** is to use a DIV with floating but its harder to code because you want a table-style and you must calc the exact width of any div (in pixel or percent). * **the easyer way** is to use TABLES with colspan.
40,037,946
How do I convert a JSON array into a JSON object. For example, I have created a variable which holds a JSON array: ``` [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}] ``` How do I convert it into a JSON object with entities as a JS...
2016/10/14
[ "https://Stackoverflow.com/questions/40037946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6582516/" ]
```js var array = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var obj = {"Entities" : array}; console.log(obj); ```
``` <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ var obj = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var objNew=...
40,037,946
How do I convert a JSON array into a JSON object. For example, I have created a variable which holds a JSON array: ``` [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}] ``` How do I convert it into a JSON object with entities as a JS...
2016/10/14
[ "https://Stackoverflow.com/questions/40037946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6582516/" ]
``` var original = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var newValue = JSON.stringify({Entities:[original[0]]}); console.log(newValue); //{"Entities":[{"Bank Account Name":"State Bank","Currency Code":"4000","Deposit Date":"5/2/1794...
``` <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function(){ var obj = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var objNew=...
40,037,946
How do I convert a JSON array into a JSON object. For example, I have created a variable which holds a JSON array: ``` [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}] ``` How do I convert it into a JSON object with entities as a JS...
2016/10/14
[ "https://Stackoverflow.com/questions/40037946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6582516/" ]
```js var array = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var obj = {"Entities" : array}; console.log(obj); ```
Simply wrap it: ``` var array = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var jsonObject = {"Entities":array}; ```
40,037,946
How do I convert a JSON array into a JSON object. For example, I have created a variable which holds a JSON array: ``` [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}] ``` How do I convert it into a JSON object with entities as a JS...
2016/10/14
[ "https://Stackoverflow.com/questions/40037946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6582516/" ]
``` var original = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var newValue = JSON.stringify({Entities:[original[0]]}); console.log(newValue); //{"Entities":[{"Bank Account Name":"State Bank","Currency Code":"4000","Deposit Date":"5/2/1794...
Simply wrap it: ``` var array = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var jsonObject = {"Entities":array}; ```
40,037,946
How do I convert a JSON array into a JSON object. For example, I have created a variable which holds a JSON array: ``` [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}] ``` How do I convert it into a JSON object with entities as a JS...
2016/10/14
[ "https://Stackoverflow.com/questions/40037946", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6582516/" ]
```js var array = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var obj = {"Entities" : array}; console.log(obj); ```
``` var original = [{ "Bank Account Name": "State Bank", "Currency Code": "4000", "Deposit Date": "5/2/1794", "Payment Channel": "check"}]; var newValue = JSON.stringify({Entities:[original[0]]}); console.log(newValue); //{"Entities":[{"Bank Account Name":"State Bank","Currency Code":"4000","Deposit Date":"5/2/1794...
1,909,477
I've written a console app that **sends MS Reports to emails**.. (the reason was that i could check it easily if it works) I want this to run daily at 6 am. My idea was to **write a service** (so nooone will need to be logged in and the service will run). So I'd like to call the static Method directly in a WebService....
2009/12/15
[ "https://Stackoverflow.com/questions/1909477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133566/" ]
Sounds like overkill to use a Windows Service to send an email once a day. Why not just schedule a task in Task Scheduler?
Create a class library and put the shared classes in that library.
1,909,477
I've written a console app that **sends MS Reports to emails**.. (the reason was that i could check it easily if it works) I want this to run daily at 6 am. My idea was to **write a service** (so nooone will need to be logged in and the service will run). So I'd like to call the static Method directly in a WebService....
2009/12/15
[ "https://Stackoverflow.com/questions/1909477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133566/" ]
You're going to have to refactor your app. I'd recommend three projects - **Console App** - instantiates and performs any neccessary set up on your business logic object then routes all output to the console. Use this for debugging and testing **Business logic** - Extract all the logic of your application into this ...
Create a class library and put the shared classes in that library.
1,909,477
I've written a console app that **sends MS Reports to emails**.. (the reason was that i could check it easily if it works) I want this to run daily at 6 am. My idea was to **write a service** (so nooone will need to be logged in and the service will run). So I'd like to call the static Method directly in a WebService....
2009/12/15
[ "https://Stackoverflow.com/questions/1909477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/133566/" ]
Sounds like overkill to use a Windows Service to send an email once a day. Why not just schedule a task in Task Scheduler?
You're going to have to refactor your app. I'd recommend three projects - **Console App** - instantiates and performs any neccessary set up on your business logic object then routes all output to the console. Use this for debugging and testing **Business logic** - Extract all the logic of your application into this ...
32,902,521
``` <div style="width: 50px !important"> ``` I want to set the pixel number dynamically by angularjs. The final width should also be calculated times a base pixel width. How could I achieve this? ``` <div ng-style="{{width: (model.number * 30)px !important}}"> ``` This does of course not work, but shows what I'm t...
2015/10/02
[ "https://Stackoverflow.com/questions/32902521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1194415/" ]
Try this: ``` <div ng-style="{width: (model.number * 30) +'px'}"> ```
this should work ``` <div ng-style="{'width': model.number * 30}"> ```
32,902,521
``` <div style="width: 50px !important"> ``` I want to set the pixel number dynamically by angularjs. The final width should also be calculated times a base pixel width. How could I achieve this? ``` <div ng-style="{{width: (model.number * 30)px !important}}"> ``` This does of course not work, but shows what I'm t...
2015/10/02
[ "https://Stackoverflow.com/questions/32902521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1194415/" ]
This works fine. HTML: ``` <div ng-app="myApp" ng-controller="myCtrl"> <p> Number: <input type="number" ng-model="model.number" /> </p> <p> Times: <input type="number" ng-model="model.times" /></p> <p style="outline:1px solid black; width:{{model.number*model.times}}px;" >Resulding width: {{model.number*mode...
this should work ``` <div ng-style="{'width': model.number * 30}"> ```
561,740
In Linux bash terminal we can enable color. Is it possible to achieve the same for ConEmu?
2013/03/06
[ "https://superuser.com/questions/561740", "https://superuser.com", "https://superuser.com/users/201739/" ]
Seems to me, your question is incorrect. You need to enable color in your console application, but not in ConEmu, because it is terminal, but not a shell. Refer to your shell/application manuals. For example, `ls` has special switch. ![ls --color](https://i.stack.imgur.com/73WQI.png) There are also ANSI sequences, Co...
Have you looked in the [Options dialog](https://code.google.com/p/conemu-maximus5/wiki/Settings#Colors). ![enter image description here](https://i.stack.imgur.com/9rDwO.png)
36,824,219
I am gettin' into touch with meteor.js and I am quite confused about some things. I wrote a new collection : ``` sendEmailAfterNotification = function(comment) { var post = Posts.findOne(comment.postId); if (comment.userId !== post.userId) { Meteor.call('sendEmail', Meteor.users.findOne(pos...
2016/04/24
[ "https://Stackoverflow.com/questions/36824219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1809417/" ]
`Meteor.users.findOne(post.userId)` doesn't work on the client, since the client only has the current user's data in `Meteor.users` collection. Make sure your server-side `sendEmail` is the one that queries `Meteor.users`, and not the client.
Meteor.users works on the client, just ensure you have published and subscribed to `Meteor.users.find({},{})` manually.
27,745,656
I've had a look at this question- [Call OnResume when Back Button Pressed when using Fragments](https://stackoverflow.com/questions/26732839/call-onresume-when-back-button-pressed-when-using-fragments) I've done the same things, as mentioned in the answers, but neither is onResume called, nor onCreateView. It's a tran...
2015/01/02
[ "https://Stackoverflow.com/questions/27745656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3649263/" ]
Because " `*`" matches zero or more spaces, but nothing else. The regex for "anything" is `.*` (the dot matches any character and the star allows for zero or more repetitions). However, that would match `mam am` whereas you apparently want word matches, so try ``` grep '\<a\>.*\<a\>' ```
If your `grep` support `-P` option you can try something like ``` $ echo "a b a" | grep -P "\ba\b.*\ba\b" a b a ``` * `\b` matches word boundaries * `\ba\b` matches `words "a"`
27,745,656
I've had a look at this question- [Call OnResume when Back Button Pressed when using Fragments](https://stackoverflow.com/questions/26732839/call-onresume-when-back-button-pressed-when-using-fragments) I've done the same things, as mentioned in the answers, but neither is onResume called, nor onCreateView. It's a tran...
2015/01/02
[ "https://Stackoverflow.com/questions/27745656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3649263/" ]
Because " `*`" matches zero or more spaces, but nothing else. The regex for "anything" is `.*` (the dot matches any character and the star allows for zero or more repetitions). However, that would match `mam am` whereas you apparently want word matches, so try ``` grep '\<a\>.*\<a\>' ```
Grep can take more complex regular expressions: ``` grep -E "\ba\b.*\ba\b" ``` Breakdown: * `\b` - Word Boundary * `a` - The word * `\b` - Word Boundary * `.*` - Zero or more characters * `\b` - Word Boundary * `a` - The word * `\b` - Word Boundary The `\b` marks the end of *word boundaries* and will whether the w...
27,745,656
I've had a look at this question- [Call OnResume when Back Button Pressed when using Fragments](https://stackoverflow.com/questions/26732839/call-onresume-when-back-button-pressed-when-using-fragments) I've done the same things, as mentioned in the answers, but neither is onResume called, nor onCreateView. It's a tran...
2015/01/02
[ "https://Stackoverflow.com/questions/27745656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3649263/" ]
If your `grep` support `-P` option you can try something like ``` $ echo "a b a" | grep -P "\ba\b.*\ba\b" a b a ``` * `\b` matches word boundaries * `\ba\b` matches `words "a"`
Grep can take more complex regular expressions: ``` grep -E "\ba\b.*\ba\b" ``` Breakdown: * `\b` - Word Boundary * `a` - The word * `\b` - Word Boundary * `.*` - Zero or more characters * `\b` - Word Boundary * `a` - The word * `\b` - Word Boundary The `\b` marks the end of *word boundaries* and will whether the w...
10,696,595
I intend to create an HTML report from a perl script on Linux/Unix side. The report contains various statistics mainly in the tabular format. Since there are many such tables I want to split them into categories using Tabs. The report then will be sent to some email-ids, as an attachment. The questions are: 1. Is the...
2012/05/22
[ "https://Stackoverflow.com/questions/10696595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/932068/" ]
``` final Uri Person = Uri.withAppendedPath( ContactsContract.CommonDataKinds.Phone.CONTENT_FILTER_URI, Uri.encode(number)); final String[] projection = new String[] { ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME }; final Cursor cursor = context.getContentResolver().query(Pe...
Try the following, ``` public void getContactDetails(String conatctname) { try { ContentResolver cr =getContentResolver(); Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); while (cursor.moveToNext()) { ...
10,696,595
I intend to create an HTML report from a perl script on Linux/Unix side. The report contains various statistics mainly in the tabular format. Since there are many such tables I want to split them into categories using Tabs. The report then will be sent to some email-ids, as an attachment. The questions are: 1. Is the...
2012/05/22
[ "https://Stackoverflow.com/questions/10696595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/932068/" ]
``` final Uri Person = Uri.withAppendedPath( ContactsContract.CommonDataKinds.Phone.CONTENT_FILTER_URI, Uri.encode(number)); final String[] projection = new String[] { ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME }; final Cursor cursor = context.getContentResolver().query(Pe...
You can get selected name and number from contact of phone ``` Uri uri = data.getData(); String[] projection = new String[] {ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER}; Cursor people = getActivity().getContentResolver()....
10,696,595
I intend to create an HTML report from a perl script on Linux/Unix side. The report contains various statistics mainly in the tabular format. Since there are many such tables I want to split them into categories using Tabs. The report then will be sent to some email-ids, as an attachment. The questions are: 1. Is the...
2012/05/22
[ "https://Stackoverflow.com/questions/10696595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/932068/" ]
Try the following, ``` public void getContactDetails(String conatctname) { try { ContentResolver cr =getContentResolver(); Cursor cursor = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null); while (cursor.moveToNext()) { ...
You can get selected name and number from contact of phone ``` Uri uri = data.getData(); String[] projection = new String[] {ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER}; Cursor people = getActivity().getContentResolver()....
13,425,560
In this code I think maybe it would be best to close after both the if and else but it seems off to close it twice. ``` <?php $member_id = ""; require("connect.php"); if (isset($_POST['member_id']))$member_id = fix_string($_POST['member_id']); $sql=("DELETE FROM members WHERE member_id = '$member_id'"); $res = mysql...
2012/11/16
[ "https://Stackoverflow.com/questions/13425560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1769839/" ]
I don't have an answer for you, but I did test your code on my iPhone 5 running 6.0.1 and mmap succeeded on a 700MB ISO file. So I would start with other factors and assume mmap is working properly. Perhaps the error you're getting back is not really due to memory, or perhaps the memory on the device itself is somehow ...
Use NSData and dont touch mmap directly here. To get the advantages of faulting reads, use NSDataReadingMapped. NSData ALSO frees bytes when in low-mem situations
13,425,560
In this code I think maybe it would be best to close after both the if and else but it seems off to close it twice. ``` <?php $member_id = ""; require("connect.php"); if (isset($_POST['member_id']))$member_id = fix_string($_POST['member_id']); $sql=("DELETE FROM members WHERE member_id = '$member_id'"); $res = mysql...
2012/11/16
[ "https://Stackoverflow.com/questions/13425560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1769839/" ]
After further investigation and reading this **[excellent blog post by John Carmack](https://web.archive.org/web/20151105205433/http://www.bethblog.com/2010/10/29/john-carmack-discusses-rage-on-iphoneipadipod-touch/)**, here are my conclusions: * 700MB is the limit for virtual memory on iOS (as of 2012, 32-bit iOS) * ...
Use NSData and dont touch mmap directly here. To get the advantages of faulting reads, use NSDataReadingMapped. NSData ALSO frees bytes when in low-mem situations
13,425,560
In this code I think maybe it would be best to close after both the if and else but it seems off to close it twice. ``` <?php $member_id = ""; require("connect.php"); if (isset($_POST['member_id']))$member_id = fix_string($_POST['member_id']); $sql=("DELETE FROM members WHERE member_id = '$member_id'"); $res = mysql...
2012/11/16
[ "https://Stackoverflow.com/questions/13425560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1769839/" ]
After further investigation and reading this **[excellent blog post by John Carmack](https://web.archive.org/web/20151105205433/http://www.bethblog.com/2010/10/29/john-carmack-discusses-rage-on-iphoneipadipod-touch/)**, here are my conclusions: * 700MB is the limit for virtual memory on iOS (as of 2012, 32-bit iOS) * ...
I don't have an answer for you, but I did test your code on my iPhone 5 running 6.0.1 and mmap succeeded on a 700MB ISO file. So I would start with other factors and assume mmap is working properly. Perhaps the error you're getting back is not really due to memory, or perhaps the memory on the device itself is somehow ...
13,425,560
In this code I think maybe it would be best to close after both the if and else but it seems off to close it twice. ``` <?php $member_id = ""; require("connect.php"); if (isset($_POST['member_id']))$member_id = fix_string($_POST['member_id']); $sql=("DELETE FROM members WHERE member_id = '$member_id'"); $res = mysql...
2012/11/16
[ "https://Stackoverflow.com/questions/13425560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1769839/" ]
I don't have an answer for you, but I did test your code on my iPhone 5 running 6.0.1 and mmap succeeded on a 700MB ISO file. So I would start with other factors and assume mmap is working properly. Perhaps the error you're getting back is not really due to memory, or perhaps the memory on the device itself is somehow ...
Normally the amount of physical memory available has nothing to do with whether or not you are able to mmap a file. This is after all VIRTUAL memory we are talking about. The problem on iOS is that, at least according to the iOS App Programming Guide, the virtual memory manager only swaps out read-only sections... In t...
13,425,560
In this code I think maybe it would be best to close after both the if and else but it seems off to close it twice. ``` <?php $member_id = ""; require("connect.php"); if (isset($_POST['member_id']))$member_id = fix_string($_POST['member_id']); $sql=("DELETE FROM members WHERE member_id = '$member_id'"); $res = mysql...
2012/11/16
[ "https://Stackoverflow.com/questions/13425560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1769839/" ]
After further investigation and reading this **[excellent blog post by John Carmack](https://web.archive.org/web/20151105205433/http://www.bethblog.com/2010/10/29/john-carmack-discusses-rage-on-iphoneipadipod-touch/)**, here are my conclusions: * 700MB is the limit for virtual memory on iOS (as of 2012, 32-bit iOS) * ...
Normally the amount of physical memory available has nothing to do with whether or not you are able to mmap a file. This is after all VIRTUAL memory we are talking about. The problem on iOS is that, at least according to the iOS App Programming Guide, the virtual memory manager only swaps out read-only sections... In t...
595,349
We're running Ubuntu server 13.10 under Vagrant, and have come across an interesting problem. We're overriding the socket location in conf.d/my.cnf ``` [client] port = 3306 socket = /tmp/mysql.sock [mysqld_safe] socket = /tmp/mysql.sock [mysq...
2014/05/15
[ "https://serverfault.com/questions/595349", "https://serverfault.com", "https://serverfault.com/users/34274/" ]
Depending on your exact configuration below might be enough to fix your connection issue. you can start mysql with --socket=/tmp/mysql.sock from the [Mysql Manual](http://dev.mysql.com/doc/refman/5.0/en/mysql-command-options.html#option_mysql_socket) ``` --socket=path, -S path ``` > > For connections to localhost...
I just looked at a fairly fresh install of Ubuntu 14.04 and the default permissions on /etc/mysql are 755. To be honest I don't understand why you think that's a problem.
11,161
Of the two noun homonyms 'pledge', I'm asking merely about that derived from Latin. For the other homonym from Proto-Germanic , please see [this](https://linguistics.stackexchange.com/q/12196/5306). [Etymonline for 'plight (n.1)'](http://www.etymonline.com/index.php?allowed_in_frame=0&search=plight&searchmode=none) : ...
2019/07/19
[ "https://latin.stackexchange.com/questions/11161", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/-1/" ]
The closest I can come is > > Cave lector, anima tua mea erit. > > > means "Beware reader, your mind (or spirit, or soul) will be mine". I don't quite see how that adds up to "Who reads this is stupid", but maybe you can.
You might even consider something like *Hoc lecto tua voluntas mea fiet*, using an ablative absolute. Note I'm using *voluntas* rather than *anima*, too. Perhaps even just *Hoc lecto meus fies*, to be more compact and not as Englishy.
11,161
Of the two noun homonyms 'pledge', I'm asking merely about that derived from Latin. For the other homonym from Proto-Germanic , please see [this](https://linguistics.stackexchange.com/q/12196/5306). [Etymonline for 'plight (n.1)'](http://www.etymonline.com/index.php?allowed_in_frame=0&search=plight&searchmode=none) : ...
2019/07/19
[ "https://latin.stackexchange.com/questions/11161", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/-1/" ]
The closest I can come is > > Cave lector, anima tua mea erit. > > > means "Beware reader, your mind (or spirit, or soul) will be mine". I don't quite see how that adds up to "Who reads this is stupid", but maybe you can.
If you'd like to say "If you read this, you will be mine" as literally as possible, this is probably as close as you will get: ``` Si hoc legis, mihi futurus eris. ``` `Esse+Dat.` means to belong to somebody by the means that you are somebody's property. Moreover, using a conditional clause shows that if you don't r...
11,161
Of the two noun homonyms 'pledge', I'm asking merely about that derived from Latin. For the other homonym from Proto-Germanic , please see [this](https://linguistics.stackexchange.com/q/12196/5306). [Etymonline for 'plight (n.1)'](http://www.etymonline.com/index.php?allowed_in_frame=0&search=plight&searchmode=none) : ...
2019/07/19
[ "https://latin.stackexchange.com/questions/11161", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/-1/" ]
> > 'cave lectorem tuus anima mea' > > > This is pretty close! Just some case and agreement issues. *Cave* means "beware!" as a command to someone; *caveat* means "may [he/she] beware". So if you use *cave* you're talking to the person directly (*cave canem* "watch out for the dog!"), and if you use *caveat* you'...
You might even consider something like *Hoc lecto tua voluntas mea fiet*, using an ablative absolute. Note I'm using *voluntas* rather than *anima*, too. Perhaps even just *Hoc lecto meus fies*, to be more compact and not as Englishy.
11,161
Of the two noun homonyms 'pledge', I'm asking merely about that derived from Latin. For the other homonym from Proto-Germanic , please see [this](https://linguistics.stackexchange.com/q/12196/5306). [Etymonline for 'plight (n.1)'](http://www.etymonline.com/index.php?allowed_in_frame=0&search=plight&searchmode=none) : ...
2019/07/19
[ "https://latin.stackexchange.com/questions/11161", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/-1/" ]
> > 'cave lectorem tuus anima mea' > > > This is pretty close! Just some case and agreement issues. *Cave* means "beware!" as a command to someone; *caveat* means "may [he/she] beware". So if you use *cave* you're talking to the person directly (*cave canem* "watch out for the dog!"), and if you use *caveat* you'...
If you'd like to say "If you read this, you will be mine" as literally as possible, this is probably as close as you will get: ``` Si hoc legis, mihi futurus eris. ``` `Esse+Dat.` means to belong to somebody by the means that you are somebody's property. Moreover, using a conditional clause shows that if you don't r...
11,161
Of the two noun homonyms 'pledge', I'm asking merely about that derived from Latin. For the other homonym from Proto-Germanic , please see [this](https://linguistics.stackexchange.com/q/12196/5306). [Etymonline for 'plight (n.1)'](http://www.etymonline.com/index.php?allowed_in_frame=0&search=plight&searchmode=none) : ...
2019/07/19
[ "https://latin.stackexchange.com/questions/11161", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/-1/" ]
You might even consider something like *Hoc lecto tua voluntas mea fiet*, using an ablative absolute. Note I'm using *voluntas* rather than *anima*, too. Perhaps even just *Hoc lecto meus fies*, to be more compact and not as Englishy.
If you'd like to say "If you read this, you will be mine" as literally as possible, this is probably as close as you will get: ``` Si hoc legis, mihi futurus eris. ``` `Esse+Dat.` means to belong to somebody by the means that you are somebody's property. Moreover, using a conditional clause shows that if you don't r...
63,801,958
I'm getting ConcurrentModificationException when I'am just iterating through an ArrayList and using indexOf() in the loop for my application logic. Can someone explain the reason behind this? From what I read, this should happen if I try to add/remove an item to/from the list while I'm still iterating. Am I missing som...
2020/09/08
[ "https://Stackoverflow.com/questions/63801958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6921379/" ]
You are having a concurrency issues, then, instead of you do: ``` ArrayList<SomeClass> listOfSomeClass = new ArrayList<>(); ``` Try to do: ``` CopyOnWriteArrayList<SomeClass> contas = new CopyOnWriteArrayList<>(); ``` 'CopyOnWriteArrayList' is a thread-safe variant of java.util.ArrayList in which all mutative ope...
If you want to delete or add new item when you traverse list,you should use the ListIterator.This the code ``` package com.test.dal; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; public class LTest { public static void main(String[] args) { List<String> listOfSomeClas...
27,715,564
I'm a complete novice to Java and in the process of creating the game Snake. In the game I have created a Board class, what this class does is it creates a JFrame for giving a visual representation (to my understanding). My question resides with my lack of understanding of the code. I am not sure what "public static Bo...
2014/12/31
[ "https://Stackoverflow.com/questions/27715564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4401235/" ]
The line `public static Board board;` declares a variable that can refer to a board. In a way, think of it like a box - you created an empty box. It has nothing in it, but you now have the ability to put something in that box. Each part of the statement tells you something about the box: * public : anyone can access ...
When you put ``` public static Board board; ``` This implies that in your Java program there is an class level (static) reference which is named as board. It can hold a Board instance. But until you assign an instance to that reference, it is pointing to nothing. It is just a reference in the memory. When the code ...
27,715,564
I'm a complete novice to Java and in the process of creating the game Snake. In the game I have created a Board class, what this class does is it creates a JFrame for giving a visual representation (to my understanding). My question resides with my lack of understanding of the code. I am not sure what "public static Bo...
2014/12/31
[ "https://Stackoverflow.com/questions/27715564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4401235/" ]
The line `public static Board board;` declares a variable that can refer to a board. In a way, think of it like a box - you created an empty box. It has nothing in it, but you now have the ability to put something in that box. Each part of the statement tells you something about the box: * public : anyone can access ...
The first question: ``` public static Board board; ``` So far, you've declared a *reference variable* of type Board with public visibility. It can be accessed anywhere by Game.Board. The static modifier means that it is attached to the class (like static methods that don't require an instance of the class to run i.e...
29,207,536
I have thousand rows of input.txt , each row contains 1 number after "grep". I want to have 2nd to 4th row numbers from every 5 rows divided by 1st row from every 5 rows, until end of the file. The way I am using is ``` paste - - - - - - <input.txt >lines.txt ``` which converts 5 rows into one row, and then ``` a...
2015/03/23
[ "https://Stackoverflow.com/questions/29207536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4702547/" ]
You could do the whole thing using awk: ``` awk '{if(NR%5==1)a=$1;else $1/=a}1' input.txt ``` The `if` branch is taken on lines 1,6,11,etc. It saves the value of the first field in the variable `a`. The `else` branch is taken on all other lines and divides the values of the field by `a`. The `1` at the end is a co...
I'd use ``` awk '{ n = $1; for(i = 1; i <= 4; ++i) { v = 0; getline v; $i = v / n } } 1' filename ``` That is: ``` { n = $1 # remember divisor for(i = 1; i <= 4; ++i) { # four times: v = 0 # Reset base value (to achieve the same output ...
29,207,536
I have thousand rows of input.txt , each row contains 1 number after "grep". I want to have 2nd to 4th row numbers from every 5 rows divided by 1st row from every 5 rows, until end of the file. The way I am using is ``` paste - - - - - - <input.txt >lines.txt ``` which converts 5 rows into one row, and then ``` a...
2015/03/23
[ "https://Stackoverflow.com/questions/29207536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4702547/" ]
You could do the whole thing using awk: ``` awk '{if(NR%5==1)a=$1;else $1/=a}1' input.txt ``` The `if` branch is taken on lines 1,6,11,etc. It saves the value of the first field in the variable `a`. The `else` branch is taken on all other lines and divides the values of the field by `a`. The `1` at the end is a co...
This does what you seem to want. Using `seq` as the input ``` $ seq 10 | awk ' NR % 5 == 1 {n=$1; next} {printf "%f ", $1/n} NR % 5 == 0 {print ""} END {print ""} ' 2.000000 3.000000 4.000000 5.000000 1.166667 1.333333 1.500000 1.666667 ```
29,207,536
I have thousand rows of input.txt , each row contains 1 number after "grep". I want to have 2nd to 4th row numbers from every 5 rows divided by 1st row from every 5 rows, until end of the file. The way I am using is ``` paste - - - - - - <input.txt >lines.txt ``` which converts 5 rows into one row, and then ``` a...
2015/03/23
[ "https://Stackoverflow.com/questions/29207536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4702547/" ]
I'd use ``` awk '{ n = $1; for(i = 1; i <= 4; ++i) { v = 0; getline v; $i = v / n } } 1' filename ``` That is: ``` { n = $1 # remember divisor for(i = 1; i <= 4; ++i) { # four times: v = 0 # Reset base value (to achieve the same output ...
This does what you seem to want. Using `seq` as the input ``` $ seq 10 | awk ' NR % 5 == 1 {n=$1; next} {printf "%f ", $1/n} NR % 5 == 0 {print ""} END {print ""} ' 2.000000 3.000000 4.000000 5.000000 1.166667 1.333333 1.500000 1.666667 ```
39,853,875
Is there a possibility to remove root element of xml file? How can I do this in Java? My xml file looks like this: ``` <root> <body> .... </body> </root> ``` I already tried to parse it by Sax and ok I implement this, but I found out that SAX doesn't allow to write code to xml file(I read that is really hard). Have ...
2016/10/04
[ "https://Stackoverflow.com/questions/39853875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6921106/" ]
One way to solve your problem is to parse to document using the Scilca XML Progession package available at GitHub. You can get the structure of the child element then save it. ``` import org.scilca.sxp.*; XMLConnection xc = new XMLConnection("@filepath"); List<Node> allBodies = xc.searchMatches("body"); // as body is...
**If** you **only** need to strip the `<root>` and `</root>` tags you don't need to parse the xml file with SAX etc. Just parse it as String and replace the tags with empty strings. A very very basic example could be: ``` String str = "<root><body></body></root>"; String str2 = str.replace("<root>", "").replace...
40,272,348
Example ``` $value1 = $array[ 0 ][ $key ]; $value2 = (string) $array[ 0 ][ $key ]; ``` Variables are read-only, I dont modify value of them. Does PHP copies value of those elements or makes reference? EDIT: Copying of value takes time and memory. I would like to know if copying is performed? For example - in fun...
2016/10/26
[ "https://Stackoverflow.com/questions/40272348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1398264/" ]
PHP uses copy-on-write. It attempts to avoid physically copying data unless it needs to. From [PHP docs - Introduction to Variables](http://php.net/manual/de/internals2.variables.intro.php): > > PHP is a dynamic, loosely typed language, that uses copy-on-write and reference counting. > > > You can test this easi...
Yes, PHP copy value from $array[ 0 ][ $key ] to variable $value1 ( Your code: $value1 = $array[ 0 ][ $key ];). In PHP for reference used reserved symbol &, and you can work with reference like in other programing language. For using reference you need to modify you code: $value1 = & $array[ 0 ][ $key ]; Use unset($v...
12,986,003
I am trying my hands on Windows Azure Mobile Services. My environment is Visual Studio 2010. Azure SDK is installed. And operating system is Windows 7. I have created a Windows Azure Mobile Services and also created the sample database and the table as instructed while creating the service. On the other hand I have i...
2012/10/20
[ "https://Stackoverflow.com/questions/12986003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1707750/" ]
If I'm not mistaken, Windows Azure Mobile Service SDK is not supported for Windows 7 and VS 2010. On Windows platform, You can only build mobile applications for Windows 8 (Windows Store Apps) using VS 2012. Hope this helps.
To add to Gaurav's answer, Windows Azure Mobile Svcs does support Windows Phone 8 (in addition to Windows Store apps), but not Windows Phone 7. You can still retrieve data from WAMS from any client via a REST call though.
428,142
My book says that as soon as the two ends of a conducting wire touches the two terminals of a battery, it generates an electric field inside the conductor. Why?
2018/09/11
[ "https://physics.stackexchange.com/questions/428142", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/197304/" ]
There is an electric field between the battery terminals even before you connect the wire. For example, positive ions in the air will be attracted towards the battery's negative terminal (and repelled by the battery's positive terminal). Vice versa for negative ions. The *mean* magnitude of the electric field strength ...
Think of it this way, one side of the battery has a higher pressure and the other has a lower pressure as there is no such thing as a negative anywhere in our universe. when they are connected the higher pressure flows to the lower pressure as this is with all our universe. the wire will then create a magnetic field th...
67,857,773
I have a on-premise k8s GPU cluster with several computing nodes which have 8 GPUs respectively. Because we are on the way of migration to k8s, and also there are some remained project to use GPUs, I have to remain some GPUs which do not allowed by k8s to use. Furthermore, some projects require the use of contiguous GP...
2021/06/06
[ "https://Stackoverflow.com/questions/67857773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16143302/" ]
if you want your jobs to never use one of the gpu nodes, you can taint this nodes with noschedule taint for example: ``` kubectl taint nodes aks-gpuv100small.. no=k8s:NoSchedule ``` if you want your jobs to run only on specific gpu nodes you can add labels to this nodes and nodeSelectors to your jobs ``` kubectl...
This would be up to the specifics of your device plugin, and if you mean the Nvidia one, I don't think so, at least not without some custom work. The <https://github.com/NVIDIA/go-gpuallocator> library does support modular allocation policies, but I don't think this is specifically exposed as an option in the device pl...
535,140
i am use $(expr).attr("hash",value) to set a "hash" attribute for HTML anchor element "a" but the Jquery would not do that. but if i change expr to "div", then i can set "hash" attribute to "div" tag. is this behavior a xhtml specification? i can set "id" of "a" tag attribute. since id is a built in attribute for htm...
2009/02/11
[ "https://Stackoverflow.com/questions/535140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > to set a "hash" attribute for HTML anchor element "a" > > > The <a> element (HTMLLinkElement) already has a DOM Level 0 `hash` property. It is used like window.location.hash to read or set the ‘...#anchor’ part at the end of the URL being referred to by the element's `href`. Setting `a.hash`, whether directly...
Probably your trouble is that there isn't any `hash` attribute for an `<a>` tag. Perhaps you're looking for the `name` attribute, or maybe you want to change the hash in the link `href`, in which case you'll have to parse the link text and replace the hash using regular expressions.
535,140
i am use $(expr).attr("hash",value) to set a "hash" attribute for HTML anchor element "a" but the Jquery would not do that. but if i change expr to "div", then i can set "hash" attribute to "div" tag. is this behavior a xhtml specification? i can set "id" of "a" tag attribute. since id is a built in attribute for htm...
2009/02/11
[ "https://Stackoverflow.com/questions/535140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Probably your trouble is that there isn't any `hash` attribute for an `<a>` tag. Perhaps you're looking for the `name` attribute, or maybe you want to change the hash in the link `href`, in which case you'll have to parse the link text and replace the hash using regular expressions.
Another option for setting the hash. this only works where the expression returns an a element. This is because hash is a property on the actual a dom element. ``` $(expr).each(function() { this.hash = value; }); ``` if your need to test to see whether its an a tag use this ``` $(expr).is('a').each(function() { ...
535,140
i am use $(expr).attr("hash",value) to set a "hash" attribute for HTML anchor element "a" but the Jquery would not do that. but if i change expr to "div", then i can set "hash" attribute to "div" tag. is this behavior a xhtml specification? i can set "id" of "a" tag attribute. since id is a built in attribute for htm...
2009/02/11
[ "https://Stackoverflow.com/questions/535140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > to set a "hash" attribute for HTML anchor element "a" > > > The <a> element (HTMLLinkElement) already has a DOM Level 0 `hash` property. It is used like window.location.hash to read or set the ‘...#anchor’ part at the end of the URL being referred to by the element's `href`. Setting `a.hash`, whether directly...
Another option for setting the hash. this only works where the expression returns an a element. This is because hash is a property on the actual a dom element. ``` $(expr).each(function() { this.hash = value; }); ``` if your need to test to see whether its an a tag use this ``` $(expr).is('a').each(function() { ...
39,280
Is it a reference to Windows Vista? Is it an actual vista of an entire level from top? Where can I find this particular secret?
2011/11/30
[ "https://gaming.stackexchange.com/questions/39280", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/23/" ]
As usual in Serious Sam 3, the area in question is in serious plain sight. Acute players will have noticed this small green blinking item in The Power of The Underworld, roughly 400 kills into this serious level (after the serious infinite rocket storage). ![](https://i.imgur.com/evoS6.jpg) It's seriously right under...
It is in the Power to the Underworld level. From this walkthrough: > > In the final courtyard before exiting into the final open arena, on > the middle left side, on the roof of the rooms there, there are some > Secret Keys sitting against the wall. Simply climb up towards the > final open arena, but instead walk...
216,867
How can compare one item list with others items list in the meaning of No duplicate values ?? ``` if (item.Title != dp1.Text + tb2.Text) { item["Title"] = dp1.Text + tb2.Text; item["Nom"] = nom; //item1["Date"] = DateTime.N...
2017/05/30
[ "https://sharepoint.stackexchange.com/questions/216867", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/67099/" ]
it's not possible to use CAML query to get/filter the list fields because of the `list.Fields` is a collection property, not a function which could accept the CAML query to filter out the fields.
It's better to have a List associated with a Content Type. So that you can have a set of Fields retrieved from the Content Type using CSOM. please refer [this](https://msdn.microsoft.com/en-us/library/office/ff630940(v=office.14).aspx) link to create a list using content type. To create/edit a content type please ref...
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
You may want to have a look at Diaspora (probably a bit too much to start with), Authlogic, [OmniAuth](https://github.com/intridea/omniauth), [Koala](https://github.com/arsduo/koala) and the like - plus possible related Railscasts to walk you through it. Good luck and have fun :)
You could have a look at [diaspora](https://github.com/diaspora/diaspora). May not be a beginners project, though.
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
You could have a look at [diaspora](https://github.com/diaspora/diaspora). May not be a beginners project, though.
You may want to go through the learning app that's built in the free [Rails Book 3 Tutorial Site](http://ruby.railstutorial.org/ruby-on-rails-tutorial-book). The app that you build there literally goes over all of the things you want to do except for the Twitter / Facebook integration toward the end, but that's easy en...
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
Rails3: <https://github.com/ging/social_stream> "Social Stream, a core for building social network websites." Very current, being maintained today. Generator approach that I like. Rails2: <https://github.com/insoshi/insoshi> Older and not being actively maintained.
You could have a look at [diaspora](https://github.com/diaspora/diaspora). May not be a beginners project, though.
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
You could have a look at [diaspora](https://github.com/diaspora/diaspora). May not be a beginners project, though.
Check git for RailsSpace its a Social Network from a tutorial. Many people (like myself) rebuildet it under Rails 3. RailsSpace rocks for learning. Btw. get the tutorial book, its good ;-)
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
You may want to have a look at Diaspora (probably a bit too much to start with), Authlogic, [OmniAuth](https://github.com/intridea/omniauth), [Koala](https://github.com/arsduo/koala) and the like - plus possible related Railscasts to walk you through it. Good luck and have fun :)
You may want to go through the learning app that's built in the free [Rails Book 3 Tutorial Site](http://ruby.railstutorial.org/ruby-on-rails-tutorial-book). The app that you build there literally goes over all of the things you want to do except for the Twitter / Facebook integration toward the end, but that's easy en...
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
You may want to have a look at Diaspora (probably a bit too much to start with), Authlogic, [OmniAuth](https://github.com/intridea/omniauth), [Koala](https://github.com/arsduo/koala) and the like - plus possible related Railscasts to walk you through it. Good luck and have fun :)
Check git for RailsSpace its a Social Network from a tutorial. Many people (like myself) rebuildet it under Rails 3. RailsSpace rocks for learning. Btw. get the tutorial book, its good ;-)
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
Rails3: <https://github.com/ging/social_stream> "Social Stream, a core for building social network websites." Very current, being maintained today. Generator approach that I like. Rails2: <https://github.com/insoshi/insoshi> Older and not being actively maintained.
You may want to go through the learning app that's built in the free [Rails Book 3 Tutorial Site](http://ruby.railstutorial.org/ruby-on-rails-tutorial-book). The app that you build there literally goes over all of the things you want to do except for the Twitter / Facebook integration toward the end, but that's easy en...
8,167,597
Using the following code, I need to post some data to script. I know this isn't ideal, but it's a one off operation to save some data which got waylaid. So, the question is, how do you best reccommend posting this data so as to cause minimum server problems? Thanks in advance ``` <script> $.post("path/path/call...
2011/11/17
[ "https://Stackoverflow.com/questions/8167597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004781/" ]
Rails3: <https://github.com/ging/social_stream> "Social Stream, a core for building social network websites." Very current, being maintained today. Generator approach that I like. Rails2: <https://github.com/insoshi/insoshi> Older and not being actively maintained.
Check git for RailsSpace its a Social Network from a tutorial. Many people (like myself) rebuildet it under Rails 3. RailsSpace rocks for learning. Btw. get the tutorial book, its good ;-)
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
What you need is called attribute selector. An example, using your html structure, is the following: ``` div.page-search-site[class*='-bundle-medical-group'] { color:red } ``` In the place of `div` you can add any element or remove it altogether, and in the place of `class` you can add any attribute of the sp...
You're looking for a selctor that selects all elements with a list of class names beginning with `health-bundle-` or containing `health-bundle-` preceded by a space so you'll need to use [attribute selectors](https://developer.mozilla.org/en/docs/Web/CSS/Attribute_selectors), rather than [class selectors](https://devel...
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
You're looking for a selctor that selects all elements with a list of class names beginning with `health-bundle-` or containing `health-bundle-` preceded by a space so you'll need to use [attribute selectors](https://developer.mozilla.org/en/docs/Web/CSS/Attribute_selectors), rather than [class selectors](https://devel...
The CSS selector you're looking for looks like this. ```css div.page-search-site[class*=health-bundle] ``` It selects all `div` elements with class `page-search-site` and class attribute containing the substring `health-bundle`.