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
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
The are a number of ways. The most obvious, at least to me, is to use a loop inside sed. ``` sed -e :loop -e 's/ *\(.*YYY\)/\1/;t loop' ``` (there are two spaces after the first slash). The `:loop` just is a label. The `s/ *\(.*YYY\)/\1/` matches one or more spaces followed by something and then YYY and replaces ...
``` awk '{$1=$1}1' OFS= your_file ``` This is all you need. The assigning to a field (in this case first) takes away all extras and the empty OFS stitches together the fields w/o anything separating them.
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
Using **GNU sed** stream editor in extended regex mode `-E` , we strip away the internal spaces, those that see a nonwhitespace on both sides. It needs a repeat as a single character nonwhitespace will stop the run. ``` sed -Ee ' s/(\S)\s+(\S)/\1\2/g s//\1\2/g ' file ```
``` sed -r "s/\s+//g" filename output 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08YYY 8080C01125DMART5/23PPPPPPP09YYY awk '{gsub(" ","",$0);print }' filename 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08Y...
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
The are a number of ways. The most obvious, at least to me, is to use a loop inside sed. ``` sed -e :loop -e 's/ *\(.*YYY\)/\1/;t loop' ``` (there are two spaces after the first slash). The `:loop` just is a label. The `s/ *\(.*YYY\)/\1/` matches one or more spaces followed by something and then YYY and replaces ...
With `perl`, ``` perl -pe 's{\s.*YYY}{$& =~ s/\s//gr}e' ``` would remove all the ASCII white space characters that are to the left of the rightmost occurrence of `YYY` on lines that contain `YYY`.
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
With `perl`, ``` perl -pe 's{\s.*YYY}{$& =~ s/\s//gr}e' ``` would remove all the ASCII white space characters that are to the left of the rightmost occurrence of `YYY` on lines that contain `YYY`.
``` sed -r "s/\s+//g" filename output 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08YYY 8080C01125DMART5/23PPPPPPP09YYY awk '{gsub(" ","",$0);print }' filename 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08Y...
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
Here's an answer to the question you kind-of sort-of seem to be asking: ``` sed 's/ *\([^ ]\)/\1/g' ``` This assumes that you are dealing only with ordinary spaces, and not tabs.  It looks for a string of spaces, followed by a non-space character, and replaces it with just the non-space character.  And it does that ...
``` sed -r "s/\s+//g" filename output 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08YYY 8080C01125DMART5/23PPPPPPP09YYY awk '{gsub(" ","",$0);print }' filename 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08Y...
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
``` awk '{$1=$1}1' OFS= your_file ``` This is all you need. The assigning to a field (in this case first) takes away all extras and the empty OFS stitches together the fields w/o anything separating them.
``` sed -r "s/\s+//g" filename output 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08YYY 8080C01125DMART5/23PPPPPPP09YYY awk '{gsub(" ","",$0);print }' filename 8080C01124Amazon45/234Birch00YYY 8080C01184Flipkart45/234Lotus01YYY 8080C01186PrimeTime45/23XCCCCH08Y...
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
``` awk '{$1=$1}1' OFS= your_file ``` This is all you need. The assigning to a field (in this case first) takes away all extras and the empty OFS stitches together the fields w/o anything separating them.
Using **GNU sed** stream editor in extended regex mode `-E` , we strip away the internal spaces, those that see a nonwhitespace on both sides. It needs a repeat as a single character nonwhitespace will stop the run. ``` sed -Ee ' s/(\S)\s+(\S)/\1\2/g s//\1\2/g ' file ```
640,169
I am trying to remove the spaces from each line till the last word for each line in a file. Example input file: ``` 808 0 C01124 Amazon 45/234Birch 00 YYY 808 0 C01184 Flipkart 45/234Lotus 01 YYY 808 0 C01186 PrimeTime 45/2...
2021/03/20
[ "https://unix.stackexchange.com/questions/640169", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/461473/" ]
The are a number of ways. The most obvious, at least to me, is to use a loop inside sed. ``` sed -e :loop -e 's/ *\(.*YYY\)/\1/;t loop' ``` (there are two spaces after the first slash). The `:loop` just is a label. The `s/ *\(.*YYY\)/\1/` matches one or more spaces followed by something and then YYY and replaces ...
Here's an answer to the question you kind-of sort-of seem to be asking: ``` sed 's/ *\([^ ]\)/\1/g' ``` This assumes that you are dealing only with ordinary spaces, and not tabs.  It looks for a string of spaces, followed by a non-space character, and replaces it with just the non-space character.  And it does that ...
735,500
I am making this web site <http://www.christopherbier.com/gbg/locations.html> In safari on mac the content div is larger in width than it is in other browsers. It overlaps the right side bar bit. I am not sure how to fix this. Here is my css: ``` #mainwrap { width:1000px; margin-right:auto; margin-left:au...
2009/04/09
[ "https://Stackoverflow.com/questions/735500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84292/" ]
I don't have a mac so can't see, but a few points: > > > > > > your xhtml is not valid. center> doesn't exist anyomre (and by the looks of things isn't actually needed in the design anyway), also you shoudl specify the dimensions of any the header image in px. > > > > > > don't know why you're using margin auto o...
I don't see the problem in my copy of Safari 4 beta, though I'm not exactly sure what issue you would be having since the sidebar on the right is empty and so I'm not sure how I could tell if its being overlapped. Perhaps you should clarify about the exact problem that you're having? In order to debug the problem, and...
134,544
I have an ASUS USB-N13 wireless adapter and three laptops in a home. I've tried multiple times to create an ad-hoc network following the 802.11n standard, but failed each time. The laptops have Intel WiFi Link 5100 802.11a/b/g/n wireless adapters. I tried to create a network with WPA2 personal encryption. That failed ...
2010/04/24
[ "https://superuser.com/questions/134544", "https://superuser.com", "https://superuser.com/users/35102/" ]
The wireless network structure that you describe is called ad-hoc, which is the mode for wireless devices to directly communicate with each other. The alternative when using a router is called infrastructure mode. For most manufacturers of wireless adapters, 802.11n is only possible in infrastructure mode, which requi...
One problem at emerges a lot during N networking is G support. If you do not require G support try turning it off in the router. It has been known to distabalize the whole network.
66,559,129
I am writing table to mysql from python using pymysql to\_sql function. I am having 1000 rows with 200 columns. Query to connect to mysql is below: ``` engine = create_engine("mysql://hostname:password#@localhostname/dbname") conn = engine.connect() writing query: df.to_sql('data'.lower(),schema=schema,conn,'replace'...
2021/03/10
[ "https://Stackoverflow.com/questions/66559129", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12249443/" ]
You can store the data with 3 methods- 1. Use localStorage if you are using a json object then you can use localStorage.setItem("data123",JSON.stringify(data)) and fetch the data using JSON.prase(localStorage.getItem("data123")) 2. sessionStorgae Syntax is same as localStaorage. Just replace localwith session Dif...
I think the best way to save form data locally is to preserve it in your form handler class like you can create a new Handler class and create setter and getter in it which store the form fields data/values in object key, value pair which you always update whenever fields update.
70,677,352
here's how the story goes. We started transforming a monolith, single-machine, e-commerce application (Apache/PHP) to cloud infrastructure. Obviously, the application and the database (MySQL) were on the same machine. We decided to move to AWS. And as the first step of transformation, we decided to split the database...
2022/01/12
[ "https://Stackoverflow.com/questions/70677352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3050530/" ]
Are you using python 3.10? Looks like beautifulsoup library is using removed deprecated aliases to Collections Abstract Base Classes. More info here: <https://docs.python.org/3/whatsnew/3.10.html#removed> A quick fix is to paste these 2 lines just below your imports: ``` import collections collections.Callable = coll...
Andrey, i cannot comment yet. But i tried your fix and Im using Thonny and using 3.10 in terminal. But after adding the two import collections and callable lines. i get another error in Thonny that isnt shown in terminal. when i run the program in terminal it simply seems to do nothing. In Thonny it suggests that "Modu...
373,387
What are the best settings to tune so that Linux can handle a very large amount of TCP connections such as would be seen by a proxy server or a webserver? I'm using Centos6 and squid and am seeing a large amount of TIME\_WAIT connections backing up until finally the machine stops responding. The machine isn't loaded a...
2012/03/26
[ "https://serverfault.com/questions/373387", "https://serverfault.com", "https://serverfault.com/users/5153/" ]
Yes, after I typed "active directory ubuntu authenticate" into google, the top page was this: <https://help.ubuntu.com/community/ActiveDirectoryHowto> So yes you can do that. There are several ways to use AD for authentication, you can use Centrify Express, Likewise Open, pam\_krb5, LDAP or winbind. For Centrify Exp...
Yes, it's possible, but can be quite a pain to set-up. You have to install libnss-ldap and configure your workstation properly. See the [Ubuntu guide](https://help.ubuntu.com/community/ActiveDirectoryHowto) to get started.
373,387
What are the best settings to tune so that Linux can handle a very large amount of TCP connections such as would be seen by a proxy server or a webserver? I'm using Centos6 and squid and am seeing a large amount of TIME\_WAIT connections backing up until finally the machine stops responding. The machine isn't loaded a...
2012/03/26
[ "https://serverfault.com/questions/373387", "https://serverfault.com", "https://serverfault.com/users/5153/" ]
Yes, after I typed "active directory ubuntu authenticate" into google, the top page was this: <https://help.ubuntu.com/community/ActiveDirectoryHowto> So yes you can do that. There are several ways to use AD for authentication, you can use Centrify Express, Likewise Open, pam\_krb5, LDAP or winbind. For Centrify Exp...
Likewise Open is a good easy way to do that. As from [Ubuntu help page](https://help.ubuntu.com/10.04/serverguide/C/likewise-open.html): ``` sudo apt-get install likewise-open sudo domainjoin-cli join example.com user ``` Where `user` is a user with the privilege to join a computer to the domain, `example.com` is t...
373,387
What are the best settings to tune so that Linux can handle a very large amount of TCP connections such as would be seen by a proxy server or a webserver? I'm using Centos6 and squid and am seeing a large amount of TIME\_WAIT connections backing up until finally the machine stops responding. The machine isn't loaded a...
2012/03/26
[ "https://serverfault.com/questions/373387", "https://serverfault.com", "https://serverfault.com/users/5153/" ]
Likewise Open is a good easy way to do that. As from [Ubuntu help page](https://help.ubuntu.com/10.04/serverguide/C/likewise-open.html): ``` sudo apt-get install likewise-open sudo domainjoin-cli join example.com user ``` Where `user` is a user with the privilege to join a computer to the domain, `example.com` is t...
Yes, it's possible, but can be quite a pain to set-up. You have to install libnss-ldap and configure your workstation properly. See the [Ubuntu guide](https://help.ubuntu.com/community/ActiveDirectoryHowto) to get started.
15,301,971
I am trying to call an ioctl function in my toy file system module. I would simply like to have this ioctl set a variable that is passed in by the caller. So far I have set up the ioctl infrastructure that has allowed me to make ioctl calls. I have this function in my module to handle ioctl. ``` int ospfs_ioctl(struct...
2013/03/08
[ "https://Stackoverflow.com/questions/15301971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174472/" ]
You need to introduce a service layer on top of `Dao's` (Entity, Old system) and inject (assuming you're using `Spring`) all the `Dao's` into the service. Option 1 is better however just create two Dao's inside a Service and create the Business Transfer Object that will be used throughout the application. The workflow ...
Pretty difficult to answer that without an idea of the data. What I would do is to have two dao's :one for the db and one for the webservice (I would call it more a service than a dao) and use the latter to add properties to the entity retrieve by the JPA dao. I would later drop the service/dao of webservice and evol...
54,820
Want to display the Powerpoint Presentation on the Mobile, let me know if it can be achieved in SharePoint 2010?
2012/12/28
[ "https://sharepoint.stackexchange.com/questions/54820", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/1232/" ]
If available Office Web Apps will let you natively open and present a PowerPoint presentation. If you don't need to keep this "in house" you can leverage it via SkyDrive (Microsoft has Office Web Apps integrated with SkyDrive). SharePoint 2010 Enterprise also contains the same PowerPoint functionality without Office W...
I am pretty sure, if you create a SharePoint page using page viewer webpart by following this [Tutorial](https://www.acceleratedk.com/Blog/Lists/Posts/Post.aspx?ID=13), you will be able to view it on mobile as power point presentation as well. Hope it helps.
2,104,468
I have been trying to find the limit, $$\lim \_{ x \to 0} \frac{\sqrt[3]{1+6x+3x^2+3x^3+3x^4}-\sqrt[4]{1+8x+4x^2+4x^3-2x^4}}{6x^2}$$ and sort of succeeded. But my $0$ answer doesn't converge with what Wolfram says which is $1/3$. Therefore, I would really appreciate it, if you could give me the right answer and drop ...
2017/01/19
[ "https://math.stackexchange.com/questions/2104468", "https://math.stackexchange.com", "https://math.stackexchange.com/users/400605/" ]
**Without Taylor nor the generalized Binomial theorem**: Use the identity $$a^{12}-b^{12}=\\ (a-b)(a^{11}+a^{10}b^{1}+a^{9}b^{2}+a^{8}b^{3}+a^{7}b^{4}+a^{6}b^{5}+a^{5}b^{6}+a^{4}b^{7}+a^{3}b^{8}+a^{2}b^{9}+ab^{10}+b^{11}).$$ By multiplying/dividing by the conjugate "dodecanomial", the numerator becomes the polynomi...
First, do a Binomial expansion of the cube root expressions, simplify the numerator, cancel $x^2$ terms and then conduct the limit. You should get $1/3$.
2,104,468
I have been trying to find the limit, $$\lim \_{ x \to 0} \frac{\sqrt[3]{1+6x+3x^2+3x^3+3x^4}-\sqrt[4]{1+8x+4x^2+4x^3-2x^4}}{6x^2}$$ and sort of succeeded. But my $0$ answer doesn't converge with what Wolfram says which is $1/3$. Therefore, I would really appreciate it, if you could give me the right answer and drop ...
2017/01/19
[ "https://math.stackexchange.com/questions/2104468", "https://math.stackexchange.com", "https://math.stackexchange.com/users/400605/" ]
Another approach (apart from the one mentioned in my comments) is to use Binomial Theorem. Let the expression be denoted by $$\frac{u - v}{w}$$ and then multiply numerator and denominator by $$t = u^{11} + u^{10}v + \cdots + v^{11}$$ to get $$\frac{u^{12} - v^{12}}{wt}$$ and note that since $u, v$ both tend to $1$ as $...
First, do a Binomial expansion of the cube root expressions, simplify the numerator, cancel $x^2$ terms and then conduct the limit. You should get $1/3$.
2,104,468
I have been trying to find the limit, $$\lim \_{ x \to 0} \frac{\sqrt[3]{1+6x+3x^2+3x^3+3x^4}-\sqrt[4]{1+8x+4x^2+4x^3-2x^4}}{6x^2}$$ and sort of succeeded. But my $0$ answer doesn't converge with what Wolfram says which is $1/3$. Therefore, I would really appreciate it, if you could give me the right answer and drop ...
2017/01/19
[ "https://math.stackexchange.com/questions/2104468", "https://math.stackexchange.com", "https://math.stackexchange.com/users/400605/" ]
Another approach (apart from the one mentioned in my comments) is to use Binomial Theorem. Let the expression be denoted by $$\frac{u - v}{w}$$ and then multiply numerator and denominator by $$t = u^{11} + u^{10}v + \cdots + v^{11}$$ to get $$\frac{u^{12} - v^{12}}{wt}$$ and note that since $u, v$ both tend to $1$ as $...
**Without Taylor nor the generalized Binomial theorem**: Use the identity $$a^{12}-b^{12}=\\ (a-b)(a^{11}+a^{10}b^{1}+a^{9}b^{2}+a^{8}b^{3}+a^{7}b^{4}+a^{6}b^{5}+a^{5}b^{6}+a^{4}b^{7}+a^{3}b^{8}+a^{2}b^{9}+ab^{10}+b^{11}).$$ By multiplying/dividing by the conjugate "dodecanomial", the numerator becomes the polynomi...
23,510,082
``` private void BrokerWiseSalesReport_Load(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = null; dataGridView1.Rows.Clear(); ds = GetBrokerDetailspageload(); //int ii = 0; if (ds.Tables[0].Rows.Count != 0) ...
2014/05/07
[ "https://Stackoverflow.com/questions/23510082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3445382/" ]
You need to use MySqlDataAdapter. ``` private void BrokerWiseSalesReport_Load(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = null; dataGridView1.Rows.Clear(); ds = GetBrokerDetailspageload(); MySqlDataAdapter msd= new MySqlDataAdapter(); msd.Fill(ds)...
I think you are missing one line of code. Add this line after dataGridView1.DataSource = ds.Tables[0]; ``` dataGridView1.DataBind(); ```
20,169,550
Suppose I have my classes as: ``` namespace scope { class A { private: int a; public: ... }; class B { public: ... A method(); ... }; }; ``` The method definition: ``` A B::method() { A object; object.a = 3; // private member access error // access via object (...
2013/11/24
[ "https://Stackoverflow.com/questions/20169550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2505590/" ]
You want B to have access to A that you don't want other people to have? That is friendship. Add `friend class B`, into the class A definition, and all will be happiness. btw the common examples for this are when I am using multiple classes to generate a single interface. Eg: things like list<> and map<> usually ne...
Just like Richard said, you can use friendship. But keep in mind that when you need friendship, you should probably think again about your design. As Richard saids too, maybe putting a as a parameter of A constructor should do exactly what you want. Here is a working example with friendship : ``` #include <iostream> ...
41,761,401
I'm working on creating a linear search in Java using the StdIn library from Princeton, and I can't figure out why my `if-else` statement will only print out “-1”. It seems to me that its skipping over the `if` block entirely and going straight onto the `else`. I'm entering in my list with command-line arguments and e...
2017/01/20
[ "https://Stackoverflow.com/questions/41761401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7445465/" ]
Your method will return (after printing -1) as soon as the searched value is not in the array: ``` else{ System.out.println("-1"); return; // EXITING HERE } ``` so if the value entered is not the the first value in the array, you will get -1 and the method is terminated. What you probably w...
Finally after lots of effort I have completed your code. Run program as follows java SearchAlgs 4 5 6 7 > > enter size:5 > > > 67546 > > > Output would be : > > 6 is at index 2 > > 7 is at index 3 > > 5 is at index 1 > > 4 is at index 0 > > > Code: import java.util.Scanner; class SearchAl...
12,709,005
So I don't know why but I learned that when you call a function and pass an argument to it, it deals with it on the stack(processor?). Can someone please explain it? then how does it change values of variables, blocks of memory and so on?
2012/10/03
[ "https://Stackoverflow.com/questions/12709005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1714732/" ]
There is no guarantee that parameters are passed on the stack, it's architecture and compiler dependent. As to how values and memory get changed -- when you call a function that must make changes that are seen by the caller, it's normal that what you provide is not the actual value, but rather the address of (pointer ...
Lets start with this suppose you have a function ``` int foo(int value) { int a = 10; return a; } ``` So whenever a function call is made OS needs some memory space to allocate the local variables of the function `int a` in this case and arguments to the function passed `int value` in this case. This memory r...
12,709,005
So I don't know why but I learned that when you call a function and pass an argument to it, it deals with it on the stack(processor?). Can someone please explain it? then how does it change values of variables, blocks of memory and so on?
2012/10/03
[ "https://Stackoverflow.com/questions/12709005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1714732/" ]
Stack is used in most cases to pass arguments to function. The reason for using it is that you are not bound to fixed memory places (for arguments) to have your function functional. If you had function that could take arguments from fixed memory you would probably only be able to run it if the memory was free and you w...
Lets start with this suppose you have a function ``` int foo(int value) { int a = 10; return a; } ``` So whenever a function call is made OS needs some memory space to allocate the local variables of the function `int a` in this case and arguments to the function passed `int value` in this case. This memory r...
258,211
With the [release of Internet Explorer 9](http://Windows.Microsoft.com/en-US/internet-Explorer/downloads/ie-9/worldwide-languages) I decided to give it a go. It really is great and integrates nicely with VS 2010. However when ever I try to access a page with flash I get an instant crash. I have tried uninstalling flas...
2011/03/15
[ "https://superuser.com/questions/258211", "https://superuser.com", "https://superuser.com/users/73083/" ]
crash entire computer or just the browser? any error message? Did you reboot after you reinstalled the newest flash? Googling found this thread: <http://social.technet.microsoft.com/Forums/en/itproxpsp/thread/6a8b0219-1764-417a-a38c-372266a6e10a> From it, one guy suggests 3rd party addons (mouse gestures, toolbars) ...
Yes, I found it happens on pages with javascript. I updated java and the problem was solved.
258,211
With the [release of Internet Explorer 9](http://Windows.Microsoft.com/en-US/internet-Explorer/downloads/ie-9/worldwide-languages) I decided to give it a go. It really is great and integrates nicely with VS 2010. However when ever I try to access a page with flash I get an instant crash. I have tried uninstalling flas...
2011/03/15
[ "https://superuser.com/questions/258211", "https://superuser.com", "https://superuser.com/users/73083/" ]
I have experienced the problem you described for some time now. The following steps finally solved the problem for me. Open IE, click on the gear on the top right. Select internet options, then go to the advanced tab. Click the option that resets the advanced settings, click apply. Restart IE. I found this solution b...
crash entire computer or just the browser? any error message? Did you reboot after you reinstalled the newest flash? Googling found this thread: <http://social.technet.microsoft.com/Forums/en/itproxpsp/thread/6a8b0219-1764-417a-a38c-372266a6e10a> From it, one guy suggests 3rd party addons (mouse gestures, toolbars) ...
258,211
With the [release of Internet Explorer 9](http://Windows.Microsoft.com/en-US/internet-Explorer/downloads/ie-9/worldwide-languages) I decided to give it a go. It really is great and integrates nicely with VS 2010. However when ever I try to access a page with flash I get an instant crash. I have tried uninstalling flas...
2011/03/15
[ "https://superuser.com/questions/258211", "https://superuser.com", "https://superuser.com/users/73083/" ]
I've had my previously rock solid setup, 3.2 GHz Phenom X4 w/ 16 GB of RAM and Windows 7 Pro x64 bit scretch to a halt (not even a BSOD) in the middle of flash videos (youtube, news broadcasts...etc). It's probably a bug in Adobe's x64 flash player and a bug in IE9's hardware acceleration that causes low-level exceptio...
Yes, I found it happens on pages with javascript. I updated java and the problem was solved.
258,211
With the [release of Internet Explorer 9](http://Windows.Microsoft.com/en-US/internet-Explorer/downloads/ie-9/worldwide-languages) I decided to give it a go. It really is great and integrates nicely with VS 2010. However when ever I try to access a page with flash I get an instant crash. I have tried uninstalling flas...
2011/03/15
[ "https://superuser.com/questions/258211", "https://superuser.com", "https://superuser.com/users/73083/" ]
I have experienced the problem you described for some time now. The following steps finally solved the problem for me. Open IE, click on the gear on the top right. Select internet options, then go to the advanced tab. Click the option that resets the advanced settings, click apply. Restart IE. I found this solution b...
Yes, I found it happens on pages with javascript. I updated java and the problem was solved.
258,211
With the [release of Internet Explorer 9](http://Windows.Microsoft.com/en-US/internet-Explorer/downloads/ie-9/worldwide-languages) I decided to give it a go. It really is great and integrates nicely with VS 2010. However when ever I try to access a page with flash I get an instant crash. I have tried uninstalling flas...
2011/03/15
[ "https://superuser.com/questions/258211", "https://superuser.com", "https://superuser.com/users/73083/" ]
I have experienced the problem you described for some time now. The following steps finally solved the problem for me. Open IE, click on the gear on the top right. Select internet options, then go to the advanced tab. Click the option that resets the advanced settings, click apply. Restart IE. I found this solution b...
I've had my previously rock solid setup, 3.2 GHz Phenom X4 w/ 16 GB of RAM and Windows 7 Pro x64 bit scretch to a halt (not even a BSOD) in the middle of flash videos (youtube, news broadcasts...etc). It's probably a bug in Adobe's x64 flash player and a bug in IE9's hardware acceleration that causes low-level exceptio...
11,591,447
I want to add background music to my Android game, this needs to be pause able, resume able, etc. I have found this example: <http://www.codeproject.com/Articles/258176/Adding-Background-Music-to-Android-App> However the line ``` mServ = ((MusicService.ServiceBinderbinder).getService(); ``` Seems to kick up really...
2012/07/21
[ "https://Stackoverflow.com/questions/11591447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692410/" ]
After extensive looking, I have found this other question: [Playing BG Music Across Activities in Android](https://stackoverflow.com/questions/2097909/playing-bg-music-across-activities-in-android) Which points to this code: <http://www.rbgrn.net/content/307-light-racer-20-days-61-64-completion> Which seems to work f...
``` mServ = ((MusicService.ServiceBinder)binder).getService(); ```
11,591,447
I want to add background music to my Android game, this needs to be pause able, resume able, etc. I have found this example: <http://www.codeproject.com/Articles/258176/Adding-Background-Music-to-Android-App> However the line ``` mServ = ((MusicService.ServiceBinderbinder).getService(); ``` Seems to kick up really...
2012/07/21
[ "https://Stackoverflow.com/questions/11591447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692410/" ]
After extensive looking, I have found this other question: [Playing BG Music Across Activities in Android](https://stackoverflow.com/questions/2097909/playing-bg-music-across-activities-in-android) Which points to this code: <http://www.rbgrn.net/content/307-light-racer-20-days-61-64-completion> Which seems to work f...
Try this ``` mServ = ((MusicService.ServiceBinder)binder).getService(); ``` Its working for me. Also Change getService() method in MusicService class as public method.
11,591,447
I want to add background music to my Android game, this needs to be pause able, resume able, etc. I have found this example: <http://www.codeproject.com/Articles/258176/Adding-Background-Music-to-Android-App> However the line ``` mServ = ((MusicService.ServiceBinderbinder).getService(); ``` Seems to kick up really...
2012/07/21
[ "https://Stackoverflow.com/questions/11591447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692410/" ]
After extensive looking, I have found this other question: [Playing BG Music Across Activities in Android](https://stackoverflow.com/questions/2097909/playing-bg-music-across-activities-in-android) Which points to this code: <http://www.rbgrn.net/content/307-light-racer-20-days-61-64-completion> Which seems to work f...
***Try to use*** ``` mServ = ((MusicService.ServiceBinder) binder).getService(); ``` with making getService() public ``` public class ServiceBinder extends Binder { public MusicService getService() { return MusicService.this; } } ```
11,591,447
I want to add background music to my Android game, this needs to be pause able, resume able, etc. I have found this example: <http://www.codeproject.com/Articles/258176/Adding-Background-Music-to-Android-App> However the line ``` mServ = ((MusicService.ServiceBinderbinder).getService(); ``` Seems to kick up really...
2012/07/21
[ "https://Stackoverflow.com/questions/11591447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692410/" ]
Try this ``` mServ = ((MusicService.ServiceBinder)binder).getService(); ``` Its working for me. Also Change getService() method in MusicService class as public method.
``` mServ = ((MusicService.ServiceBinder)binder).getService(); ```
11,591,447
I want to add background music to my Android game, this needs to be pause able, resume able, etc. I have found this example: <http://www.codeproject.com/Articles/258176/Adding-Background-Music-to-Android-App> However the line ``` mServ = ((MusicService.ServiceBinderbinder).getService(); ``` Seems to kick up really...
2012/07/21
[ "https://Stackoverflow.com/questions/11591447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692410/" ]
***Try to use*** ``` mServ = ((MusicService.ServiceBinder) binder).getService(); ``` with making getService() public ``` public class ServiceBinder extends Binder { public MusicService getService() { return MusicService.this; } } ```
``` mServ = ((MusicService.ServiceBinder)binder).getService(); ```
11,591,447
I want to add background music to my Android game, this needs to be pause able, resume able, etc. I have found this example: <http://www.codeproject.com/Articles/258176/Adding-Background-Music-to-Android-App> However the line ``` mServ = ((MusicService.ServiceBinderbinder).getService(); ``` Seems to kick up really...
2012/07/21
[ "https://Stackoverflow.com/questions/11591447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/692410/" ]
Try this ``` mServ = ((MusicService.ServiceBinder)binder).getService(); ``` Its working for me. Also Change getService() method in MusicService class as public method.
***Try to use*** ``` mServ = ((MusicService.ServiceBinder) binder).getService(); ``` with making getService() public ``` public class ServiceBinder extends Binder { public MusicService getService() { return MusicService.this; } } ```
20,086,374
When working on Laravel, we do query like this: ``` $user = DB::table('users')->where('name', 'John')->first(); ``` How can I view the generated sql query? This is something very important for debugging during the development. Thank you.
2013/11/20
[ "https://Stackoverflow.com/questions/20086374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1995781/" ]
According to [this answer](https://stackoverflow.com/questions/14536165/get-the-query-executed-in-laravel-3-4/14536215#14536215), you should be able to use this to get the last executed query : ``` $queries = DB::getQueryLog(); // gets a log of all executed queries $last_query = end($queries); // gets the last one ``...
You can also add this snippet: ``` Event::listen('illuminate.query', function($sql) { var_dump($sql); }); ``` It will output all queries being executed in your request.
20,086,374
When working on Laravel, we do query like this: ``` $user = DB::table('users')->where('name', 'John')->first(); ``` How can I view the generated sql query? This is something very important for debugging during the development. Thank you.
2013/11/20
[ "https://Stackoverflow.com/questions/20086374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1995781/" ]
According to [this answer](https://stackoverflow.com/questions/14536165/get-the-query-executed-in-laravel-3-4/14536215#14536215), you should be able to use this to get the last executed query : ``` $queries = DB::getQueryLog(); // gets a log of all executed queries $last_query = end($queries); // gets the last one ``...
Not a direct answer as other people have answered this but take a look at this composer package, it is very helpful and displays all of your queries and more. <https://github.com/barryvdh/laravel-debugbar>
168,973
I've been a Blender user for a few years at this point, and I finally just switched over to 2.82 after having used the version in my system's package repo for a while. Now, I can't find gosh darn anything and I'm starting to get frustrated. I can find the Materials window, and I can add a material. But I've been looki...
2020/03/06
[ "https://blender.stackexchange.com/questions/168973", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/89808/" ]
The texture button is here (not available in edit mode): [![enter image description here](https://i.stack.imgur.com/kh87c.jpg)](https://i.stack.imgur.com/kh87c.jpg) To add a new texture, click here: [![enter image description here](https://i.stack.imgur.com/wEAjO.jpg)](https://i.stack.imgur.com/wEAjO.jpg) I strongl...
This might not be your exact problem, but other's searching this problem may experience this. I found that when I added a new scene the texture tab is also missing. This is a known issue (<https://developer.blender.org/T73611>). The workaround suggested there (and worked for me in 3.2) is to add a mesh object and go i...
15,512,523
I'm using IDS 11.70. I want to be able to get the count of the number of columns in a temporary table so in 4gl/genero code I can have a function that puts the right number of question marks into a 'put cursor' statement. For example, want to replace this sort of code: ``` declare put_curs1 cursor for insert...
2013/03/19
[ "https://Stackoverflow.com/questions/15512523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1840734/" ]
The classic way to do it is to prepare 'SELECT \* FROM temptable', describe the statement, and get the column count from the description, and then free the prepared statement. That involves dropping down into ESQL/C, though...or most likely does. Untested code — with flabby to non-existent error checking: ``` int col...
FYI - If using 12.10 - Could create real instance of your temp table and get columns count from system tables. 1) CREATE TABLE yourtemp\_chck SELECT \* FROM yourtemp where 1=2; 2) Check sys tables for number of columns 3) Drop yourtemp\_chck Although I've not tried to create a real table from a temp one but does wor...
15,512,523
I'm using IDS 11.70. I want to be able to get the count of the number of columns in a temporary table so in 4gl/genero code I can have a function that puts the right number of question marks into a 'put cursor' statement. For example, want to replace this sort of code: ``` declare put_curs1 cursor for insert...
2013/03/19
[ "https://Stackoverflow.com/questions/15512523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1840734/" ]
I tested the code bellow with success over ifx 11.50 FC9. `WARNING:` I used an undocumented function. I don't know if is safe use it over production... How works: I "transform" the row to ROW datatype ; use a internal function called collectionoutput to convert this ROW to lvarchar and then count how much comma have...
FYI - If using 12.10 - Could create real instance of your temp table and get columns count from system tables. 1) CREATE TABLE yourtemp\_chck SELECT \* FROM yourtemp where 1=2; 2) Check sys tables for number of columns 3) Drop yourtemp\_chck Although I've not tried to create a real table from a temp one but does wor...
34,569,817
I execute an ajax request using `$.post`, this is my code: ``` $.post(postUrl, postData, function(response) { if(response.status == "SUCCESS") { updateConfirmFrame(); } else { return false; } }, 'json'); ``` now if the response return `SUCCESS` the code ...
2016/01/02
[ "https://Stackoverflow.com/questions/34569817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5194166/" ]
with jquery $(array1).filter(array2);
i use jquery for array operations and i'll edit one for your need and paste here, i hope this can help you: ``` var arr1 = ["01/01/2016","02/02/2015", "03/03/2014"]; var arr2 = ["01/01/2016", "02/02/2015"]; var diff = []; jQuery.grep(arr2, function(t) { if (jQuery.inArray(t, arr1) == -1) diff.push(t); }); al...
34,569,817
I execute an ajax request using `$.post`, this is my code: ``` $.post(postUrl, postData, function(response) { if(response.status == "SUCCESS") { updateConfirmFrame(); } else { return false; } }, 'json'); ``` now if the response return `SUCCESS` the code ...
2016/01/02
[ "https://Stackoverflow.com/questions/34569817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5194166/" ]
Try this : ``` for (var i = 0; i < firstArray.length; i++){ if (secondArray.indexOf(firstArray[i]) == -1){ // indexOf is -1 if not found firstArray.splice(i, 1); // Remove 1 value at index i i--; // To re-adjust the index value which is 1 less because of the splice } } ``` It may also be a bi...
with jquery $(array1).filter(array2);
34,569,817
I execute an ajax request using `$.post`, this is my code: ``` $.post(postUrl, postData, function(response) { if(response.status == "SUCCESS") { updateConfirmFrame(); } else { return false; } }, 'json'); ``` now if the response return `SUCCESS` the code ...
2016/01/02
[ "https://Stackoverflow.com/questions/34569817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5194166/" ]
Try this : ``` for (var i = 0; i < firstArray.length; i++){ if (secondArray.indexOf(firstArray[i]) == -1){ // indexOf is -1 if not found firstArray.splice(i, 1); // Remove 1 value at index i i--; // To re-adjust the index value which is 1 less because of the splice } } ``` It may also be a bi...
i use jquery for array operations and i'll edit one for your need and paste here, i hope this can help you: ``` var arr1 = ["01/01/2016","02/02/2015", "03/03/2014"]; var arr2 = ["01/01/2016", "02/02/2015"]; var diff = []; jQuery.grep(arr2, function(t) { if (jQuery.inArray(t, arr1) == -1) diff.push(t); }); al...
34,569,817
I execute an ajax request using `$.post`, this is my code: ``` $.post(postUrl, postData, function(response) { if(response.status == "SUCCESS") { updateConfirmFrame(); } else { return false; } }, 'json'); ``` now if the response return `SUCCESS` the code ...
2016/01/02
[ "https://Stackoverflow.com/questions/34569817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5194166/" ]
If you have access to `Set`: ``` function intersect(arr1, arr2){ var s = new Set(arr1); return arr2.filter(function(el){ return s.has(el); }); } ```
i use jquery for array operations and i'll edit one for your need and paste here, i hope this can help you: ``` var arr1 = ["01/01/2016","02/02/2015", "03/03/2014"]; var arr2 = ["01/01/2016", "02/02/2015"]; var diff = []; jQuery.grep(arr2, function(t) { if (jQuery.inArray(t, arr1) == -1) diff.push(t); }); al...
34,569,817
I execute an ajax request using `$.post`, this is my code: ``` $.post(postUrl, postData, function(response) { if(response.status == "SUCCESS") { updateConfirmFrame(); } else { return false; } }, 'json'); ``` now if the response return `SUCCESS` the code ...
2016/01/02
[ "https://Stackoverflow.com/questions/34569817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5194166/" ]
Try this : ``` for (var i = 0; i < firstArray.length; i++){ if (secondArray.indexOf(firstArray[i]) == -1){ // indexOf is -1 if not found firstArray.splice(i, 1); // Remove 1 value at index i i--; // To re-adjust the index value which is 1 less because of the splice } } ``` It may also be a bi...
If you have access to `Set`: ``` function intersect(arr1, arr2){ var s = new Set(arr1); return arr2.filter(function(el){ return s.has(el); }); } ```
33,958,242
I've developed a socket app (realtime) for Android. Everything was working fine until the Android 6 update with brings the "doze" mode. Is there a plugin that prevent from dozing? This renders my app useless since when the app goes in doze mode, the app cannot use the network connection anymore. I'm running a backgroun...
2015/11/27
[ "https://Stackoverflow.com/questions/33958242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/749657/" ]
use this cordova plugin to White listing an Android application programmatically from battery optimize settings To install ``` cordova plugin add https://github.com/thomas550i/cordova-plugin-doze-Optimize ``` Javascript code of usage ``` cordova.plugins.DozeOptimize.IsIgnoringBatteryOptimizations(function (respo...
There is no plugin that prevent from dozing But Users can manually configure the whitelist in Settings > Battery > Battery Optimization. Alternatively, the system provides ways for apps to ask users to whitelist them. An app can fire the ACTION\_IGNORE\_BATTERY\_OPTIMIZATION\_SETTINGS intent to take the user directly...
29,584,757
in C++ classes, if I have a constant function (In my understanding constant functions are classes that cannot change anyting in the class, hope this is true) for example a function like this ``` int output(int value) const ``` Am I allowed to call a function within this function remove that actually changes anythin...
2015/04/12
[ "https://Stackoverflow.com/questions/29584757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1335175/" ]
The answer is simple - no, you cannot. Every class method is a function that implicitly passes `this` as a parameter. When you declare a method as const, that means that it will actually pass `const this` to this function. It is both correct logically and syntactically not to call not const methods from const methods.
const instances can only call const functions. Say: ``` class YourClass { ... int output(int value) const; int regularMethod(); // Non-const ... }; ``` is your class with a const function. And the variables: ``` const YourClass obj1; YourClass obj2; ``` Here obj1 can call output method while it cant call regular...
29,584,757
in C++ classes, if I have a constant function (In my understanding constant functions are classes that cannot change anyting in the class, hope this is true) for example a function like this ``` int output(int value) const ``` Am I allowed to call a function within this function remove that actually changes anythin...
2015/04/12
[ "https://Stackoverflow.com/questions/29584757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1335175/" ]
The answer is simple - no, you cannot. Every class method is a function that implicitly passes `this` as a parameter. When you declare a method as const, that means that it will actually pass `const this` to this function. It is both correct logically and syntactically not to call not const methods from const methods.
The answer is NO. The long answer is perhaps YES, provided you use an abomination like this, via [`const_cast`](http://en.cppreference.com/w/cpp/language/const_cast)-ing `this` in the `const` calling function (but you have to make sure you invoke your function on non-`const` objects, otherwise it leads to undefined beh...
29,584,757
in C++ classes, if I have a constant function (In my understanding constant functions are classes that cannot change anyting in the class, hope this is true) for example a function like this ``` int output(int value) const ``` Am I allowed to call a function within this function remove that actually changes anythin...
2015/04/12
[ "https://Stackoverflow.com/questions/29584757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1335175/" ]
The answer is simple - no, you cannot. Every class method is a function that implicitly passes `this` as a parameter. When you declare a method as const, that means that it will actually pass `const this` to this function. It is both correct logically and syntactically not to call not const methods from const methods.
Every const function() is getting a `const this` pointer as a default parameter, so you cannot change a member variable of a class even if you try to call a non\_cost function from a const function and try to modify a member variable. So if you try to call a non const function from a const function, you will get comp...
29,584,757
in C++ classes, if I have a constant function (In my understanding constant functions are classes that cannot change anyting in the class, hope this is true) for example a function like this ``` int output(int value) const ``` Am I allowed to call a function within this function remove that actually changes anythin...
2015/04/12
[ "https://Stackoverflow.com/questions/29584757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1335175/" ]
const instances can only call const functions. Say: ``` class YourClass { ... int output(int value) const; int regularMethod(); // Non-const ... }; ``` is your class with a const function. And the variables: ``` const YourClass obj1; YourClass obj2; ``` Here obj1 can call output method while it cant call regular...
The answer is NO. The long answer is perhaps YES, provided you use an abomination like this, via [`const_cast`](http://en.cppreference.com/w/cpp/language/const_cast)-ing `this` in the `const` calling function (but you have to make sure you invoke your function on non-`const` objects, otherwise it leads to undefined beh...
29,584,757
in C++ classes, if I have a constant function (In my understanding constant functions are classes that cannot change anyting in the class, hope this is true) for example a function like this ``` int output(int value) const ``` Am I allowed to call a function within this function remove that actually changes anythin...
2015/04/12
[ "https://Stackoverflow.com/questions/29584757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1335175/" ]
Every const function() is getting a `const this` pointer as a default parameter, so you cannot change a member variable of a class even if you try to call a non\_cost function from a const function and try to modify a member variable. So if you try to call a non const function from a const function, you will get comp...
The answer is NO. The long answer is perhaps YES, provided you use an abomination like this, via [`const_cast`](http://en.cppreference.com/w/cpp/language/const_cast)-ing `this` in the `const` calling function (but you have to make sure you invoke your function on non-`const` objects, otherwise it leads to undefined beh...
5,481,902
Is an application server something like an additional layer of application servicing above a web server? Does an application server always have a web server as its core? What is the difference?
2011/03/30
[ "https://Stackoverflow.com/questions/5481902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376115/" ]
No,Application server does not contain web server... Read following articles... <http://www.answers.com/topic/application-server> <http://download.oracle.com/docs/cd/E19159-01/819-3671/ablat/index.html> Basically: **After the Web exploded in the mid-1990s, application servers became Web based.** Also following ...
> > While a Web server mainly deals with > sending HTML for display in a Web > browser, an application server > provides access to business logic for > use by client application programs. > > > Read [App server, Web server: What's the difference?](http://www.javaworld.com/javaworld/javaqa/2002-08/01-qa-0823-ap...
5,481,902
Is an application server something like an additional layer of application servicing above a web server? Does an application server always have a web server as its core? What is the difference?
2011/03/30
[ "https://Stackoverflow.com/questions/5481902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376115/" ]
Actually, with the explosion of the web, and in particular "web services", all modern App Servers can also function as Web Servers. For example, the current version of Tomcat includes built-in Web Server functionality so you no longer must run a separate Apache HTTP server. In the past, running separate dedicated Web S...
> > While a Web server mainly deals with > sending HTML for display in a Web > browser, an application server > provides access to business logic for > use by client application programs. > > > Read [App server, Web server: What's the difference?](http://www.javaworld.com/javaworld/javaqa/2002-08/01-qa-0823-ap...
5,481,902
Is an application server something like an additional layer of application servicing above a web server? Does an application server always have a web server as its core? What is the difference?
2011/03/30
[ "https://Stackoverflow.com/questions/5481902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/376115/" ]
No,Application server does not contain web server... Read following articles... <http://www.answers.com/topic/application-server> <http://download.oracle.com/docs/cd/E19159-01/819-3671/ablat/index.html> Basically: **After the Web exploded in the mid-1990s, application servers became Web based.** Also following ...
Actually, with the explosion of the web, and in particular "web services", all modern App Servers can also function as Web Servers. For example, the current version of Tomcat includes built-in Web Server functionality so you no longer must run a separate Apache HTTP server. In the past, running separate dedicated Web S...
6,595,238
I was under impression [Visual C++ 10 had built-in `static_assert`](http://msdn.microsoft.com/ru-ru/library/dd293588.aspx). However when I compile the following ``` void test() { static_assert( sizeof( char ) == 1, "" ); } ``` I get > > error C3861: 'static\_assert': identifier not found > > > What am I do...
2011/07/06
[ "https://Stackoverflow.com/questions/6595238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57428/" ]
> > I tried this, but didn't seem to work: > > > `str.replace(/<\/p><p>/g, "</p>,<p>");` > > > [`replace`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace) *returns a new string* with the result, it doesn't modify the string you called it on. So that would be: ``` str = s...
This works for me: ``` alert("Some </p><p> to replace".replace(/<\/p><p>/g, "</p>,<p>")); ```
6,595,238
I was under impression [Visual C++ 10 had built-in `static_assert`](http://msdn.microsoft.com/ru-ru/library/dd293588.aspx). However when I compile the following ``` void test() { static_assert( sizeof( char ) == 1, "" ); } ``` I get > > error C3861: 'static\_assert': identifier not found > > > What am I do...
2011/07/06
[ "https://Stackoverflow.com/questions/6595238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57428/" ]
My fault. It does work. I'd forgotten that I have ids in each p tag, so just needed to search for this: ``` /<\/p><p/g ``` Thanks for all the replies though!
This works for me: ``` alert("Some </p><p> to replace".replace(/<\/p><p>/g, "</p>,<p>")); ```
6,595,238
I was under impression [Visual C++ 10 had built-in `static_assert`](http://msdn.microsoft.com/ru-ru/library/dd293588.aspx). However when I compile the following ``` void test() { static_assert( sizeof( char ) == 1, "" ); } ``` I get > > error C3861: 'static\_assert': identifier not found > > > What am I do...
2011/07/06
[ "https://Stackoverflow.com/questions/6595238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57428/" ]
> > I tried this, but didn't seem to work: > > > `str.replace(/<\/p><p>/g, "</p>,<p>");` > > > [`replace`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace) *returns a new string* with the result, it doesn't modify the string you called it on. So that would be: ``` str = s...
Your code works just fine: <http://jsfiddle.net/eBkhR/>
6,595,238
I was under impression [Visual C++ 10 had built-in `static_assert`](http://msdn.microsoft.com/ru-ru/library/dd293588.aspx). However when I compile the following ``` void test() { static_assert( sizeof( char ) == 1, "" ); } ``` I get > > error C3861: 'static\_assert': identifier not found > > > What am I do...
2011/07/06
[ "https://Stackoverflow.com/questions/6595238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57428/" ]
My fault. It does work. I'd forgotten that I have ids in each p tag, so just needed to search for this: ``` /<\/p><p/g ``` Thanks for all the replies though!
Your code works just fine: <http://jsfiddle.net/eBkhR/>
6,595,238
I was under impression [Visual C++ 10 had built-in `static_assert`](http://msdn.microsoft.com/ru-ru/library/dd293588.aspx). However when I compile the following ``` void test() { static_assert( sizeof( char ) == 1, "" ); } ``` I get > > error C3861: 'static\_assert': identifier not found > > > What am I do...
2011/07/06
[ "https://Stackoverflow.com/questions/6595238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57428/" ]
> > I tried this, but didn't seem to work: > > > `str.replace(/<\/p><p>/g, "</p>,<p>");` > > > [`replace`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace) *returns a new string* with the result, it doesn't modify the string you called it on. So that would be: ``` str = s...
Strings in javascript are immutable. That is, the contents in a string cannot be modified. Therefore, when using `replace` method it cannot replace the content but it just returns a new string with the new contents. You would need to store the new string the in required variable. for example, ``` str = str.replace(/<...
6,595,238
I was under impression [Visual C++ 10 had built-in `static_assert`](http://msdn.microsoft.com/ru-ru/library/dd293588.aspx). However when I compile the following ``` void test() { static_assert( sizeof( char ) == 1, "" ); } ``` I get > > error C3861: 'static\_assert': identifier not found > > > What am I do...
2011/07/06
[ "https://Stackoverflow.com/questions/6595238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57428/" ]
> > I tried this, but didn't seem to work: > > > `str.replace(/<\/p><p>/g, "</p>,<p>");` > > > [`replace`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace) *returns a new string* with the result, it doesn't modify the string you called it on. So that would be: ``` str = s...
My fault. It does work. I'd forgotten that I have ids in each p tag, so just needed to search for this: ``` /<\/p><p/g ``` Thanks for all the replies though!
6,595,238
I was under impression [Visual C++ 10 had built-in `static_assert`](http://msdn.microsoft.com/ru-ru/library/dd293588.aspx). However when I compile the following ``` void test() { static_assert( sizeof( char ) == 1, "" ); } ``` I get > > error C3861: 'static\_assert': identifier not found > > > What am I do...
2011/07/06
[ "https://Stackoverflow.com/questions/6595238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57428/" ]
My fault. It does work. I'd forgotten that I have ids in each p tag, so just needed to search for this: ``` /<\/p><p/g ``` Thanks for all the replies though!
Strings in javascript are immutable. That is, the contents in a string cannot be modified. Therefore, when using `replace` method it cannot replace the content but it just returns a new string with the new contents. You would need to store the new string the in required variable. for example, ``` str = str.replace(/<...
13,743,920
We have central classes and functions in our big project to abstract from the actual platform types, e.g. mutex, file, thread etc. instead of having "fopen" everywhere in the code. While this is good, I would like to go even further and don't have any system includes in the header files (like `#include <windows.h>`), w...
2012/12/06
[ "https://Stackoverflow.com/questions/13743920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1844547/" ]
Option 1 using pointers is a bad idea. Use either `boost::scoped_ptr` or, if you can, [`std::unique_ptr`](http://herbsutter.com/elements-of-modern-c-style/). Option 2, as you implement it, should not be used. See [GotW #28: The Fast Pimpl Idiom](http://www.gotw.ca/gotw/028.htm). In C++11 however, this can be done corr...
Why even have an Implementation object? Your code will not just change on the same platform, you'll be using the same implementation on the platform that your currently using at the time. Define the interface in the header, and provide various \*.cpp files for the implementation for each platform you are targeting for....
84,313
I have an HP Envy dv7 with a dual boot setup of Win 8 and Fedora 18. On 07/22/2013 I updated all packages in Fedora 18 that had updates available. After a reboot, Fedora is now detecting that a second monitor is connected on the vga-2 port (according to `xrandr`) but I don't have a second monitor. Is there a way to p...
2013/07/24
[ "https://unix.stackexchange.com/questions/84313", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/43735/" ]
Not in a way which allows you to restore them. The normal way to backup AIX is to run a `mksysb`. You can then recover / install / build from the resulting file (via tape, DVD, network, etc.) Is there something specific you're trying to achieve?
Question is a bit ambiguous. Do you only mean a list of all [lpp,rpm,emgr] packages, or the contents of those packages? For the former case, that is quite easy to achieve but not really useful. For the latter case, if all the packages only contain files that are located within the rootvg and not within directories exc...
56,461,939
I'm trying to make a battleship game in which the game field buttons all start with the letter `A` and then a number. Now I want to count up the numbers but still be able to do basic button functions like `BackgroundImage`. What I'm doing now is just create a sting which adds the `A` with the number I receive from the...
2019/06/05
[ "https://Stackoverflow.com/questions/56461939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11604344/" ]
You are missing ``` .hiraola-banner_area-3 { flex-wrap: wrap; } ``` ```css .hiraola-banner_area-3 { padding-bottom: 60px; padding-top: 40px; display: flex; } @media only screen and (min-width: 0px) and (max-width: 767px) { .hiraola-banner_area-3 { flex-wrap: wrap; } .container_main1 { ...
Start by setting the width of the container div. Then you can set the width of the two divs to 50% for large screens and 100% for small screens. That way they will auto adjust when the viewport changes size.
56,461,939
I'm trying to make a battleship game in which the game field buttons all start with the letter `A` and then a number. Now I want to count up the numbers but still be able to do basic button functions like `BackgroundImage`. What I'm doing now is just create a sting which adds the `A` with the number I receive from the...
2019/06/05
[ "https://Stackoverflow.com/questions/56461939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11604344/" ]
You are missing ``` .hiraola-banner_area-3 { flex-wrap: wrap; } ``` ```css .hiraola-banner_area-3 { padding-bottom: 60px; padding-top: 40px; display: flex; } @media only screen and (min-width: 0px) and (max-width: 767px) { .hiraola-banner_area-3 { flex-wrap: wrap; } .container_main1 { ...
You can also use display:inline-block for big screen and display:block for small screen. Should get almost the same result but not using flex. ```css .hiraola-banner_area-3 { padding-bottom: 60px; padding-top: 40px; } .container_main1, .container_main2 {display:inline-block;} @media only screen and (min-wid...
19,059,544
How do I install the [GWT browser plugin for Chrome](https://chrome.google.com/webstore/detail/gwt-developer-plugin/jpjpnpmbddbjkfaccnmhnkdgjideieim)? It says > > This application is not supported on this computer. Installation has been disabled. > > > Has GWT been abandoned? I'm using Chrome Version 29.0.1547.7...
2013/09/27
[ "https://Stackoverflow.com/questions/19059544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148844/" ]
Solution: <https://code.google.com/p/google-web-toolkit/issues/detail?id=7778#c5> ``` Sweet, I just got the Dev Mode plugin to work on Chrome too, Windows 8. Here's what I did: 1. Make sure Chrome is pined to the task bar 2. Right click on the chrome icon>Properties>Shortcut 3. Add in target: --enable-easy-off-store...
Just set the compatibility mode of chrome to windows 7. Then it is possible to install the plugin and to use it.
51,342,369
So I am fairly new to machine learning and all and I am trying to create a python script to analyse a energy dataset of a computer. The script should in the end determine the different states of the computer (like idle, standby, working, etc...) and how much energy those states are using on average. And I was wonderin...
2018/07/14
[ "https://Stackoverflow.com/questions/51342369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10081929/" ]
I ran into a similar problem with my Android build on Cordova. The solution was to install a gradle plugin -- you might have the analogous for ionic. The Cordova plugin was: `cordova-android-support-gradle-release`
If you were trying to remove and re-add the plugin, doing it directly in the config.xml likely isn't the best way. Try these: ``` ionic cordova plugin remove call-number ionic cordova plugin add call-number ``` It's also not too uncommon to need to clear out other things occasionally with cordova build issues: * Re...
51,342,369
So I am fairly new to machine learning and all and I am trying to create a python script to analyse a energy dataset of a computer. The script should in the end determine the different states of the computer (like idle, standby, working, etc...) and how much energy those states are using on average. And I was wonderin...
2018/07/14
[ "https://Stackoverflow.com/questions/51342369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10081929/" ]
1. ionic cordova platforms remove android 2. ionic cordova plugin remove cordova-plugin-firebase 3. ionic cordova platforms add android
If you were trying to remove and re-add the plugin, doing it directly in the config.xml likely isn't the best way. Try these: ``` ionic cordova plugin remove call-number ionic cordova plugin add call-number ``` It's also not too uncommon to need to clear out other things occasionally with cordova build issues: * Re...
38,343,397
I tried to check if values exist in dataTable. With code: ``` bool lol = dtble.AsEnumerable().Any(l => array[0] == l.Field<String>("id")); ``` I need to add more condition to this code because I want to check more than one conditional. My conditional need to add in this Linq is: `array[1] == l.Field<String>("Name...
2016/07/13
[ "https://Stackoverflow.com/questions/38343397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9447110/" ]
You can use the Logical AND (`&&`) in LINQ to combine two conditions, Then your query will be like the following: ``` bool lol = dtble.AsEnumerable().Any(l => array[0] == l.Field<String>("id") && array[1] == l.Field<String>("Stunt")); ```
``` (LINQQUERY).AsEnumerable().Any(x => x.FieldName1 == (value) && x.FieldName2 == (value)); ```
38,343,397
I tried to check if values exist in dataTable. With code: ``` bool lol = dtble.AsEnumerable().Any(l => array[0] == l.Field<String>("id")); ``` I need to add more condition to this code because I want to check more than one conditional. My conditional need to add in this Linq is: `array[1] == l.Field<String>("Name...
2016/07/13
[ "https://Stackoverflow.com/questions/38343397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9447110/" ]
Now i got what you mean: So you want to match the id, check if the name starts with same word in both array and DataTable and check for matching Stunt. So do the following: ``` bool lol = (from dRow in dtble.AsEnumerable() where array[0] == dRow.Field<string>("id") && GetFirstWord(array[1]) ==...
``` (LINQQUERY).AsEnumerable().Any(x => x.FieldName1 == (value) && x.FieldName2 == (value)); ```
1,396,166
An enum structure declared in its own class is a member variable to the business logic class. That enum basically represents the state of that other class. Although I have revisited the issue several times, replacing, or getting rid of those case statements proves quite frustrating to me. Several business logic metho...
2009/09/08
[ "https://Stackoverflow.com/questions/1396166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/106467/" ]
you could include all three methods in an interface and have different implementations of that interface (one for each enum), and have this buisness class delegate the calls.. also for changing the state, have the return value from the operation be that common interface so that upon invoking these methods, the invokin...
To elaborate on my comment, and approach what I think rmn is talking about, you could do the following: ``` public interface MyInterface { operation1(property); operation2(property); operation3(property); } public enum MyEnum implements MyInterface { A { operation1(property) { //Do...
1,396,166
An enum structure declared in its own class is a member variable to the business logic class. That enum basically represents the state of that other class. Although I have revisited the issue several times, replacing, or getting rid of those case statements proves quite frustrating to me. Several business logic metho...
2009/09/08
[ "https://Stackoverflow.com/questions/1396166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/106467/" ]
you could include all three methods in an interface and have different implementations of that interface (one for each enum), and have this buisness class delegate the calls.. also for changing the state, have the return value from the operation be that common interface so that upon invoking these methods, the invokin...
As you may have guessed from the other responses, this is a common problem and has been codified into a refactoring by Martin Fowler. Take a look at the refactoring [Replace Conditional with Polymorphism](http://www.refactoring.com/catalog/replaceConditionalWithPolymorphism.html). There is also a similar codified refac...
1,396,166
An enum structure declared in its own class is a member variable to the business logic class. That enum basically represents the state of that other class. Although I have revisited the issue several times, replacing, or getting rid of those case statements proves quite frustrating to me. Several business logic metho...
2009/09/08
[ "https://Stackoverflow.com/questions/1396166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/106467/" ]
To elaborate on my comment, and approach what I think rmn is talking about, you could do the following: ``` public interface MyInterface { operation1(property); operation2(property); operation3(property); } public enum MyEnum implements MyInterface { A { operation1(property) { //Do...
As you may have guessed from the other responses, this is a common problem and has been codified into a refactoring by Martin Fowler. Take a look at the refactoring [Replace Conditional with Polymorphism](http://www.refactoring.com/catalog/replaceConditionalWithPolymorphism.html). There is also a similar codified refac...
58,663,665
i have a problem and tested a few examples i found on google but nothing works.. That is my code ``` INSERT INTO items (name, price, site, link, imagelink) SELECT * FROM (SELECT %s, %s, %s, %s, %s) AS tmp WHERE NOT EXISTS ( SELECT name FROM items WHERE n...
2019/11/01
[ "https://Stackoverflow.com/questions/58663665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12308170/" ]
I think you want the sum of transactions to be zero? See if this works: ``` SELECT MERCHANTS.MID, MERCHANTS.DBA_NAME, MERCHANTS.OPEN_DATE, SUM(TRANSACTIONS) as Transactions_Last_6_Months FROM [RESIDUAL_STAGE].[dbo].[BI_DATA_MAP_201906] INNER JOIN MERCHANTS ON BI_DATA_MAP_201906.MID = MERCHANTS.MID INNER JOIN LK_BI_...
> > I'm trying to return a list of individuals who have a total transaction count of zero over the past six months (in context, the MID list where TRANSACTIONS = 0 over the last six months). > > > I am going to ignore your query. The basic idea is: ``` select t.individual_id from transactions t group by t.indivi...
58,663,665
i have a problem and tested a few examples i found on google but nothing works.. That is my code ``` INSERT INTO items (name, price, site, link, imagelink) SELECT * FROM (SELECT %s, %s, %s, %s, %s) AS tmp WHERE NOT EXISTS ( SELECT name FROM items WHERE n...
2019/11/01
[ "https://Stackoverflow.com/questions/58663665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12308170/" ]
For conditions over aggregations (sum, avg, etc.), you should use `HAVING` instead of `WHERE` keyword. So remove this from your `WHERE` condition: ``` TRANSACTIONS = 0 ``` And replace it by (after your where condition): ``` HAVING SUM(TRANSACTIONS) = 0 ```
> > I'm trying to return a list of individuals who have a total transaction count of zero over the past six months (in context, the MID list where TRANSACTIONS = 0 over the last six months). > > > I am going to ignore your query. The basic idea is: ``` select t.individual_id from transactions t group by t.indivi...
13,363
I am working on a spectrum analyzing simulator, which is meant to compute and plot the FFT of a sine wave carrier signal of $16 Hz$. From my practicals with a spectrum analyzer, I know that the spike shows up on the $16Hz$ mark. But after computing my own FFT and passing the magnitude of the FFT to a plotter in `Matla...
2013/12/25
[ "https://dsp.stackexchange.com/questions/13363", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/7378/" ]
Generic FFTs use complex-valued input arrays and provide complex-valued output arrays, so they can differentiate positive and negative frequencies for complex-valued signals. For real-valued signals, which is what it sounds like your case may be, this means that the positive and negative frequencies are mirrors of each...
For a Spectrum Analysis using matlab FFT function you need get the first half values from your absolute FFT result and you leave to get two spikes, take a look in the [Nyquist Shannon sampling theorem](http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem). Maybe are you confusing about FFT size and Sa...
205,612
I am using enumerate together with the enumitem package. I have set up my code as per the MWE below. This puts the label and number to the left of the text. I am wondering it there a way to adapt this so as that the label and number appear above the text (with a line break) instead of to the left. For example I would ...
2014/10/11
[ "https://tex.stackexchange.com/questions/205612", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/54029/" ]
Here is a simple way, with the `stackengine` package. You can set the distance beteen label and body with `before=\setstackgap[S]{…}`: ``` \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{lipsum} % just for dummy text \usepackage{enumitem} \usepackage{stackengine} \begin{document} \begi...
I didn't see an easy way to use `enumitem` to make `enumerate` work this way (but Lucas was smarter!), so I thought that you had only two options: * Use existing formatting. For example, it wouldn't be that hard to do what you want using `\section` or `\subsection` commands, either by choosing a class that centres the...
205,612
I am using enumerate together with the enumitem package. I have set up my code as per the MWE below. This puts the label and number to the left of the text. I am wondering it there a way to adapt this so as that the label and number appear above the text (with a line break) instead of to the left. For example I would ...
2014/10/11
[ "https://tex.stackexchange.com/questions/205612", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/54029/" ]
Define a new list and a new align: ``` \documentclass{article} \usepackage{lipsum,showframe} %% showframe for demo \usepackage{enumitem} \SetLabelAlign{mycenter}{\strut\smash{\parbox[t]{\textwidth} {\centering#1}}% } \newlist{mylist}{enumerate}{1} \setlist[mylist]{...
I didn't see an easy way to use `enumitem` to make `enumerate` work this way (but Lucas was smarter!), so I thought that you had only two options: * Use existing formatting. For example, it wouldn't be that hard to do what you want using `\section` or `\subsection` commands, either by choosing a class that centres the...
205,612
I am using enumerate together with the enumitem package. I have set up my code as per the MWE below. This puts the label and number to the left of the text. I am wondering it there a way to adapt this so as that the label and number appear above the text (with a line break) instead of to the left. For example I would ...
2014/10/11
[ "https://tex.stackexchange.com/questions/205612", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/54029/" ]
Here is a simple way, with the `stackengine` package. You can set the distance beteen label and body with `before=\setstackgap[S]{…}`: ``` \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{lipsum} % just for dummy text \usepackage{enumitem} \usepackage{stackengine} \begin{document} \begi...
How about this (you can obviously tweak the vertical space in the definition): ``` \documentclass{article} \usepackage{lipsum} \usepackage[inline]{enumitem} \newenvironment{mylist}{% \begin{enumerate*}[% before={\\[12pt]},% label=\centerline{Article \arabic*:},% afterlabel={\\[12pt]},% itemjoin={\\[1...
205,612
I am using enumerate together with the enumitem package. I have set up my code as per the MWE below. This puts the label and number to the left of the text. I am wondering it there a way to adapt this so as that the label and number appear above the text (with a line break) instead of to the left. For example I would ...
2014/10/11
[ "https://tex.stackexchange.com/questions/205612", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/54029/" ]
Define a new list and a new align: ``` \documentclass{article} \usepackage{lipsum,showframe} %% showframe for demo \usepackage{enumitem} \SetLabelAlign{mycenter}{\strut\smash{\parbox[t]{\textwidth} {\centering#1}}% } \newlist{mylist}{enumerate}{1} \setlist[mylist]{...
How about this (you can obviously tweak the vertical space in the definition): ``` \documentclass{article} \usepackage{lipsum} \usepackage[inline]{enumitem} \newenvironment{mylist}{% \begin{enumerate*}[% before={\\[12pt]},% label=\centerline{Article \arabic*:},% afterlabel={\\[12pt]},% itemjoin={\\[1...
60,374,513
I have 2 data frames in R `DF1` is ``` ColA ColB observation 123 Text1 45 234 Text2 65 345 Text3 78 ``` `DF2` is ``` ColumnA ColumnB metric 123 Text1 7 123 Text2 65 345 Text1 102 ``` I want to replace the `observation` column of `DF1` with values of the `metric` column of `DF2` but only ...
2020/02/24
[ "https://Stackoverflow.com/questions/60374513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9548022/" ]
Here is a base R solution, using `merge` + `ifelse` ``` DF <- within(merge(DF1,DF2,by.x = c("ColA","ColB"),by.y = c("ColumnA","ColumnB"),all.x = TRUE), value <- ifelse(is.na(metric),observation,metric))[-(3:4)] ``` such that ``` > DF ColA ColB value 1 123 Text1 7 2 234 Text2 65 3 345 Text3...
Solution using `dplyr`: Since you did not provide a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610#5963610) I could not test the code... ``` library(dplyr) DF1 %>% left_join(DF2, by=("ColA"="ColumnA", "ColB"="ColumnB") %>% mutate(valu...
22,291,401
I've made a column chart for my gwt project, and I am having trouble finding a way to change colours of my columns. There is only 1 serie and I am looking to use what they call style roles. Now I know how to do this in javascript as it is shown [here](https://developers.google.com/chart/interactive/docs/gallery/columnc...
2014/03/10
[ "https://Stackoverflow.com/questions/22291401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113795/" ]
In order to get different colors, you should have different series. Try something like this (not tested) ``` private DataTable createTable() { DataTable data = DataTable.create(); data.addRows(4); data.addColumn(ColumnType.STRING, "Metal"); data.addColumn(ColumnType....
I haven't found any way having columns with different colors in a single series but I have tried a different way. **I have created multiple series as many as no of columns and now I can set different color for each series.** Visually it displays same to the end user. **Here is code:** ``` import com.google.gwt.cor...
22,291,401
I've made a column chart for my gwt project, and I am having trouble finding a way to change colours of my columns. There is only 1 serie and I am looking to use what they call style roles. Now I know how to do this in javascript as it is shown [here](https://developers.google.com/chart/interactive/docs/gallery/columnc...
2014/03/10
[ "https://Stackoverflow.com/questions/22291401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113795/" ]
In order to get different colors, you should have different series. Try something like this (not tested) ``` private DataTable createTable() { DataTable data = DataTable.create(); data.addRows(4); data.addColumn(ColumnType.STRING, "Metal"); data.addColumn(ColumnType....
It's worth noting there seems to be a newer project that wraps this for GWT: <https://code.google.com/p/gwt-charts/>, this allows roles to be set up quite easily, so per-bar colours, tooltips etc... are pretty straightforward.
22,291,401
I've made a column chart for my gwt project, and I am having trouble finding a way to change colours of my columns. There is only 1 serie and I am looking to use what they call style roles. Now I know how to do this in javascript as it is shown [here](https://developers.google.com/chart/interactive/docs/gallery/columnc...
2014/03/10
[ "https://Stackoverflow.com/questions/22291401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113795/" ]
In order to get different colors, you should have different series. Try something like this (not tested) ``` private DataTable createTable() { DataTable data = DataTable.create(); data.addRows(4); data.addColumn(ColumnType.STRING, "Metal"); data.addColumn(ColumnType....
In Server side you can use something like ``` List<ColumnDescription> cd = new ArrayList<ColumnDescription>(); cd.add(new ColumnDescription("status", ValueType.TEXT, "STATUS")); cd.add(new ColumnDescription("count", ValueType.NUMBER, "COUNT")); ColumnDescription c = new ColumnDescriptio...
22,291,401
I've made a column chart for my gwt project, and I am having trouble finding a way to change colours of my columns. There is only 1 serie and I am looking to use what they call style roles. Now I know how to do this in javascript as it is shown [here](https://developers.google.com/chart/interactive/docs/gallery/columnc...
2014/03/10
[ "https://Stackoverflow.com/questions/22291401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113795/" ]
In order to get different colors, you should have different series. Try something like this (not tested) ``` private DataTable createTable() { DataTable data = DataTable.create(); data.addRows(4); data.addColumn(ColumnType.STRING, "Metal"); data.addColumn(ColumnType....
I figured out a way to extend the DataTable and include a style column with this: ``` public class StyledDataTable extends DataTable{ protected StyledDataTable(){} public final native void addStyleColumn()/*-{ this.addColumn({type: 'string', role: 'style'}); }-*/; } ``` Then instantiate your table like th...
22,291,401
I've made a column chart for my gwt project, and I am having trouble finding a way to change colours of my columns. There is only 1 serie and I am looking to use what they call style roles. Now I know how to do this in javascript as it is shown [here](https://developers.google.com/chart/interactive/docs/gallery/columnc...
2014/03/10
[ "https://Stackoverflow.com/questions/22291401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1113795/" ]
In order to get different colors, you should have different series. Try something like this (not tested) ``` private DataTable createTable() { DataTable data = DataTable.create(); data.addRows(4); data.addColumn(ColumnType.STRING, "Metal"); data.addColumn(ColumnType....
I would like to extend working answer provided by **garagebrewer**. This is the full specs of Bar customization provided by Google: <https://developers.google.com/chart/interactive/docs/gallery/barchart#coloring-bars> First of all, what we need to do is to create a class. Let's use following name (as **garagebrewer**...
5,227,245
Is there a way to "flatten" nested modules so that all of their methods can be used when extending another class or module? For example: ``` class User extend UserStats end module UserStats module Current def active where('status = "active"') end end end ``` I want to be able to extend UserSta...
2011/03/08
[ "https://Stackoverflow.com/questions/5227245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/184733/" ]
Why not just `extend UserStats::Current` ?
Do you mean something like this? ``` module UserStats def self.extended(klass) klass.send(:extend, Current) end module Current def active puts "test" end end end class User extend ::UserStats end puts User.active ```
51,617,309
**More Details:** For this problem, I'm specifically looking for the fastest way to do this, in general and specifically in c#. I don't necessarily mean "theoretical" fastest/algorithmic, instead I'm looking for practical implementation speed. In this specific situation, the arrays only have like 1000 elements each, wh...
2018/07/31
[ "https://Stackoverflow.com/questions/51617309", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7130435/" ]
Iterate each array item using a foreach loop. ``` foreach(string dataString in firstData) { string[] temp = dataString.Split(':') //do something with the new array here } ```
I guess this is what you want, but I'm not sure. ``` var secondData = firstData.Select(str => str.Split(':')); ```
7,805,086
I'm trying to create an application which should help distribute work to employees or volunteers on a irregular time schedule based on their availabilities. Anyway, here are my models and the relations between them : ``` Users hasMany Jobs Jobs belongTo Users Users hasMany Availabilities Availabilities belongTo User...
2011/10/18
[ "https://Stackoverflow.com/questions/7805086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1000734/" ]
I solved my problem using a simple trick. I created a web user control using a checkbox and invisible link button. ``` <asp:CheckBox ID="cbSelector" runat="server" AutoPostBack="true" /> <asp:LinkButton ID="btnHiddenCheckBox" runat="server" Visible="false" CommandName="Select"></asp:LinkButton> ``` in the code behin...
The same could be achieved using `OnCheckChanged` event. You can find out what the `RepeaterItem` is to be able to access controls in the same `RepeaterItem` --- ALternatively, see this [SO question](https://stackoverflow.com/questions/3566979/checkbox-onclick-itemcommand-in-repeater-or-datalist) for a solution on h...
7,805,086
I'm trying to create an application which should help distribute work to employees or volunteers on a irregular time schedule based on their availabilities. Anyway, here are my models and the relations between them : ``` Users hasMany Jobs Jobs belongTo Users Users hasMany Availabilities Availabilities belongTo User...
2011/10/18
[ "https://Stackoverflow.com/questions/7805086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1000734/" ]
I solved my problem using a simple trick. I created a web user control using a checkbox and invisible link button. ``` <asp:CheckBox ID="cbSelector" runat="server" AutoPostBack="true" /> <asp:LinkButton ID="btnHiddenCheckBox" runat="server" Visible="false" CommandName="Select"></asp:LinkButton> ``` in the code behin...
Patrik I am going to suggest you something completely different, use `JQuery` and get this done via Ajax so to give the users way smoother experience. there is a nice article with a step by step here: [ASP.Net CheckBox and JQuery](http://elegantcode.com/2009/02/02/aspnet-checkbox-and-jquery/) everything is better tha...
3,372,659
I'm trying to solve the following problem: Given an input of, say, ``` 0000000000000000 0011111111110000 0011111111110000 0011111111110000 0000000000000000 0000000111111110 0000000111111110 0000000000000000 ``` I need to find the width and height of all rectangles in the field. The input is actually a single column...
2010/07/30
[ "https://Stackoverflow.com/questions/3372659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84041/" ]
Collect the transition points (from a 1 to a 0 or vice-versa) as you're scanning, then figure the length and width either directly from there, or from the convex hull of each object. If rectangles can overlap, then you'll have bigger issues.
I posed this question to a friend, and he suggested: 1. When seeing a 1 for the first time, store it as a new shape. Flood fill it to the right, and add those points to the same shape. 2. Any input pixel that is'nt in a shape now is a new shape. Do the same flood fill. 3. On the next input column, flood again from the...
3,372,659
I'm trying to solve the following problem: Given an input of, say, ``` 0000000000000000 0011111111110000 0011111111110000 0011111111110000 0000000000000000 0000000111111110 0000000111111110 0000000000000000 ``` I need to find the width and height of all rectangles in the field. The input is actually a single column...
2010/07/30
[ "https://Stackoverflow.com/questions/3372659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84041/" ]
Collect the transition points (from a 1 to a 0 or vice-versa) as you're scanning, then figure the length and width either directly from there, or from the convex hull of each object. If rectangles can overlap, then you'll have bigger issues.
I'd take following steps: 1. get all columns together in a matrix (this is needed for proper filtering) 2. now apply a filter (need to google for it a bit) to sharpen edges and corners 3. create some structure to hold data for next steps (this can have many different solutions, choose your favorite and/or optimal) 4. ...
3,372,659
I'm trying to solve the following problem: Given an input of, say, ``` 0000000000000000 0011111111110000 0011111111110000 0011111111110000 0000000000000000 0000000111111110 0000000111111110 0000000000000000 ``` I need to find the width and height of all rectangles in the field. The input is actually a single column...
2010/07/30
[ "https://Stackoverflow.com/questions/3372659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84041/" ]
I'd take following steps: 1. get all columns together in a matrix (this is needed for proper filtering) 2. now apply a filter (need to google for it a bit) to sharpen edges and corners 3. create some structure to hold data for next steps (this can have many different solutions, choose your favorite and/or optimal) 4. ...
I posed this question to a friend, and he suggested: 1. When seeing a 1 for the first time, store it as a new shape. Flood fill it to the right, and add those points to the same shape. 2. Any input pixel that is'nt in a shape now is a new shape. Do the same flood fill. 3. On the next input column, flood again from the...
327,531
I have a fairly large spreadsheet and the dates column hasn't been locked down with an input mask/format and users have been using an incorrect dating scheme. Users are inputting dates as Apr 1/11 when they are supposed to be 1-Apr-11. How could I go about using regex in excel to fix these values? This isn't just for ...
2011/08/24
[ "https://superuser.com/questions/327531", "https://superuser.com", "https://superuser.com/users/48198/" ]
looking at the .png in your comment to Dave, and assuming that the users were consistent in their input, the following should work. Put this into an empty cell ``` =DATEVALUE(SUBSTITUTE(A1644,"/",", ")) ``` and then apply a date format to the results.
Excel stores dates as numeric values rather than strings. If you want to display them as 1-Apr-11, you shouldn't have to use a regex at all; just apply the desired date format to that column (`d-mmm-yy` in this case).
3,670,127
Well, I'm trying to build a small python prgram with a SocketServer that is supposed to send messages it receives to all connected clients. I'm stuck, I don't know how to store clients on the serverside, and I don't know how to send to multiple clients. Oh and, my program fails everytime more then 1 client connects, an...
2010/09/08
[ "https://Stackoverflow.com/questions/3670127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/442660/" ]
You want to look at [asyncore](http://docs.python.org/library/asyncore.html) here. The socket operations you're calling on the client side are blocking (don't return until some data is received or a timeout occurs) which makes it hard to listen for messages sent from the host and let the client instances enqueue data t...
why use SocketServer? a simple client doesn't meet your needs? ``` import socket HOST = '' PORT = 8000 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind((HOST, PORT)) sock.listen(5) while True: conn, addr = sock.accept() print 'connecting to', addr while True: data = conn.recv(102...
3,670,127
Well, I'm trying to build a small python prgram with a SocketServer that is supposed to send messages it receives to all connected clients. I'm stuck, I don't know how to store clients on the serverside, and I don't know how to send to multiple clients. Oh and, my program fails everytime more then 1 client connects, an...
2010/09/08
[ "https://Stackoverflow.com/questions/3670127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/442660/" ]
You want to look at [asyncore](http://docs.python.org/library/asyncore.html) here. The socket operations you're calling on the client side are blocking (don't return until some data is received or a timeout occurs) which makes it hard to listen for messages sent from the host and let the client instances enqueue data t...
To take multiple clients simultaneously, you will have to add `SocketServer.ForkingMixIn` or `ThreadingMixIn`.
3,670,127
Well, I'm trying to build a small python prgram with a SocketServer that is supposed to send messages it receives to all connected clients. I'm stuck, I don't know how to store clients on the serverside, and I don't know how to send to multiple clients. Oh and, my program fails everytime more then 1 client connects, an...
2010/09/08
[ "https://Stackoverflow.com/questions/3670127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/442660/" ]
You want to look at [asyncore](http://docs.python.org/library/asyncore.html) here. The socket operations you're calling on the client side are blocking (don't return until some data is received or a timeout occurs) which makes it hard to listen for messages sent from the host and let the client instances enqueue data t...
You can use [`socketserver`](https://docs.python.org/3/library/socketserver.html) to broadcast messages to all connected clients. However, the ability is not built into the code and will need to be implemented by extending some of the classes already provided. In the following example, this is implemented using the `Th...
3,670,127
Well, I'm trying to build a small python prgram with a SocketServer that is supposed to send messages it receives to all connected clients. I'm stuck, I don't know how to store clients on the serverside, and I don't know how to send to multiple clients. Oh and, my program fails everytime more then 1 client connects, an...
2010/09/08
[ "https://Stackoverflow.com/questions/3670127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/442660/" ]
You can use [`socketserver`](https://docs.python.org/3/library/socketserver.html) to broadcast messages to all connected clients. However, the ability is not built into the code and will need to be implemented by extending some of the classes already provided. In the following example, this is implemented using the `Th...
why use SocketServer? a simple client doesn't meet your needs? ``` import socket HOST = '' PORT = 8000 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind((HOST, PORT)) sock.listen(5) while True: conn, addr = sock.accept() print 'connecting to', addr while True: data = conn.recv(102...
3,670,127
Well, I'm trying to build a small python prgram with a SocketServer that is supposed to send messages it receives to all connected clients. I'm stuck, I don't know how to store clients on the serverside, and I don't know how to send to multiple clients. Oh and, my program fails everytime more then 1 client connects, an...
2010/09/08
[ "https://Stackoverflow.com/questions/3670127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/442660/" ]
You can use [`socketserver`](https://docs.python.org/3/library/socketserver.html) to broadcast messages to all connected clients. However, the ability is not built into the code and will need to be implemented by extending some of the classes already provided. In the following example, this is implemented using the `Th...
To take multiple clients simultaneously, you will have to add `SocketServer.ForkingMixIn` or `ThreadingMixIn`.