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
22,423,274
My problem is that after I launch my app on emulator, it writes "unfortunately, appname has stopped". Eclipse doesnt show that there are any mistakes. I know I can somehow fix them using LogCat, but unfortunately Im totally new to eclipse and Im not sure how exactly to do it. So tell me plese what are my mistakes, and ...
2014/03/15
[ "https://Stackoverflow.com/questions/22423274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3389712/" ]
``` ComponentInfo{com.gosha.bux/com.gosha.bux.MainActivity}: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button ``` Solution 1: Replace Button with ImageButton ``` ImageButton first = (ImageButton)findViewById(R.id.button1); ``` Solution 2: In your Layout change ImageB...
If you want `ImageButton` then change- ``` ImageButton first; first = (ImageButton) findViewById(R.id.button1); ``` If you want simple Button then change- `ImageButton` into `Button` in your xml file.
22,423,274
My problem is that after I launch my app on emulator, it writes "unfortunately, appname has stopped". Eclipse doesnt show that there are any mistakes. I know I can somehow fix them using LogCat, but unfortunately Im totally new to eclipse and Im not sure how exactly to do it. So tell me plese what are my mistakes, and ...
2014/03/15
[ "https://Stackoverflow.com/questions/22423274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3389712/" ]
If you want `ImageButton` then change- ``` ImageButton first; first = (ImageButton) findViewById(R.id.button1); ``` If you want simple Button then change- `ImageButton` into `Button` in your xml file.
try: ``` ImageButton first = (ImageButton)findViewById(R.id.button1); ``` If this doesnt work try to refresh your project.
22,423,274
My problem is that after I launch my app on emulator, it writes "unfortunately, appname has stopped". Eclipse doesnt show that there are any mistakes. I know I can somehow fix them using LogCat, but unfortunately Im totally new to eclipse and Im not sure how exactly to do it. So tell me plese what are my mistakes, and ...
2014/03/15
[ "https://Stackoverflow.com/questions/22423274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3389712/" ]
If you want `ImageButton` then change- ``` ImageButton first; first = (ImageButton) findViewById(R.id.button1); ``` If you want simple Button then change- `ImageButton` into `Button` in your xml file.
``` java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gosha.bux/com.gosha.bux.MainActivity}: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button ``` suggests that you're casting an `ImageButton` to a `Button`. Is it possible that your `R.id.button1` is...
22,423,274
My problem is that after I launch my app on emulator, it writes "unfortunately, appname has stopped". Eclipse doesnt show that there are any mistakes. I know I can somehow fix them using LogCat, but unfortunately Im totally new to eclipse and Im not sure how exactly to do it. So tell me plese what are my mistakes, and ...
2014/03/15
[ "https://Stackoverflow.com/questions/22423274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3389712/" ]
If you want `ImageButton` then change- ``` ImageButton first; first = (ImageButton) findViewById(R.id.button1); ``` If you want simple Button then change- `ImageButton` into `Button` in your xml file.
change this code ``` Button first; setContentView(R.layout.activity_main); first = (Button)findViewById(R.id.button1); ``` to ``` ImageButton first; setContentView(R.layout.activity_main); first = (ImageButton)findViewById(R.id.button1); ```
157,525
So this is not my computer, but my girlfriends. She was doing thesis work in the library when all of a sudden the screen to her Macbook began to malfunction. At the point it is at now, whenever it is booted up, it makes the normal booting sound yet the screen is completely black with gray bars in the center. The bars s...
2014/11/21
[ "https://apple.stackexchange.com/questions/157525", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/101754/" ]
There is a small possibility that the video cable is mis-seated and simply unplugging it and re-plugging it in might help. ifixit.com can help you with the take-apart. It is not difficult, just make sure you ground yourself and disconnect the battery before touching anything. Has the machine been dropped? Has anything...
Just wanted to add, don't forget that you have warranty on your device... If it is a retina display MBP I'm guessing it's not overly old, so may still be within the limited warranty period (even if it's not in warranty it's likely Apple will still help you) — especially seeing as you said that there is no accidental da...
157,525
So this is not my computer, but my girlfriends. She was doing thesis work in the library when all of a sudden the screen to her Macbook began to malfunction. At the point it is at now, whenever it is booted up, it makes the normal booting sound yet the screen is completely black with gray bars in the center. The bars s...
2014/11/21
[ "https://apple.stackexchange.com/questions/157525", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/101754/" ]
There is a small possibility that the video cable is mis-seated and simply unplugging it and re-plugging it in might help. ifixit.com can help you with the take-apart. It is not difficult, just make sure you ground yourself and disconnect the battery before touching anything. Has the machine been dropped? Has anything...
1. do an SMC reset 2. see if it'll drive external display ok. If it is good on external display, then it's likely the LCD or the LVDS cable (most likely).. it could also be the connection at the logic board (cheapest point to check first, but BE VERY CAREFUL - - easy connector to bend/break, and very expensive if you ...
121,992
This past summer, I worked a normal summer job and received a W2 form. However, I have also been tutoring two fellow students at the university I attend. They have been paying me "informally", eg they simply gave me dollar bills at the end of our tutoring sessions. I've made a total of $458 this way. My question is: h...
2020/03/24
[ "https://money.stackexchange.com/questions/121992", "https://money.stackexchange.com", "https://money.stackexchange.com/users/95339/" ]
Let’s start with your last question first: > > Do I even need to report it? > > > Yes, you are supposed to report it, as this is considered income. It was not simply a gift, because you did do some work in exchange for the money. Having said that, I will point out that, because it was all in cash, it is unlikely ...
Ben Miller's answer is good, but for completeness, I will simply note that if any of your students had paid you more than $600, they would be legally required to report that on a 1099-MISC, per [IRS rules](https://www.irs.gov/pub/irs-pdf/i1099msc.pdf). Of course, many folks don't do this, especially if the amount is no...
121,992
This past summer, I worked a normal summer job and received a W2 form. However, I have also been tutoring two fellow students at the university I attend. They have been paying me "informally", eg they simply gave me dollar bills at the end of our tutoring sessions. I've made a total of $458 this way. My question is: h...
2020/03/24
[ "https://money.stackexchange.com/questions/121992", "https://money.stackexchange.com", "https://money.stackexchange.com/users/95339/" ]
Let’s start with your last question first: > > Do I even need to report it? > > > Yes, you are supposed to report it, as this is considered income. It was not simply a gift, because you did do some work in exchange for the money. Having said that, I will point out that, because it was all in cash, it is unlikely ...
It is not a smorgasboard. Your facts and circumstances decide which you must do. Based on yours: Pretend you got a 1099-MISC for that income. File Schedule C. ------------------------------------------------------------- And you report it exactly the same as *if you had* gotten a 1099-MISC. **This means you must go t...
121,992
This past summer, I worked a normal summer job and received a W2 form. However, I have also been tutoring two fellow students at the university I attend. They have been paying me "informally", eg they simply gave me dollar bills at the end of our tutoring sessions. I've made a total of $458 this way. My question is: h...
2020/03/24
[ "https://money.stackexchange.com/questions/121992", "https://money.stackexchange.com", "https://money.stackexchange.com/users/95339/" ]
It is not a smorgasboard. Your facts and circumstances decide which you must do. Based on yours: Pretend you got a 1099-MISC for that income. File Schedule C. ------------------------------------------------------------- And you report it exactly the same as *if you had* gotten a 1099-MISC. **This means you must go t...
Ben Miller's answer is good, but for completeness, I will simply note that if any of your students had paid you more than $600, they would be legally required to report that on a 1099-MISC, per [IRS rules](https://www.irs.gov/pub/irs-pdf/i1099msc.pdf). Of course, many folks don't do this, especially if the amount is no...
28,911,342
I have a flask app in which I have an restful api which I am trying to call through a remote server. **init** File :- ``` from flask.ext import restful from flask.ext.cors import CORS app = create_app(__name__) app.config['CORS_HEADERS'] = 'Content-Type' cors = CORS(app, resorces={r'/d/<string:d_name>': {"origins": ...
2015/03/07
[ "https://Stackoverflow.com/questions/28911342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2570342/" ]
Problem is with resources definition and you only can use regex for the resources You need something like this or any other valid regex : ``` cors = CORS(app, resorces={r'/d/*': {"origins": '*'}}) ```
Ok. The issue is I was using ``` $.ajax({ async: false, type: 'GET', url: 'http://localhost:8080/d/'+d_name, success: function(data) { alert(data); ...
28,911,342
I have a flask app in which I have an restful api which I am trying to call through a remote server. **init** File :- ``` from flask.ext import restful from flask.ext.cors import CORS app = create_app(__name__) app.config['CORS_HEADERS'] = 'Content-Type' cors = CORS(app, resorces={r'/d/<string:d_name>': {"origins": ...
2015/03/07
[ "https://Stackoverflow.com/questions/28911342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2570342/" ]
Problem is with resources definition and you only can use regex for the resources You need something like this or any other valid regex : ``` cors = CORS(app, resorces={r'/d/*': {"origins": '*'}}) ```
The problem is with this statement in your code: `cors = CORS(app, resorces={r'/d/<string:d_name>': {"origins": '*'}})` From the documentation: <http://flask-cors.corydolphin.com/en/latest/api.html?highlight=origin#flask_cors.cross_origin> `flask_cors.cross_origin(*args, **kwargs) The origin, or list of origins to a...
48,277,723
I am trying to display the documents from my MongoDb collection over my Angular UI using MEAN STACK with Angular 4 (I am new to this technology) Html code: Admin.component.html ``` <div class="table"> <table> <thead> <tr> <th>TrainingName</th> ...
2018/01/16
[ "https://Stackoverflow.com/questions/48277723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9186499/" ]
Your code should remain that way: ``` selected_services = forms.CharField(label="Selected_services *", widget=forms.Textarea()) ``` Defining the TextArea widget becomes a TextField and the max\_length attribute is not required
Only `models.CharField` requires `max_length`. You can remove it from your `forms.CharField`. Apart from that your current code looks fine. The `TextArea` is the right widget to use.
48,277,723
I am trying to display the documents from my MongoDb collection over my Angular UI using MEAN STACK with Angular 4 (I am new to this technology) Html code: Admin.component.html ``` <div class="table"> <table> <thead> <tr> <th>TrainingName</th> ...
2018/01/16
[ "https://Stackoverflow.com/questions/48277723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9186499/" ]
Only `models.CharField` requires `max_length`. You can remove it from your `forms.CharField`. Apart from that your current code looks fine. The `TextArea` is the right widget to use.
`max_length` property doesn't appear to have an upper limit. I've checked the [source code](https://docs.djangoproject.com/en/dev/_modules/django/db/models/fields/#TextField) and [this forms documentation](https://docs.djangoproject.com/en/2.0/ref/forms/fields/) So you might wanna try using `sys.maxint` (python 2) or...
48,277,723
I am trying to display the documents from my MongoDb collection over my Angular UI using MEAN STACK with Angular 4 (I am new to this technology) Html code: Admin.component.html ``` <div class="table"> <table> <thead> <tr> <th>TrainingName</th> ...
2018/01/16
[ "https://Stackoverflow.com/questions/48277723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9186499/" ]
Your code should remain that way: ``` selected_services = forms.CharField(label="Selected_services *", widget=forms.Textarea()) ``` Defining the TextArea widget becomes a TextField and the max\_length attribute is not required
`max_length` property doesn't appear to have an upper limit. I've checked the [source code](https://docs.djangoproject.com/en/dev/_modules/django/db/models/fields/#TextField) and [this forms documentation](https://docs.djangoproject.com/en/2.0/ref/forms/fields/) So you might wanna try using `sys.maxint` (python 2) or...
514,060
I need to connect to a MySQL database on a server to which I do not have access through the firewall. I do however have SSH access to another server which is allowed through the firewall on my target server. I have SSH'd into the latter (let's say host1) and then I am attempting to execute the following command: ``` ...
2013/06/07
[ "https://serverfault.com/questions/514060", "https://serverfault.com", "https://serverfault.com/users/176955/" ]
You are misunderstanding the error, it is saying that the user `username` connecting from `host1` was denied access. The error comes from `host2`.
The error is actually saying "You're trying to use `username` **from** `host1`". You'll need to add permissions for `username` on `host1`. Can you post `SHOW GRANTS FOR 'username'` from while logged into MySQL as root on `host2`? Edit: Ninja'd :)
514,060
I need to connect to a MySQL database on a server to which I do not have access through the firewall. I do however have SSH access to another server which is allowed through the firewall on my target server. I have SSH'd into the latter (let's say host1) and then I am attempting to execute the following command: ``` ...
2013/06/07
[ "https://serverfault.com/questions/514060", "https://serverfault.com", "https://serverfault.com/users/176955/" ]
You are misunderstanding the error, it is saying that the user `username` connecting from `host1` was denied access. The error comes from `host2`.
I had this error because of the wrong password I used for the database. This was the case for the Version Version of mysql is 5.1.61. So ensure the password of your database is correct.
514,060
I need to connect to a MySQL database on a server to which I do not have access through the firewall. I do however have SSH access to another server which is allowed through the firewall on my target server. I have SSH'd into the latter (let's say host1) and then I am attempting to execute the following command: ``` ...
2013/06/07
[ "https://serverfault.com/questions/514060", "https://serverfault.com", "https://serverfault.com/users/176955/" ]
The error is actually saying "You're trying to use `username` **from** `host1`". You'll need to add permissions for `username` on `host1`. Can you post `SHOW GRANTS FOR 'username'` from while logged into MySQL as root on `host2`? Edit: Ninja'd :)
I had this error because of the wrong password I used for the database. This was the case for the Version Version of mysql is 5.1.61. So ensure the password of your database is correct.
5,810
I'm using Spatialite (2.3.1, binary from the website) on Windows XP via Java ("Xerial Driver"). SQLite loads fine, also Spatialite seems to be loading successfully. I can even do SELECT-statements. But I can't do SELECT's on geometries. E.g. ``` SELECT link_id, SRID(GEOMETRY), AsText(GEOMETRY) FROM streets1 ``` retu...
2011/02/04
[ "https://gis.stackexchange.com/questions/5810", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/1804/" ]
Found the solution: The tables are in FDO-Ogr format, you can see that when opening the db with spatialite-gui. Then you need to do: ``` SELECT AutoFDOStart(); ``` and ``` SELECT link_id, SRID(GEOMETRY), AsText(GEOMETRY) FROM fdo_streets1 ``` instead of ``` SELECT link_id, SRID(GEOMETRY), AsText(GEOMETRY) FROM ...
returning NULL and not an error means that the columns are empty or GEOMETRY is in WKB or WKT format and not in SPATIALITE. WKB is the default for ogr2ogr, see [here](http://www.gdal.org/ogr/drv_sqlite.html), so it's probably the problem. Solutions: 1)use: `SELECT AsText(GeomFromWKB(GEOMETRY))` or 2)put layer c...
31,398,386
Just playing around with facebook api but couldn't get the basic setup.Downloaded the sdk from facebook[SDK](https://github.com/facebook/facebook-php-sdk-v4). I cant seem to get the access token working ``` $fb = new Facebook\Facebook([ 'app_id' => 'keyxx', 'app_secret' => 'key', 'default_graph_version' => 'v2.4...
2015/07/14
[ "https://Stackoverflow.com/questions/31398386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4246181/" ]
If you allocate memory with `buffer = new char[length]` you should free memory with `delete[] buffer;` But there are other problems in your code. Why don't you want to simply use `std::string` ? It will certainly be more efficient... I can't compile your code either (I don't use windows) but I have issues with `strcp...
``` Buffer = new char[strlen(CopySource.Buffer + 1)]; ``` should be: ``` Buffer = new char[strlen(CopySource.Buffer) + 1]; ``` In each case where it shows up. This is in addition to the problem that @PinkFloyd pointed out.
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In C++, [intro.execution]: > > When calling a function (whether or not the function is inline), every value computation and side effect associated with any argument expression, or with the postfix expression designating the called function, is sequenced before execution of every expression or statement in the body of...
If you have the following statement ``` foo(bar()); ``` The function `bar()` will be called before `foo()`. The compiler cannot reorder these function calls.
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In C++, [intro.execution]: > > When calling a function (whether or not the function is inline), every value computation and side effect associated with any argument expression, or with the postfix expression designating the called function, is sequenced before execution of every expression or statement in the body of...
It's same as : ``` type bar_result = bar(); foo(bar_result); ``` 1. bar() will be called first. 2. bar\_result is passed as a copy/referencie.
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In C++, [intro.execution]: > > When calling a function (whether or not the function is inline), every value computation and side effect associated with any argument expression, or with the postfix expression designating the called function, is sequenced before execution of every expression or statement in the body of...
There is a sequence point after function argument evaluation (i.e. before the code of any function is entered). Hence, `bar()` must be evaluated before `foo(...)` will be entered. Confer, for example, the [C11 standard](http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf): > > 6.5.2.2 Function calls: (10) There...
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > 1. Is it required that `bar()` is called first […]? > > > The code is required to behave as if that's what's happening. > > 2. Is it permitted that the compiler reorders the above […]? > > > Yes, if the observable behavior is the same as if `bar()` was evaluated first. This is known as the [**"as-if" ru...
In C++, [intro.execution]: > > When calling a function (whether or not the function is inline), every value computation and side effect associated with any argument expression, or with the postfix expression designating the called function, is sequenced before execution of every expression or statement in the body of...
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In addition to what others have said, you might consider ``` foo( bar1(), bar2() ); ``` which is a more interesting case. Here, the order is allowed to be [bar1, bar2, foo] or [bar2, bar1, foo].
There is a sequence point after function argument evaluation (i.e. before the code of any function is entered). Hence, `bar()` must be evaluated before `foo(...)` will be entered. Confer, for example, the [C11 standard](http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1570.pdf): > > 6.5.2.2 Function calls: (10) There...
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > 1. Is it required that `bar()` is called first […]? > > > The code is required to behave as if that's what's happening. > > 2. Is it permitted that the compiler reorders the above […]? > > > Yes, if the observable behavior is the same as if `bar()` was evaluated first. This is known as the [**"as-if" ru...
If you have the following statement ``` foo(bar()); ``` The function `bar()` will be called before `foo()`. The compiler cannot reorder these function calls.
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In addition to what others have said, you might consider ``` foo( bar1(), bar2() ); ``` which is a more interesting case. Here, the order is allowed to be [bar1, bar2, foo] or [bar2, bar1, foo].
It's same as : ``` type bar_result = bar(); foo(bar_result); ``` 1. bar() will be called first. 2. bar\_result is passed as a copy/referencie.
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > 1. Is it required that `bar()` is called first […]? > > > The code is required to behave as if that's what's happening. > > 2. Is it permitted that the compiler reorders the above […]? > > > Yes, if the observable behavior is the same as if `bar()` was evaluated first. This is known as the [**"as-if" ru...
It's same as : ``` type bar_result = bar(); foo(bar_result); ``` 1. bar() will be called first. 2. bar\_result is passed as a copy/referencie.
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In addition to what others have said, you might consider ``` foo( bar1(), bar2() ); ``` which is a more interesting case. Here, the order is allowed to be [bar1, bar2, foo] or [bar2, bar1, foo].
If you have the following statement ``` foo(bar()); ``` The function `bar()` will be called before `foo()`. The compiler cannot reorder these function calls.
42,540,954
Assume we have code like this in C or C++: ``` foo(bar()); ``` What is the function execution order in this case? 1. Is it required that `bar()` is called first, and `foo()` is called no earlier than `bar()` returns, in which case `foo()` is passed the return value of `bar()`? 2. Is it permitted that the compiler r...
2017/03/01
[ "https://Stackoverflow.com/questions/42540954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
> > 1. Is it required that `bar()` is called first […]? > > > The code is required to behave as if that's what's happening. > > 2. Is it permitted that the compiler reorders the above […]? > > > Yes, if the observable behavior is the same as if `bar()` was evaluated first. This is known as the [**"as-if" ru...
In addition to what others have said, you might consider ``` foo( bar1(), bar2() ); ``` which is a more interesting case. Here, the order is allowed to be [bar1, bar2, foo] or [bar2, bar1, foo].
3,509,599
I have some code in a reusable class that modifies some types. Here's a simplified version. ``` class Foo: def __init__(self): self.count = 0 def increment(self): self.count += 1 # Add another method outside of the class definition. # Pylint doesn't care about this, and rates this file 10/10....
2010/08/18
[ "https://Stackoverflow.com/questions/3509599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8014/" ]
Following one your comments, since you're going for an Enumerated type, why not have a look [at this SO question](https://stackoverflow.com/questions/36932/whats-the-best-way-to-implement-an-enum-in-python), or [this ActiveState cookbook recipe](http://code.activestate.com/recipes/67107/)? Out of personal preference, ...
Pragmatically speaking, why the assumption that pylint (or any lint) should be silent? Given a bias between false positives and false negatives, lints should prefer the former. It seems to me that because Pylint expresses its results as a score that people assume it should be maximized, but there is no prize for "winni...
3,509,599
I have some code in a reusable class that modifies some types. Here's a simplified version. ``` class Foo: def __init__(self): self.count = 0 def increment(self): self.count += 1 # Add another method outside of the class definition. # Pylint doesn't care about this, and rates this file 10/10....
2010/08/18
[ "https://Stackoverflow.com/questions/3509599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8014/" ]
Here is my solution inspired by the example in [ActiveState cookbook recipe](http://code.activestate.com/recipes/67107/), provided in [Yoni H](https://stackoverflow.com/users/396593/yoni-h)'s [answer](https://stackoverflow.com/questions/3509599/can-an-api-tell-pylint-not-to-complain-in-the-client-code/3510122#3510122)....
Pragmatically speaking, why the assumption that pylint (or any lint) should be silent? Given a bias between false positives and false negatives, lints should prefer the former. It seems to me that because Pylint expresses its results as a score that people assume it should be maximized, but there is no prize for "winni...
3,509,599
I have some code in a reusable class that modifies some types. Here's a simplified version. ``` class Foo: def __init__(self): self.count = 0 def increment(self): self.count += 1 # Add another method outside of the class definition. # Pylint doesn't care about this, and rates this file 10/10....
2010/08/18
[ "https://Stackoverflow.com/questions/3509599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8014/" ]
Here is my solution inspired by the example in [ActiveState cookbook recipe](http://code.activestate.com/recipes/67107/), provided in [Yoni H](https://stackoverflow.com/users/396593/yoni-h)'s [answer](https://stackoverflow.com/questions/3509599/can-an-api-tell-pylint-not-to-complain-in-the-client-code/3510122#3510122)....
Following one your comments, since you're going for an Enumerated type, why not have a look [at this SO question](https://stackoverflow.com/questions/36932/whats-the-best-way-to-implement-an-enum-in-python), or [this ActiveState cookbook recipe](http://code.activestate.com/recipes/67107/)? Out of personal preference, ...
400,811
$$\frac{\ln(e^x+x)}{x}=\frac{e^x+1}{e^x+x}$$ I see that they did something to get rid of the natural log. I couldn't find any properties that would allow me to do this. I also think that they raised both the numerator and denominator by $e$. I have tried it and I did not get the same result. Does anyone know how the s...
2013/05/24
[ "https://math.stackexchange.com/questions/400811", "https://math.stackexchange.com", "https://math.stackexchange.com/users/39754/" ]
$$\frac{\ln(e^x+x)}{x} \; \neq \;\;\frac{e^x+1}{e^x+x}$$ It's the application of l'Hospital's rule to the left hand side: take the derivative of the LHS's numerator and of the denominator. $$\large \frac{e^x+1}{e^x+x}=\frac{\frac{e^x+1}{e^x+x}}{1} = \frac{\frac d{dx}\left({\ln(e^x+x)}\right)}{\frac d{dx}(x)}$$ So $...
The equation that you wrote is false. The correct statement is an application of l’Hospital’s rule: $$\lim\_{x\to 0}\frac{\ln(e^x+x)}x=\lim\_{x\to 0}\frac{e^x+1}{e^x+x}\;.$$ Since both $\ln(e^x+x)$ and $x$ approach $0$ as $x\to 0$, you can apply l’Hospital’s rule to evaluate the limit. To do this you must differentia...
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
**Python 2.x** ``` from itertools import repeat map(lambda (x, y): x + y, zip(repeat(x), y)) ``` **Python 3.x** ``` map(lambda xy: ''.join(xy), zip(repeat(x), y)) ```
Do you have to use lambda? ``` >>> x='a' >>> y=['2','4','8','16'] >>> map(x.__add__, y) ['a2', 'a4', 'a8', 'a16'] >>> ```
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
You can use `itertools.starmap` ``` a = itertools.starmap(lambda x,y: x+y, zip(itertools.repeat(x), y)) a = list(a) ``` and you get your desired output. BTW, both `itertools.imap` and Python3's `map` will accept the following: ``` itertools.imap(lambda x,y: x+y, itertools.repeat(x), y) ``` The default Python2's ...
> > BTW, both itertools.imap and Python3's map will accept the following: > > > itertools.imap(lambda x,y: x+y, itertools.repeat(x), y) > The default Python2's map will not stop at the end of y and will insert Nones... > > > I just wanted to add on to this answer that in python 2.x you can do something like ```...
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
``` ['a' + x for x in y] ``` or if you really need a callable: ``` def f(x, y): return x + y [f('a', x) for x in y] ```
Do you have to use lambda? ``` >>> x='a' >>> y=['2','4','8','16'] >>> map(x.__add__, y) ['a2', 'a4', 'a8', 'a16'] >>> ```
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
Also you could use closure for this ``` x='a' f = lambda y: x+y map(f, ['1', '2', '3', '4', '5']) >>> ['a1', 'a2', 'a3', 'a4', 'a5'] ```
**Python 2.x** ``` from itertools import repeat map(lambda (x, y): x + y, zip(repeat(x), y)) ``` **Python 3.x** ``` map(lambda xy: ''.join(xy), zip(repeat(x), y)) ```
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
``` def prependConstant(x, y): return map(lambda yel: x + yel, y) ```
Do you have to use lambda? ``` >>> x='a' >>> y=['2','4','8','16'] >>> map(x.__add__, y) ['a2', 'a4', 'a8', 'a16'] >>> ```
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
You can use `itertools.starmap` ``` a = itertools.starmap(lambda x,y: x+y, zip(itertools.repeat(x), y)) a = list(a) ``` and you get your desired output. BTW, both `itertools.imap` and Python3's `map` will accept the following: ``` itertools.imap(lambda x,y: x+y, itertools.repeat(x), y) ``` The default Python2's ...
``` def prependConstant(x, y): return map(lambda yel: x + yel, y) ```
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
You can use `itertools.starmap` ``` a = itertools.starmap(lambda x,y: x+y, zip(itertools.repeat(x), y)) a = list(a) ``` and you get your desired output. BTW, both `itertools.imap` and Python3's `map` will accept the following: ``` itertools.imap(lambda x,y: x+y, itertools.repeat(x), y) ``` The default Python2's ...
Do you have to use lambda? ``` >>> x='a' >>> y=['2','4','8','16'] >>> map(x.__add__, y) ['a2', 'a4', 'a8', 'a16'] >>> ```
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
You can use `itertools.starmap` ``` a = itertools.starmap(lambda x,y: x+y, zip(itertools.repeat(x), y)) a = list(a) ``` and you get your desired output. BTW, both `itertools.imap` and Python3's `map` will accept the following: ``` itertools.imap(lambda x,y: x+y, itertools.repeat(x), y) ``` The default Python2's ...
**Python 2.x** ``` from itertools import repeat map(lambda (x, y): x + y, zip(repeat(x), y)) ``` **Python 3.x** ``` map(lambda xy: ''.join(xy), zip(repeat(x), y)) ```
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
Also you could use closure for this ``` x='a' f = lambda y: x+y map(f, ['1', '2', '3', '4', '5']) >>> ['a1', 'a2', 'a3', 'a4', 'a5'] ```
> > BTW, both itertools.imap and Python3's map will accept the following: > > > itertools.imap(lambda x,y: x+y, itertools.repeat(x), y) > The default Python2's map will not stop at the end of y and will insert Nones... > > > I just wanted to add on to this answer that in python 2.x you can do something like ```...
7,647,792
What would be an elegant way to `map` a two parameter `lambda` function to a list of values where the first parameter is constant and the second is taken from a `list`? **Example:** ``` lambda x,y: x+y x='a' y=['2','4','8','16'] ``` expected result: ``` ['a2','a4','a8','a16'] ``` Notes: * This is just an exampl...
2011/10/04
[ "https://Stackoverflow.com/questions/7647792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348545/" ]
``` def prependConstant(x, y): return map(lambda yel: x + yel, y) ```
> > BTW, both itertools.imap and Python3's map will accept the following: > > > itertools.imap(lambda x,y: x+y, itertools.repeat(x), y) > The default Python2's map will not stop at the end of y and will insert Nones... > > > I just wanted to add on to this answer that in python 2.x you can do something like ```...
69,111,785
I need to run a particular ts script using hardhat from the command line but I need to specify parameters... Similar to this: ``` npx hardhat run --network rinkeby scripts/task-executor.ts param1 param2 ``` Where the `--network rinkeby` is the parameter for the **hardhat run** And `param1` and `param2` are parame...
2021/09/09
[ "https://Stackoverflow.com/questions/69111785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16855328/" ]
According to [Hardhat](https://hardhat.org/guides/scripts.html): > > Hardhat scripts are useful for simple things that don't take user arguments, and for integrating with external tools that aren't well suited for the Hardhat CLI, like a Node.js debugger. > > > For scripts that require parameters, you should use ...
Usually it works like this: ``` const hre = require('hardhat'); const { ethers } = hre; ```
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
You need to load your JNI library. **[System.loadLibrary](http://www.tutorialspoint.com/java/lang/runtime_loadlibrary.htm)** loads the DLL from the JVM path (JDK bin path). If you want to load an explicit file with a path, use **[System.load](http://www.tutorialspoint.com/java/lang/system_load.htm)**() See also: [Di...
installing Microsoft Visual C++ 2010 SP1 Redistributable Fixed it
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
Please verify your library path is right or not. Of course, you can use following code to check your library path path: `System.out.println(System.getProperty("java.library.path"));` You can appoint the **java.library.path** when launching a Java application: ``` java -Djava.library.path=path ... ```
* Short answer: for "can't find dependent library" error, check your $PATH (corresponds to bullet point #3 below) * Long answer: 1. Pure java world: jvm uses "Classpath" to find class files 2. JNI world (java/native boundary): jvm uses "java.library.path" (which defaults to $PATH) to find dlls 3. pure native world: ...
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
When calling `System.loadLibrary()`, the JVM will look on the `java.library.path` for your native library. However, if that native library declares any dependencies on other native libraries, then the operating system will be tasked with finding those native library dependencies. Since the operating system has no conc...
Creating static library worked for me, compiling using `g++ -static`. It bundles the dependent libraries along with the build.
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
* Short answer: for "can't find dependent library" error, check your $PATH (corresponds to bullet point #3 below) * Long answer: 1. Pure java world: jvm uses "Classpath" to find class files 2. JNI world (java/native boundary): jvm uses "java.library.path" (which defaults to $PATH) to find dlls 3. pure native world: ...
Creating static library worked for me, compiling using `g++ -static`. It bundles the dependent libraries along with the build.
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
In my situation, I was trying to run a java web service in Tomcat 7 via a connector in Eclipse. The app ran well when I deployed the war file to an instance of Tomcat 7 on my laptop. The app requires a jdbc type 2 driver for "IBM DB2 9.5". For some odd reason the connector in Eclispe could not see or use the paths in t...
I faced the same problem after migrating my CI into a new machine. I was still facing it even after applying all the above solutions. The problem was in my new machine, there was Microsoft Visual C++ 2010 SP1 Redistributable x86 installed in it. But my new machine was having 64-bit CPU and operating system. So the fix...
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
I was facing same issue with ffmpeg library after merging two Android projects as one project. Actually issue was arriving due to two different versions of ffmpeg library but they were loaded with same names in memory. One library was placed in JNiLibs while other was inside another library used as module. I was not ...
1. Go to <http://tess4j.sourceforge.net/usage.html> and click on `Visual C++ Redistributable for VS2012` 2. Download it and run `VSU_4\vcredist_x64.exe` or `VSU_4\vcredist_x84.exe` depending upon your system configuration 3. Put your `dll` files inside the `lib` folder, along with your other libraries (eg `\lib\win32-x...
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
I want to inform this interesting case, after tried all the above method, the error is still there. The weird thing is it works on a Windows 7 computer, but on Windows XP it is not. Then I use dependency walker and found on the Windows XP there is no VC++ Runtime as my dll requirement. After installing VC++ Runtime pac...
place the required dlls in folder and set the folder path in PATH environment variable. make sure updated environment PATH variable is reflected.
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
Please verify your library path is right or not. Of course, you can use following code to check your library path path: `System.out.println(System.getProperty("java.library.path"));` You can appoint the **java.library.path** when launching a Java application: ``` java -Djava.library.path=path ... ```
place the required dlls in folder and set the folder path in PATH environment variable. make sure updated environment PATH variable is reflected.
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
I want to inform this interesting case, after tried all the above method, the error is still there. The weird thing is it works on a Windows 7 computer, but on Windows XP it is not. Then I use dependency walker and found on the Windows XP there is no VC++ Runtime as my dll requirement. After installing VC++ Runtime pac...
I had the same issue, and I tried everything what is posted here to fix it but none worked for me. In my case I'm using Cygwin to compile the dll. It seems that JVM tries to find the JRE DLLs in the virtual Cygwin path. I added the the Cygwin's virtual directory path to JRE's DLLs and it works now. I did something like...
6,092,200
I'm working on a Java project that uses the JNI. The JNI calls a custom library that I've written myself, let's say mylib.dll, and that depends on a 3rd party library, libsndfile-1.dll. When I run my program it crashes with ``` java.lang.UnsatisfiedLinkError: C:\...path...\mylib.dll: Can't find dependent libraries....
2011/05/23
[ "https://Stackoverflow.com/questions/6092200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765287/" ]
I'm pretty sure the classpath and the shared library search path have little to do with each other. According to [The JNI Book](http://barbie.uta.edu/~jli/Resources/Resource%20Provisoning&Performance%20Evaluation/85.pdf) (which admittedly is old), on Windows if you do not use the `java.library.path` system property, th...
If you load a 32 bit version of your dll with a 64 bit JRE you could have this issue. This was my case.
43,071,389
I have a scenario where I want to put a condition on a join, i.e if A = B then join on 1 set else join on another. Tables in both scenario are same only the conditions are different. I have tried using case but I get syntax error. ``` SELECT * FROM [Table1] CUP LEFT OUTER JOIN Table2 CP ON CUP.StateCode = CP.StateCod...
2017/03/28
[ "https://Stackoverflow.com/questions/43071389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5290978/" ]
* You'll have to use `coalesce` for the `SELECT` clause * Note the `CP1.ClientId is null` which removes Gordon solution's limitation regarding NULLS --- ``` select ... from table1 CUP left outer join Table2 CP1 on CP1.StateCode = CUP.StateCode ...
I wrote this: ``` SELECT * FROM TABLE1 CUP INNER JOIN TABLE2 CP ON CUP.StateCode = CP.StateCode AND CUP.ClientId = CP.ClientId UNION ALL SELECT * FROM (SELECT * FROM TABLE1 WHERE NOT EXISTS (SELECT 1 FROM TABLE2 WHERE TABLE2.CLIENTID = TABLE1.CLIENTID) ) CUP INNER JOIN TABLE2 CP ON CUP.St...
43,071,389
I have a scenario where I want to put a condition on a join, i.e if A = B then join on 1 set else join on another. Tables in both scenario are same only the conditions are different. I have tried using case but I get syntax error. ``` SELECT * FROM [Table1] CUP LEFT OUTER JOIN Table2 CP ON CUP.StateCode = CP.StateCod...
2017/03/28
[ "https://Stackoverflow.com/questions/43071389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5290978/" ]
* You'll have to use `coalesce` for the `SELECT` clause * Note the `CP1.ClientId is null` which removes Gordon solution's limitation regarding NULLS --- ``` select ... from table1 CUP left outer join Table2 CP1 on CP1.StateCode = CUP.StateCode ...
I think you want two `left join`, one for the first value the second for the default: ``` SELECT CUP.*, COALESCE(CP.col1, CPdef.col1) as col1, . . . FROM [Table1] CUP LEFT OUTER JOIN Table2 CP ON CUP.StateCode = CP.StateCode AND CUP.ClientId = CP.ClientId LEFT OUTER JOIN Table2 CdPef ON CUP.StateCo...
43,071,389
I have a scenario where I want to put a condition on a join, i.e if A = B then join on 1 set else join on another. Tables in both scenario are same only the conditions are different. I have tried using case but I get syntax error. ``` SELECT * FROM [Table1] CUP LEFT OUTER JOIN Table2 CP ON CUP.StateCode = CP.StateCod...
2017/03/28
[ "https://Stackoverflow.com/questions/43071389", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5290978/" ]
* You'll have to use `coalesce` for the `SELECT` clause * Note the `CP1.ClientId is null` which removes Gordon solution's limitation regarding NULLS --- ``` select ... from table1 CUP left outer join Table2 CP1 on CP1.StateCode = CUP.StateCode ...
When a case is all said and done, it ends with a value. ``` case when SomeColumn = 4 then 1 end ``` As you can see, the return is a VALUE you can use it to return a column in a join, but really you are returning the value in the column ``` select aa.a from aa inner join bb on aa.a = case when bb.a is null then 4 e...
56,198,892
Given below is the code in which I tried to modify an array using arrow function but while running, it returns a value of undefined as the output can someone give suggestions please ```js var modifyArray = (nums) => { return nums.forEach(function (element) { (element % 2 == 0) ? element *= 2 : element...
2019/05/18
[ "https://Stackoverflow.com/questions/56198892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10336726/" ]
`.forEach` returns undefined. You probably want to `.map` to a new array and return that: ``` return nums.map(function (element) { return element * ((element % 2 == 0) ? 2 : 3); }); ``` For sure you also have to return the statement inside of the inner function, otherwise that evaluates to undefined too.
`forEach` doesn't return anything - use `map` instead: ```js var modifyArray = nums => nums.map(element => element % 2 == 0 ? element *= 2 : element *= 3) console.log(modifyArray([1,2,3,4,5])); ``` Also note that inside of the function passed to `forEach` you weren't returning anything - with ES5 `function` you need...
56,198,892
Given below is the code in which I tried to modify an array using arrow function but while running, it returns a value of undefined as the output can someone give suggestions please ```js var modifyArray = (nums) => { return nums.forEach(function (element) { (element % 2 == 0) ? element *= 2 : element...
2019/05/18
[ "https://Stackoverflow.com/questions/56198892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10336726/" ]
`.forEach` returns undefined. You probably want to `.map` to a new array and return that: ``` return nums.map(function (element) { return element * ((element % 2 == 0) ? 2 : 3); }); ``` For sure you also have to return the statement inside of the inner function, otherwise that evaluates to undefined too.
See the answers above. There is a workaround if you still want to use `forEach` ``` let result = [] var modifyArray = (nums) => { nums.forEach(function (element) { result.push((element % 2 == 0) ? element *= 2 : element *= 3); }) return result; } modifyArray([1,2,3,4,5]) console.log(result) ...
56,198,892
Given below is the code in which I tried to modify an array using arrow function but while running, it returns a value of undefined as the output can someone give suggestions please ```js var modifyArray = (nums) => { return nums.forEach(function (element) { (element % 2 == 0) ? element *= 2 : element...
2019/05/18
[ "https://Stackoverflow.com/questions/56198892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10336726/" ]
`.forEach` returns undefined. You probably want to `.map` to a new array and return that: ``` return nums.map(function (element) { return element * ((element % 2 == 0) ? 2 : 3); }); ``` For sure you also have to return the statement inside of the inner function, otherwise that evaluates to undefined too.
What about using for loops? ``` var modifyArray = (nums) => { for (let i = 0; i < nums.length; i++) { let element = nums[i]; // console.log(element + ' - ' + element % 2 ); nums[i] = (element % 2 == 0) ? element *= 2 : element *= 3; } return nums; } console.log(modifyArray([1,2,3,4...
56,198,892
Given below is the code in which I tried to modify an array using arrow function but while running, it returns a value of undefined as the output can someone give suggestions please ```js var modifyArray = (nums) => { return nums.forEach(function (element) { (element % 2 == 0) ? element *= 2 : element...
2019/05/18
[ "https://Stackoverflow.com/questions/56198892", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10336726/" ]
`.forEach` returns undefined. You probably want to `.map` to a new array and return that: ``` return nums.map(function (element) { return element * ((element % 2 == 0) ? 2 : 3); }); ``` For sure you also have to return the statement inside of the inner function, otherwise that evaluates to undefined too.
For each returns undefined as it doesn't return anything but you can use forEach for doing the same thing by pushing your data into an array. Notice I did not change your approach but just extended it ```js var modifyArray = (nums) => { var somearray = [] nums.forEach((element) => somearray.push((element % 2 ==...
24,554,315
I'm trying to make some "images" within OpenGL ES 2.0 but I'm having some problems. What I want is to build a framebuffer object, let's say one of 400x300 pixels, and then render some graphics using an orthogonal projections. The way I create the framebuffer object I think is right. This is the vertex array which hold...
2014/07/03
[ "https://Stackoverflow.com/questions/24554315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/368299/" ]
Ok, so I was doing it right , however my environment is a bit weird (I'm using a projector, not a screen) and I have to deal with it. The only change I've made, is to use identity matrix as a view matrix, since it's not needed, and set the vertex data array to: ``` GLfloat vertexData[] = { // X Y Z U...
when drawing to FBO you most likely want use ortho projection so you can use "pixel" coordinates. to draw texture from FBO as full screen quad use identity projection matrix and ``` GLfloat vertexData[] = { // X Y Z U V -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, // Bottom-right -1.0f, 1.0f, 0.0f, 0.0f, 1....
5,750,903
I have this problem: When i set a language (it or en)in my django app, [with this form](http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#the-set-language-redirect-view), the javascript strings are converted always in English. My base Language is Italian. This is my configuration: urls.py: > > ...
2011/04/21
[ "https://Stackoverflow.com/questions/5750903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/347466/" ]
you should run ``` django-admin.py makemessages -d djangojs -l en django-admin.py compilemessages ``` for each language you have :)
In your file base.html add the following lines to the beginning ``` {% load static from staticfiles %} {% load i18n %} {% get_current_language as LANGUAGE_CODE %} {% get_available_languages as LANGUAGES %} ```
48,862,363
My code is ``` #import "AppDelegate" ``` in viewDidLoad ``` self.delegate = (AppDelegate *) [[UIApplication sharedApplication] delegate]; ``` After getting the response ``` //If server response is success make HomeViewController as Root VC if ([[[_response objectForKey:@"Response"] objectForKey:@"status"] isEq...
2018/02/19
[ "https://Stackoverflow.com/questions/48862363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7319386/" ]
If your user is logged in, in your applicaiotn and you are manually deleting it from the Firebase Console, the user will remain active, till the token will be refreshed. So for about at most an hour, the user will remain authenticated. So if you want to restrict the access of a user instantly, you need to sign him out....
To check if the user has been deleted in the database, then try this: ``` FirebaseUser user=FirebaseAuth.getInstance().getCurrentUser(); String useruid=user.getUid(); DatabaseReference ref=FirebaseDatabase.getInstance().getReference().child("users").child(useruid); ref.addValueEventListener(new ValueEventListener(){ ...
39,267,598
I want expose C++ class member in v8, and i know how to expose the class method but i don't know how to expose class member. C++ class: ``` class Person{ public: string name; } ``` Javascript: ``` var p1 = new Person(); p1.name = "Jack"; ``` I want to achieve this, It's that possible. thanks!
2016/09/01
[ "https://Stackoverflow.com/questions/39267598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6265441/" ]
You may use `SetAccessor()` for the Person prototype template, supplying pointer the the member as an external V8 Data. But you need to wrap C++ instance of Person into V8 object, and then unwrap this V8 object back to C++ object in accessor getter/setter callbacks from theirs args.This() I use this way in my [`v8pp`]...
What pmed said is correct, but to expand a bit more, you would create an ObjectTemplate (possibly via a FunctionTemplate) with an InternalFieldCount = 1 and throw the cpp object in there as a v8::External. Then you call SetAccessor on your ObjectTemplate with the name of the javascript property you want to have corre...
964,494
Im trying to install a web service with centos 7 apache and sql server. For that purpose, Im using VMware, the installation of OS finish successfully but when I try to update centos it gives me this error: ``` #yum update Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=s...
2019/04/25
[ "https://serverfault.com/questions/964494", "https://serverfault.com", "https://serverfault.com/users/496323/" ]
You've already proved that the server is behind a proxy, because the proxy that intercepted the request identifed itself as `mikrotik httpproxy`. What to do about it depends on what that Mikrotik device is, why you're proxying to it at all, and what it's meant to be doing.
It's okay to use proxy to make secure and audit able environment, you can still work with yum behind the proxy add below lines to youe yum file /etc/yum.conf proxy=http://: proxy\_username=user proxy\_password=password Hope it will help you.
42,924,052
Apologies for a possible basic question. New at JS and I'm likely using the wrong terms in my search. I have this variable; ``` myArray = ['000001', '0000002', '0000003', '0000004'] ``` What I ideally want to do is create a new row for each value held in this array - regardless of how many values are present (so 1 ...
2017/03/21
[ "https://Stackoverflow.com/questions/42924052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7744738/" ]
You can do it like that: ``` import itertools l = set(['john','jeff','george','peter']) m=list(itertools.combinations(l, 2)) res=[[i,tuple(l.symmetric_difference(i))] for i in m] ``` `m` is a list of all the pairs, and `res` associates each pair with its complement. So the output is ``` [[('john', 'jeff'), ('peter'...
try itertools with [permutations()](http://docs.python.org/library/itertools.html#itertools.permutations) ``` import itertools my_list = ['john','jeff','george','peter'] paired = [] for pair in itertools.permutations(my_list, 2): paired.append(pair) print paired ``` > > [('john', 'jeff'), > ('john', 'george'),...
42,924,052
Apologies for a possible basic question. New at JS and I'm likely using the wrong terms in my search. I have this variable; ``` myArray = ['000001', '0000002', '0000003', '0000004'] ``` What I ideally want to do is create a new row for each value held in this array - regardless of how many values are present (so 1 ...
2017/03/21
[ "https://Stackoverflow.com/questions/42924052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7744738/" ]
You can do it like that: ``` import itertools l = set(['john','jeff','george','peter']) m=list(itertools.combinations(l, 2)) res=[[i,tuple(l.symmetric_difference(i))] for i in m] ``` `m` is a list of all the pairs, and `res` associates each pair with its complement. So the output is ``` [[('john', 'jeff'), ('peter'...
How about the following: ``` from itertools import combinations from pprint import pprint names = ['john', 'jeff', 'george', 'peter', 'ringo'] combos = list(combinations(names, 2)) pairs = [[x, y] for x in combos for y in combos if not set(x).intersection(set(y))] pprint(pairs) ``` `combinations` gives us all pai...
42,924,052
Apologies for a possible basic question. New at JS and I'm likely using the wrong terms in my search. I have this variable; ``` myArray = ['000001', '0000002', '0000003', '0000004'] ``` What I ideally want to do is create a new row for each value held in this array - regardless of how many values are present (so 1 ...
2017/03/21
[ "https://Stackoverflow.com/questions/42924052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7744738/" ]
You can do it like that: ``` import itertools l = set(['john','jeff','george','peter']) m=list(itertools.combinations(l, 2)) res=[[i,tuple(l.symmetric_difference(i))] for i in m] ``` `m` is a list of all the pairs, and `res` associates each pair with its complement. So the output is ``` [[('john', 'jeff'), ('peter'...
This should do the trick for you: ``` from itertools import combinations l = ['john','jeff','george','peter','beni'] x= list(combinations(l,2)) y=list(combinations(x,2)) remove_dup =lambda y: y if len(set(y[0])-set(y[1]))==2 else None answer=[remove_dup(t) for t in y if remove_dup(t) is not None] ``` answer: ``` [(...
42,924,052
Apologies for a possible basic question. New at JS and I'm likely using the wrong terms in my search. I have this variable; ``` myArray = ['000001', '0000002', '0000003', '0000004'] ``` What I ideally want to do is create a new row for each value held in this array - regardless of how many values are present (so 1 ...
2017/03/21
[ "https://Stackoverflow.com/questions/42924052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7744738/" ]
How about the following: ``` from itertools import combinations from pprint import pprint names = ['john', 'jeff', 'george', 'peter', 'ringo'] combos = list(combinations(names, 2)) pairs = [[x, y] for x in combos for y in combos if not set(x).intersection(set(y))] pprint(pairs) ``` `combinations` gives us all pai...
try itertools with [permutations()](http://docs.python.org/library/itertools.html#itertools.permutations) ``` import itertools my_list = ['john','jeff','george','peter'] paired = [] for pair in itertools.permutations(my_list, 2): paired.append(pair) print paired ``` > > [('john', 'jeff'), > ('john', 'george'),...
42,924,052
Apologies for a possible basic question. New at JS and I'm likely using the wrong terms in my search. I have this variable; ``` myArray = ['000001', '0000002', '0000003', '0000004'] ``` What I ideally want to do is create a new row for each value held in this array - regardless of how many values are present (so 1 ...
2017/03/21
[ "https://Stackoverflow.com/questions/42924052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7744738/" ]
This should do the trick for you: ``` from itertools import combinations l = ['john','jeff','george','peter','beni'] x= list(combinations(l,2)) y=list(combinations(x,2)) remove_dup =lambda y: y if len(set(y[0])-set(y[1]))==2 else None answer=[remove_dup(t) for t in y if remove_dup(t) is not None] ``` answer: ``` [(...
try itertools with [permutations()](http://docs.python.org/library/itertools.html#itertools.permutations) ``` import itertools my_list = ['john','jeff','george','peter'] paired = [] for pair in itertools.permutations(my_list, 2): paired.append(pair) print paired ``` > > [('john', 'jeff'), > ('john', 'george'),...
42,924,052
Apologies for a possible basic question. New at JS and I'm likely using the wrong terms in my search. I have this variable; ``` myArray = ['000001', '0000002', '0000003', '0000004'] ``` What I ideally want to do is create a new row for each value held in this array - regardless of how many values are present (so 1 ...
2017/03/21
[ "https://Stackoverflow.com/questions/42924052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7744738/" ]
How about the following: ``` from itertools import combinations from pprint import pprint names = ['john', 'jeff', 'george', 'peter', 'ringo'] combos = list(combinations(names, 2)) pairs = [[x, y] for x in combos for y in combos if not set(x).intersection(set(y))] pprint(pairs) ``` `combinations` gives us all pai...
This should do the trick for you: ``` from itertools import combinations l = ['john','jeff','george','peter','beni'] x= list(combinations(l,2)) y=list(combinations(x,2)) remove_dup =lambda y: y if len(set(y[0])-set(y[1]))==2 else None answer=[remove_dup(t) for t in y if remove_dup(t) is not None] ``` answer: ``` [(...
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
``` $(document).ready(function () { $(".top-menu li a.drop").click(function () { var panel = $(this).parent().find("div.panel"); $('.top-menu li div.panel').slideUp("fast"); $(panel).slideDown(); }); }); ``` this can help
You can try: ``` $(".top-menu li a.drop").click(function () { var panel = $(this).next(); if($(panel).not(":visible")){ $(".panel").each(function(){ if($(this).is(":visible")) $(this).slideUp("slow"); }); $(panel).slideDown("slow"); } }); ``` Though I ...
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
You bet <http://jsfiddle.net/xPTNS/> ``` .panel { display:none; } ``` ``` $(document).ready(function () { $(".panel:first").toggle(); $(".top-menu li a.drop").click(function () { $(".panel").slideToggle(); }); }); ``` Better solution for multiple items ``` $(document).ready(function () { ...
You can try: ``` $(".top-menu li a.drop").click(function () { var panel = $(this).next(); if($(panel).not(":visible")){ $(".panel").each(function(){ if($(this).is(":visible")) $(this).slideUp("slow"); }); $(panel).slideDown("slow"); } }); ``` Though I ...
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
I would do it like so: **Code** ``` $( function() { var top_menu = $( 'ul.top-menu' ), panels = top_menu.find( 'div.panel' ); top_menu.find( 'a.drop' ).click( function( e ) { var target_panel = $( this ).parent().find( 'div.panel:hidden' ); if( target_panel.length ) { ...
You can try: ``` $(".top-menu li a.drop").click(function () { var panel = $(this).next(); if($(panel).not(":visible")){ $(".panel").each(function(){ if($(this).is(":visible")) $(this).slideUp("slow"); }); $(panel).slideDown("slow"); } }); ``` Though I ...
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
``` $(document).ready(function () { $(".top-menu li a.drop").click(function () { var panel = $(this).parent().find("div.panel"); $('.top-menu li div.panel').slideUp("fast"); $(panel).slideDown(); }); }); ``` this can help
In your code at many places you were wrapping a jQuery object into `$()` which is not required because its already a `jQuery` object. ``` $(document).ready(function () { var visId = null; $(".top-menu li a.drop").click(function () { var $this = $(this); var parent = $this.parent(); var...
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
You bet <http://jsfiddle.net/xPTNS/> ``` .panel { display:none; } ``` ``` $(document).ready(function () { $(".panel:first").toggle(); $(".top-menu li a.drop").click(function () { $(".panel").slideToggle(); }); }); ``` Better solution for multiple items ``` $(document).ready(function () { ...
In your code at many places you were wrapping a jQuery object into `$()` which is not required because its already a `jQuery` object. ``` $(document).ready(function () { var visId = null; $(".top-menu li a.drop").click(function () { var $this = $(this); var parent = $this.parent(); var...
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
I would do it like so: **Code** ``` $( function() { var top_menu = $( 'ul.top-menu' ), panels = top_menu.find( 'div.panel' ); top_menu.find( 'a.drop' ).click( function( e ) { var target_panel = $( this ).parent().find( 'div.panel:hidden' ); if( target_panel.length ) { ...
In your code at many places you were wrapping a jQuery object into `$()` which is not required because its already a `jQuery` object. ``` $(document).ready(function () { var visId = null; $(".top-menu li a.drop").click(function () { var $this = $(this); var parent = $this.parent(); var...
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
I would do it like so: **Code** ``` $( function() { var top_menu = $( 'ul.top-menu' ), panels = top_menu.find( 'div.panel' ); top_menu.find( 'a.drop' ).click( function( e ) { var target_panel = $( this ).parent().find( 'div.panel:hidden' ); if( target_panel.length ) { ...
``` $(document).ready(function () { $(".top-menu li a.drop").click(function () { var panel = $(this).parent().find("div.panel"); $('.top-menu li div.panel').slideUp("fast"); $(panel).slideDown(); }); }); ``` this can help
7,098,199
I am unfortunately not the best Jquery programmer but I thought I would give this a try to see what i could come up with. It works however I don't think it is the best way to accomplish what i am after. HTML MARKUP: ``` <ul class="top-menu"> <li><a href="#" class="drop">Sign In</a> <div id="panel_1" class="panel ...
2011/08/17
[ "https://Stackoverflow.com/questions/7098199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619583/" ]
I would do it like so: **Code** ``` $( function() { var top_menu = $( 'ul.top-menu' ), panels = top_menu.find( 'div.panel' ); top_menu.find( 'a.drop' ).click( function( e ) { var target_panel = $( this ).parent().find( 'div.panel:hidden' ); if( target_panel.length ) { ...
You bet <http://jsfiddle.net/xPTNS/> ``` .panel { display:none; } ``` ``` $(document).ready(function () { $(".panel:first").toggle(); $(".top-menu li a.drop").click(function () { $(".panel").slideToggle(); }); }); ``` Better solution for multiple items ``` $(document).ready(function () { ...
63,621,691
so we have an assignment about a check-out counter. I want to loop back to a process if you typed an amount that is not enough for your price. I can't seem to do that because when I try to do the "do" loop, the scanned cash won't be read by "while ()". Thats all thank you. this is the whole code, the process where my ...
2020/08/27
[ "https://Stackoverflow.com/questions/63621691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14178146/" ]
The `else if` statement is officially defined as byproduct of the `if` statement in §6.8.4/1, C18 by declaring the syntax: > > **Syntax** > > > 1 selection-statement: > > > `if ( expression ) statement` > > > `if ( expression ) statement else statement` > > > Source: C18, §6.8.4/1 > > > The last "*stateme...
C 2018 6.8.4 says a *selection-statement* may be “`if (` *expression* `)` *statement* `else` *statement*”. C 2018 6.8 says that latter *statement* may be “*selection-statement*”, and so it may be an `if` or `if … else` statement, which results in a statement containing `else if`.
49,766,349
After customizing the navigation bar height bigger than the default value (44pt), I want to change the height of my right side navigation bar item button, but it's limited in 44pt. How can I make it taller? I know that in iOS 11, the button now is inside a UIBarButtonStackView, it seems we cannot change the stack view ...
2018/04/11
[ "https://Stackoverflow.com/questions/49766349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2799778/" ]
You can change the width of navigation bar button item by using this code - ``` override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. var frame: CGRect? = navigationItem.leftBarButtonItem?.customView?.frame ...
Using subclass of UInavigationcontroller class and NavigationBar class you can achieve this. I am sharing some code of snipt: ``` class ARVNavigationController { init(rootViewController: UIViewController) { super.init(navigationBarClass: AVNavigationBar.self, toolbarClass: nil) viewControllers = [rootViewControlle...
3,786
I was looking for some benchmarks on the search capabilities of FAST Search Server to try and determine whether or not we need a single or multi-server environment for FAST Search Server. Do any exist? How big of an index have people seen before FAST Search starts to have issues serving queries or indexing? Thanks!
2010/06/29
[ "https://sharepoint.stackexchange.com/questions/3786", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/505/" ]
There isn't a hard and fast answer to this. Individual servers can be configured to handle very demanding search requirements. The question of multiple servers tends to come up in response to redundancy and the "cost" of losing your search application in the event of an outage.
There is some sizing guidance, but I can't find the link right now. At a high level, the number of servers are dictated by how many items you have in your index (millions), how many poeple are actively searching, and if you need to setup processing for things like extraction of meta-data.
3,786
I was looking for some benchmarks on the search capabilities of FAST Search Server to try and determine whether or not we need a single or multi-server environment for FAST Search Server. Do any exist? How big of an index have people seen before FAST Search starts to have issues serving queries or indexing? Thanks!
2010/06/29
[ "https://sharepoint.stackexchange.com/questions/3786", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/505/" ]
Really the best place to look through is [link text](http://technet.microsoft.com/en-us/library/ff383304.aspx "Planning and architecture (FAST Search Server 2010 for SharePoint)") as there is no short answer. There's so much good content there, giving you a link to a single document / web page is simply not enough. F...
There isn't a hard and fast answer to this. Individual servers can be configured to handle very demanding search requirements. The question of multiple servers tends to come up in response to redundancy and the "cost" of losing your search application in the event of an outage.
3,786
I was looking for some benchmarks on the search capabilities of FAST Search Server to try and determine whether or not we need a single or multi-server environment for FAST Search Server. Do any exist? How big of an index have people seen before FAST Search starts to have issues serving queries or indexing? Thanks!
2010/06/29
[ "https://sharepoint.stackexchange.com/questions/3786", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/505/" ]
Really the best place to look through is [link text](http://technet.microsoft.com/en-us/library/ff383304.aspx "Planning and architecture (FAST Search Server 2010 for SharePoint)") as there is no short answer. There's so much good content there, giving you a link to a single document / web page is simply not enough. F...
There is some sizing guidance, but I can't find the link right now. At a high level, the number of servers are dictated by how many items you have in your index (millions), how many poeple are actively searching, and if you need to setup processing for things like extraction of meta-data.
39,881,995
I am updating the question.Same case just another code.This could help you understand what i want.I am bad for explaining (mostly in English) so here is the code : ``` #include <stdio.h> unsigned int power(unsigned int base, unsigned int on); int main(void) { printf("\n%d\n",sizeof(int)); printf("\n%u\n",4294...
2016/10/05
[ "https://Stackoverflow.com/questions/39881995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5911206/" ]
Since the correct answer is *still* missing here, I'll chime in. Your code when running with 32-bit integers, will produce undefined behaviour. That means that literally anything could happen. The C standard (the "rules" for what the C language **is**) specifically says that putting a number that is too big into a sig...
2^31 overflows a 4-byte signed integer. It 'wraps around' to -(2^31).
70,288,266
I am attempting to convert a data `.dat` file to a pandas dataframe. However, the `.dat` file contains extra whitespace at the end of each row, which creates an issue when reading the file as a dataframe. The `.dat` file looks like this: ``` ~ H H H H H H H H ~ ~ ~ H H H H H H H H ~ ~ ~ H H H H H H T T ~ ~ ``` Ther...
2021/12/09
[ "https://Stackoverflow.com/questions/70288266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12194774/" ]
Given your input format, it's better to use `read_fwf` instead of `read_csv` ```py df = pd.read_fwf('mydata.dat', names=colnames) ``` ```py res76 res77 res78 res79 res80 res81 res82 res83 res84 res85 res86 0 ~ H H H H H H H H ~ ~ 1 ~ H H H H H ...
You may drop the last column from dataframe `df.drop(df.columns[-1], axis=1, inplace=True)` Or you may loops through file to remove trailing spaces (although not a clean solution). ``` parsed_file = open("parsed.dat", "w") with open('mydata.dat') as mydatafile: for line in mydatafile: if line.endswith(" ...
70,288,266
I am attempting to convert a data `.dat` file to a pandas dataframe. However, the `.dat` file contains extra whitespace at the end of each row, which creates an issue when reading the file as a dataframe. The `.dat` file looks like this: ``` ~ H H H H H H H H ~ ~ ~ H H H H H H H H ~ ~ ~ H H H H H H T T ~ ~ ``` Ther...
2021/12/09
[ "https://Stackoverflow.com/questions/70288266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12194774/" ]
3 solutions to solve this problem with Pandas: [`read_csv`](https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html): ``` >>> pd.read_csv(file, sep='\s+', engine='python', names=colnames) res76 res77 res78 res79 res80 res81 res82 res83 res84 res85 res86 0 ~ H H H H H H H ...
You may drop the last column from dataframe `df.drop(df.columns[-1], axis=1, inplace=True)` Or you may loops through file to remove trailing spaces (although not a clean solution). ``` parsed_file = open("parsed.dat", "w") with open('mydata.dat') as mydatafile: for line in mydatafile: if line.endswith(" ...
9,116,951
I am looking at pthread\_create manual page. ``` int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr, void *(*start_routine)(void*), void *restrict arg); ``` What is the meaning of 'restrict' in this function signature ?. what is the purpose of it?
2012/02/02
[ "https://Stackoverflow.com/questions/9116951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/916439/" ]
`restrict` places a requirement on the caller that the pointer arguments to this function cannot alias. That is, pointers must not point to the same object. While this makes obvious sense for `pthread_create`, it's more important for a function like `memcpy`. ``` void * memcpy(void *restrict s1, const void *restrict...
[This](http://en.wikipedia.org/wiki/Restrict) pretty much answers your question. It basically tells the compiler that only this pointer, or a pointer derived from it (pointer + 1) will access what the pointer is pointing to.
12,202,357
In order to load a Prism Module's view to a WPF application Region ``` <ContentControl Name="MainRegion" prism:RegionManager.RegionName="MainRegion"/> ``` I can use `regionManager.RequestNavigate`: ``` this.regionManager.RequestNavigate(RegionNames.MainContentRegion, toViewUri); ``` Sometimes I need to just remov...
2012/08/30
[ "https://Stackoverflow.com/questions/12202357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199722/" ]
Have you tried either of these? ``` regionManager.Regions[RegionNames.MainContentRegion].Remove(view) regionManager.Regions[RegionNames.MainContentRegion].Deactivate(view) ```
[`IRegion.Remove`](http://msdn.microsoft.com/en-us/library/microsoft.practices.prism.regions.iregion.remove%28v=pandp.40%29) does exactly that.
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
> > Requests for hosting providers and services in general, [is outside our scope](https://softwarerecs.meta.stackexchange.com/a/683/226), through we accept asking for [**applications** hosted in the internet (WebApps).](https://softwarerecs.meta.stackexchange.com/a/219/226) > > >
Questions that ask for **hardware shopping recommendations** are off-topic for this site because they are often only relevant to the question asker **at the time the question was posted** and **age rapidly**. Instead, **state the hardware you already have** along with your software feature requirement outline. For deta...
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
I went through the latest 50 closed questions (excluding duplicates and already-deleted ones) and tried to classify them according to why they were closed, to see if common patterns emerged. ### General software usage Potentially SU/Webapps/Android/Apple/… material, but usually too low-quality to migrate. * [How to ...
Questions that ask for **hardware shopping recommendations** are off-topic for this site because they are often only relevant to the question asker **at the time the question was posted** and **age rapidly**. Instead, **state the hardware you already have** along with your software feature requirement outline. For deta...
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
This question appears to be off-topic because **it does not contain enough information to give good recommendations**. In particular, questions without **a clear outline of features requested** are off-topic for this site. For more guidelines on what your question should contain, please see [What is required for a ques...
I went through the latest 50 closed questions (excluding duplicates and already-deleted ones) and tried to classify them according to why they were closed, to see if common patterns emerged. ### General software usage Potentially SU/Webapps/Android/Apple/… material, but usually too low-quality to migrate. * [How to ...
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
> > Requests for hosting providers and services in general, [is outside our scope](https://softwarerecs.meta.stackexchange.com/a/683/226), through we accept asking for [**applications** hosted in the internet (WebApps).](https://softwarerecs.meta.stackexchange.com/a/219/226) > > >
This question is not about software recommendations, within the scope defined in the [help center](https://softwarerecs.stackexchange.com/).
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
This question appears to be off-topic because **it does not contain enough information to give good recommendations**. In particular, questions without **a clear outline of features requested** are off-topic for this site. For more guidelines on what your question should contain, please see [What is required for a ques...
Questions that ask for **hardware shopping recommendations** are off-topic for this site because they are often only relevant to the question asker **at the time the question was posted** and **age rapidly**. Instead, **state the hardware you already have** along with your software feature requirement outline. For deta...
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
This question appears to be off-topic because **it does not contain enough information to give good recommendations**. In particular, questions without **a clear outline of features requested** are off-topic for this site. For more guidelines on what your question should contain, please see [What is required for a ques...
Questions that solicit **discussion or [feature comparisons](https://softwarerecs.meta.stackexchange.com/q/69) between multiple products** rather than asking for recommendations that fit within our [clearly defined requirements](https://softwarerecs.meta.stackexchange.com/q/336) are off-topic for this site. Instead, **...
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
Questions that solicit **discussion or [feature comparisons](https://softwarerecs.meta.stackexchange.com/q/69) between multiple products** rather than asking for recommendations that fit within our [clearly defined requirements](https://softwarerecs.meta.stackexchange.com/q/336) are off-topic for this site. Instead, **...
I went through the latest 50 closed questions (excluding duplicates and already-deleted ones) and tried to classify them according to why they were closed, to see if common patterns emerged. ### General software usage Potentially SU/Webapps/Android/Apple/… material, but usually too low-quality to migrate. * [How to ...
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
Questions that solicit **discussion or [feature comparisons](https://softwarerecs.meta.stackexchange.com/q/69) between multiple products** rather than asking for recommendations that fit within our [clearly defined requirements](https://softwarerecs.meta.stackexchange.com/q/336) are off-topic for this site. Instead, **...
This question is not about software recommendations, within the scope defined in the [help center](https://softwarerecs.stackexchange.com/).
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
Questions that solicit **discussion or [feature comparisons](https://softwarerecs.meta.stackexchange.com/q/69) between multiple products** rather than asking for recommendations that fit within our [clearly defined requirements](https://softwarerecs.meta.stackexchange.com/q/336) are off-topic for this site. Instead, **...
Questions that ask for **hardware shopping recommendations** are off-topic for this site because they are often only relevant to the question asker **at the time the question was posted** and **age rapidly**. Instead, **state the hardware you already have** along with your software feature requirement outline. For deta...
349
Due to the unique nature of Software Recommendations in comparison to the rest of the Stack Exchange network, I feel some discussion needs to go into the creation of close reasons specific to this site. What is the point of this post? =============================== The issues I want to tackle with this discussion ar...
2014/02/10
[ "https://softwarerecs.meta.stackexchange.com/questions/349", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/305/" ]
This question appears to be off-topic because **it does not contain enough information to give good recommendations**. In particular, questions without **a clear outline of features requested** are off-topic for this site. For more guidelines on what your question should contain, please see [What is required for a ques...
> > Requests for hosting providers and services in general, [is outside our scope](https://softwarerecs.meta.stackexchange.com/a/683/226), through we accept asking for [**applications** hosted in the internet (WebApps).](https://softwarerecs.meta.stackexchange.com/a/219/226) > > >