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
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 use `removeAttr` method: ``` $('#abc p').removeAttr('class') ```
From the documentation, [`.removeClass()`](http://api.jquery.com/removeClass/#example-2) ``` $('#abc p').removeClass(); ```
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(); ```
> > 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.
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.
From the documentation, [`.removeClass()`](http://api.jquery.com/removeClass/#example-2) ``` $('#abc p').removeClass(); ```
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(); ```
From the documentation, [`.removeClass()`](http://api.jquery.com/removeClass/#example-2) ``` $('#abc p').removeClass(); ```
33,668,984
I am stuck with the following issue. I have 1 table that looks like this: ``` field_number.. Value ```````````````````````````````` 1 ......................... 1 2 ..........................1 3 ......................... 2 4 ..........................2 ``` etc. I want to group different fieldnumbers and...
2015/11/12
['https://Stackoverflow.com/questions/33668984', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5554171/']
Try join ``` SELECT a.`begin_date`, IF(b.`end_date` IS NOT NULL, b.`end_date`, a.`end_date`), a.`employer_id` FROM `mytable` a LEFT JOIN `mytable` b ON a.`employer_id` = b.`employer_id` AND a.`end_date` = b.`begin_date` LEFT JOIN `mytable` c ON a.`employer_id` = c.`employer_id` AND a.`begin_date` = c.`end_date` WHERE ...
You can use `MIN(),MAX()` if you want to get earlier and later times. ``` SELECT MIN(begin),MAX(end),employeesId FROM table_name GROUP BY employeesId ``` Hope this helps
865,659
sorry for asking the same question in a slightly different angle, I want a book in Category Theory similar to Dummit and Foote's book in Abstract Algebra. I want it to have tons of examples and problems, and I want it to be the sort of book in which you always have an idea about what the next results are going to be. S...
2014/07/13
['https://math.stackexchange.com/questions/865659', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/33907/']
I definitely recommend [Number Theory by George Andrews](http://books.google.com.mx/books?id=eVwvvwZeBf4C&printsec=frontcover&dq=number+theory+andrew&hl=es-419&sa=X&ei=5PPBU67CHYiV8gHz64Bw&redir_esc=y#v=onepage&q=number%20theory%20andrew&f=false). It's a very comprehensive book, short sweet and cheap. his writing style...
I'm enjoying this library book, Introduction to Number Theory by Daniel E. Flath. Pretty similar topics to the type of answers I generally give on MSE. It really is pretty basic, but I do think a semester of abstract algebra (groups, rings, fields) and one of linear algebra/matrix theory would help. I ordered a used co...
865,659
sorry for asking the same question in a slightly different angle, I want a book in Category Theory similar to Dummit and Foote's book in Abstract Algebra. I want it to have tons of examples and problems, and I want it to be the sort of book in which you always have an idea about what the next results are going to be. S...
2014/07/13
['https://math.stackexchange.com/questions/865659', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/33907/']
I really like "An Introduction to the Theory of Numbers" by Niven, Zuckerman and Montgomery. Great collection of problems too.
I'm enjoying this library book, Introduction to Number Theory by Daniel E. Flath. Pretty similar topics to the type of answers I generally give on MSE. It really is pretty basic, but I do think a semester of abstract algebra (groups, rings, fields) and one of linear algebra/matrix theory would help. I ordered a used co...
25,805,883
So the objective is to make some buttons the size of 20% of the width & height of the screen. In regular Famo.us, this works: ``` var ww = window.innerWidth * .2; var hh = window.innerHeight * .2; // later in the code for(var i = 0; i < 2; i++) { surfaces.push(new Surface({ content: "button", size: [ww, hh]...
2014/09/12
['https://Stackoverflow.com/questions/25805883', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4033895/']
`CMD + N -> iOs -> Cocoa Touch -> Objective-C Class`
To create a Objective-C class, you have to select **"Cocoa class"**. This will create an .h and .m file for you. Alternatively you can manually add a "Header file" with the same name, but thats just more work for the same thing.
8,899,076
There seems to be a bug in firefox where if I put anything on the right edge of a container (using text-align or float) it makes the container larger than it should be. So for example - ``` <div style='width:100px; overflow:auto'> <div style='width:50px; float:left;'>Something</div> <div style='width:50px; f...
2012/01/17
['https://Stackoverflow.com/questions/8899076', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1075814/']
What you're seeing is that the text actually overflows its container, because the painted dimensions of text can be bigger than its layout dimensions. This is particularly visible with italic text, but can happen with any text, especially with subpixel layout and antialiasing. Chrome doesn't do subpixel layout of any ...
When i am doing aligenment with objects i do ``` <div style='width:100px; overflow:auto'> <div style='width:50px; float:left;'>Something</div> <div style='width:49px; float:right;'> <h1 style='text-align:right;'>Title</h1> </div> ``` this prob will not help you but i have to do it alot when useing %'s
8,899,076
There seems to be a bug in firefox where if I put anything on the right edge of a container (using text-align or float) it makes the container larger than it should be. So for example - ``` <div style='width:100px; overflow:auto'> <div style='width:50px; float:left;'>Something</div> <div style='width:50px; f...
2012/01/17
['https://Stackoverflow.com/questions/8899076', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1075814/']
What you're seeing is that the text actually overflows its container, because the painted dimensions of text can be bigger than its layout dimensions. This is particularly visible with italic text, but can happen with any text, especially with subpixel layout and antialiasing. Chrome doesn't do subpixel layout of any ...
Sorry reread you question you can remove the scroll bar like this: ``` <div style='width:100px; overflow:hidden'> <div style='width:50px; float:left;'>Something</div> <div style='width:50px; float:right;'> <h1 style='text-align:right;'>Title</h1> </div> </div> ``` you will lose 1px of content th...
8,899,076
There seems to be a bug in firefox where if I put anything on the right edge of a container (using text-align or float) it makes the container larger than it should be. So for example - ``` <div style='width:100px; overflow:auto'> <div style='width:50px; float:left;'>Something</div> <div style='width:50px; f...
2012/01/17
['https://Stackoverflow.com/questions/8899076', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1075814/']
What you're seeing is that the text actually overflows its container, because the painted dimensions of text can be bigger than its layout dimensions. This is particularly visible with italic text, but can happen with any text, especially with subpixel layout and antialiasing. Chrome doesn't do subpixel layout of any ...
It's behaving as it should. You don't state which versions of Firefox and Chrome you're using, but for me with FF 9.0 and Chrome 16, they behave the same, i.e., the scrollbar appears. It's because your content extends beyond the defined width, and the default value for overflow is "visible", so the h1 in your right-flo...
12,451,787
I am trying to filter for a specific word ("no-image") in my image src and if it returns true, I want to remove that particular image but keep the rest of the images. This is my output: ``` <div class="product"> <div class="image"> <img src="mytee-red.jpg"> <img src="mytee-blue.jpg"> <img src="mytee-black....
2012/09/17
['https://Stackoverflow.com/questions/12451787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/992731/']
You could simplify this into a single command - ``` $(".product .image img[src*='no-image']").remove(); ``` The [jQuery attribute contains selector](http://api.jquery.com/attribute-equals-selector/) will help you pin-point the exact elements that you want containing the text "no-image" anywhere within the `src` att...
Filter will only keep the items where the passed function returns true. Instead of trying to remove them inside the filter function, just return false. > > .filter( function(index) ): Reduce the set of matched elements to those that match the selector or pass the function's test. > > > ``` var keyword = "no-image...
12,451,787
I am trying to filter for a specific word ("no-image") in my image src and if it returns true, I want to remove that particular image but keep the rest of the images. This is my output: ``` <div class="product"> <div class="image"> <img src="mytee-red.jpg"> <img src="mytee-blue.jpg"> <img src="mytee-black....
2012/09/17
['https://Stackoverflow.com/questions/12451787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/992731/']
You could simplify this into a single command - ``` $(".product .image img[src*='no-image']").remove(); ``` The [jQuery attribute contains selector](http://api.jquery.com/attribute-equals-selector/) will help you pin-point the exact elements that you want containing the text "no-image" anywhere within the `src` att...
``` $('.product .image img[src*="no-image"]').remove(); ``` <http://api.jquery.com/attribute-contains-selector/> No regex needed.
12,451,787
I am trying to filter for a specific word ("no-image") in my image src and if it returns true, I want to remove that particular image but keep the rest of the images. This is my output: ``` <div class="product"> <div class="image"> <img src="mytee-red.jpg"> <img src="mytee-blue.jpg"> <img src="mytee-black....
2012/09/17
['https://Stackoverflow.com/questions/12451787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/992731/']
You could simplify this into a single command - ``` $(".product .image img[src*='no-image']").remove(); ``` The [jQuery attribute contains selector](http://api.jquery.com/attribute-equals-selector/) will help you pin-point the exact elements that you want containing the text "no-image" anywhere within the `src` att...
according to your example, you need to use `match()` instead of `==` ``` var keyword = "no-image"; $(".product .image img").filter(function(index) { if ($(this).attr("src").match(keyword)) { $(this).remove(); } }); ``` Assuming that you want to remove `<img src="mytee-no-image.jpg">` as it matches t...
12,451,787
I am trying to filter for a specific word ("no-image") in my image src and if it returns true, I want to remove that particular image but keep the rest of the images. This is my output: ``` <div class="product"> <div class="image"> <img src="mytee-red.jpg"> <img src="mytee-blue.jpg"> <img src="mytee-black....
2012/09/17
['https://Stackoverflow.com/questions/12451787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/992731/']
You could simplify this into a single command - ``` $(".product .image img[src*='no-image']").remove(); ``` The [jQuery attribute contains selector](http://api.jquery.com/attribute-equals-selector/) will help you pin-point the exact elements that you want containing the text "no-image" anywhere within the `src` att...
Other answers suggest better approaches, but a demonstration of `filter()` could be: ``` var keyword = "no-image"; $(".product .image img").filter(function(index) { return $(this).attr("src").match(keyword); }).remove(); ```
12,451,787
I am trying to filter for a specific word ("no-image") in my image src and if it returns true, I want to remove that particular image but keep the rest of the images. This is my output: ``` <div class="product"> <div class="image"> <img src="mytee-red.jpg"> <img src="mytee-blue.jpg"> <img src="mytee-black....
2012/09/17
['https://Stackoverflow.com/questions/12451787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/992731/']
``` $('.product .image img[src*="no-image"]').remove(); ``` <http://api.jquery.com/attribute-contains-selector/> No regex needed.
Filter will only keep the items where the passed function returns true. Instead of trying to remove them inside the filter function, just return false. > > .filter( function(index) ): Reduce the set of matched elements to those that match the selector or pass the function's test. > > > ``` var keyword = "no-image...
12,451,787
I am trying to filter for a specific word ("no-image") in my image src and if it returns true, I want to remove that particular image but keep the rest of the images. This is my output: ``` <div class="product"> <div class="image"> <img src="mytee-red.jpg"> <img src="mytee-blue.jpg"> <img src="mytee-black....
2012/09/17
['https://Stackoverflow.com/questions/12451787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/992731/']
according to your example, you need to use `match()` instead of `==` ``` var keyword = "no-image"; $(".product .image img").filter(function(index) { if ($(this).attr("src").match(keyword)) { $(this).remove(); } }); ``` Assuming that you want to remove `<img src="mytee-no-image.jpg">` as it matches t...
Filter will only keep the items where the passed function returns true. Instead of trying to remove them inside the filter function, just return false. > > .filter( function(index) ): Reduce the set of matched elements to those that match the selector or pass the function's test. > > > ``` var keyword = "no-image...
12,451,787
I am trying to filter for a specific word ("no-image") in my image src and if it returns true, I want to remove that particular image but keep the rest of the images. This is my output: ``` <div class="product"> <div class="image"> <img src="mytee-red.jpg"> <img src="mytee-blue.jpg"> <img src="mytee-black....
2012/09/17
['https://Stackoverflow.com/questions/12451787', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/992731/']
Other answers suggest better approaches, but a demonstration of `filter()` could be: ``` var keyword = "no-image"; $(".product .image img").filter(function(index) { return $(this).attr("src").match(keyword); }).remove(); ```
Filter will only keep the items where the passed function returns true. Instead of trying to remove them inside the filter function, just return false. > > .filter( function(index) ): Reduce the set of matched elements to those that match the selector or pass the function's test. > > > ``` var keyword = "no-image...
45,396,346
In my project there are a `stable` branch and a `dev` branch. Commits are cherry-picked from `dev` branch to `stable` branch. In order to filter all commits on `dev` that have not been merged to `stable`, `git cherry -v stable dev` looks like a good choice. However it identifies equivalence by diff, which usually chan...
2017/07/30
['https://Stackoverflow.com/questions/45396346', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4140668/']
It seems that there is no direct way to do this, so I wrote a short script: ``` #!/bin/bash git cherry -v stable dev | grep + | cut -d ' ' -f 3- > /tmp/unmerged xargs -a /tmp/unmerged -I{} git --no-pager log stable --pretty=oneline --grep {} | cut -d ' ' -f 2- > /tmp/cherry-picked diff /tmp/unmerged /tmp/cherry-picke...
If commits in `dev` are not rebased, then you could use `git cherry-pick -x`, marking the source explicitly. There is no automatic use of this information, but with some bash fu it is possible to use it.
45,396,346
In my project there are a `stable` branch and a `dev` branch. Commits are cherry-picked from `dev` branch to `stable` branch. In order to filter all commits on `dev` that have not been merged to `stable`, `git cherry -v stable dev` looks like a good choice. However it identifies equivalence by diff, which usually chan...
2017/07/30
['https://Stackoverflow.com/questions/45396346', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4140668/']
It seems that there is no direct way to do this, so I wrote a short script: ``` #!/bin/bash git cherry -v stable dev | grep + | cut -d ' ' -f 3- > /tmp/unmerged xargs -a /tmp/unmerged -I{} git --no-pager log stable --pretty=oneline --grep {} | cut -d ' ' -f 2- > /tmp/cherry-picked diff /tmp/unmerged /tmp/cherry-picke...
You want to use `patch-id`. This is the mechanism used by `git cherry`. To find an equivalent of commit `3642151` run: `git show 3642151 | git patch-id` You should get a line with two hashes; the first is the patchid (call it `PATCHID_FROM_ABOVE`) `git log -p | git patch-id | grep PATCHID_FROM_ABOVE` This should ...
45,396,346
In my project there are a `stable` branch and a `dev` branch. Commits are cherry-picked from `dev` branch to `stable` branch. In order to filter all commits on `dev` that have not been merged to `stable`, `git cherry -v stable dev` looks like a good choice. However it identifies equivalence by diff, which usually chan...
2017/07/30
['https://Stackoverflow.com/questions/45396346', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4140668/']
If commits in `dev` are not rebased, then you could use `git cherry-pick -x`, marking the source explicitly. There is no automatic use of this information, but with some bash fu it is possible to use it.
You want to use `patch-id`. This is the mechanism used by `git cherry`. To find an equivalent of commit `3642151` run: `git show 3642151 | git patch-id` You should get a line with two hashes; the first is the patchid (call it `PATCHID_FROM_ABOVE`) `git log -p | git patch-id | grep PATCHID_FROM_ABOVE` This should ...
63,593,917
I have 2 function for API connection: ``` //Load data from API private fun loadData() { compositeDisposable.add( ApiClient.getClient.getQuestions(Params.getParamsSearch()) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(this::handleRes...
2020/08/26
['https://Stackoverflow.com/questions/63593917', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1075753/']
``` .subscribe({ objectsQueryResult -> updateAdapter(objectsQueryResult) }) ``` or ``` .subscribe({ updateAdapter(it) }) ```
```kotlin //Load data from API private fun loadData() { compositeDisposable.add( ApiClient.getClient.getQuestions(Params.getParamsSearch()) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe { objectsQueryResult -> updateAdapter(objectsQu...
2,054,438
I'm working on a map of the native languages of California for Wikipedia. The map contains areas that each correspond to a language. The original looks like this (click it to see the [SVG](http://en.wikipedia.org/wiki/Scalable_Vector_Graphics)): [![](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/California...
2010/01/13
['https://Stackoverflow.com/questions/2054438', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
I would recommend using Python and specifically creating extensions for Inkscape. I don't think you really need 60 SVG unless you really want to because the source map will have everything you need. What I would do is use Inkscape to rename the various regions to the same language code you will be using. For example, ...
Here's an [example](http://xn--dahlstrm-t4a.net/svg/examples/MapWithMiniView.svg) using your map. You can click any element to get the boundingbox, this can be used for the miniview viewBox (with some tweaking). As you see it's not adding much code to the map, just a couple of elements. When you have all the viewBoxes ...
63,146,323
I have made this mouse hover image zoom page. But I want the output to be shown on the left side and only when someone hovers the mouse on it. In this code the output window is continuously opened. HERE IS MY CODE: ```js function imageZoom(imgID, resultID) { var img, lens, result, cx, cy; img = document.getElemen...
2020/07/29
['https://Stackoverflow.com/questions/63146323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13993822/']
You can't set that flag. It's managed by Firebase Auth. My guess for the reason that it's always set true by default (for Google auth, as you imply here) is that Google manages the email verification scheme for their own accounts. You can be sure that, if you get an email address for a Google account, the email does in...
As i can see that you are using google login , So if someone logins through google the email is already verified . If you want to send verification mail use email/password signin .
381,207
I've used a few Stack Exchange sites and am thinking of close / downvotes on *[Linguistics](https://linguistics.stackexchange.com/tour)*, *[Philosophy](https://philosophy.stackexchange.com/tour)* and *[English Language & Usage](https://english.stackexchange.com/tour)* especially. While it is obvious that SE should tol...
2022/08/14
['https://meta.stackexchange.com/questions/381207', 'https://meta.stackexchange.com', 'https://meta.stackexchange.com/users/356826/']
What happens to sites is simply that questions accumulate over time and that in and of itself changes things. On day 1 there are no questions and you can ask anything you like no matter how simple and it will be a new and unique question. After 10 years though there will be a huge existing body of questions so unless...
SE in general shouldn't have any issue with simple questions that **are** googleable, so long as the question itself is well-constructed. The reception of such is often down to the rapidity & acceptability of the first answer. Get in too late, it's been downvoted to all heck, get in early with a fully comprehensive an...
7,152,533
I have an Ajax call to create an image gallery. There is a combo box to set the number of images per page, and pagination to navigate through the pages. It's working fine, except that if a person is on the last page, and they increase the number of images per page, it reloads to the current page number. This is a probl...
2011/08/22
['https://Stackoverflow.com/questions/7152533', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/708274/']
You should use query: ``` $query_pag_data = "SELECT SQL_CALC_FOUND_ROWS `imgURL`,`imgTitle` FROM `images` ". "ORDER BY `imgDate` DESC LIMIT $start, $per_page"; ``` And instead of ``` $query_pag_num = "SELECT COUNT(*) AS count FROM images"; ``` use ``` $query_pag_num = "SELECT FOUND_ROWS()"; ```
If you do the "SELECT COUNT(\*) ..." query earlier in the script (at least before the other query), you will have $no\_of\_paginations earlier, and can use it to clamp $page to the correct range.
7,152,533
I have an Ajax call to create an image gallery. There is a combo box to set the number of images per page, and pagination to navigate through the pages. It's working fine, except that if a person is on the last page, and they increase the number of images per page, it reloads to the current page number. This is a probl...
2011/08/22
['https://Stackoverflow.com/questions/7152533', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/708274/']
As you are currently doing it, there would be no problem with moving the last section to above the main query. A better way to find the total records with MySQL is to use the [SQL\_CALC\_FOUND\_ROWS](http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows) keyword on your main query (so h...
If you do the "SELECT COUNT(\*) ..." query earlier in the script (at least before the other query), you will have $no\_of\_paginations earlier, and can use it to clamp $page to the correct range.
7,152,533
I have an Ajax call to create an image gallery. There is a combo box to set the number of images per page, and pagination to navigate through the pages. It's working fine, except that if a person is on the last page, and they increase the number of images per page, it reloads to the current page number. This is a probl...
2011/08/22
['https://Stackoverflow.com/questions/7152533', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/708274/']
You should use query: ``` $query_pag_data = "SELECT SQL_CALC_FOUND_ROWS `imgURL`,`imgTitle` FROM `images` ". "ORDER BY `imgDate` DESC LIMIT $start, $per_page"; ``` And instead of ``` $query_pag_num = "SELECT COUNT(*) AS count FROM images"; ``` use ``` $query_pag_num = "SELECT FOUND_ROWS()"; ```
Sometimes you just have to bite the bullet and do a query twice. Accept the user-provided "I want page X" value, and try to get that particular page. If it ends up being past the end of the available data, you can either say "hey, wait... that ain't right" and abort, or redo the loop and default to the last available p...
7,152,533
I have an Ajax call to create an image gallery. There is a combo box to set the number of images per page, and pagination to navigate through the pages. It's working fine, except that if a person is on the last page, and they increase the number of images per page, it reloads to the current page number. This is a probl...
2011/08/22
['https://Stackoverflow.com/questions/7152533', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/708274/']
As you are currently doing it, there would be no problem with moving the last section to above the main query. A better way to find the total records with MySQL is to use the [SQL\_CALC\_FOUND\_ROWS](http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows) keyword on your main query (so h...
You should use query: ``` $query_pag_data = "SELECT SQL_CALC_FOUND_ROWS `imgURL`,`imgTitle` FROM `images` ". "ORDER BY `imgDate` DESC LIMIT $start, $per_page"; ``` And instead of ``` $query_pag_num = "SELECT COUNT(*) AS count FROM images"; ``` use ``` $query_pag_num = "SELECT FOUND_ROWS()"; ```
7,152,533
I have an Ajax call to create an image gallery. There is a combo box to set the number of images per page, and pagination to navigate through the pages. It's working fine, except that if a person is on the last page, and they increase the number of images per page, it reloads to the current page number. This is a probl...
2011/08/22
['https://Stackoverflow.com/questions/7152533', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/708274/']
As you are currently doing it, there would be no problem with moving the last section to above the main query. A better way to find the total records with MySQL is to use the [SQL\_CALC\_FOUND\_ROWS](http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows) keyword on your main query (so h...
Sometimes you just have to bite the bullet and do a query twice. Accept the user-provided "I want page X" value, and try to get that particular page. If it ends up being past the end of the available data, you can either say "hey, wait... that ain't right" and abort, or redo the loop and default to the last available p...
3,119,558
i am trying to store the user preference of whether the checkbox is clicked or not in an Activity , but when i shutdown and restart the app, i don't get the desired result . i.e if the user had checked the checkbox then on restarting i am not getting it as checked. here's what i have tried: ``` public void onCreate()...
2010/06/25
['https://Stackoverflow.com/questions/3119558', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/238505/']
Many applications may provide a way to capture user preferences on the settings of a specific application or an activity. For supporting this, Android provides a simple set of APIs. Preferences are typically name value pairs. They can be stored as “Shared Preferences” across various activities in an application (note...
You are working with two separate preference data files, in all likelihood, since it would appear that you have two different components (e.g., activities). Try switching to using `getDefaultSharedPreferences()` (available on `PreferenceManager`) instead of `getSharedPreferences()`, and see if that helps.
3,119,558
i am trying to store the user preference of whether the checkbox is clicked or not in an Activity , but when i shutdown and restart the app, i don't get the desired result . i.e if the user had checked the checkbox then on restarting i am not getting it as checked. here's what i have tried: ``` public void onCreate()...
2010/06/25
['https://Stackoverflow.com/questions/3119558', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/238505/']
Many applications may provide a way to capture user preferences on the settings of a specific application or an activity. For supporting this, Android provides a simple set of APIs. Preferences are typically name value pairs. They can be stored as “Shared Preferences” across various activities in an application (note...
Hi Pranay if you created before your preference with the same name in other activity or app you will have problems reading the same preference change to MODE\_WORLD\_READABLE ``` getSharedPreferences(MYPREF,Activity.MODE_WORLD_READABLE); ``` or ``` getSharedPreferences(MYPREF,1); ```
74,065,222
I am trying to decode the JSON string into a single element. Below is my code. It is returning null as a result. ``` var topOfHead = landmarks.Landmark[10]; string jsonString = topOfHead.ToString(); //Json in String - tophead:{ "x": 0.8063538, "y": 0.6247897, "z": -0.0117829954 } DistanceVector serialized = JsonUtili...
2022/10/14
['https://Stackoverflow.com/questions/74065222', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2722645/']
JsonUtility in Unity follows the same serialisation rules for all objects. That means you can't natively (de)serialise such things as dictionaries. It also means you can't (de)serialise properties or nullables. To get around this, you'd have to modify your code: ```cs [Serializable] public class DistanceVector { pu...
Don't use the "?" because it is detecting the current variable as a nullable and it returns a null value. Instead of this `public double? x{get; set;}`, replace it with this `public double x{get; set;}`
251,783
ASP.Net is Active Server Pages using .Net Framework [Wikipedia](http://en.wikipedia.org/wiki/ASP.NET) says > > It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. > > > While answering [this](https://stackoverflo...
2014/07/31
['https://softwareengineering.stackexchange.com/questions/251783', 'https://softwareengineering.stackexchange.com', 'https://softwareengineering.stackexchange.com/users/58676/']
Because it's part of the ASP.NET framework. Sure, ASP used to stand for "Active Server Pages" but it's really grown to be beyond that now. I've never heard anyone call it "Active Server Pages .Net Web Api", and I would be confused if they did.
While their earlier attempts at .Net API were under the WCF namespaces (we wont go into asmx services, they just failed) people found it much easier to use MVC controller classes and route patterns to do rest style APIs and WCF was always a bit awkward at simple rest as it was designed around a bunch of complex soap or...
251,783
ASP.Net is Active Server Pages using .Net Framework [Wikipedia](http://en.wikipedia.org/wiki/ASP.NET) says > > It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. > > > While answering [this](https://stackoverflo...
2014/07/31
['https://softwareengineering.stackexchange.com/questions/251783', 'https://softwareengineering.stackexchange.com', 'https://softwareengineering.stackexchange.com/users/58676/']
As you probably know, Web API used to be a part of WCF and NOT part of the ASP.NET family. Microsoft tried to develop the technology under the WCF Web API moniker for several years, but eventually decided that they were probably trying to fit a square peg in a round hole. I think that makes sense. After all, WCF alway...
While their earlier attempts at .Net API were under the WCF namespaces (we wont go into asmx services, they just failed) people found it much easier to use MVC controller classes and route patterns to do rest style APIs and WCF was always a bit awkward at simple rest as it was designed around a bunch of complex soap or...
865,710
I observed huge difference between following two scenarios for copying a file: 1. Copying a file into a new file. 2. Copying a file in an existing file and overwriting it. I expect both operations take the same amount of time to complete. But the first scenario is much faster in practice. I tried this on two differen...
2015/01/16
['https://superuser.com/questions/865710', 'https://superuser.com', 'https://superuser.com/users/173093/']
Actually the physical copying takes the same time. But the ext4 filesystem driver close() waits before data are really written when the operation is done on an existing i-node and it does not wait for write operation if it is done on a new node. I did some experiments and realized that it is the ext4 feature. I have no...
Overwriting takes a seek operation... The file's permissions must be read in order to know if you can overwrite it(which may or may not be an issue depending on your file system). Also the file must be truncated. This requires the drive to seek to the position where the file is.. Copying into a new file generates ...
865,710
I observed huge difference between following two scenarios for copying a file: 1. Copying a file into a new file. 2. Copying a file in an existing file and overwriting it. I expect both operations take the same amount of time to complete. But the first scenario is much faster in practice. I tried this on two differen...
2015/01/16
['https://superuser.com/questions/865710', 'https://superuser.com', 'https://superuser.com/users/173093/']
I believe it's ext4's `auto_da_alloc` behavior that makes this difference. [see ext4 kernel doc](https://www.kernel.org/doc/html/latest/admin-guide/ext4.html) @Zaboj Campula 's answer show us that close() a truncated file would block until written data got "forced to disk". ext4 auto detected this replace-by-truncate...
Overwriting takes a seek operation... The file's permissions must be read in order to know if you can overwrite it(which may or may not be an issue depending on your file system). Also the file must be truncated. This requires the drive to seek to the position where the file is.. Copying into a new file generates ...
865,710
I observed huge difference between following two scenarios for copying a file: 1. Copying a file into a new file. 2. Copying a file in an existing file and overwriting it. I expect both operations take the same amount of time to complete. But the first scenario is much faster in practice. I tried this on two differen...
2015/01/16
['https://superuser.com/questions/865710', 'https://superuser.com', 'https://superuser.com/users/173093/']
Actually the physical copying takes the same time. But the ext4 filesystem driver close() waits before data are really written when the operation is done on an existing i-node and it does not wait for write operation if it is done on a new node. I did some experiments and realized that it is the ext4 feature. I have no...
I believe it's ext4's `auto_da_alloc` behavior that makes this difference. [see ext4 kernel doc](https://www.kernel.org/doc/html/latest/admin-guide/ext4.html) @Zaboj Campula 's answer show us that close() a truncated file would block until written data got "forced to disk". ext4 auto detected this replace-by-truncate...
13,976,550
Let's say you want to create an ASP.NET web app. You *think* it will always just be a web app (with regular and mobile pages) but you never know. It's possible someday you might want to have an iPhone, iPad, Android, or whatever app as a client. If there is a 0% chance of this, you'd package your business layer as DLLs...
2012/12/20
['https://Stackoverflow.com/questions/13976550', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1761600/']
You don't have to go with WCF. If the need arises and you need to expose your BLL's functionality to other non-microsoft types, then you can create a new WCF service. Inside this new service, you can create wrapper methods in your ServiceContract that expose your DLL's methods, etc. So, you can just create your DLL and...
To my mind you could use [ASP.NET Web API](http://www.asp.net/web-api) (or at least to add it to your list). You can create web site that will call REST api and it will be available from native apps too. Check next articles for more information: * [Introduction to the ASP.NET Web API](http://stephenwalther.com/archiv...
13,976,550
Let's say you want to create an ASP.NET web app. You *think* it will always just be a web app (with regular and mobile pages) but you never know. It's possible someday you might want to have an iPhone, iPad, Android, or whatever app as a client. If there is a 0% chance of this, you'd package your business layer as DLLs...
2012/12/20
['https://Stackoverflow.com/questions/13976550', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1761600/']
You don't have to go with WCF. If the need arises and you need to expose your BLL's functionality to other non-microsoft types, then you can create a new WCF service. Inside this new service, you can create wrapper methods in your ServiceContract that expose your DLL's methods, etc. So, you can just create your DLL and...
Two options come to mind * Define coarse-grained public methods in your BLL that are stateless. If/when you wish to run as a WCF service you can easily wrap your library. * Or implement as WCF and host locally The second option is better suited for a proof-of-concept. A good description is at <http://msdn.microsoft.c...
34,263,306
I want to convert currency from INR to USD in php, here is my code I've tried so far. But its not working. What am i missing? ```html function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "ht...
2015/12/14
['https://Stackoverflow.com/questions/34263306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
As google changed the URL to ``` https://www.google.com/finance/converter?a ``` So the fix i found is below. ``` $amount = 1.00; $from_Currency = 'USD'; $to_Currency = 'INR'; $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get = file_get_contents("h...
Google have been change currency converter `API` So you can get it using : ``` function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get_amount = file_get_contents("https://www.google.com/fin...
34,263,306
I want to convert currency from INR to USD in php, here is my code I've tried so far. But its not working. What am i missing? ```html function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "ht...
2015/12/14
['https://Stackoverflow.com/questions/34263306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
As google changed the URL to ``` https://www.google.com/finance/converter?a ``` So the fix i found is below. ``` $amount = 1.00; $from_Currency = 'USD'; $to_Currency = 'INR'; $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get = file_get_contents("h...
Although both answers above are correct, they use explode instead of regex which is slower(relatively). ``` function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "http://www.googl...
34,263,306
I want to convert currency from INR to USD in php, here is my code I've tried so far. But its not working. What am i missing? ```html function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "ht...
2015/12/14
['https://Stackoverflow.com/questions/34263306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
As google changed the URL to ``` https://www.google.com/finance/converter?a ``` So the fix i found is below. ``` $amount = 1.00; $from_Currency = 'USD'; $to_Currency = 'INR'; $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get = file_get_contents("h...
``` <?php // change amount according to your needs $amount =1; // change From Currency according to your needs $from_Curr ='USD'; // change To Currency according to your needs $to_Curr ="BHD"; $converted_currency=currencyConverter($from_Curr, $to_Curr, $amount); // Print outout echo $converted_currency; function curr...
34,263,306
I want to convert currency from INR to USD in php, here is my code I've tried so far. But its not working. What am i missing? ```html function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "ht...
2015/12/14
['https://Stackoverflow.com/questions/34263306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Google have been change currency converter `API` So you can get it using : ``` function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get_amount = file_get_contents("https://www.google.com/fin...
Although both answers above are correct, they use explode instead of regex which is slower(relatively). ``` function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "http://www.googl...
34,263,306
I want to convert currency from INR to USD in php, here is my code I've tried so far. But its not working. What am i missing? ```html function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "ht...
2015/12/14
['https://Stackoverflow.com/questions/34263306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
Google have been change currency converter `API` So you can get it using : ``` function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get_amount = file_get_contents("https://www.google.com/fin...
``` <?php // change amount according to your needs $amount =1; // change From Currency according to your needs $from_Curr ='USD'; // change To Currency according to your needs $to_Curr ="BHD"; $converted_currency=currencyConverter($from_Curr, $to_Curr, $amount); // Print outout echo $converted_currency; function curr...
34,263,306
I want to convert currency from INR to USD in php, here is my code I've tried so far. But its not working. What am i missing? ```html function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "ht...
2015/12/14
['https://Stackoverflow.com/questions/34263306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']
``` <?php // change amount according to your needs $amount =1; // change From Currency according to your needs $from_Curr ='USD'; // change To Currency according to your needs $to_Curr ="BHD"; $converted_currency=currencyConverter($from_Curr, $to_Curr, $amount); // Print outout echo $converted_currency; function curr...
Although both answers above are correct, they use explode instead of regex which is slower(relatively). ``` function currency($from_Currency,$to_Currency,$amount) { $amount = urlencode($amount); $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $url = "http://www.googl...
17,077,190
I'm trying to pass a PHP variable to Javascript like this.. ``` var url = <?php echo $urlArray[0]; ?>; ``` The contents of $urlArray[0] is a string from a json decoded array > > "baby" > > > When I run the code I get the error.. > > Uncaught ReferenceError: baby is not defined > > >
2013/06/12
['https://Stackoverflow.com/questions/17077190', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1714301/']
``` var url = "<?php echo $urlArray[0]; ?>"; ``` you forgot the quotes. If you need to export more complicated data structure, you may need [json\_encode](http://php.net/manual/en/function.json-encode.php). This might be helpful if exporting arrays and/or objects.
`json_encode` is your friend - use to wrap anything you're trying to pass to javascript. <http://php.net/manual/en/function.json-encode.php> ``` var url = <?php echo json_encode($urlArray[0]); ?>; ```
66,714,870
I'm really struggling with my code and cannot find a way to make it work. I need to check whether my array exists or its length is not 0 and then if there is an object with a specific value in it. If so then update it. If not then add it. Please see my code below: ``` const originals = []; if (!originals || original...
2021/03/19
['https://Stackoverflow.com/questions/66714870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647297/']
Use the `find()` method to look for an element with the name you want. If it's found, update it, otherwise add the new element. There's no need to check the length of the array. If the array is empty, `find()` won't find it. ``` let mike = originals.find(({name}) => name == 'Michael'); if (mike) { if (mike.age ==...
The simple solution is below with help of amazing supporters on StackOverflow. Thank you all ```js const originals = [{ "name": "Michael", "age": 21, "gender": "male" }]; if (!originals || originals.length === 0) { originals.push({ "name": "Michael", "age": 21, "gender": "male" ...
66,714,870
I'm really struggling with my code and cannot find a way to make it work. I need to check whether my array exists or its length is not 0 and then if there is an object with a specific value in it. If so then update it. If not then add it. Please see my code below: ``` const originals = []; if (!originals || original...
2021/03/19
['https://Stackoverflow.com/questions/66714870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647297/']
Use the `find()` method to look for an element with the name you want. If it's found, update it, otherwise add the new element. There's no need to check the length of the array. If the array is empty, `find()` won't find it. ``` let mike = originals.find(({name}) => name == 'Michael'); if (mike) { if (mike.age ==...
Reading between the lines what I think you want to do is: * If "Michael" is in the array. Then his age should be updated to 21, if he is 22 years old. * If "Michael" is not in the array. Then add Michael with an age of 21. There are some odd things in your code which makes no sense to me. For example you are checking...
66,714,870
I'm really struggling with my code and cannot find a way to make it work. I need to check whether my array exists or its length is not 0 and then if there is an object with a specific value in it. If so then update it. If not then add it. Please see my code below: ``` const originals = []; if (!originals || original...
2021/03/19
['https://Stackoverflow.com/questions/66714870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647297/']
Use the `find()` method to look for an element with the name you want. If it's found, update it, otherwise add the new element. There's no need to check the length of the array. If the array is empty, `find()` won't find it. ``` let mike = originals.find(({name}) => name == 'Michael'); if (mike) { if (mike.age ==...
Here is my quick solution to this issue: From my perspective its a good idea to address a new array to contain temporary data. The easiest way to describe what I mean follows in the code snippet. Code Snippet (For-Loop) ----------------------- ``` var originalsStack=[]; function PushToOriginalStack() { for (i=0; ...
66,714,870
I'm really struggling with my code and cannot find a way to make it work. I need to check whether my array exists or its length is not 0 and then if there is an object with a specific value in it. If so then update it. If not then add it. Please see my code below: ``` const originals = []; if (!originals || original...
2021/03/19
['https://Stackoverflow.com/questions/66714870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647297/']
Reading between the lines what I think you want to do is: * If "Michael" is in the array. Then his age should be updated to 21, if he is 22 years old. * If "Michael" is not in the array. Then add Michael with an age of 21. There are some odd things in your code which makes no sense to me. For example you are checking...
The simple solution is below with help of amazing supporters on StackOverflow. Thank you all ```js const originals = [{ "name": "Michael", "age": 21, "gender": "male" }]; if (!originals || originals.length === 0) { originals.push({ "name": "Michael", "age": 21, "gender": "male" ...
66,714,870
I'm really struggling with my code and cannot find a way to make it work. I need to check whether my array exists or its length is not 0 and then if there is an object with a specific value in it. If so then update it. If not then add it. Please see my code below: ``` const originals = []; if (!originals || original...
2021/03/19
['https://Stackoverflow.com/questions/66714870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647297/']
Here is my quick solution to this issue: From my perspective its a good idea to address a new array to contain temporary data. The easiest way to describe what I mean follows in the code snippet. Code Snippet (For-Loop) ----------------------- ``` var originalsStack=[]; function PushToOriginalStack() { for (i=0; ...
The simple solution is below with help of amazing supporters on StackOverflow. Thank you all ```js const originals = [{ "name": "Michael", "age": 21, "gender": "male" }]; if (!originals || originals.length === 0) { originals.push({ "name": "Michael", "age": 21, "gender": "male" ...
66,714,870
I'm really struggling with my code and cannot find a way to make it work. I need to check whether my array exists or its length is not 0 and then if there is an object with a specific value in it. If so then update it. If not then add it. Please see my code below: ``` const originals = []; if (!originals || original...
2021/03/19
['https://Stackoverflow.com/questions/66714870', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1647297/']
Reading between the lines what I think you want to do is: * If "Michael" is in the array. Then his age should be updated to 21, if he is 22 years old. * If "Michael" is not in the array. Then add Michael with an age of 21. There are some odd things in your code which makes no sense to me. For example you are checking...
Here is my quick solution to this issue: From my perspective its a good idea to address a new array to contain temporary data. The easiest way to describe what I mean follows in the code snippet. Code Snippet (For-Loop) ----------------------- ``` var originalsStack=[]; function PushToOriginalStack() { for (i=0; ...
45,374,668
I am acquiring data from a microcontroller via UDP. Each packet is a hex string, and I need to split it into equal-sized chunks to do some processing afterwards. However, since the packets are relatively large (about 700 chars each), the time it takes to split one into chunks is larger than the time between packet arri...
2017/07/28
['https://Stackoverflow.com/questions/45374668', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8382085/']
You can check whether the callable is convertible to `std::function<T(T)>`: ``` template<class T, class F> std::enable_if_t<std::is_convertible<F, std::function<T(T)>>::value, T> f(T v, F fn) { return fn(v); } ```
Make deducible blocks the compiler from trying tomdeduce that argument. Which seems like a poor choice of name; that is usually called `block_deduction` or something. The easiest way to include the signature is a comment: ``` template <class T, class F /*T(T) signature*/> T f(T val, F fc) { return fc(val); } ``` wh...
48,375,282
Given a `Flux` or a `Mono` from project reactor is a there a way to get the Flux or Mono to print out what the operator chain looks like. For example given the code below. ``` Fulx flux = Flux.just("a","b","c") .map( v -> v.toUpperCase()) .log(); ``` Is there some way to get the flux to p...
2018/01/22
['https://Stackoverflow.com/questions/48375282', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/438319/']
There is partial building blocks for doing this with the `Scannable` interface: ``` public String textRepresentation(Flux<?> flux) { Scannable sc = Scannable.from(flux); //scan the last operator in the chain and ask if it knows its parents List<String> names = sc.parents().map(Scannable::operatorName) ...
Nice suggestion! However, waiting for it, we can just have something like : ``` Disposable flux = Flux.just("a", "b", "c") .map(String::toUpperCase) .doOnNext(FluxUtil::print) .subscribe(); ``` Where `FluxUtil::print` is just a static method that you can write with different ...
34,831,973
I have a josn file I'm working with that contains multiple json objects in a single file. R is unable to read the file as a whole. But since each object occurs at regular intervals, I would like to iteratively read a fixed number of lines into R. There are a number of SO questions on reading single lines into R but I...
2016/01/16
['https://Stackoverflow.com/questions/34831973', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4530884/']
Why not just use a case statement? ``` CASE WHEN r.Id IS NULL THEN 0 ELSE 1 END ``` Change the 0 and 1 to whatever you want for false and true.
You should clarify what SQL language you are actually using, but an answer can be provided anyway: ``` CREATE PROCEDURE [dbo].[TournamentsWithLoggedUser] @user nvarchar(128) AS BEGIN SELECT t.Id, t.Info, -- this works in SQL Server CAST ((CASE WHEN r.UserId IS NOT NULL THEN 1 ELSE 0 END) AS BI...
34,831,973
I have a josn file I'm working with that contains multiple json objects in a single file. R is unable to read the file as a whole. But since each object occurs at regular intervals, I would like to iteratively read a fixed number of lines into R. There are a number of SO questions on reading single lines into R but I...
2016/01/16
['https://Stackoverflow.com/questions/34831973', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4530884/']
You are looking for this query ``` SELECT t.id, t.info, Cast (CASE WHEN r.userid IS NOT NULL THEN 1 ELSE 0 END AS BIT) AS IsRegistered FROM tournaments AS t LEFT JOIN registrations AS r ON t.id = r.tournamentid AN...
You should clarify what SQL language you are actually using, but an answer can be provided anyway: ``` CREATE PROCEDURE [dbo].[TournamentsWithLoggedUser] @user nvarchar(128) AS BEGIN SELECT t.Id, t.Info, -- this works in SQL Server CAST ((CASE WHEN r.UserId IS NOT NULL THEN 1 ELSE 0 END) AS BI...
34,831,973
I have a josn file I'm working with that contains multiple json objects in a single file. R is unable to read the file as a whole. But since each object occurs at regular intervals, I would like to iteratively read a fixed number of lines into R. There are a number of SO questions on reading single lines into R but I...
2016/01/16
['https://Stackoverflow.com/questions/34831973', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4530884/']
``` SELECT t.Id, t.Info, -- this works in SQL Server CAST ((CASE WHEN r.UserId IS NOT NULL THEN 1 ELSE 0 END) AS BIT) AS IsRegistered FROM Tournaments as t LEFT JOIN Registrations as r ON t.Id = r.TournamentId where (r.UserId = '' OR r.UserId = @user) ``` -- i think this one is help for you...
You should clarify what SQL language you are actually using, but an answer can be provided anyway: ``` CREATE PROCEDURE [dbo].[TournamentsWithLoggedUser] @user nvarchar(128) AS BEGIN SELECT t.Id, t.Info, -- this works in SQL Server CAST ((CASE WHEN r.UserId IS NOT NULL THEN 1 ELSE 0 END) AS BI...
39,191,276
I was trying to create a shortest-possible code for a puzzle, and the question came to mind trying to do something like this: `zip(l=[1,2,3,4,5],l[1:])` So I was wondering, is there a way to produce a value, assign it to a variable and use that variable on the very same line/function call? EDIT:To clarify things, ...
2016/08/28
['https://Stackoverflow.com/questions/39191276', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1774080/']
Here is one hack, but not pythonic. Actually since all you need is creating an object in global namespace you can simply update the namespace by your intended object. ``` >>> zip(globals().update(a=[1, 2, 3]) or a, a[1:]) [(1, 2), (2, 3)] ``` Since the `update()` attribute returns None, its logical `or` with the obj...
If this is a code golf thing so it **must** be a single statement, then this works in Python 2: ``` print[zip(l,l[1:])for l in[[1,2,3,4,5]]][0] ``` **output** ``` [(1, 2), (2, 3), (3, 4), (4, 5)] ``` Otherwise, ``` l=[1,2,3,4,5];print zip(l,l[1:]) ``` is shorter, and **far** more sensible than the list compre...
39,191,276
I was trying to create a shortest-possible code for a puzzle, and the question came to mind trying to do something like this: `zip(l=[1,2,3,4,5],l[1:])` So I was wondering, is there a way to produce a value, assign it to a variable and use that variable on the very same line/function call? EDIT:To clarify things, ...
2016/08/28
['https://Stackoverflow.com/questions/39191276', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1774080/']
Here is one hack, but not pythonic. Actually since all you need is creating an object in global namespace you can simply update the namespace by your intended object. ``` >>> zip(globals().update(a=[1, 2, 3]) or a, a[1:]) [(1, 2), (2, 3)] ``` Since the `update()` attribute returns None, its logical `or` with the obj...
You can use lambdas and default arguments to code golf this. Stressing that this shouldn't be used in production code, but just demonstrating what is possible in python. ``` (lambda l=[1, 2, 3]: zip(l, l[1:]))() ```
39,191,276
I was trying to create a shortest-possible code for a puzzle, and the question came to mind trying to do something like this: `zip(l=[1,2,3,4,5],l[1:])` So I was wondering, is there a way to produce a value, assign it to a variable and use that variable on the very same line/function call? EDIT:To clarify things, ...
2016/08/28
['https://Stackoverflow.com/questions/39191276', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1774080/']
Here is one hack, but not pythonic. Actually since all you need is creating an object in global namespace you can simply update the namespace by your intended object. ``` >>> zip(globals().update(a=[1, 2, 3]) or a, a[1:]) [(1, 2), (2, 3)] ``` Since the `update()` attribute returns None, its logical `or` with the obj...
Of course, you can always do this: ``` l = range(1, 6); zip(l, l[1:]) ``` but I guess that's not what you wanted. :-) There is a relatively clean way ``` (lambda l: zip(l, l[1:]))(range(1, 6)) ``` BTW that function is defined in [itertools recipes](https://docs.python.org/3.6/library/itertools.html#itertools-rec...
39,191,276
I was trying to create a shortest-possible code for a puzzle, and the question came to mind trying to do something like this: `zip(l=[1,2,3,4,5],l[1:])` So I was wondering, is there a way to produce a value, assign it to a variable and use that variable on the very same line/function call? EDIT:To clarify things, ...
2016/08/28
['https://Stackoverflow.com/questions/39191276', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1774080/']
If this is a code golf thing so it **must** be a single statement, then this works in Python 2: ``` print[zip(l,l[1:])for l in[[1,2,3,4,5]]][0] ``` **output** ``` [(1, 2), (2, 3), (3, 4), (4, 5)] ``` Otherwise, ``` l=[1,2,3,4,5];print zip(l,l[1:]) ``` is shorter, and **far** more sensible than the list compre...
Of course, you can always do this: ``` l = range(1, 6); zip(l, l[1:]) ``` but I guess that's not what you wanted. :-) There is a relatively clean way ``` (lambda l: zip(l, l[1:]))(range(1, 6)) ``` BTW that function is defined in [itertools recipes](https://docs.python.org/3.6/library/itertools.html#itertools-rec...
39,191,276
I was trying to create a shortest-possible code for a puzzle, and the question came to mind trying to do something like this: `zip(l=[1,2,3,4,5],l[1:])` So I was wondering, is there a way to produce a value, assign it to a variable and use that variable on the very same line/function call? EDIT:To clarify things, ...
2016/08/28
['https://Stackoverflow.com/questions/39191276', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1774080/']
You can use lambdas and default arguments to code golf this. Stressing that this shouldn't be used in production code, but just demonstrating what is possible in python. ``` (lambda l=[1, 2, 3]: zip(l, l[1:]))() ```
Of course, you can always do this: ``` l = range(1, 6); zip(l, l[1:]) ``` but I guess that's not what you wanted. :-) There is a relatively clean way ``` (lambda l: zip(l, l[1:]))(range(1, 6)) ``` BTW that function is defined in [itertools recipes](https://docs.python.org/3.6/library/itertools.html#itertools-rec...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
First of all, you don't have to tell Company A anything except the last date you'll be working for them. However, you *could* say something to the effect of > > I see this as a personal growth opportunity and a chance to experience different corporate cultures and different ways of doing things. I've thoroughly enjo...
You just have to spin up a bunch of nonsense that you probably don't mean. Something like, "While I am grateful for the opportunities that were presented to me during my time here - I feel that at this juncture its best for all parties if I move on" Then say something about how you will do all you can to transfer knowl...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
> > I decided to accept it. > > > If you've already made your decision and accepted the other offer, it's OK to say that. > > I have already accepted the offer from Company B and thus cannot consider any counter offer. My last day will be XX/XX/XXXX. > > > The expectation is that once a job offer is accepted...
You just have to spin up a bunch of nonsense that you probably don't mean. Something like, "While I am grateful for the opportunities that were presented to me during my time here - I feel that at this juncture its best for all parties if I move on" Then say something about how you will do all you can to transfer knowl...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
If you're leaving your current employer, there's obviously some reason. In any situation, your best bet is going to be to outline those reasons and state that those are what are motivating you towards accepting the new position. The key here is you need to be specific, rather than giving vague reasons like 'the new opp...
You just have to spin up a bunch of nonsense that you probably don't mean. Something like, "While I am grateful for the opportunities that were presented to me during my time here - I feel that at this juncture its best for all parties if I move on" Then say something about how you will do all you can to transfer knowl...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
First of all, you don't have to tell Company A anything except the last date you'll be working for them. However, you *could* say something to the effect of > > I see this as a personal growth opportunity and a chance to experience different corporate cultures and different ways of doing things. I've thoroughly enjo...
The best thing here is to put it back on the company. > > I am not comfortable trying to define what sort of offer I would be > comfortable requesting. I would entertain an offer by the company if > it feels that I am under-compensated currently, or should be advanced to > higher position, and consider it appro...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
First of all, you don't have to tell Company A anything except the last date you'll be working for them. However, you *could* say something to the effect of > > I see this as a personal growth opportunity and a chance to experience different corporate cultures and different ways of doing things. I've thoroughly enjo...
> > I decided to accept it. > > > If you've already made your decision and accepted the other offer, it's OK to say that. > > I have already accepted the offer from Company B and thus cannot consider any counter offer. My last day will be XX/XX/XXXX. > > > The expectation is that once a job offer is accepted...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
First of all, you don't have to tell Company A anything except the last date you'll be working for them. However, you *could* say something to the effect of > > I see this as a personal growth opportunity and a chance to experience different corporate cultures and different ways of doing things. I've thoroughly enjo...
If you're leaving your current employer, there's obviously some reason. In any situation, your best bet is going to be to outline those reasons and state that those are what are motivating you towards accepting the new position. The key here is you need to be specific, rather than giving vague reasons like 'the new opp...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
> > I decided to accept it. > > > If you've already made your decision and accepted the other offer, it's OK to say that. > > I have already accepted the offer from Company B and thus cannot consider any counter offer. My last day will be XX/XX/XXXX. > > > The expectation is that once a job offer is accepted...
The best thing here is to put it back on the company. > > I am not comfortable trying to define what sort of offer I would be > comfortable requesting. I would entertain an offer by the company if > it feels that I am under-compensated currently, or should be advanced to > higher position, and consider it appro...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
If you're leaving your current employer, there's obviously some reason. In any situation, your best bet is going to be to outline those reasons and state that those are what are motivating you towards accepting the new position. The key here is you need to be specific, rather than giving vague reasons like 'the new opp...
The best thing here is to put it back on the company. > > I am not comfortable trying to define what sort of offer I would be > comfortable requesting. I would entertain an offer by the company if > it feels that I am under-compensated currently, or should be advanced to > higher position, and consider it appro...
78,863
I work in Company A and I'm kind of the star there (I feel it is mainly due to political reasons). Recently, I received an offer from Company B and I decided to accept it. HR department in my current company pushed me to review my decision and propose conditions under which I would like to stay at company. I feel tha...
2016/11/01
['https://workplace.stackexchange.com/questions/78863', 'https://workplace.stackexchange.com', 'https://workplace.stackexchange.com/users/-1/']
> > I decided to accept it. > > > If you've already made your decision and accepted the other offer, it's OK to say that. > > I have already accepted the offer from Company B and thus cannot consider any counter offer. My last day will be XX/XX/XXXX. > > > The expectation is that once a job offer is accepted...
If you're leaving your current employer, there's obviously some reason. In any situation, your best bet is going to be to outline those reasons and state that those are what are motivating you towards accepting the new position. The key here is you need to be specific, rather than giving vague reasons like 'the new opp...
9,013,024
I am attempting to build a download accelerator for Linux. My program utilizes gevent, os, and urllib2. My program receives a URL and attempts to download the file concurrently. All of my code is valid. My only problem is that urllib2.urlopen.read() is blocking me from running the .read() function concurrently. This i...
2012/01/26
['https://Stackoverflow.com/questions/9013024', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1113071/']
You're trying to read a response to a single request from different greenlets. If you'd like to download the same file using *several* concurrent connections then you could use [`Range` http header](https://www.rfc-editor.org/rfc/rfc2616#section-14.35) if the server supports it (you get 206 status instead of 200 for t...
the argument to `read` is a number of bytes, not an offset. It seems gevent will let you call urllib asynchronously, but not let you access the same resource from multiple greenlets. Furthermore, since it is using wait\_read, the effect will still be a synchronous, sequential read from the file (The complete opposite...
13,542,805
I currently convert an integer to a string for display to the screen, but wish to maintain 4 digits - i.e 10 = "0010". What is the best way of going from an integer of 10 to a string of "0010"? This is in C# and .NET 4. Cheers!
2012/11/24
['https://Stackoverflow.com/questions/13542805', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1299105/']
``` int num = 1; // pad with 0 up to 4 places string str = num.ToString("D4"); ```
``` var str = 10.ToString("0000"); ```
13,542,805
I currently convert an integer to a string for display to the screen, but wish to maintain 4 digits - i.e 10 = "0010". What is the best way of going from an integer of 10 to a string of "0010"? This is in C# and .NET 4. Cheers!
2012/11/24
['https://Stackoverflow.com/questions/13542805', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1299105/']
``` var str = 10.ToString("0000"); ```
You can try :- ``` string str = num.ToString("D8"); //padding with 8 zero's ``` Check this [link](http://msdn.microsoft.com/en-us/library/dd260048.aspx)
13,542,805
I currently convert an integer to a string for display to the screen, but wish to maintain 4 digits - i.e 10 = "0010". What is the best way of going from an integer of 10 to a string of "0010"? This is in C# and .NET 4. Cheers!
2012/11/24
['https://Stackoverflow.com/questions/13542805', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1299105/']
``` int num = 1; // pad with 0 up to 4 places string str = num.ToString("D4"); ```
You can try :- ``` string str = num.ToString("D8"); //padding with 8 zero's ``` Check this [link](http://msdn.microsoft.com/en-us/library/dd260048.aspx)
62,152,528
I have a small snipped of code, which just produces a function to get the current directory for either Windows or Linux platform: ``` #include <stdio.h> /* defines FILENAME_MAX */ #include <string> #ifdef WINDOWS #include <direct.h> #define GetCurrentDir _getcwd #else #include <unistd.h> #define GetCu...
2020/06/02
['https://Stackoverflow.com/questions/62152528', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9007093/']
Your `fUtils::getcwd()` function is attempting to call *itself* when the `GetCurrentDir` macro is evaluated (to `getcwd`), and this results in a function that expects no argument but is being given two arguments. To resolve this, add the global namespace operator (`::`) in the definitions for `GetCurrentDir`, as follo...
Use of macros in such context is invitation to problems in future. Just wrap those functions with own API and all problems will be resolved. Header file: ```cpp #include <string> namepsace fUtils { std::string getcwd(); } ``` Then you can have platform specific cpp files, Windows: ```cpp namepsace fUtils { std::...
52,327,462
I am creating a chat app, for which I need to check each of my contact list members if they are registered with my app and show the registered members list in my app. Currently I am calling an API to check every number one by one. In case of 800 contacts it is getting called 800 times. I know this is not best way to do...
2018/09/14
['https://Stackoverflow.com/questions/52327462', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7257122/']
In fact,you can do little on client. The normal way is: Server provide an interface that support check a phonenumber array, and return the phonenumbers has registered on server.
I think you need to save user's phone number to your database when user registers your app. Then you can find out contacts which have already used your chat app.
52,327,462
I am creating a chat app, for which I need to check each of my contact list members if they are registered with my app and show the registered members list in my app. Currently I am calling an API to check every number one by one. In case of 800 contacts it is getting called 800 times. I know this is not best way to do...
2018/09/14
['https://Stackoverflow.com/questions/52327462', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7257122/']
There is no way to do it without back-end modifications. So you need to work closely with your back-end engineer and build an API for this. Here is an advise how you can build this API: To have 2 APIs: 1) Upload the whole user address book to the back-end in a single request, something like: ``` let addressBook =...
I think you need to save user's phone number to your database when user registers your app. Then you can find out contacts which have already used your chat app.
52,327,462
I am creating a chat app, for which I need to check each of my contact list members if they are registered with my app and show the registered members list in my app. Currently I am calling an API to check every number one by one. In case of 800 contacts it is getting called 800 times. I know this is not best way to do...
2018/09/14
['https://Stackoverflow.com/questions/52327462', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7257122/']
There is no way to do it without back-end modifications. So you need to work closely with your back-end engineer and build an API for this. Here is an advise how you can build this API: To have 2 APIs: 1) Upload the whole user address book to the back-end in a single request, something like: ``` let addressBook =...
In fact,you can do little on client. The normal way is: Server provide an interface that support check a phonenumber array, and return the phonenumbers has registered on server.
44,725
Здесь прямая речь находится внутри авторских слов, но, по моему, нет определенных указаний на ее введение авторскими словами. В связи с этим вопрос: нужно ли двоеточие после слова "замешательство" или можно ограничиться точкой? Женщина, вероятно, поняла моё замешательство: «Ваше платье несколько испачкалось. Вы можете...
2014/12/25
['https://rus.stackexchange.com/questions/44725', 'https://rus.stackexchange.com', 'https://rus.stackexchange.com/users/4012/']
2 Перед прямой речью, следующей за авторскими словами, ставится двоеточие... 3 Если прямая речь начинается с абзаца, то двоеточие после предшествующих авторских слов ставится не всегда. <http://www.evartist.narod.ru/text1/52.htm> §119. Прямая речь после авторских слов
Конечно,Аленка, это слова автора. В этом случае глаголы "говорения" (помню нечто подобное у Розенталя) подразумеваются.Он посмотрел на меня (и спросил): "Это ты сделал?". В Вашем предложении "Женщина поняла мое замешательство (и сказала): "Ваше платье несколько испачкалось"
44,725
Здесь прямая речь находится внутри авторских слов, но, по моему, нет определенных указаний на ее введение авторскими словами. В связи с этим вопрос: нужно ли двоеточие после слова "замешательство" или можно ограничиться точкой? Женщина, вероятно, поняла моё замешательство: «Ваше платье несколько испачкалось. Вы можете...
2014/12/25
['https://rus.stackexchange.com/questions/44725', 'https://rus.stackexchange.com', 'https://rus.stackexchange.com/users/4012/']
2 Перед прямой речью, следующей за авторскими словами, ставится двоеточие... 3 Если прямая речь начинается с абзаца, то двоеточие после предшествующих авторских слов ставится не всегда. <http://www.evartist.narod.ru/text1/52.htm> §119. Прямая речь после авторских слов
Если прямая речь начинается с абзаца, то двоеточие после предшествующих слов автора ставится не всегда: > > двоеточие ставится, если слова автора содержат глагол со значением речи-мысли (говорить, сказать, рассказать, заметить, обратиться, воскликнуть, закричать, прошептать, спросить, спрашивать, ответить, вставить, ...
44,725
Здесь прямая речь находится внутри авторских слов, но, по моему, нет определенных указаний на ее введение авторскими словами. В связи с этим вопрос: нужно ли двоеточие после слова "замешательство" или можно ограничиться точкой? Женщина, вероятно, поняла моё замешательство: «Ваше платье несколько испачкалось. Вы можете...
2014/12/25
['https://rus.stackexchange.com/questions/44725', 'https://rus.stackexchange.com', 'https://rus.stackexchange.com/users/4012/']
2 Перед прямой речью, следующей за авторскими словами, ставится двоеточие... 3 Если прямая речь начинается с абзаца, то двоеточие после предшествующих авторских слов ставится не всегда. <http://www.evartist.narod.ru/text1/52.htm> §119. Прямая речь после авторских слов
Розенталь пишет на этот счет: "Двоеточие ставится также и в тех случаях, когда в авторских словах нет глаголов речи или заменяющих их глаголов с указанными выше значениями, но ситуация показывает, что вводится прямая речь, например: ...А тот ему: «Этот дом наш общий» (Чехов)".
67,678
If someone wanted to sign a 12 month rental contract and, being over 70 and single, wanted that contract to terminate upon death of the renter so the landlord would not have right to claim payment from the estate for the remaining contract period and also required the landlord to release any personal belongings to heir...
2021/07/13
['https://law.stackexchange.com/questions/67678', 'https://law.stackexchange.com', 'https://law.stackexchange.com/users/39019/']
It would be treated like a residential lease with whatever legal terms were agreed ---------------------------------------------------------------------------------- The first term may need some careful drafting to comply with any minimum notice law Florida has. So a term that gave the estate the option to give 30 day...
> > What specific legal statement might one request to include in a 12 month rental contract so that the rental contract terminates upon renter's death? > > > There is a risk that formulating an isolated statement or provision without us knowing other relevant clauses of the proposed draft might be superseded by t...
18,897,410
I'm using Liferay 6.1.20 and my Portlet is using the Liferay Mail Service to send an E-Mail via the in Liferay configured SMTP-Server. My Question is now: is it possible to check whether the SMTP-Server is available or is it possbile to check whether the E-Mail was successfully sent? If the SMTP-Server is not availabl...
2013/09/19
['https://Stackoverflow.com/questions/18897410', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2343286/']
basically there are two problems which prevent you to discover if any failure occurred when sending e-mails with MailServiceUtil service. Firstly messages are sent asynchronously over Liferay message bus, so the user gets faster response but you never know if anything failed on the way. Secondly messages eventually g...
Since Liferay 6.2, if you set *mail.throws.exception.on.failure=true* in your portal-ext.properties file, the MailEngine class will also throw a `com.liferay.util.mail.MailEngineException` on errors, instead of just logging.
18,897,410
I'm using Liferay 6.1.20 and my Portlet is using the Liferay Mail Service to send an E-Mail via the in Liferay configured SMTP-Server. My Question is now: is it possible to check whether the SMTP-Server is available or is it possbile to check whether the E-Mail was successfully sent? If the SMTP-Server is not availabl...
2013/09/19
['https://Stackoverflow.com/questions/18897410', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2343286/']
basically there are two problems which prevent you to discover if any failure occurred when sending e-mails with MailServiceUtil service. Firstly messages are sent asynchronously over Liferay message bus, so the user gets faster response but you never know if anything failed on the way. Secondly messages eventually g...
A really old question, but as I kept arriving here, I am leaving this to anyone that may need (tested on 7.3). We can test if the mail flow is normal with the following Groovy script: ``` import com.liferay.mail.kernel.service.MailServiceUtil import javax.mail.* import javax.mail.internet.* import com.liferay.mail.ke...
18,897,410
I'm using Liferay 6.1.20 and my Portlet is using the Liferay Mail Service to send an E-Mail via the in Liferay configured SMTP-Server. My Question is now: is it possible to check whether the SMTP-Server is available or is it possbile to check whether the E-Mail was successfully sent? If the SMTP-Server is not availabl...
2013/09/19
['https://Stackoverflow.com/questions/18897410', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2343286/']
Since Liferay 6.2, if you set *mail.throws.exception.on.failure=true* in your portal-ext.properties file, the MailEngine class will also throw a `com.liferay.util.mail.MailEngineException` on errors, instead of just logging.
A really old question, but as I kept arriving here, I am leaving this to anyone that may need (tested on 7.3). We can test if the mail flow is normal with the following Groovy script: ``` import com.liferay.mail.kernel.service.MailServiceUtil import javax.mail.* import javax.mail.internet.* import com.liferay.mail.ke...
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
For the love of the flying spaghetti monster; don't ever pay retail. We just did a large purchase from Dell for a bunch of servers, an EMC CX4 SAN, switches, load ballancers, etc. With full Microsoft licensing we paid easily 30-40% off the original quotes. It's all about having a good sales rep, and being able to nego...
I have a Silicon Mechanics rack mount that I bought used. It is a dual socket Opteron system with a 3ware raid controller and I have had no hardware problems with it. A friend bought some used on Ebay and those have worked without hardware issues. My former employer has a dozen Silicon Mechanics boxes that they use for...
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
I have a Silicon Mechanics rack mount that I bought used. It is a dual socket Opteron system with a 3ware raid controller and I have had no hardware problems with it. A friend bought some used on Ebay and those have worked without hardware issues. My former employer has a dozen Silicon Mechanics boxes that they use for...
I've used a variety of vendors over the years and I always come back to Dell. Their build quality is hard to beat. For important servers, I love the fact that I can call them up and say "it won't boot" and 90 minutes later a guy shows up with a box full of parts and begins swapping them out until it works. Fried mothe...
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
We've (company I work for) used Silicon Mechanics for a while. Probably >20 servers from them, many of them with weird requirements, from low-end stuff (single-CPU, single-disk web servers) to multi-core, multi-CPU 16-disk DB servers, to weird stuff like telephony servers. We even got some Windows XP(!) servers from th...
I bought 3 servers from them probably 3 years ago. 2 servers had the (cheap plastic) rabbit ears break off almost immediately. One server was RMA'd. In terms of operations and not cheap plastic case addons, they've been reliable machines. I've heard their quality has improved from the models I bought.
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
We've (company I work for) used Silicon Mechanics for a while. Probably >20 servers from them, many of them with weird requirements, from low-end stuff (single-CPU, single-disk web servers) to multi-core, multi-CPU 16-disk DB servers, to weird stuff like telephony servers. We even got some Windows XP(!) servers from th...
I've used a variety of vendors over the years and I always come back to Dell. Their build quality is hard to beat. For important servers, I love the fact that I can call them up and say "it won't boot" and 90 minutes later a guy shows up with a box full of parts and begins swapping them out until it works. Fried mothe...
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
For the love of the flying spaghetti monster; don't ever pay retail. We just did a large purchase from Dell for a bunch of servers, an EMC CX4 SAN, switches, load ballancers, etc. With full Microsoft licensing we paid easily 30-40% off the original quotes. It's all about having a good sales rep, and being able to nego...
We've (company I work for) used Silicon Mechanics for a while. Probably >20 servers from them, many of them with weird requirements, from low-end stuff (single-CPU, single-disk web servers) to multi-core, multi-CPU 16-disk DB servers, to weird stuff like telephony servers. We even got some Windows XP(!) servers from th...
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
Fyi; [SilliconMechanics](http://siliconmechanics.com) is just reselling branded [SuperMicro](http://supermicro.com) machines at a lower cost than direct with added support and sales. Still cheaper to buy from them than elsewhere -- but their equipment does come from a bigname whitebox manufacturer.
We've (company I work for) used Silicon Mechanics for a while. Probably >20 servers from them, many of them with weird requirements, from low-end stuff (single-CPU, single-disk web servers) to multi-core, multi-CPU 16-disk DB servers, to weird stuff like telephony servers. We even got some Windows XP(!) servers from th...
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
For the love of the flying spaghetti monster; don't ever pay retail. We just did a large purchase from Dell for a bunch of servers, an EMC CX4 SAN, switches, load ballancers, etc. With full Microsoft licensing we paid easily 30-40% off the original quotes. It's all about having a good sales rep, and being able to nego...
I've used a variety of vendors over the years and I always come back to Dell. Their build quality is hard to beat. For important servers, I love the fact that I can call them up and say "it won't boot" and 90 minutes later a guy shows up with a box full of parts and begins swapping them out until it works. Fried mothe...
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
For the love of the flying spaghetti monster; don't ever pay retail. We just did a large purchase from Dell for a bunch of servers, an EMC CX4 SAN, switches, load ballancers, etc. With full Microsoft licensing we paid easily 30-40% off the original quotes. It's all about having a good sales rep, and being able to nego...
I bought 3 servers from them probably 3 years ago. 2 servers had the (cheap plastic) rabbit ears break off almost immediately. One server was RMA'd. In terms of operations and not cheap plastic case addons, they've been reliable machines. I've heard their quality has improved from the models I bought.
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
I have a Silicon Mechanics rack mount that I bought used. It is a dual socket Opteron system with a 3ware raid controller and I have had no hardware problems with it. A friend bought some used on Ebay and those have worked without hardware issues. My former employer has a dozen Silicon Mechanics boxes that they use for...
I bought 3 servers from them probably 3 years ago. 2 servers had the (cheap plastic) rabbit ears break off almost immediately. One server was RMA'd. In terms of operations and not cheap plastic case addons, they've been reliable machines. I've heard their quality has improved from the models I bought.
31,361
Anyone every purchase / use hardware from <http://SiliconMechanics.com>? Their prices seem to be unbeatable. So I'm curious to know how reliable their servers are. **Also, who do you recommend to buy the best bang for your buck on rack servers?**
2009/06/25
['https://serverfault.com/questions/31361', 'https://serverfault.com', 'https://serverfault.com/users/-1/']
Fyi; [SilliconMechanics](http://siliconmechanics.com) is just reselling branded [SuperMicro](http://supermicro.com) machines at a lower cost than direct with added support and sales. Still cheaper to buy from them than elsewhere -- but their equipment does come from a bigname whitebox manufacturer.
I bought 3 servers from them probably 3 years ago. 2 servers had the (cheap plastic) rabbit ears break off almost immediately. One server was RMA'd. In terms of operations and not cheap plastic case addons, they've been reliable machines. I've heard their quality has improved from the models I bought.
47,305,875
can you give me a hint how to sort the points according to x coordinates in O(nLogn)? ``` Set<Point> points = new HashSet<Point>(); points.add(new Point(9, 0)); points.add(new Point(1, 1)); points.add(new Point(5, 6)); points.add(new Point(3, 3)); points.add(new Point(2, 7)); points.add(ne...
2017/11/15
['https://Stackoverflow.com/questions/47305875', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8027142/']
``` Set<Point> sortedPoints = points .stream() .sorted(Comparator.comparing(Point::getX)) .collect(Collectors.toCollection(LinkedHashSet::new)); ``` I am sure this way is better of all because: 1) on the big a...
Any `Set` that implements `SortedSet` interface can keep elements sorted within it. `TreeSet` is a known implementation of `SortedSet`. You can pass a custom Comparator for your class in the `TreeSet` constructor in order to obtain a set sorted according to your conditions. ``` public static void main(String[] args) ...
174,444
Do you know of a formula or function that can calculate the real world height of a satellite image in degrees? The image is from Google Static Maps and the image uses [Mercator projection](http://en.wikipedia.org/wiki/Mercator_projection#Derivation_of_the_Mercator_projection) which makes calculating the height very di...
2012/07/23
['https://math.stackexchange.com/questions/174444', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/23680/']
After a quick look at the Wikipedia entry for the Mercador projection, I believe that for short distances, the horizontal and vertical scales are the same (on a printed map). Scroll down to **Formulae for distance**. Pixels are usually not square, so you have to allow for that, and it could vary between devices. There...
map a matrix over the image, and find the actual coordinate points of the grid points of your matrix. fill a second matrix with calculations of the coordinate points with the information of your picture. with two values in every gridpoint you can figure out a matrix of slopes. make a list of functions using the respe...
174,444
Do you know of a formula or function that can calculate the real world height of a satellite image in degrees? The image is from Google Static Maps and the image uses [Mercator projection](http://en.wikipedia.org/wiki/Mercator_projection#Derivation_of_the_Mercator_projection) which makes calculating the height very di...
2012/07/23
['https://math.stackexchange.com/questions/174444', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/23680/']
After a quick look at the Wikipedia entry for the Mercador projection, I believe that for short distances, the horizontal and vertical scales are the same (on a printed map). Scroll down to **Formulae for distance**. Pixels are usually not square, so you have to allow for that, and it could vary between devices. There...
If you know the location of the satellite and the time of the photo, you can measure the length of shadows to determine height of the objects casting them.