qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
20,132,066
I have a form page where the users must put a code that I send them by email, this form has as action file redirect.php, which contain this code: ``` <?php header('Location: page.php?code='.$_POST['code']); ?> ``` now what I want to do with my form page is to show a error or to redirect to a page if the code they in...
2013/11/21
['https://Stackoverflow.com/questions/20132066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3016012/']
I'm reqesting a image from yahoo and it isn't using the `content-disposition` header but I am extracting the `date` and `content-type` headers to construct a filename. This seems close enough to what you're trying to do... ``` var request = require('request'), fs = require('fs'); var url2 = 'http://l4.yimg.com/nn/fp/...
Question has been around a while, but I today faced the same problem and solved it differently: ``` var Request = require( 'request' ), Fs = require( 'fs' ); // RegExp to extract the filename from Content-Disposition var regexp = /filename=\"(.*)\"/gi; // initiate the download var req = Request.get( 'url.to/some...
20,132,066
I have a form page where the users must put a code that I send them by email, this form has as action file redirect.php, which contain this code: ``` <?php header('Location: page.php?code='.$_POST['code']); ?> ``` now what I want to do with my form page is to show a error or to redirect to a page if the code they in...
2013/11/21
['https://Stackoverflow.com/questions/20132066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3016012/']
I'm reqesting a image from yahoo and it isn't using the `content-disposition` header but I am extracting the `date` and `content-type` headers to construct a filename. This seems close enough to what you're trying to do... ``` var request = require('request'), fs = require('fs'); var url2 = 'http://l4.yimg.com/nn/fp/...
Here's my solution: ``` var fs = require('fs'); var request = require('request'); var through2 = require('through2'); var req = request(url); req.on('error', function (e) { // Handle connection errors console.log(e); }); var bufferedResponse = req.pipe(through2(function (chunk, enc, callback) { this.push(...
20,132,066
I have a form page where the users must put a code that I send them by email, this form has as action file redirect.php, which contain this code: ``` <?php header('Location: page.php?code='.$_POST['code']); ?> ``` now what I want to do with my form page is to show a error or to redirect to a page if the code they in...
2013/11/21
['https://Stackoverflow.com/questions/20132066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3016012/']
Question has been around a while, but I today faced the same problem and solved it differently: ``` var Request = require( 'request' ), Fs = require( 'fs' ); // RegExp to extract the filename from Content-Disposition var regexp = /filename=\"(.*)\"/gi; // initiate the download var req = Request.get( 'url.to/some...
Here's my solution: ``` var fs = require('fs'); var request = require('request'); var through2 = require('through2'); var req = request(url); req.on('error', function (e) { // Handle connection errors console.log(e); }); var bufferedResponse = req.pipe(through2(function (chunk, enc, callback) { this.push(...
44,629,249
Im trying to find out how to detect a touch&hold on screen method in the game im making. Im using touches began for single taps (Making the character move up) When they touch and keep holding i want the character to move straight forward. ``` - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //code ...
2017/06/19
['https://Stackoverflow.com/questions/44629249', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6151911/']
**Objective-c** ``` // Add guesture recognizer UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(buttonDidLongPress:)]; [self.button addGestureRecognizer:longPress]; // Call back event - (void)buttonDidLongPress:(UILongPressGestureRecognizer*)ges...
Try: ``` UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; [self.view addGestureRecognizer:longPress]; -(void) handleLongPress: (UIGestureRecognizer *)longPress { switch (longPress.state) { case UIGestureRecognizerStateBegan: ...
3,206,951
I'm trying to use PostgreSQL's RETURNING clause on an UPDATE within in UPDATE statement, and running into trouble. Postgres allows a query clause in an INSERT, for example: ``` INSERT INTO films SELECT * FROM tmp_films WHERE date_prod < '2004-05-07'; ``` I would like to use the RETURNING clause from an UPDATE as t...
2010/07/08
['https://Stackoverflow.com/questions/3206951', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/127044/']
Right now, no. There was a feature that *almost* made it into PostgreSQL 9.0 known as [Writeable CTE's](http://johtopg.blogspot.com/2010/06/writeable-ctes.html) that does what you're thinking (although the syntax is different). Currently, you could either do this via a trigger or as two separate statements.
I think this is not possible the way you are trying to do. I'd suggest you to write an AFTER UPDATE trigger, which could perform the insert, then.
3,206,951
I'm trying to use PostgreSQL's RETURNING clause on an UPDATE within in UPDATE statement, and running into trouble. Postgres allows a query clause in an INSERT, for example: ``` INSERT INTO films SELECT * FROM tmp_films WHERE date_prod < '2004-05-07'; ``` I would like to use the RETURNING clause from an UPDATE as t...
2010/07/08
['https://Stackoverflow.com/questions/3206951', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/127044/']
With PostgreSQL 9.1 (or higher) you may use the new functionality that allows data-modification commands (INSERT/UPDATE/DELETE) in [WITH clauses](http://www.postgresql.org/docs/9.1/static/queries-with.html), such as: ``` WITH updated_rows AS ( UPDATE products SET ... WHERE ... RETURNING * ) INSERT INTO...
I think this is not possible the way you are trying to do. I'd suggest you to write an AFTER UPDATE trigger, which could perform the insert, then.
3,206,951
I'm trying to use PostgreSQL's RETURNING clause on an UPDATE within in UPDATE statement, and running into trouble. Postgres allows a query clause in an INSERT, for example: ``` INSERT INTO films SELECT * FROM tmp_films WHERE date_prod < '2004-05-07'; ``` I would like to use the RETURNING clause from an UPDATE as t...
2010/07/08
['https://Stackoverflow.com/questions/3206951', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/127044/']
With PostgreSQL 9.1 (or higher) you may use the new functionality that allows data-modification commands (INSERT/UPDATE/DELETE) in [WITH clauses](http://www.postgresql.org/docs/9.1/static/queries-with.html), such as: ``` WITH updated_rows AS ( UPDATE products SET ... WHERE ... RETURNING * ) INSERT INTO...
Right now, no. There was a feature that *almost* made it into PostgreSQL 9.0 known as [Writeable CTE's](http://johtopg.blogspot.com/2010/06/writeable-ctes.html) that does what you're thinking (although the syntax is different). Currently, you could either do this via a trigger or as two separate statements.
62,205
I wanted to know if there is any contradiction when someone is learning several different instruments? For example, I am learning to play piano . Would becoming a good piano player in any way hold me back from playing another instrument professionally? P.S. Sorry i couldn't explain well
2017/09/25
['https://music.stackexchange.com/questions/62205', 'https://music.stackexchange.com', 'https://music.stackexchange.com/users/44336/']
It's good to keep in mind that it takes *a lot* of practice to learn an instrument. You have to dedicate a lot of time and it will take years to become a *good* piano player (same for all the instruments). So, if you want to learn how to play multiple instruments, you will have to practice all of them. If you don't hav...
One of the more dangerous combinations is piano and piano accordion. The similarity of the keyboard leads to a conflation of technique that results in "lowest common denominator" approaches. The piano is a percussive string instrument featuring impetus-sensitive attack and rather fuzzy decay, the accordion is a contin...
62,205
I wanted to know if there is any contradiction when someone is learning several different instruments? For example, I am learning to play piano . Would becoming a good piano player in any way hold me back from playing another instrument professionally? P.S. Sorry i couldn't explain well
2017/09/25
['https://music.stackexchange.com/questions/62205', 'https://music.stackexchange.com', 'https://music.stackexchange.com/users/44336/']
It's good to keep in mind that it takes *a lot* of practice to learn an instrument. You have to dedicate a lot of time and it will take years to become a *good* piano player (same for all the instruments). So, if you want to learn how to play multiple instruments, you will have to practice all of them. If you don't hav...
The first thing to emphasise is that "professional" and "highly skilled" do not necessarily go hand in hand. The Sex Pistols were professional musicians, but you wouldn't use them as examples of how to play their instruments well! It's also important to emphasise that *expecting* to become a professional musician when...
62,205
I wanted to know if there is any contradiction when someone is learning several different instruments? For example, I am learning to play piano . Would becoming a good piano player in any way hold me back from playing another instrument professionally? P.S. Sorry i couldn't explain well
2017/09/25
['https://music.stackexchange.com/questions/62205', 'https://music.stackexchange.com', 'https://music.stackexchange.com/users/44336/']
It's good to keep in mind that it takes *a lot* of practice to learn an instrument. You have to dedicate a lot of time and it will take years to become a *good* piano player (same for all the instruments). So, if you want to learn how to play multiple instruments, you will have to practice all of them. If you don't hav...
Don't construct excuses. With the possible exception of some atheletic pursuits, where over-development of one set of muscles might hinder other requirements - a body-builder is probably not suited to the pole-vault for instance - getting good at one thing is very unlikely to prevent you from getting good at another. O...
62,205
I wanted to know if there is any contradiction when someone is learning several different instruments? For example, I am learning to play piano . Would becoming a good piano player in any way hold me back from playing another instrument professionally? P.S. Sorry i couldn't explain well
2017/09/25
['https://music.stackexchange.com/questions/62205', 'https://music.stackexchange.com', 'https://music.stackexchange.com/users/44336/']
One of the more dangerous combinations is piano and piano accordion. The similarity of the keyboard leads to a conflation of technique that results in "lowest common denominator" approaches. The piano is a percussive string instrument featuring impetus-sensitive attack and rather fuzzy decay, the accordion is a contin...
The first thing to emphasise is that "professional" and "highly skilled" do not necessarily go hand in hand. The Sex Pistols were professional musicians, but you wouldn't use them as examples of how to play their instruments well! It's also important to emphasise that *expecting* to become a professional musician when...
62,205
I wanted to know if there is any contradiction when someone is learning several different instruments? For example, I am learning to play piano . Would becoming a good piano player in any way hold me back from playing another instrument professionally? P.S. Sorry i couldn't explain well
2017/09/25
['https://music.stackexchange.com/questions/62205', 'https://music.stackexchange.com', 'https://music.stackexchange.com/users/44336/']
One of the more dangerous combinations is piano and piano accordion. The similarity of the keyboard leads to a conflation of technique that results in "lowest common denominator" approaches. The piano is a percussive string instrument featuring impetus-sensitive attack and rather fuzzy decay, the accordion is a contin...
Don't construct excuses. With the possible exception of some atheletic pursuits, where over-development of one set of muscles might hinder other requirements - a body-builder is probably not suited to the pole-vault for instance - getting good at one thing is very unlikely to prevent you from getting good at another. O...
5,336,413
I'm learning VHDL and I've come to a halt. I'd like to create a simple gate out of smaller gates (a NAND gate here). Here's the code: ``` library IEEE; use IEEE.STD_LOGIC_1164.all; entity ANDGATE2 is port( x,y : in STD_LOGIC; z : out STD_LOGIC ); end ANDGATE2; architecture ANDGATE...
2011/03/17
['https://Stackoverflow.com/questions/5336413', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/663907/']
You need to use the same port names on your component and entity declarations. Right now, for example in your `NOTGATE1` entity declaration, you have input port `x` and output port `z`, but in the `NANDGATE2` architecture, you declare the `NOTGATE1` component to have ports `n_in` and `n_out`. This won't cause problem...
Not 100% sure, but I think the pins in your `component` declarations need to match up to the ones in your `entity` blocks: ``` component NOTGATE1 port( x : in STD_LOGIC; z : out STD_LOGIC ); end component; component ANDGATE2 port( x,y : in STD_LOGIC; z : out ST...
5,336,413
I'm learning VHDL and I've come to a halt. I'd like to create a simple gate out of smaller gates (a NAND gate here). Here's the code: ``` library IEEE; use IEEE.STD_LOGIC_1164.all; entity ANDGATE2 is port( x,y : in STD_LOGIC; z : out STD_LOGIC ); end ANDGATE2; architecture ANDGATE...
2011/03/17
['https://Stackoverflow.com/questions/5336413', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/663907/']
You need to use the same port names on your component and entity declarations. Right now, for example in your `NOTGATE1` entity declaration, you have input port `x` and output port `z`, but in the `NANDGATE2` architecture, you declare the `NOTGATE1` component to have ports `n_in` and `n_out`. This won't cause problem...
Always use explicit port bindings in your port maps, like ``` port map(a_in1 => x, a_in2 => y, a_out => c); ``` It will make your code also more clear. In big projects it is the first rule of thumb.
25,891,060
I have 2 NSArrays of 2 different types of custom objects. Object A properties: ID: Name: Author: Object B Properties: bookID: value: terminator: I need to filter an array of objects of type "A" that has the ID value equal to the bookID value of any of the objects of the second array that contains objects of type "...
2014/09/17
['https://Stackoverflow.com/questions/25891060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1200174/']
Here is a sample code with example: ``` NSDictionary *dictionaryA1 = @{@"ID":@"1", @"Name":@"NameA1", @"Author":@"AuthorA1"}; NSDictionary *dictionaryA2 = @{@"ID":@"2", @"Name":@"NameA2", @"Author":@"AuthorA2"}; NSDictionary *dictionaryA3 = @{@"ID":@"3", @"Name":@"NameA3", @"Author":@"AuthorA3"}; NSDictionary *dictio...
I m hopping your 2 NSArrays are like arrayA = ( ObjectA1, ObjectA2, . . ObjectAn ) and arrayB = ( ObjectB1, ObjectB2, . . ObjectBn ) In this case you have to first extract the values into separate arrays using predicate like this for both arrayA and arrayB ``` NSPredicate *predicateA = [NSPredicate predicateWi...
25,891,060
I have 2 NSArrays of 2 different types of custom objects. Object A properties: ID: Name: Author: Object B Properties: bookID: value: terminator: I need to filter an array of objects of type "A" that has the ID value equal to the bookID value of any of the objects of the second array that contains objects of type "...
2014/09/17
['https://Stackoverflow.com/questions/25891060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1200174/']
Here is a sample code with example: ``` NSDictionary *dictionaryA1 = @{@"ID":@"1", @"Name":@"NameA1", @"Author":@"AuthorA1"}; NSDictionary *dictionaryA2 = @{@"ID":@"2", @"Name":@"NameA2", @"Author":@"AuthorA2"}; NSDictionary *dictionaryA3 = @{@"ID":@"3", @"Name":@"NameA3", @"Author":@"AuthorA3"}; NSDictionary *dictio...
I used NSPredicate for filtering array; here is the code: ``` +(void)findIntersectionOfAuthors:(NSArray *)authors withBooks:(NSArray *)books { NSLog(@"CLASS A"); for (Author * aut in authors) [aut print]; NSLog(@"CLASS B"); for (Book * b in books) [b print]; NSMutableArray * resul...
25,891,060
I have 2 NSArrays of 2 different types of custom objects. Object A properties: ID: Name: Author: Object B Properties: bookID: value: terminator: I need to filter an array of objects of type "A" that has the ID value equal to the bookID value of any of the objects of the second array that contains objects of type "...
2014/09/17
['https://Stackoverflow.com/questions/25891060', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1200174/']
I m hopping your 2 NSArrays are like arrayA = ( ObjectA1, ObjectA2, . . ObjectAn ) and arrayB = ( ObjectB1, ObjectB2, . . ObjectBn ) In this case you have to first extract the values into separate arrays using predicate like this for both arrayA and arrayB ``` NSPredicate *predicateA = [NSPredicate predicateWi...
I used NSPredicate for filtering array; here is the code: ``` +(void)findIntersectionOfAuthors:(NSArray *)authors withBooks:(NSArray *)books { NSLog(@"CLASS A"); for (Author * aut in authors) [aut print]; NSLog(@"CLASS B"); for (Book * b in books) [b print]; NSMutableArray * resul...
9,918,552
I have an image compression algorithm that I can train and then feed it with some test images. There seems to be something wrong with this code though. To test this, I tried to give it the same test image that I have trained it with (i.e. test set== train set). Now the general question that I have is as follows What w...
2012/03/29
['https://Stackoverflow.com/questions/9918552', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1299705/']
Your suspicion is not correct. A ML algorithm should generally give very good results (in some cases, perfect) on the set that was used to train it, except when the algorithm is completely unsuitable for the task, or if it is badly conceived and doesn't converge. It is hard to tell because I'm not sure how you are tea...
This depends entirely on the algorithm and on your problem. Some (e.g. classification with nearest-neighbor approaches) will trivially get perfect answers. Most will show better performance than they would on different test data drawn from the same distribution as the training data, but not perfect. I guess there might...
20,952,372
I need my application to log in on site with user defined login and password. Although sending POST data is very simple I can't manage how to check if returned page shows "logged in" or "wrong password" statement. Searching .html string for specified statement is too slow and comparing pre-seted error page is not work...
2014/01/06
['https://Stackoverflow.com/questions/20952372', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2843974/']
Eat Your Cookies ================ The majority of websites will use cookies to track the current user's session across multiple requests. You'll have to attach a cookie storage to your WebRequest when sending the POST request, and inspect the storage for the login response. Each website will implement their session t...
Problem with logging in via a script, web-sites return `200 OK` response on both of login outcomes: logged in or not logged in. So you'll have to parse the incoming html for the required string to verify successful credential check. There is no other way for that, unless the site provides some API. The best way to par...
20,952,372
I need my application to log in on site with user defined login and password. Although sending POST data is very simple I can't manage how to check if returned page shows "logged in" or "wrong password" statement. Searching .html string for specified statement is too slow and comparing pre-seted error page is not work...
2014/01/06
['https://Stackoverflow.com/questions/20952372', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2843974/']
I made some research and found that regular expression perfectly fits my problem as they are **easy to implement**, and **really fast in that case**. If anyone would also have a problem like that: ``` using System.Text.RegularExpressions; // .html document returned by page string webRequestResponse = getResponse(); ...
Problem with logging in via a script, web-sites return `200 OK` response on both of login outcomes: logged in or not logged in. So you'll have to parse the incoming html for the required string to verify successful credential check. There is no other way for that, unless the site provides some API. The best way to par...
20,952,372
I need my application to log in on site with user defined login and password. Although sending POST data is very simple I can't manage how to check if returned page shows "logged in" or "wrong password" statement. Searching .html string for specified statement is too slow and comparing pre-seted error page is not work...
2014/01/06
['https://Stackoverflow.com/questions/20952372', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2843974/']
Eat Your Cookies ================ The majority of websites will use cookies to track the current user's session across multiple requests. You'll have to attach a cookie storage to your WebRequest when sending the POST request, and inspect the storage for the login response. Each website will implement their session t...
I made some research and found that regular expression perfectly fits my problem as they are **easy to implement**, and **really fast in that case**. If anyone would also have a problem like that: ``` using System.Text.RegularExpressions; // .html document returned by page string webRequestResponse = getResponse(); ...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
The setup you posted looks correct. As for `App` not being provided, you probably need to bind it in your component, since right now you're binding `TestApp` only. So you need to replace ```kotlin fun create(@BindsInstance application: TestApp): TestAppComponent ``` with ```kotlin fun create(@BindsInstance applicat...
When I try to do something similar, I don't create two types of application-components, just one. I provide them with different inputs, based on whether it's for the actual `App` or for the `TestApp`. No need for `TestAppComponent` at all. E.g. ``` open class App : Application(), HasAndroidInjector { lateinit var...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
I had the same problem with `mockWebServer` recently, what you need to do is to put a breakpoint and see what's the error, in my case I put it on my `BaseRepository` where I was doing the call, and found that the exception was : ``` java.net.UnknownServiceException: CLEARTEXT communication to localhost not permitted b...
The setup you posted looks correct. As for `App` not being provided, you probably need to bind it in your component, since right now you're binding `TestApp` only. So you need to replace ```kotlin fun create(@BindsInstance application: TestApp): TestAppComponent ``` with ```kotlin fun create(@BindsInstance applicat...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
The setup you posted looks correct. As for `App` not being provided, you probably need to bind it in your component, since right now you're binding `TestApp` only. So you need to replace ```kotlin fun create(@BindsInstance application: TestApp): TestAppComponent ``` with ```kotlin fun create(@BindsInstance applicat...
I am presuming that you are trying to inject OkHttpClient: ``` @Inject lateinit var okHttpClient: OkHttpClient ``` in your TestApp class, and it fails. In order to make it work, you will need to add an inject method in your `TestAppComponent`, to inject the overriden TestApp, so that it becomes: ``` @Singleton @Co...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
The setup you posted looks correct. As for `App` not being provided, you probably need to bind it in your component, since right now you're binding `TestApp` only. So you need to replace ```kotlin fun create(@BindsInstance application: TestApp): TestAppComponent ``` with ```kotlin fun create(@BindsInstance applicat...
How about `a dagger module` for your `Test Class` with a `ContributeAndroidInjector` in there and do `Inject` on a `@Before` method. Your `TestAppComponent`: ``` @Component(modules = [AndroidInjectionModule::class, TestAppModule::class]) interface TestAppComponent { fun inject(app: TestApp) @Component.Builde...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
I had the same problem with `mockWebServer` recently, what you need to do is to put a breakpoint and see what's the error, in my case I put it on my `BaseRepository` where I was doing the call, and found that the exception was : ``` java.net.UnknownServiceException: CLEARTEXT communication to localhost not permitted b...
When I try to do something similar, I don't create two types of application-components, just one. I provide them with different inputs, based on whether it's for the actual `App` or for the `TestApp`. No need for `TestAppComponent` at all. E.g. ``` open class App : Application(), HasAndroidInjector { lateinit var...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
When I try to do something similar, I don't create two types of application-components, just one. I provide them with different inputs, based on whether it's for the actual `App` or for the `TestApp`. No need for `TestAppComponent` at all. E.g. ``` open class App : Application(), HasAndroidInjector { lateinit var...
I am presuming that you are trying to inject OkHttpClient: ``` @Inject lateinit var okHttpClient: OkHttpClient ``` in your TestApp class, and it fails. In order to make it work, you will need to add an inject method in your `TestAppComponent`, to inject the overriden TestApp, so that it becomes: ``` @Singleton @Co...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
I had the same problem with `mockWebServer` recently, what you need to do is to put a breakpoint and see what's the error, in my case I put it on my `BaseRepository` where I was doing the call, and found that the exception was : ``` java.net.UnknownServiceException: CLEARTEXT communication to localhost not permitted b...
I am presuming that you are trying to inject OkHttpClient: ``` @Inject lateinit var okHttpClient: OkHttpClient ``` in your TestApp class, and it fails. In order to make it work, you will need to add an inject method in your `TestAppComponent`, to inject the overriden TestApp, so that it becomes: ``` @Singleton @Co...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
I had the same problem with `mockWebServer` recently, what you need to do is to put a breakpoint and see what's the error, in my case I put it on my `BaseRepository` where I was doing the call, and found that the exception was : ``` java.net.UnknownServiceException: CLEARTEXT communication to localhost not permitted b...
How about `a dagger module` for your `Test Class` with a `ContributeAndroidInjector` in there and do `Inject` on a `@Before` method. Your `TestAppComponent`: ``` @Component(modules = [AndroidInjectionModule::class, TestAppModule::class]) interface TestAppComponent { fun inject(app: TestApp) @Component.Builde...
61,539,234
I'm trying to create Espresso tests and using a `mockWebServer` the thing is when I try to create my `mockWebServer` it calls the real api call and I want to intercept it and mock the response. My dagger organisation is : My App ``` open class App : Application(), HasAndroidInjector { lateinit var application...
2020/05/01
['https://Stackoverflow.com/questions/61539234', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4329781/']
How about `a dagger module` for your `Test Class` with a `ContributeAndroidInjector` in there and do `Inject` on a `@Before` method. Your `TestAppComponent`: ``` @Component(modules = [AndroidInjectionModule::class, TestAppModule::class]) interface TestAppComponent { fun inject(app: TestApp) @Component.Builde...
I am presuming that you are trying to inject OkHttpClient: ``` @Inject lateinit var okHttpClient: OkHttpClient ``` in your TestApp class, and it fails. In order to make it work, you will need to add an inject method in your `TestAppComponent`, to inject the overriden TestApp, so that it becomes: ``` @Singleton @Co...
67,309,013
I'm trying to draw a rotated shape at a given point. To give an example, in the following image, the red rectangle is a non-rotated rectangle drawn at a point and then the blue rectangle is rotated and drawn at the same position. The blue rectangle is the outcome I'm aiming for. [![](https://i.stack.imgur.com/1gIYm.pn...
2021/04/28
['https://Stackoverflow.com/questions/67309013', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11235159/']
Something like this? [![enter image description here](https://i.stack.imgur.com/yzHpM.png)](https://i.stack.imgur.com/yzHpM.png) [![enter image description here](https://i.stack.imgur.com/CT9or.png)](https://i.stack.imgur.com/CT9or.png) [![enter image description here](https://i.stack.imgur.com/63oo5.png)](https://i.s...
You have a shape, any shape. You have a point `(px,py)` and you want to rotate the shape around this point and angle `ag` measured counter-clokwise. For each point of the shape the proccess has three steps: 1. Translate to `(px,py)` 2. Rotate 3. Translate back to `(0,0)` The translation is fully simple ``` xNew = ...
3,264,251
Let $G$ be a group with $y\in{G}$ and $n,r\in\mathbb{N}$. If $o(y)=n$, what is $o(y^r)$? My attempt: Let $$o(y^r)=a,$$ Then we have $$1\_G=(y^r)^a=(y)^{ra}.$$ So we have that $$n\mid ra,$$ So either $r$ or $a$ (or both) is a multiple of $n$. I'm not too sure where to go from here or if this is even the most effective ...
2019/06/16
['https://math.stackexchange.com/questions/3264251', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/514050/']
No, take $\color{blue}{f(x)=1}$ and $\color{red}{g(x)=1-{1\over 2^x}}$ [![enter image description here](https://i.stack.imgur.com/VfsY1.png)](https://i.stack.imgur.com/VfsY1.png) --- If $f'(x)-g'(x)>0$ then this would be true.
Consider $f(x) = x+17$ and $g(x) = x.$ They increase at the same rate everywhere for any reasonable definition, yet $f > g.$
3,264,251
Let $G$ be a group with $y\in{G}$ and $n,r\in\mathbb{N}$. If $o(y)=n$, what is $o(y^r)$? My attempt: Let $$o(y^r)=a,$$ Then we have $$1\_G=(y^r)^a=(y)^{ra}.$$ So we have that $$n\mid ra,$$ So either $r$ or $a$ (or both) is a multiple of $n$. I'm not too sure where to go from here or if this is even the most effective ...
2019/06/16
['https://math.stackexchange.com/questions/3264251', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/514050/']
No, take $\color{blue}{f(x)=1}$ and $\color{red}{g(x)=1-{1\over 2^x}}$ [![enter image description here](https://i.stack.imgur.com/VfsY1.png)](https://i.stack.imgur.com/VfsY1.png) --- If $f'(x)-g'(x)>0$ then this would be true.
Consider $g(x)=-e^{-x}$. That increases to $0$. Now take $f(x)=e^{-x}$. That decreases to $0$. Clearly $$f(x)>g(x)$$ Thus, knowing that $f$ is bigger than an increasing function $g$ doesn't even prove that $f$ is increasing.
3,264,251
Let $G$ be a group with $y\in{G}$ and $n,r\in\mathbb{N}$. If $o(y)=n$, what is $o(y^r)$? My attempt: Let $$o(y^r)=a,$$ Then we have $$1\_G=(y^r)^a=(y)^{ra}.$$ So we have that $$n\mid ra,$$ So either $r$ or $a$ (or both) is a multiple of $n$. I'm not too sure where to go from here or if this is even the most effective ...
2019/06/16
['https://math.stackexchange.com/questions/3264251', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/514050/']
No, take $\color{blue}{f(x)=1}$ and $\color{red}{g(x)=1-{1\over 2^x}}$ [![enter image description here](https://i.stack.imgur.com/VfsY1.png)](https://i.stack.imgur.com/VfsY1.png) --- If $f'(x)-g'(x)>0$ then this would be true.
If $f$ increases more quickly than $g$, that simply means the function $f-g$ is increasing. So you want to show that $(f-g)'>0$ Your question therefore boils down to, is: $$f-g>0\implies (f-g)'>0$$ true? You can define $h(x)=f(x)-g(x)$ to give the statement: $$h(x)>0\implies h'(x)>0$$ f0r which I supply $h:\Bbb R^+ ...
3,264,251
Let $G$ be a group with $y\in{G}$ and $n,r\in\mathbb{N}$. If $o(y)=n$, what is $o(y^r)$? My attempt: Let $$o(y^r)=a,$$ Then we have $$1\_G=(y^r)^a=(y)^{ra}.$$ So we have that $$n\mid ra,$$ So either $r$ or $a$ (or both) is a multiple of $n$. I'm not too sure where to go from here or if this is even the most effective ...
2019/06/16
['https://math.stackexchange.com/questions/3264251', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/514050/']
Consider $g(x)=-e^{-x}$. That increases to $0$. Now take $f(x)=e^{-x}$. That decreases to $0$. Clearly $$f(x)>g(x)$$ Thus, knowing that $f$ is bigger than an increasing function $g$ doesn't even prove that $f$ is increasing.
Consider $f(x) = x+17$ and $g(x) = x.$ They increase at the same rate everywhere for any reasonable definition, yet $f > g.$
3,264,251
Let $G$ be a group with $y\in{G}$ and $n,r\in\mathbb{N}$. If $o(y)=n$, what is $o(y^r)$? My attempt: Let $$o(y^r)=a,$$ Then we have $$1\_G=(y^r)^a=(y)^{ra}.$$ So we have that $$n\mid ra,$$ So either $r$ or $a$ (or both) is a multiple of $n$. I'm not too sure where to go from here or if this is even the most effective ...
2019/06/16
['https://math.stackexchange.com/questions/3264251', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/514050/']
Consider $f(x) = x+17$ and $g(x) = x.$ They increase at the same rate everywhere for any reasonable definition, yet $f > g.$
If $f$ increases more quickly than $g$, that simply means the function $f-g$ is increasing. So you want to show that $(f-g)'>0$ Your question therefore boils down to, is: $$f-g>0\implies (f-g)'>0$$ true? You can define $h(x)=f(x)-g(x)$ to give the statement: $$h(x)>0\implies h'(x)>0$$ f0r which I supply $h:\Bbb R^+ ...
3,264,251
Let $G$ be a group with $y\in{G}$ and $n,r\in\mathbb{N}$. If $o(y)=n$, what is $o(y^r)$? My attempt: Let $$o(y^r)=a,$$ Then we have $$1\_G=(y^r)^a=(y)^{ra}.$$ So we have that $$n\mid ra,$$ So either $r$ or $a$ (or both) is a multiple of $n$. I'm not too sure where to go from here or if this is even the most effective ...
2019/06/16
['https://math.stackexchange.com/questions/3264251', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/514050/']
Consider $g(x)=-e^{-x}$. That increases to $0$. Now take $f(x)=e^{-x}$. That decreases to $0$. Clearly $$f(x)>g(x)$$ Thus, knowing that $f$ is bigger than an increasing function $g$ doesn't even prove that $f$ is increasing.
If $f$ increases more quickly than $g$, that simply means the function $f-g$ is increasing. So you want to show that $(f-g)'>0$ Your question therefore boils down to, is: $$f-g>0\implies (f-g)'>0$$ true? You can define $h(x)=f(x)-g(x)$ to give the statement: $$h(x)>0\implies h'(x)>0$$ f0r which I supply $h:\Bbb R^+ ...
709,346
I'm working with a startup that's teaching kids to program. We've just obtained our first "fleet" of laptops - half a dozen refurbished thinkpads running Windows 7 - and I'm looking for the best way to administer and maintain them. I've already determined that it appears to make sense to buy a volume license key, so I...
2015/07/29
['https://serverfault.com/questions/709346', 'https://serverfault.com', 'https://serverfault.com/users/83562/']
This is the perfect use case for [Microsoft Intune](http://www.microsoft.com/en-us/server-cloud/products/microsoft-intune/). While it is primarily known as an MDM solution, it also has PC management capabilities as well, such as app deployment and patch management. It's also completely cloud-based and is licensed on a ...
It would be possible to automatically connect each laptop to a VPN network. All you would need is an VPN server / router. And some configuration for the laptop to connect to vpn on logon. After that you could simply RDP to it.
709,346
I'm working with a startup that's teaching kids to program. We've just obtained our first "fleet" of laptops - half a dozen refurbished thinkpads running Windows 7 - and I'm looking for the best way to administer and maintain them. I've already determined that it appears to make sense to buy a volume license key, so I...
2015/07/29
['https://serverfault.com/questions/709346', 'https://serverfault.com', 'https://serverfault.com/users/83562/']
This is the perfect use case for [Microsoft Intune](http://www.microsoft.com/en-us/server-cloud/products/microsoft-intune/). While it is primarily known as an MDM solution, it also has PC management capabilities as well, such as app deployment and patch management. It's also completely cloud-based and is licensed on a ...
Depending on your budget (which you haven't stated) I think a good solution for you could be that of a HP Microserver with some extra RAM as a domain controller? That way you have an extremely portable server with the ability to push out updates and lock down the laptops with group policy? For that amount of laptop...
709,346
I'm working with a startup that's teaching kids to program. We've just obtained our first "fleet" of laptops - half a dozen refurbished thinkpads running Windows 7 - and I'm looking for the best way to administer and maintain them. I've already determined that it appears to make sense to buy a volume license key, so I...
2015/07/29
['https://serverfault.com/questions/709346', 'https://serverfault.com', 'https://serverfault.com/users/83562/']
This is the perfect use case for [Microsoft Intune](http://www.microsoft.com/en-us/server-cloud/products/microsoft-intune/). While it is primarily known as an MDM solution, it also has PC management capabilities as well, such as app deployment and patch management. It's also completely cloud-based and is licensed on a ...
I'm not sure if this will cover all you need but... At the place I am recently employed, company-issued laptops (which are running Windows) are required to be able to access the company VPN. Namely, VPN access is only allowed using company-issued laptops. Users are not admins on their local machine. Therefore, compa...
709,346
I'm working with a startup that's teaching kids to program. We've just obtained our first "fleet" of laptops - half a dozen refurbished thinkpads running Windows 7 - and I'm looking for the best way to administer and maintain them. I've already determined that it appears to make sense to buy a volume license key, so I...
2015/07/29
['https://serverfault.com/questions/709346', 'https://serverfault.com', 'https://serverfault.com/users/83562/']
This is the perfect use case for [Microsoft Intune](http://www.microsoft.com/en-us/server-cloud/products/microsoft-intune/). While it is primarily known as an MDM solution, it also has PC management capabilities as well, such as app deployment and patch management. It's also completely cloud-based and is licensed on a ...
I would recommend [Meraki Systems Manager](https://meraki.cisco.com/products/systems-manager). It's an entirely cloud-managed solution that's free for up to 100 devices. It's probably not as robust as Microsoft InTune or Systems Center Configuration Manager, but it may fit the bill for the price. My favorite feature is...
15,152,058
I wanted to use `Collection` for only single threaded environment and I am using a `HashMap` that is synchronized. However, I still doubt if it is thread safe to have it synchronized or not.
2013/03/01
['https://Stackoverflow.com/questions/15152058', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/891556/']
For your needs, use `ConcurrentHashMap`. It allows concurrent modification of the Map from several threads without the need to block them. `Collections.synchronizedMap(map)` creates a blocking Map which will degrade performance, albeit ensure consistency
The commonly used `Collection` classes, such as `java.util.ArrayList`, are not synchronized. However, if there's a chance that two threads could be altering a collection concurrently, you can generate a synchronized collection from it using the `synchronizedCollection()` method. Similar to the read-only methods, the th...
15,152,058
I wanted to use `Collection` for only single threaded environment and I am using a `HashMap` that is synchronized. However, I still doubt if it is thread safe to have it synchronized or not.
2013/03/01
['https://Stackoverflow.com/questions/15152058', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/891556/']
For your needs, use `ConcurrentHashMap`. It allows concurrent modification of the Map from several threads without the need to block them. `Collections.synchronizedMap(map)` creates a blocking Map which will degrade performance, albeit ensure consistency
As its a single-threaded environment you can safely use HashMap.
15,152,058
I wanted to use `Collection` for only single threaded environment and I am using a `HashMap` that is synchronized. However, I still doubt if it is thread safe to have it synchronized or not.
2013/03/01
['https://Stackoverflow.com/questions/15152058', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/891556/']
1. the standard java HashMap is not synchronized. 2. If you are in a single threaded environment you don't need to worry about synchronization.
The commonly used `Collection` classes, such as `java.util.ArrayList`, are not synchronized. However, if there's a chance that two threads could be altering a collection concurrently, you can generate a synchronized collection from it using the `synchronizedCollection()` method. Similar to the read-only methods, the th...
15,152,058
I wanted to use `Collection` for only single threaded environment and I am using a `HashMap` that is synchronized. However, I still doubt if it is thread safe to have it synchronized or not.
2013/03/01
['https://Stackoverflow.com/questions/15152058', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/891556/']
If you're only using a single thread, you don't *need* a thread-safe collection - `HashMap` should be fine. You should be very careful to work out your requirements: * If you're really using a single thread, stick with `HashMap` (or consider `LinkedHashMap`) * If you're sharing the map, you need to work out what kind...
The commonly used `Collection` classes, such as `java.util.ArrayList`, are not synchronized. However, if there's a chance that two threads could be altering a collection concurrently, you can generate a synchronized collection from it using the `synchronizedCollection()` method. Similar to the read-only methods, the th...
15,152,058
I wanted to use `Collection` for only single threaded environment and I am using a `HashMap` that is synchronized. However, I still doubt if it is thread safe to have it synchronized or not.
2013/03/01
['https://Stackoverflow.com/questions/15152058', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/891556/']
1. the standard java HashMap is not synchronized. 2. If you are in a single threaded environment you don't need to worry about synchronization.
As its a single-threaded environment you can safely use HashMap.
15,152,058
I wanted to use `Collection` for only single threaded environment and I am using a `HashMap` that is synchronized. However, I still doubt if it is thread safe to have it synchronized or not.
2013/03/01
['https://Stackoverflow.com/questions/15152058', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/891556/']
If you're only using a single thread, you don't *need* a thread-safe collection - `HashMap` should be fine. You should be very careful to work out your requirements: * If you're really using a single thread, stick with `HashMap` (or consider `LinkedHashMap`) * If you're sharing the map, you need to work out what kind...
As its a single-threaded environment you can safely use HashMap.
5,713,437
i want to draw/add an image as a part of text in textbox in windows phone 7. I m not using Expression blend. So where i can find the drawing objects as well as paint events in silverlight?
2011/04/19
['https://Stackoverflow.com/questions/5713437', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/665983/']
There is no way to add an image as part of a TextBox. Although I'm not entirely sure what you want to achieve. Do you really mean TextBox? If so, the only option will be to restyle it so it have the image included as well. Do you mean TextBlock? If so, and you're trying to include an image part way through a piece of...
You might want to override the template in order to define your own template. You can do this in the style: ``` <Style x:Key="textboxImage" TargetType="TextBox"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TextBox"> <Grid> ...
5,713,437
i want to draw/add an image as a part of text in textbox in windows phone 7. I m not using Expression blend. So where i can find the drawing objects as well as paint events in silverlight?
2011/04/19
['https://Stackoverflow.com/questions/5713437', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/665983/']
You can apply a background image to a lot of Silverlight elements with the following: ``` <TextBox x:Name="SearchBox" Text="Search" Height="70" Width="390"> <TextBox.Background> <ImageBrush ImageSource="Images/MagnifyingGlass.png" Stretch="UniformToFill" /> </TextBox.Background> </TextBox> ```
You might want to override the template in order to define your own template. You can do this in the style: ``` <Style x:Key="textboxImage" TargetType="TextBox"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TextBox"> <Grid> ...
22,665,835
I am working in my asp.net project; when I run my program, it stops running and gives me this message: `A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is co...
2014/03/26
['https://Stackoverflow.com/questions/22665835', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3464877/']
This problem is related to connection string, 1. Check instance server 2. Check user and password Connection string: > > > ``` > Server=YOUR_SQLSERVER_INSTANCE;Database=YOUR_DATABASE_NAME;User Id=sa;Password=YOUR_SA_PASSWORD; > > ``` > > If you have instance, make sure instance is specified in server, for exam...
This exception throws when your sqlServer service is stopped or when your TCP port is changed, so check for that one.
22,665,835
I am working in my asp.net project; when I run my program, it stops running and gives me this message: `A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is co...
2014/03/26
['https://Stackoverflow.com/questions/22665835', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3464877/']
This problem is related to connection string, 1. Check instance server 2. Check user and password Connection string: > > > ``` > Server=YOUR_SQLSERVER_INSTANCE;Database=YOUR_DATABASE_NAME;User Id=sa;Password=YOUR_SA_PASSWORD; > > ``` > > If you have instance, make sure instance is specified in server, for exam...
We added the port info to our connection string which alleviated this error. For example: server=*servername*,*port#*;database=*databasename*;....
22,665,835
I am working in my asp.net project; when I run my program, it stops running and gives me this message: `A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is co...
2014/03/26
['https://Stackoverflow.com/questions/22665835', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3464877/']
This problem is related to connection string, 1. Check instance server 2. Check user and password Connection string: > > > ``` > Server=YOUR_SQLSERVER_INSTANCE;Database=YOUR_DATABASE_NAME;User Id=sa;Password=YOUR_SA_PASSWORD; > > ``` > > If you have instance, make sure instance is specified in server, for exam...
I got the error because my `DataSource` was named > > (localdb)\v11.0 > > > and in C# the backslash is interpreted as a special character so needs to be escaped as follows : the below lines will work! But single "\" fails. ``` String source = "Data Source=(localdb)" + "\\" + "v11.0;Initial Catalog=Northwind;Int...
22,665,835
I am working in my asp.net project; when I run my program, it stops running and gives me this message: `A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is co...
2014/03/26
['https://Stackoverflow.com/questions/22665835', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3464877/']
This problem is related to connection string, 1. Check instance server 2. Check user and password Connection string: > > > ``` > Server=YOUR_SQLSERVER_INSTANCE;Database=YOUR_DATABASE_NAME;User Id=sa;Password=YOUR_SA_PASSWORD; > > ``` > > If you have instance, make sure instance is specified in server, for exam...
I got the same error, and my connection string is correct. I try to use ip address of SQL Server instead of server name. Finally, this error has gone. I use this connection string ``` <add name="YourEntitiesName" connectionString="metadata=res://*/Model.SampleDatabaseModel.csdl|res://*/Model.SampleDatabaseModel.ssdl...
330,473
(QGIS 3.4) The image below will help explain my goal: I'm working out how to coalesce the attributes of the field "ID" if the field "X, Y" is a duplicate. I have highlighted some duplicate coordinates in red. My expression will create a new text field and chain all attributes in the "ID" field, delimited by a pipe (`...
2019/07/30
['https://gis.stackexchange.com/questions/330473', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/93834/']
With credit to Vince, the correct expression to use in this case was: ``` concatenate( to_string( "ID" ),group_by:="X, Y", concatenator:='|') ```
In QGIS I can suggest using a [**"Virtual Layer"**](https://docs.qgis.org/3.10/en/docs/user_manual/managing_data_source/create_layers.html#creating-virtual-layers) through `Layer > Add Layer > Add/Edit Virtual Layer...` Let's assume there is a point layer with it's corresponding attribute table, see image below. [![i...
4,127,256
I've seen many tutorials, but none of them have worked in my case, I think it is because I'm using a .jar instead of an .class and in that .jar, I have more than just one Java class. Anyone knows how to solve this? code: <http://dl.dropbox.com/u/1430071/code.txt>
2010/11/08
['https://Stackoverflow.com/questions/4127256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/501066/']
Ignore the DWR answers, they misunderstood your architecture. Applet code runs on client, not server. What error message do you get? Is the method you are trying to call public? The way you are calling the Java method, the method has to be in the applet class. Is it? It seems like your applet tag is missing the cod...
Are you trying to call server side java from client side javascript? You would need to wire up a DWR call.
4,127,256
I've seen many tutorials, but none of them have worked in my case, I think it is because I'm using a .jar instead of an .class and in that .jar, I have more than just one Java class. Anyone knows how to solve this? code: <http://dl.dropbox.com/u/1430071/code.txt>
2010/11/08
['https://Stackoverflow.com/questions/4127256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/501066/']
Ignore the DWR answers, they misunderstood your architecture. Applet code runs on client, not server. What error message do you get? Is the method you are trying to call public? The way you are calling the Java method, the method has to be in the applet class. Is it? It seems like your applet tag is missing the cod...
As Joe mentioned, DWR can help you here. Here a [link](http://directwebremoting.org/dwr/examples/index.html) to their tutorials.
44,212,729
I have a cordova plugin in my local. I can add it to my project without problems by typing: `cordova plugin add --link /Users/goforu/WorkSpace/MyProject/cordovaPlugins/cordova-plugin-IFlyspeech` But I can't remove it from my project: ``` cordova plugin remove cordova-plugin-xunfeiListenSpeaking ``` It always logs ...
2017/05/27
['https://Stackoverflow.com/questions/44212729', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3616815/']
It's a bug when using `--link`. I've already [reported it](https://issues.apache.org/jira/browse/CB-12840). Anyway, `--link` [is broken too](https://issues.apache.org/jira/browse/CB-12787), so don't use it. You don't really need it unless you are creating the plugin and want to have the changes on the original plugin...
Yes, it is showing on running command ``` cordova plugin remove/rm cordova-plugin-xunfeiListenSpeaking ``` Error: Plugin "cordova-plugin-xunfeiListenSpeaking" is not present in the project. See cordova plugin list. because, really there is no plugin existing in the plugins list but, the --link is broken as he sa...
10,548,777
I've created a .NET console application that gets some command line arguments. When I pass args with white spaces, I use quotes to embrace these arguments so that they are not splitted by cmd: ``` C:\MyAppDir> MyApp argument1 "argument 2" "the third argument" ``` If I execute the app in Windows XP it works fine: it...
2012/05/11
['https://Stackoverflow.com/questions/10548777', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/150370/']
Make sure the character you are typing is indeed the double quote ". Maybe it's a character that looks like it. I know my Greek language settings produce a " but it's not read that way.
Please Try it. C:\MyAppDir> MyApp argument1 \"argument 2\" \"the third argument\"
10,548,777
I've created a .NET console application that gets some command line arguments. When I pass args with white spaces, I use quotes to embrace these arguments so that they are not splitted by cmd: ``` C:\MyAppDir> MyApp argument1 "argument 2" "the third argument" ``` If I execute the app in Windows XP it works fine: it...
2012/05/11
['https://Stackoverflow.com/questions/10548777', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/150370/']
Make sure the character you are typing is indeed the double quote ". Maybe it's a character that looks like it. I know my Greek language settings produce a " but it's not read that way.
You can try, put each arguments between Quota"" and in the paths put double backslash for example like that: generadorPlantillasPDF.exe "C:\GDI\desarrollos\celula canales\proyectos\Progreso\curso xml\" generadorprogreso.xml C:\Temp\ BVI "C:\GDI\desarrollos\celula canales\proyectos\Progreso\plantilla\" "C:\GDI\desarrol...
10,548,777
I've created a .NET console application that gets some command line arguments. When I pass args with white spaces, I use quotes to embrace these arguments so that they are not splitted by cmd: ``` C:\MyAppDir> MyApp argument1 "argument 2" "the third argument" ``` If I execute the app in Windows XP it works fine: it...
2012/05/11
['https://Stackoverflow.com/questions/10548777', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/150370/']
Please Try it. C:\MyAppDir> MyApp argument1 \"argument 2\" \"the third argument\"
You can try, put each arguments between Quota"" and in the paths put double backslash for example like that: generadorPlantillasPDF.exe "C:\GDI\desarrollos\celula canales\proyectos\Progreso\curso xml\" generadorprogreso.xml C:\Temp\ BVI "C:\GDI\desarrollos\celula canales\proyectos\Progreso\plantilla\" "C:\GDI\desarrol...
25,109,492
I use sass mixin and i want change my old code using regex for example i have the next scss code ``` margin-left:30px; margin-right:3em; padding-right:1rem; ``` to ``` @include margin-start(30px); @include margin-end(3em); @include padding-end(1rem); ```
2014/08/03
['https://Stackoverflow.com/questions/25109492', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1901574/']
I dug into Directory class source code and found an inspiration. Here is a working solution which gives you list of all opened named pipes. My result does not contain \\.\pipe\ prefix as it can be seen in result of Directory.GetFiles. I tested my solution on WinXp SP3, Win 7, Win 8.1. ``` [StructLayout(LayoutKind....
Using one of the .NET 4 APIs returning `IEnumerable`, you can catch those exceptions: ``` static IEnumerable<string> EnumeratePipes() { bool MoveNextSafe(IEnumerator enumerator) { // Pipes might have illegal characters in path. Seen one from IAR containing < and >. // The FileSystemEnumerable.Move...
260,160
I found a [semi-related post](https://diy.stackexchange.com/questions/184406/barn-door-with-no-header) about this, but it doesn't really answer my question. It basically claims a horizontal, wall-mounted barn door could work in a space like below (see images). However, all horizontal, wall-mounted barn doors I have fou...
2022/11/08
['https://diy.stackexchange.com/questions/260160', 'https://diy.stackexchange.com', 'https://diy.stackexchange.com/users/158563/']
A few options come to mind: * A common swinging door. Easy to frame there. * A barn door, sliding right. Sliding left is probably prohibited and likely impractical because of the other door. * A pocket door in a faux wall on the right Additionally, or in lieu of the above, pad the stairs with carpet, pad the walls wi...
Perhaps an accordion door (note: the accordion will not contribute to noise). [![enter image description here](https://i.stack.imgur.com/uYArV.png)](https://i.stack.imgur.com/uYArV.png)
260,160
I found a [semi-related post](https://diy.stackexchange.com/questions/184406/barn-door-with-no-header) about this, but it doesn't really answer my question. It basically claims a horizontal, wall-mounted barn door could work in a space like below (see images). However, all horizontal, wall-mounted barn doors I have fou...
2022/11/08
['https://diy.stackexchange.com/questions/260160', 'https://diy.stackexchange.com', 'https://diy.stackexchange.com/users/158563/']
A few options come to mind: * A common swinging door. Easy to frame there. * A barn door, sliding right. Sliding left is probably prohibited and likely impractical because of the other door. * A pocket door in a faux wall on the right Additionally, or in lieu of the above, pad the stairs with carpet, pad the walls wi...
One option could be free-swinging **French doors**; while ideally you want more space between the bottom step and the door than you've got, French doors wouldn't feel like as much of an obstacle. Obviously, they would need to swing out into the room, away from the stairs. However, if the goal is to *reduce* noise, a b...
260,160
I found a [semi-related post](https://diy.stackexchange.com/questions/184406/barn-door-with-no-header) about this, but it doesn't really answer my question. It basically claims a horizontal, wall-mounted barn door could work in a space like below (see images). However, all horizontal, wall-mounted barn doors I have fou...
2022/11/08
['https://diy.stackexchange.com/questions/260160', 'https://diy.stackexchange.com', 'https://diy.stackexchange.com/users/158563/']
The problem with a door here is that it will feel weird and cramped to people coming down the stairs. So you need enough space on the flat-floor to stand and open the door. Right now it looks about one stair-tread of depth, ideally you'd want triple that. I would suggest a curtain rail over the access, and hang a soun...
Perhaps an accordion door (note: the accordion will not contribute to noise). [![enter image description here](https://i.stack.imgur.com/uYArV.png)](https://i.stack.imgur.com/uYArV.png)
260,160
I found a [semi-related post](https://diy.stackexchange.com/questions/184406/barn-door-with-no-header) about this, but it doesn't really answer my question. It basically claims a horizontal, wall-mounted barn door could work in a space like below (see images). However, all horizontal, wall-mounted barn doors I have fou...
2022/11/08
['https://diy.stackexchange.com/questions/260160', 'https://diy.stackexchange.com', 'https://diy.stackexchange.com/users/158563/']
The problem with a door here is that it will feel weird and cramped to people coming down the stairs. So you need enough space on the flat-floor to stand and open the door. Right now it looks about one stair-tread of depth, ideally you'd want triple that. I would suggest a curtain rail over the access, and hang a soun...
One option could be free-swinging **French doors**; while ideally you want more space between the bottom step and the door than you've got, French doors wouldn't feel like as much of an obstacle. Obviously, they would need to swing out into the room, away from the stairs. However, if the goal is to *reduce* noise, a b...
260,160
I found a [semi-related post](https://diy.stackexchange.com/questions/184406/barn-door-with-no-header) about this, but it doesn't really answer my question. It basically claims a horizontal, wall-mounted barn door could work in a space like below (see images). However, all horizontal, wall-mounted barn doors I have fou...
2022/11/08
['https://diy.stackexchange.com/questions/260160', 'https://diy.stackexchange.com', 'https://diy.stackexchange.com/users/158563/']
Perhaps an accordion door (note: the accordion will not contribute to noise). [![enter image description here](https://i.stack.imgur.com/uYArV.png)](https://i.stack.imgur.com/uYArV.png)
One option could be free-swinging **French doors**; while ideally you want more space between the bottom step and the door than you've got, French doors wouldn't feel like as much of an obstacle. Obviously, they would need to swing out into the room, away from the stairs. However, if the goal is to *reduce* noise, a b...
73,359,708
I have a table with design ``` CREATE TABLE IF NOT EXISTS InsuranceContract ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `enquiryCode` VARCHAR(20) DEFAULT NULL, `contractCode` VARCHAR(20) DEFAULT NULL, `createdAt` DATETIME DEFAULT CURRENT_TIMESTAMP (), `updatedAt` DATETIME DEFAULT CURRENT_TIMESTAMP () ON UPDATE CUR...
2022/08/15
['https://Stackoverflow.com/questions/73359708', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12073199/']
You can use placehoders on prepare statements, this is why we use them to prevent sql injection One other thing never use column names as variables names, databases can not differentiate ``` DROP procedure IF EXISTS `sp_insurance_contract_get`; DELIMITER $$ CREATE PROCEDURE `sp_insurance_contract_get` (enquiryCode_ ...
When you say ``` WHERE enquiryCode = enquiryCode ``` you compare that named column to itself. The result is true always (unless the column value is NULL). Change the names of your SP's parameters, so you can say something like ``` WHERE enquiryCode_param = enquiryCode ``` and things should work. Notice that you...
45,320,053
I developed a website using Asp.Net MVC and Edmx database and I published this website on azure and my database is also on azure and I've a functionality on website that uploads excel record into database and that excel sheet contain almost 18000 records every time I upload that sheet it throw Timeout error after some ...
2017/07/26
['https://Stackoverflow.com/questions/45320053', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4207036/']
I actually Solved my problem. I did everything correct. But only thing I did not do is to map the hostname with the same ip in Route53. And instead of accessing the website with hostname, I was accessing it from IP. Now after accessing the website from hostname, I was able to access it :)
Seems like you posted [here and got your answer](https://github.com/nginxinc/kubernetes-ingress/issues/76). The solution is to deploy a different Ingress for each namespace. However, deploying 2 Ingresses complicates matters because one instance has to run on a non-standard port (eg. 8080, 8443). I think this is bette...
45,320,053
I developed a website using Asp.Net MVC and Edmx database and I published this website on azure and my database is also on azure and I've a functionality on website that uploads excel record into database and that excel sheet contain almost 18000 records every time I upload that sheet it throw Timeout error after some ...
2017/07/26
['https://Stackoverflow.com/questions/45320053', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4207036/']
Seems like you posted [here and got your answer](https://github.com/nginxinc/kubernetes-ingress/issues/76). The solution is to deploy a different Ingress for each namespace. However, deploying 2 Ingresses complicates matters because one instance has to run on a non-standard port (eg. 8080, 8443). I think this is bette...
You can create nginx ingress cotroller in kube-system namespace instead of creating it in QA namespace.
45,320,053
I developed a website using Asp.Net MVC and Edmx database and I published this website on azure and my database is also on azure and I've a functionality on website that uploads excel record into database and that excel sheet contain almost 18000 records every time I upload that sheet it throw Timeout error after some ...
2017/07/26
['https://Stackoverflow.com/questions/45320053', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4207036/']
Seems like you posted [here and got your answer](https://github.com/nginxinc/kubernetes-ingress/issues/76). The solution is to deploy a different Ingress for each namespace. However, deploying 2 Ingresses complicates matters because one instance has to run on a non-standard port (eg. 8080, 8443). I think this is bette...
Had the same issue, found a way to resolve it: you just need to add the "**--watch-namespace**" argument to the ingress controller that sits under the ingress service that you've linked to your ingress resource. Then it will be bound only to the services within the same namespace as the ingress service and its pods be...
45,320,053
I developed a website using Asp.Net MVC and Edmx database and I published this website on azure and my database is also on azure and I've a functionality on website that uploads excel record into database and that excel sheet contain almost 18000 records every time I upload that sheet it throw Timeout error after some ...
2017/07/26
['https://Stackoverflow.com/questions/45320053', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4207036/']
I actually Solved my problem. I did everything correct. But only thing I did not do is to map the hostname with the same ip in Route53. And instead of accessing the website with hostname, I was accessing it from IP. Now after accessing the website from hostname, I was able to access it :)
You can create nginx ingress cotroller in kube-system namespace instead of creating it in QA namespace.
45,320,053
I developed a website using Asp.Net MVC and Edmx database and I published this website on azure and my database is also on azure and I've a functionality on website that uploads excel record into database and that excel sheet contain almost 18000 records every time I upload that sheet it throw Timeout error after some ...
2017/07/26
['https://Stackoverflow.com/questions/45320053', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4207036/']
I actually Solved my problem. I did everything correct. But only thing I did not do is to map the hostname with the same ip in Route53. And instead of accessing the website with hostname, I was accessing it from IP. Now after accessing the website from hostname, I was able to access it :)
Had the same issue, found a way to resolve it: you just need to add the "**--watch-namespace**" argument to the ingress controller that sits under the ingress service that you've linked to your ingress resource. Then it will be bound only to the services within the same namespace as the ingress service and its pods be...
45,320,053
I developed a website using Asp.Net MVC and Edmx database and I published this website on azure and my database is also on azure and I've a functionality on website that uploads excel record into database and that excel sheet contain almost 18000 records every time I upload that sheet it throw Timeout error after some ...
2017/07/26
['https://Stackoverflow.com/questions/45320053', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4207036/']
Had the same issue, found a way to resolve it: you just need to add the "**--watch-namespace**" argument to the ingress controller that sits under the ingress service that you've linked to your ingress resource. Then it will be bound only to the services within the same namespace as the ingress service and its pods be...
You can create nginx ingress cotroller in kube-system namespace instead of creating it in QA namespace.
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
it's not proper syntax use instead ``` case 's': case 'g': cout << "Finish"; break; ```
``` char o,t; cin >> o >> t; switch (o,t) { case 's': case 'g': cout << "Finish"; break; default: cout << "Nothing"; } ``` In switch when matched case is found, all operator after that are executed. That's why you should write `break;` operator after `case`-es to exit switch. So if you want to do the same in se...
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
it's not proper syntax use instead ``` case 's': case 'g': cout << "Finish"; break; ```
You have some syntax error, the correct code is ``` char o,t; cin >> o >> t; switch (o) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } switch (t) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } ```
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
it's not proper syntax use instead ``` case 's': case 'g': cout << "Finish"; break; ```
You can't `switch` on multiple values in C++. ``` switch (o,t) ``` uses the *comma operator* (it looks a lot like a pair would in some other languages, but it isn't). The comma operator evaluates its left operand (`o`), ignores the value of that, and then returns the value of its right operand (`t`). In other ...
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
You cannot do switch for two expressions at the same time. The switch part only compiles because there is a comma operator (which simply evaluates to the second value, in this case `t`). Use plain old `if` statements.
``` char o,t; cin >> o >> t; switch (o,t) { case 's': case 'g': cout << "Finish"; break; default: cout << "Nothing"; } ``` In switch when matched case is found, all operator after that are executed. That's why you should write `break;` operator after `case`-es to exit switch. So if you want to do the same in se...
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
``` char o,t; cin >> o >> t; switch (o,t) { case 's': case 'g': cout << "Finish"; break; default: cout << "Nothing"; } ``` In switch when matched case is found, all operator after that are executed. That's why you should write `break;` operator after `case`-es to exit switch. So if you want to do the same in se...
You have some syntax error, the correct code is ``` char o,t; cin >> o >> t; switch (o) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } switch (t) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } ```
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
You cannot do switch for two expressions at the same time. The switch part only compiles because there is a comma operator (which simply evaluates to the second value, in this case `t`). Use plain old `if` statements.
You have some syntax error, the correct code is ``` char o,t; cin >> o >> t; switch (o) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } switch (t) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } ```
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
You cannot do switch for two expressions at the same time. The switch part only compiles because there is a comma operator (which simply evaluates to the second value, in this case `t`). Use plain old `if` statements.
You can't `switch` on multiple values in C++. ``` switch (o,t) ``` uses the *comma operator* (it looks a lot like a pair would in some other languages, but it isn't). The comma operator evaluates its left operand (`o`), ignores the value of that, and then returns the value of its right operand (`t`). In other ...
9,358,237
I got app with UITableView. There is UILabel in each UITableViewCell. I add labels in this way: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //look at the upd } ``` But when i try to reload data in this table with some other information, old infromat...
2012/02/20
['https://Stackoverflow.com/questions/9358237', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1150441/']
You can't `switch` on multiple values in C++. ``` switch (o,t) ``` uses the *comma operator* (it looks a lot like a pair would in some other languages, but it isn't). The comma operator evaluates its left operand (`o`), ignores the value of that, and then returns the value of its right operand (`t`). In other ...
You have some syntax error, the correct code is ``` char o,t; cin >> o >> t; switch (o) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } switch (t) { case 's':case 'g': cout << "Finish"; break; default: cout << "Nothing"; } ```
60,176,340
I have a front-end application that sends a formData which contains arrays, so I'm using "object-to-formdata" to parse an the following object: ``` { "profileImage": { "name": "5574c060-853b-4999-ba39-1c66d5329704", "size": 364985, "mimetype": "image/png", "url":...
2020/02/11
['https://Stackoverflow.com/questions/60176340', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11101440/']
If you have a small program that is going to exit quickly and you are running on a fully-featured modern desktop or server operating system, then probably you can rely on the operating system to clean up allocated heap memory when the process terminates; see [here](https://stackoverflow.com/questions/15882531/does-the-...
If you are on an operating system, where a misbehaving process can't really do much passive harm, then it is in practice fine. Active harm such as corrupting files is another thing, but leaving memory un-freed at program exit will not interact with those system APIs. So omitting memory free at program exit is, in a sen...
60,176,340
I have a front-end application that sends a formData which contains arrays, so I'm using "object-to-formdata" to parse an the following object: ``` { "profileImage": { "name": "5574c060-853b-4999-ba39-1c66d5329704", "size": 364985, "mimetype": "image/png", "url":...
2020/02/11
['https://Stackoverflow.com/questions/60176340', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11101440/']
> > I know, any dynamically allocated memory MUST be freed at the end of its use, with `free()`. > > > No. Not freeing has the result that less memory remains for your program to allocate for other purposes. It may (or may not) cause the program's memory footprint to be larger than it otherwise would be. In flagra...
If you are on an operating system, where a misbehaving process can't really do much passive harm, then it is in practice fine. Active harm such as corrupting files is another thing, but leaving memory un-freed at program exit will not interact with those system APIs. So omitting memory free at program exit is, in a sen...
2,648,348
For ordinary differential equation, $$y'+y\sin(x) = \sin(2x) $$ where y=y(x) for real x. Is there any way that I can solve this question with eigenvalues and eigenvectors by changing above equation like X`=AX ? Thanks in advance
2018/02/13
['https://math.stackexchange.com/questions/2648348', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/530979/']
$$\frac{dy}{dx}+y\sin(x) = \sin(2x)=2\sin(x)\cos(x) $$ $$\frac{dy}{\sin(x)dx}+y =2\cos(x)$$ $$\frac{dy}{d(-\cos(x))}+y=2\cos(x) $$ Let $\quad X=\cos(x)$ $$-\frac{dy}{dX}+y=2X$$ This first order linear ODE is easy to solve : $\quad y=c\:e^X+2X+2$ $$y(x)=c\:e^{\cos(x)}+2\cos(x)+2$$
$$ y'+y\sin x=\sin (2x)\quad\Longleftrightarrow\quad \mathrm{e}^{-\cos x}(\,y'+y\sin x)=2 \sin x\cos x\,\mathrm{e}^{-\cos x} \\ \quad\Longleftrightarrow\quad \big(\mathrm{e}^{-\cos x}y\big)'=f(\cos x)\sin x=-\frac{d}{dx}F(\cos x), $$ where $$ f(w)=2 w\mathrm{e}^{-w}\quad\text{and}\quad F(w)=\int f(w)\,dw. $$ But $$ F(w...
592,278
I'm trying to prevent the ipmi kernel modules from loading on a server with a SuperMicro X8DTG-D motherboard running Ubuntu 14.04. My motivation for doing so is that the modules sometimes seem to take a very long time to unload when I attempt to reboot the machine. My understanding is that putting the following into a ...
2014/04/30
['https://serverfault.com/questions/592278', 'https://serverfault.com', 'https://serverfault.com/users/86482/']
I suggest to create a file /etc/modprobe.d/blacklist-ipmi.conf containing ``` blacklist ipmi_si blacklist ipmi_devintf blacklist ipmi_msghandler ```
If you have **ipmitool** package installed, comment your module in ``` /usr/lib/modules-load.d/ipmievd.conf ```
185,212
I want to make an AJAX request on every select value change to update the real value from database. I'm coding inside a shortcode on `functions.php`. I have a `select` element like this one below, ``` echo '<select name="changeValue" onchange="changeValue(' . $user->ID . ', this.options[this.selectedIndex])">' ``` A...
2015/04/24
['https://wordpress.stackexchange.com/questions/185212', 'https://wordpress.stackexchange.com', 'https://wordpress.stackexchange.com/users/51091/']
What a type you work with response If you work with json ``` $.post( ajaxurl , data , function(res){ // your code },'json'); ``` Remove wp\_die() and replace with die()
When using `admin-ajax.php` the `admin_init` hook is fired, so many functions that run in the admin will also run when ajax is used. In this case there is some code locking non admin users out of the admin by redirecting them somewhere else. This could be part of your theme or coming from a plugin. When the redirect f...
62,573,604
I have an example here with a simple state called counter. In the componentDidMount, I am getting 0 instead of 3 during console.log and during unmount, I am getting the counter number from button click instead of 0. I am confused as to how does it really works? Here is the code: ``` import React, { Component } from 'r...
2020/06/25
['https://Stackoverflow.com/questions/62573604', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9500607/']
In addition to posed answer. The problem here is not with life cycle methods but the problem is `state`. In react state can be asynchronous sometimes. React Doc: <https://reactjs.org/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous> Supporting article: <https://medium.com/@wereHamster/beware-react-set...
It is not about how those two life-cycle methods work, it is about the `setState` being async in React, which means that the sate value won't be modified right after you call `setState` and that is why you get the old values from the console.log. [Why is setState in reactjs Async instead of Sync?](https://stackoverflo...
9,607
I have been working as a freelancer for a few months, providing R&D services for small companies. My preferred mode of collaboration is billing per project, which usually lasts a few weeks. It gives me the flexibility to solve the problems as a want and in the order that I prefer. The disadvantage is that I systematica...
2020/02/04
['https://freelancing.stackexchange.com/questions/9607', 'https://freelancing.stackexchange.com', 'https://freelancing.stackexchange.com/users/23884/']
I started my consultancy twenty years ago and struggled with this problem a lot in the past. I found that everyone is generally happier in the long run with hourly contracts billed weekly or monthly. If you are running into issues where customers want quantifiable proof that you are working on their projects as much as...
It depends on the scope of the project. If you think that after completion of project multiple revisions will be required and client can ask for multiple modifications, you need to go for the hourly payment method. If all the requirements are crystal clear and you are clear in your mind regarding the requirements and...
9,607
I have been working as a freelancer for a few months, providing R&D services for small companies. My preferred mode of collaboration is billing per project, which usually lasts a few weeks. It gives me the flexibility to solve the problems as a want and in the order that I prefer. The disadvantage is that I systematica...
2020/02/04
['https://freelancing.stackexchange.com/questions/9607', 'https://freelancing.stackexchange.com', 'https://freelancing.stackexchange.com/users/23884/']
I started my consultancy twenty years ago and struggled with this problem a lot in the past. I found that everyone is generally happier in the long run with hourly contracts billed weekly or monthly. If you are running into issues where customers want quantifiable proof that you are working on their projects as much as...
I don't use any of those pricing models. I find [value-based pricing](https://www.priceintelligently.com/blog/value-based-pricing) not only more easily managed, but much more profitable.
17,548,265
I would like to set up a simple jQuery onClick event to make the UI dynamic on a handlebars template. I was wondering to addClass() after a specific click. consider the HTML (generated by handlebars) ``` {{#if hasButton}} <div id="container"> <button type="submit" class="myButton">Click me!</...
2013/07/09
['https://Stackoverflow.com/questions/17548265', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1060155/']
You have to refresh your Jquery listeners AFTER the insertion of nodes into your DOM HTML. ``` var source = "<li><a href="{{uri}}">{{label}}</a></li>"; var template = Handlebars.compile(source); var context = {"uri":"http://example.com", "label":"my label"}; $("ul").append( template(context) ); // add your JQuery e...
I am not sure what your problem exactly is. It's correct like this if you keep your JavaScript in a \*.js file, `perhaps` using parent() instead on `prev()` in this specific case.
17,548,265
I would like to set up a simple jQuery onClick event to make the UI dynamic on a handlebars template. I was wondering to addClass() after a specific click. consider the HTML (generated by handlebars) ``` {{#if hasButton}} <div id="container"> <button type="submit" class="myButton">Click me!</...
2013/07/09
['https://Stackoverflow.com/questions/17548265', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1060155/']
there is no need to reattach the event handler on every dynamic DOM update if you're defining them at document level: ``` $(document).on('click','li',function(){ alert( 'success' ); }); ``` Hope this helps! :-)
I am not sure what your problem exactly is. It's correct like this if you keep your JavaScript in a \*.js file, `perhaps` using parent() instead on `prev()` in this specific case.
3,458,590
I'm trying to add a 'Home' and 'Work' address my Person record. It seems only 1 shows up (the one added later. Is if possible to add multiple addresses to a Person and see them displayed in the UnknownPersonViewController? If so, how should I do this? Here's my code: ``` void multiValueAddDictionaryValueAndLabel(ABMu...
2010/08/11
['https://Stackoverflow.com/questions/3458590', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/250164/']
What you want to do is use the same mutable ABMultiValueRef for both addresses: ``` ABMultiValueRef addresses = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType); // set up your 2 dictionaries here as you did in your question (though obviously with differing names) ABMultiValueAddDictionaryValueAndLabel(addr...
This code works: ``` ABMultiValueRef addresses = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType); values = [NSDictionary dictionaryWithObjectsAndKeys: (NSString *)getValueForKey(dict, CFSTR("d:street")), (NSString *)kABPersonAddressStreetKey, (NSString *)getV...
48,527,248
Question: --------- Is it possible to use WampServer3 (Apache, PHP, MySQL) to work with my Application Load Balancer over port 443? If so how? Issue: ------ Currently my application load balancer is connected to my instance and I have 2 listeners, Port 80 and Port 443. The listener on port 443 has an SSL Certificate...
2018/01/30
['https://Stackoverflow.com/questions/48527248', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2675902/']
You have a listener on both 80 and 443 on your load balancer. The listener on 443 has the ACM cert. You also say that you have one target group for each listener - one on 80 which is health, and one on 443 which is not. The simple answer is to use one target group for both listeners. That way the connection to your e...
I ended up not using the AWS Certificate Manager at all due to the hurdles that one has to overcome in order to get it to work. Instead I found a great resource that provides SSL Certificates for free - [LetsEncrypt](https://letsencrypt.org/). I would highly recommend this solution for everyone due to the ease of use...
12,491,240
I'm developing an android app with phonegap and I have a table with some data. When clicking on a row it should go back to index and fire a function, so I turn each row into an html `a href` with a `onclick` property. The problem is that the `href` it's working and it goes back to the index but ti doesn't fire the func...
2012/09/19
['https://Stackoverflow.com/questions/12491240', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/907577/']
One you should really be using jQuery as it will take care of browser inconsistencies for you. Two, you'll likely need to use onlick like this. ``` a.onclick = function() { doLocalStorage(xyz); }; ```
Try to delete a href attribute and handle a click event with redirection `window.location.href = ('url')`. It should help.
2,926,220
Can a python script on my server access the webcam and audio input of a user as easily and as well as a Flash plugin can?
2010/05/28
['https://Stackoverflow.com/questions/2926220', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/301860/']
No: the "plugin" you mention runs in the user's **browser**, your server-side script (Python or otherwise) runs on the **server**, a completely different proposition. This relates to your other recent question about a server-side script accessing information on your desktop: your client machine tends to be very protect...
Server-side web scripts have no access to the client other than through requests. You need to use JavaScript, Java, or Flash to access devices that the browser (and consequently user) allows them to.
2,926,220
Can a python script on my server access the webcam and audio input of a user as easily and as well as a Flash plugin can?
2010/05/28
['https://Stackoverflow.com/questions/2926220', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/301860/']
No: the "plugin" you mention runs in the user's **browser**, your server-side script (Python or otherwise) runs on the **server**, a completely different proposition. This relates to your other recent question about a server-side script accessing information on your desktop: your client machine tends to be very protect...
Not as easy, no. But there are extensions you can use. E.g. A Win32 Python Extension for Accessing Video Devices (e.g. a USB WebCam, a TV-Card, ...) <http://videocapture.sourceforge.net/> Tutorial: <http://technobabbler.com/?p=22>
74,487,746
I deployed kubernetes cluster in `minikube` which has one master node and one worker node. When I tried to see the kube-proxy with: ``` kubectl get pods -n kube-system ``` two kube-proxies apear ``` kube-proxy-6jxgq kube-proxy-sq58d ``` According to the refrence architecture [https://kubernetes.i...
2022/11/18
['https://Stackoverflow.com/questions/74487746', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/19664050/']
Update ------ So after seeing your photos, I believe this is what you are trying to achieve: ```css .collection-item-28 { margin-bottom: 14px; /* Adjust this to your liking */ } .text-block-19{ position: absolute; top: 100%; transform: translateY(-100%); width: 100%; white-space: nowrap; text-overflow: ...
From what I have understood the thing that you need. I have created a small sandbox implementation for that. You can check just the index.css file and App.js to look for structure. <https://codesandbox.io/s/vigilant-roman-4dv820> Let me know if it helps or you need any clarification or a thing apart from that. Cheer...
7,204,024
I have done it before, but it's not working this time. All I'm trying to do is delete an entry from a table, and as you can see, it is supposed to output "ok" if it succeeds, (and I *have* manually checked the querystring data and everything matches what its trying to delete, even all the conditions are also met), but...
2011/08/26
['https://Stackoverflow.com/questions/7204024', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/908110/']
It looks fine. It will fail when you've *actually* a `rendered` attribute set on the link or one of its parents and the bean is in request scope. This should work if the bean is put in the view scope and you always return `null` or `void` from link actions which should return to the same view. This way the conditions f...
i think first command link should be inside h:form
12,523,146
> > **Possible Duplicate:** > > [How to remove all CSS classes using jQuery?](https://stackoverflow.com/questions/1424981/how-to-remove-all-css-classes-using-jquery) > > > I have the following: ``` <div id="abc"> </div> ``` Inside that div there can be one only of the following: ``` <p class="message"> <p ...
2012/09/21
['https://Stackoverflow.com/questions/12523146', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
> > If no class names are specified in the parameter, all classes will be removed. > > > [Source](http://api.jquery.com/removeClass/). Use `removeClass()` with no arguments.
You can use `removeAttr` method: ``` $('#abc p').removeAttr('class') ```
12,523,146
> > **Possible Duplicate:** > > [How to remove all CSS classes using jQuery?](https://stackoverflow.com/questions/1424981/how-to-remove-all-css-classes-using-jquery) > > > I have the following: ``` <div id="abc"> </div> ``` Inside that div there can be one only of the following: ``` <p class="message"> <p ...
2012/09/21
['https://Stackoverflow.com/questions/12523146', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
You can do this: ``` $("#abc p").attr("class", ""); ``` or ``` $("#abc p").removeClass(); ```
You can use `removeAttr` method: ``` $('#abc p').removeAttr('class') ```